summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/oberdiek
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/oberdiek
Initial commit
Diffstat (limited to 'macros/latex/contrib/oberdiek')
-rw-r--r--macros/latex/contrib/oberdiek/README.txt33
-rw-r--r--macros/latex/contrib/oberdiek/accsupp.dtx1217
-rw-r--r--macros/latex/contrib/oberdiek/accsupp.pdfbin0 -> 142568 bytes
-rw-r--r--macros/latex/contrib/oberdiek/aliascnt.dtx644
-rw-r--r--macros/latex/contrib/oberdiek/aliascnt.pdfbin0 -> 101507 bytes
-rw-r--r--macros/latex/contrib/oberdiek/alphalph.dtx1963
-rw-r--r--macros/latex/contrib/oberdiek/alphalph.pdfbin0 -> 192492 bytes
-rw-r--r--macros/latex/contrib/oberdiek/askinclude.dtx3062
-rw-r--r--macros/latex/contrib/oberdiek/askinclude.pdfbin0 -> 253846 bytes
-rw-r--r--macros/latex/contrib/oberdiek/atbegshi.dtx2458
-rw-r--r--macros/latex/contrib/oberdiek/atbegshi.pdfbin0 -> 230223 bytes
-rw-r--r--macros/latex/contrib/oberdiek/atenddvi.dtx624
-rw-r--r--macros/latex/contrib/oberdiek/atenddvi.pdfbin0 -> 94323 bytes
-rw-r--r--macros/latex/contrib/oberdiek/attachfile2.dtx3335
-rw-r--r--macros/latex/contrib/oberdiek/attachfile2.pdfbin0 -> 261387 bytes
-rw-r--r--macros/latex/contrib/oberdiek/atveryend.dtx1624
-rw-r--r--macros/latex/contrib/oberdiek/atveryend.pdfbin0 -> 185103 bytes
-rw-r--r--macros/latex/contrib/oberdiek/auxhook.dtx677
-rw-r--r--macros/latex/contrib/oberdiek/auxhook.pdfbin0 -> 103134 bytes
-rw-r--r--macros/latex/contrib/oberdiek/bigintcalc.dtx4562
-rw-r--r--macros/latex/contrib/oberdiek/bigintcalc.pdfbin0 -> 334661 bytes
-rw-r--r--macros/latex/contrib/oberdiek/bitset.dtx4250
-rw-r--r--macros/latex/contrib/oberdiek/bitset.pdfbin0 -> 334786 bytes
-rw-r--r--macros/latex/contrib/oberdiek/bmpsize.dtx4097
-rw-r--r--macros/latex/contrib/oberdiek/bmpsize.pdfbin0 -> 320950 bytes
-rw-r--r--macros/latex/contrib/oberdiek/bookmark.dtx3527
-rw-r--r--macros/latex/contrib/oberdiek/bookmark.pdfbin0 -> 283904 bytes
-rw-r--r--macros/latex/contrib/oberdiek/catchfile.dtx1155
-rw-r--r--macros/latex/contrib/oberdiek/catchfile.pdfbin0 -> 139933 bytes
-rw-r--r--macros/latex/contrib/oberdiek/centernot.dtx571
-rw-r--r--macros/latex/contrib/oberdiek/centernot.pdfbin0 -> 165845 bytes
-rw-r--r--macros/latex/contrib/oberdiek/chemarr.dtx569
-rw-r--r--macros/latex/contrib/oberdiek/chemarr.pdfbin0 -> 92479 bytes
-rw-r--r--macros/latex/contrib/oberdiek/classlist.dtx674
-rw-r--r--macros/latex/contrib/oberdiek/classlist.pdfbin0 -> 94019 bytes
-rw-r--r--macros/latex/contrib/oberdiek/colonequals.dtx681
-rw-r--r--macros/latex/contrib/oberdiek/colonequals.pdfbin0 -> 100988 bytes
-rw-r--r--macros/latex/contrib/oberdiek/dvipscol.dtx569
-rw-r--r--macros/latex/contrib/oberdiek/dvipscol.pdfbin0 -> 88021 bytes
-rw-r--r--macros/latex/contrib/oberdiek/embedfile.dtx2198
-rw-r--r--macros/latex/contrib/oberdiek/embedfile.pdfbin0 -> 209130 bytes
-rw-r--r--macros/latex/contrib/oberdiek/engord.dtx1043
-rw-r--r--macros/latex/contrib/oberdiek/engord.pdfbin0 -> 128998 bytes
-rw-r--r--macros/latex/contrib/oberdiek/enparen.dtx987
-rw-r--r--macros/latex/contrib/oberdiek/enparen.pdfbin0 -> 117643 bytes
-rw-r--r--macros/latex/contrib/oberdiek/eolgrab.dtx1096
-rw-r--r--macros/latex/contrib/oberdiek/eolgrab.pdfbin0 -> 130535 bytes
-rw-r--r--macros/latex/contrib/oberdiek/epstopdf.dtx1647
-rw-r--r--macros/latex/contrib/oberdiek/epstopdf.pdfbin0 -> 175392 bytes
-rw-r--r--macros/latex/contrib/oberdiek/etexcmds.dtx986
-rw-r--r--macros/latex/contrib/oberdiek/etexcmds.pdfbin0 -> 127044 bytes
-rw-r--r--macros/latex/contrib/oberdiek/fibnum.dtx1180
-rw-r--r--macros/latex/contrib/oberdiek/fibnum.pdfbin0 -> 142121 bytes
-rw-r--r--macros/latex/contrib/oberdiek/flags.dtx721
-rw-r--r--macros/latex/contrib/oberdiek/flags.pdfbin0 -> 100301 bytes
-rw-r--r--macros/latex/contrib/oberdiek/gettitlestring.dtx1037
-rw-r--r--macros/latex/contrib/oberdiek/gettitlestring.pdfbin0 -> 137706 bytes
-rw-r--r--macros/latex/contrib/oberdiek/grfext.dtx1182
-rw-r--r--macros/latex/contrib/oberdiek/grfext.pdfbin0 -> 144083 bytes
-rw-r--r--macros/latex/contrib/oberdiek/grffile.dtx1412
-rw-r--r--macros/latex/contrib/oberdiek/grffile.pdfbin0 -> 155400 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hobsub.dtx1490
-rw-r--r--macros/latex/contrib/oberdiek/hobsub.pdfbin0 -> 150496 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hologo.dtx5108
-rw-r--r--macros/latex/contrib/oberdiek/hologo.pdfbin0 -> 380470 bytes
-rw-r--r--macros/latex/contrib/oberdiek/holtxdoc.dtx862
-rw-r--r--macros/latex/contrib/oberdiek/holtxdoc.pdfbin0 -> 120154 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hopatch.dtx964
-rw-r--r--macros/latex/contrib/oberdiek/hopatch.pdfbin0 -> 122699 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hycolor.dtx2229
-rw-r--r--macros/latex/contrib/oberdiek/hycolor.pdfbin0 -> 218241 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hypbmsec.dtx870
-rw-r--r--macros/latex/contrib/oberdiek/hypbmsec.pdfbin0 -> 108788 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hypcap.dtx803
-rw-r--r--macros/latex/contrib/oberdiek/hypcap.pdfbin0 -> 106566 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hypdestopt.dtx1040
-rw-r--r--macros/latex/contrib/oberdiek/hypdestopt.pdfbin0 -> 126296 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hypdoc.dtx1441
-rw-r--r--macros/latex/contrib/oberdiek/hypdoc.pdfbin0 -> 145294 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hypgotoe.dtx727
-rw-r--r--macros/latex/contrib/oberdiek/hypgotoe.pdfbin0 -> 105001 bytes
-rw-r--r--macros/latex/contrib/oberdiek/hyphsubst.dtx969
-rw-r--r--macros/latex/contrib/oberdiek/hyphsubst.pdfbin0 -> 122760 bytes
-rw-r--r--macros/latex/contrib/oberdiek/ifdraft.dtx599
-rw-r--r--macros/latex/contrib/oberdiek/ifdraft.pdfbin0 -> 90912 bytes
-rw-r--r--macros/latex/contrib/oberdiek/iflang.dtx1258
-rw-r--r--macros/latex/contrib/oberdiek/iflang.pdfbin0 -> 151203 bytes
-rw-r--r--macros/latex/contrib/oberdiek/ifluatex.dtx920
-rw-r--r--macros/latex/contrib/oberdiek/ifluatex.pdfbin0 -> 117967 bytes
-rw-r--r--macros/latex/contrib/oberdiek/ifpdf.dtx143
-rw-r--r--macros/latex/contrib/oberdiek/ifpdf.pdfbin0 -> 68735 bytes
-rw-r--r--macros/latex/contrib/oberdiek/ifvtex.dtx902
-rw-r--r--macros/latex/contrib/oberdiek/ifvtex.pdfbin0 -> 119287 bytes
-rw-r--r--macros/latex/contrib/oberdiek/infwarerr.dtx1247
-rw-r--r--macros/latex/contrib/oberdiek/infwarerr.pdfbin0 -> 141514 bytes
-rw-r--r--macros/latex/contrib/oberdiek/inputenx.dtx12193
-rw-r--r--macros/latex/contrib/oberdiek/inputenx.pdfbin0 -> 755252 bytes
-rw-r--r--macros/latex/contrib/oberdiek/intcalc.dtx4315
-rw-r--r--macros/latex/contrib/oberdiek/intcalc.pdfbin0 -> 311180 bytes
-rw-r--r--macros/latex/contrib/oberdiek/kvdefinekeys.dtx792
-rw-r--r--macros/latex/contrib/oberdiek/kvdefinekeys.pdfbin0 -> 113497 bytes
-rw-r--r--macros/latex/contrib/oberdiek/kvoptions.dtx3439
-rw-r--r--macros/latex/contrib/oberdiek/kvoptions.pdfbin0 -> 299355 bytes
-rw-r--r--macros/latex/contrib/oberdiek/kvsetkeys.dtx2201
-rw-r--r--macros/latex/contrib/oberdiek/kvsetkeys.pdfbin0 -> 212326 bytes
-rw-r--r--macros/latex/contrib/oberdiek/letltxmacro.dtx1208
-rw-r--r--macros/latex/contrib/oberdiek/letltxmacro.pdfbin0 -> 142429 bytes
-rw-r--r--macros/latex/contrib/oberdiek/listingsutf8.dtx857
-rw-r--r--macros/latex/contrib/oberdiek/listingsutf8.pdfbin0 -> 117793 bytes
-rw-r--r--macros/latex/contrib/oberdiek/ltxcmds.dtx3359
-rw-r--r--macros/latex/contrib/oberdiek/ltxcmds.pdfbin0 -> 279912 bytes
-rw-r--r--macros/latex/contrib/oberdiek/luacolor.dtx1293
-rw-r--r--macros/latex/contrib/oberdiek/luacolor.pdfbin0 -> 136440 bytes
-rw-r--r--macros/latex/contrib/oberdiek/luatex.dtx1967
-rw-r--r--macros/latex/contrib/oberdiek/luatex.pdfbin0 -> 198503 bytes
-rw-r--r--macros/latex/contrib/oberdiek/magicnum.dtx1604
-rw-r--r--macros/latex/contrib/oberdiek/magicnum.pdfbin0 -> 146217 bytes
-rw-r--r--macros/latex/contrib/oberdiek/makerobust.dtx553
-rw-r--r--macros/latex/contrib/oberdiek/makerobust.pdfbin0 -> 87707 bytes
-rw-r--r--macros/latex/contrib/oberdiek/mleftright.dtx996
-rw-r--r--macros/latex/contrib/oberdiek/mleftright.pdfbin0 -> 125901 bytes
-rw-r--r--macros/latex/contrib/oberdiek/oberdiek.pdfbin0 -> 446184 bytes
-rw-r--r--macros/latex/contrib/oberdiek/oberdiek.tex1345
-rw-r--r--macros/latex/contrib/oberdiek/pagegrid.dtx1144
-rw-r--r--macros/latex/contrib/oberdiek/pagegrid.pdfbin0 -> 139288 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pagesel.dtx925
-rw-r--r--macros/latex/contrib/oberdiek/pagesel.pdfbin0 -> 119176 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdfcol.dtx1192
-rw-r--r--macros/latex/contrib/oberdiek/pdfcol.pdfbin0 -> 141045 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdfcolfoot.dtx780
-rw-r--r--macros/latex/contrib/oberdiek/pdfcolfoot.pdfbin0 -> 109765 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdfcolmk.dtx1058
-rw-r--r--macros/latex/contrib/oberdiek/pdfcolmk.pdfbin0 -> 139712 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdfcolparallel.dtx1161
-rw-r--r--macros/latex/contrib/oberdiek/pdfcolparallel.pdfbin0 -> 144508 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx847
-rw-r--r--macros/latex/contrib/oberdiek/pdfcolparcolumns.pdfbin0 -> 122729 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdfcrypt.dtx1160
-rw-r--r--macros/latex/contrib/oberdiek/pdfcrypt.pdfbin0 -> 135571 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdfescape.dtx2346
-rw-r--r--macros/latex/contrib/oberdiek/pdfescape.pdfbin0 -> 225919 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdflscape.dtx1117
-rw-r--r--macros/latex/contrib/oberdiek/pdflscape.pdfbin0 -> 128747 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdfrender.dtx1960
-rw-r--r--macros/latex/contrib/oberdiek/pdfrender.pdfbin0 -> 195863 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pdftexcmds.dtx2732
-rw-r--r--macros/latex/contrib/oberdiek/pdftexcmds.pdfbin0 -> 225175 bytes
-rw-r--r--macros/latex/contrib/oberdiek/picture.dtx840
-rw-r--r--macros/latex/contrib/oberdiek/picture.pdfbin0 -> 112168 bytes
-rw-r--r--macros/latex/contrib/oberdiek/pmboxdraw.dtx5647
-rw-r--r--macros/latex/contrib/oberdiek/pmboxdraw.pdfbin0 -> 489245 bytes
-rw-r--r--macros/latex/contrib/oberdiek/protecteddef.dtx1052
-rw-r--r--macros/latex/contrib/oberdiek/protecteddef.pdfbin0 -> 133470 bytes
-rw-r--r--macros/latex/contrib/oberdiek/refcount.dtx1603
-rw-r--r--macros/latex/contrib/oberdiek/refcount.pdfbin0 -> 172463 bytes
-rw-r--r--macros/latex/contrib/oberdiek/rerunfilecheck.dtx1106
-rw-r--r--macros/latex/contrib/oberdiek/rerunfilecheck.pdfbin0 -> 136401 bytes
-rw-r--r--macros/latex/contrib/oberdiek/resizegather.dtx1041
-rw-r--r--macros/latex/contrib/oberdiek/resizegather.pdfbin0 -> 130372 bytes
-rw-r--r--macros/latex/contrib/oberdiek/rotchiffre.dtx1416
-rw-r--r--macros/latex/contrib/oberdiek/rotchiffre.pdfbin0 -> 156279 bytes
-rw-r--r--macros/latex/contrib/oberdiek/scrindex.dtx777
-rw-r--r--macros/latex/contrib/oberdiek/scrindex.pdfbin0 -> 108115 bytes
-rw-r--r--macros/latex/contrib/oberdiek/selinput.dtx1050
-rw-r--r--macros/latex/contrib/oberdiek/selinput.pdfbin0 -> 150589 bytes
-rw-r--r--macros/latex/contrib/oberdiek/setouterhbox.dtx1226
-rw-r--r--macros/latex/contrib/oberdiek/setouterhbox.pdfbin0 -> 146528 bytes
-rw-r--r--macros/latex/contrib/oberdiek/settobox.dtx811
-rw-r--r--macros/latex/contrib/oberdiek/settobox.pdfbin0 -> 110669 bytes
-rw-r--r--macros/latex/contrib/oberdiek/soulutf8.dtx1931
-rw-r--r--macros/latex/contrib/oberdiek/soulutf8.pdfbin0 -> 214859 bytes
-rw-r--r--macros/latex/contrib/oberdiek/stackrel.dtx542
-rw-r--r--macros/latex/contrib/oberdiek/stackrel.pdfbin0 -> 98455 bytes
-rw-r--r--macros/latex/contrib/oberdiek/stampinclude.dtx691
-rw-r--r--macros/latex/contrib/oberdiek/stampinclude.pdfbin0 -> 100345 bytes
-rw-r--r--macros/latex/contrib/oberdiek/stringenc.dtx6893
-rw-r--r--macros/latex/contrib/oberdiek/stringenc.pdfbin0 -> 546904 bytes
-rw-r--r--macros/latex/contrib/oberdiek/tabularht.dtx1267
-rw-r--r--macros/latex/contrib/oberdiek/tabularht.pdfbin0 -> 144130 bytes
-rw-r--r--macros/latex/contrib/oberdiek/tabularkv.dtx547
-rw-r--r--macros/latex/contrib/oberdiek/tabularkv.pdfbin0 -> 86482 bytes
-rw-r--r--macros/latex/contrib/oberdiek/telprint.dtx1028
-rw-r--r--macros/latex/contrib/oberdiek/telprint.pdfbin0 -> 126846 bytes
-rw-r--r--macros/latex/contrib/oberdiek/thepdfnumber.dtx1598
-rw-r--r--macros/latex/contrib/oberdiek/thepdfnumber.pdfbin0 -> 161072 bytes
-rw-r--r--macros/latex/contrib/oberdiek/transparent.dtx659
-rw-r--r--macros/latex/contrib/oberdiek/transparent.pdfbin0 -> 97755 bytes
-rw-r--r--macros/latex/contrib/oberdiek/twoopt.dtx658
-rw-r--r--macros/latex/contrib/oberdiek/twoopt.pdfbin0 -> 94820 bytes
-rw-r--r--macros/latex/contrib/oberdiek/uniquecounter.dtx1056
-rw-r--r--macros/latex/contrib/oberdiek/uniquecounter.pdfbin0 -> 129168 bytes
-rw-r--r--macros/latex/contrib/oberdiek/zref.dtx6928
-rw-r--r--macros/latex/contrib/oberdiek/zref.pdfbin0 -> 496009 bytes
193 files changed, 164264 insertions, 0 deletions
diff --git a/macros/latex/contrib/oberdiek/README.txt b/macros/latex/contrib/oberdiek/README.txt
new file mode 100644
index 0000000000..81b0691b92
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/README.txt
@@ -0,0 +1,33 @@
+README 2019/07/27
+
+This file describes the directory
+ CTAN:macros/latex/contrib/oberdiek/
+
+It contains several packages:
+ <package>.dtx: source code
+ <package>.pdf: documentation
+
+Installation is easier, if you want to install all packages:
+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.
+* oberdiek.tex, oberdiek.pdf:
+ Table of contents of all packages in the directory.
+ It contains the table of contents and the abstract of the packages.
+ The name is a convenience to users of the program `texdoc'.
+
+Happy TeXing
+ Heiko Oberdiek
+ and
+ Oberdiek Package Support Group
+ ho-tex@tug.org
+ Preferred bug reporting address is now
+ https://github.com/ho-tex/oberdiek/issues
diff --git a/macros/latex/contrib/oberdiek/accsupp.dtx b/macros/latex/contrib/oberdiek/accsupp.dtx
new file mode 100644
index 0000000000..63c5cbf8a6
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/accsupp.dtx
@@ -0,0 +1,1217 @@
+% \iffalse meta-comment
+%
+% File: accsupp.dtx
+% Version: 2018/01/30 v0.5
+% Info: Accessibility support by marked content
+%
+% Copyright (C) 2007, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file accsupp.dtx
+% and the derived files
+% accsupp.sty, accsupp.pdf, accsupp.ins, accsupp.drv,
+% accsupp-pdftex.def, \ccsupp-luatex.def, accsupp-dvipdfm.def,
+% accsupp-dvips.def,
+% accsupp-example1.tex, accsupp-example2.tex,
+% accsupp-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/accsupp.dtx
+% CTAN:macros/latex/contrib/oberdiek/accsupp.pdf
+%
+% Unpacking:
+% (a) If accsupp.ins is present:
+% tex accsupp.ins
+% (b) Without accsupp.ins:
+% tex accsupp.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{accsupp.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If accsupp.drv is present:
+% latex accsupp.drv
+% (b) Without accsupp.drv:
+% latex accsupp.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 accsupp.dtx
+% makeindex -s gind.ist accsupp.idx
+% pdflatex accsupp.dtx
+% makeindex -s gind.ist accsupp.idx
+% pdflatex accsupp.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/accsupp.sty
+% TDS:tex/latex/oberdiek/accsupp-pdftex.def
+% TDS:tex/latex/oberdiek/accsupp-luatex.def
+% TDS:tex/latex/oberdiek/accsupp-dvipdfm.def
+% TDS:tex/latex/oberdiek/accsupp-dvips.def
+% TDS:doc/latex/oberdiek/accsupp.pdf
+% TDS:doc/latex/oberdiek/accsupp-example1.tex
+% TDS:doc/latex/oberdiek/accsupp-example2.tex
+% TDS:doc/latex/oberdiek/test/accsupp-test1.tex
+% TDS:source/latex/oberdiek/accsupp.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: accsupp 2018/03/28 v0.5 Accessibility support by marked content (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: accsupp
+Version: 2018/03/28 v0.5
+
+Copyright (C) 2007, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file accsupp.dtx
+and the derived files
+ accsupp.sty, accsupp.pdf, accsupp.ins, accsupp.drv,
+ accsupp-pdftex.def, accsupp-luatex.def, accsupp-dvipdfm.def,
+ accsupp-dvips.def,
+ accsupp-example1.tex, accsupp-example2.tex,
+ accsupp-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{accsupp.ins}{\from{accsupp.dtx}{install}}%
+ \file{accsupp.drv}{\from{accsupp.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{accsupp.sty}{\from{accsupp.dtx}{package}}%
+ \file{accsupp-pdftex.def}{\from{accsupp.dtx}{pdftex}}%
+ \file{accsupp-luatex.def}{\from{accsupp.dtx}{luatex}}%
+ \file{accsupp-dvipdfm.def}{\from{accsupp.dtx}{dvipdfm}}%
+ \file{accsupp-dvips.def}{\from{accsupp.dtx}{dvips}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{accsupp-example1.tex}{\from{accsupp.dtx}{example1}}%
+ \file{accsupp-example2.tex}{\from{accsupp.dtx}{example2}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{accsupp-test1.tex}{\from{accsupp.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{accsupp.xml}{\from{accsupp.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{* accsupp.sty, accsupp-pdftex.def, accsupp-dvipdfm.def,}
+\Msg{* accsupp-dvips.def}
+\Msg{*}
+\Msg{* To produce the documentation run the file `accsupp.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{accsupp.drv}%
+ [2018/03/28 v0.5 Accessibility support by marked content (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{accsupp.dtx}%
+\end{document}
+%</driver>
+% \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{accsupp.drv}
+%
+% \title{The \xpackage{accsupp} package}
+% \date{2018/03/28 v0.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Since PDF 1.5 portions of a page can be marked for better
+% accessibility support.
+% For example, replacement texts or expansions of abbreviations can be
+% provided. Package \xpackage{accsupp} starts with providing a minimal
+% low-level interface for programmers. Status is experimental.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Macros}
+%
+% Section ``10.8 Accessibility Support'' of the PDF reference
+% \cite{pdfspec} lists some features that can be added by
+% operators for marked content.
+%
+% \begin{declcs}{BeginAccSupp} \M{options}
+% \end{declcs}
+% It puts the operator |BDC| in the page stream:
+% \begin{quote}
+% |/Span|\\
+% |<<|\dots|>>| \qquad \textit{\% property dictionary}\\
+% |BDC|
+% \end{quote}
+% The contents of the dictionary is controlled by \meta{options}.
+% See sections \ref{sec:feature} and \ref{sec:method}.
+%
+% \begin{declcs}{EndAccSupp} \M{options}
+% \end{declcs}
+% It puts the operator |EMC| in the page stream.
+% The only option is \xoption{pdfliteral}, see section \ref{sec:pdftex}.
+%
+% \bigskip
+% \noindent\textbf{Note:}
+% The caller is responsible for the placement of \cs{BeginAccSupp}
+% and \cs{EndAccSupp} pairs. Especially page breaks are not allowed
+% in between.
+%
+% \subsubsection{Feature options}\label{sec:feature}
+%
+% The PDF reference \cite{pdfspec} describes and explains the different
+% features. The names of the feature options are the same as the
+% key names for the property dictionary for operator |BDC|, see
+% \cs{BeginAccSupp}.
+%
+% \begin{description}
+% \item[\xoption{ActualText}:]
+% Provides a replacement text, see examples in
+% section \ref{sec:example}.
+% \item[\xoption{Alt}:]
+% Provides an alternate description.
+% \item[\xoption{E}:]
+% Provides the expansion of an abbreviation or an acronym.
+% \item[\xoption{Lang}:]
+% Specifies the language.
+% \end{description}
+%
+% \subsubsection{Input methods}\label{sec:method}
+%
+% Except for \xoption{Lang} option \xoption{method} controls
+% how the argument for \xoption{ActualText}, \xoption{Alt},
+% and \xoption{E} are interpreted.
+% \begin{description}
+% \item[\xoption{method=plain}:]
+% The string is only expanded and written without further
+% treatment. Special characters are not protected, thus this method
+% may result in an invalid PDF file.
+% \item[\xoption{method=escape}:]
+% The string is expanded and special characters are escaped.
+% The result is a valid PDF string.
+% \item[\xoption{method=hex}:]
+% The string is given in hexadecimal notation.
+% Section \ref{sec:example:notparallel} shows an example.
+% \item[\xoption{method=pdfstringdef}:]
+% If package \xpackage{hyperref} is loaded, then its \cs{pdfstringdef}
+% is used. This method is slow, but useful if the string contains
+% arbitrary \hologo{TeX} code.
+% \item[\xoption{unicode}:]
+% This option is needed, if the string is given as Unicode string
+% (16 bit). Internally it adds the string prefix for Unicode.
+% In case of \xoption{method=pdfstringdef} it passes the option
+% to \cs{hypersetup}.
+% \end{description}
+%
+% \subsection{Workaround, option \xoption{space}}
+%
+% PDF specification says in ``10.8.3 Replacement Text''
+% \begin{quote}
+% Just as alternative descriptions can be provided for images and other
+% items that do not translate naturally into text (\dots), replacement
+% text can be specified for content that does translate into text but
+% that is represented in a nonstandard way. These nonstandard representations
+% might include, for example, glyphs for ligatures or custom characters, or
+% inline graphics corresponding to letters in an illuminated manustript or to
+% dropped capitals.
+% \end{quote}
+% However, the ActualText is ignored in Acrobat Reader
+% (until version 9 at least), if the content does not contain glyphs.
+% Option \xoption{space} adds such an invisible glyph, a space
+% character. The font name can be configured by option \xoption{spacefont},
+% the default font is \texttt{phvr8r}. The character slot is given
+% by option \xoption{spacechar}, default is \texttt{32}, the usual
+% position of the space character.
+%
+% These options can also be given as package options or in
+% macro \cs{AccSuppSetup} that takes a key value list as argument.
+% Usually only option \xoption{space} is necessary, if the
+% contents does not contain glyphs otherwise. Option \xoption{space}
+% is enabled by |space| or |space=true| and disabled by |space=false|.
+% It is disabled as default. The option is evaluated by \cs{BeginAccSupp}
+% and ignored by \cs{EndAccSupp}.
+%
+% Note: Even with option \xoption{space} I get sometimes wrong texts
+% when cut \& paste from AR7/Linux or AR8/Linux, e.g.
+% \begin{quote}
+% |Hello| $\rightarrow$ |Helo|, |Helol|, |Hell|, \dots\\
+% |Hello World| $\rightarrow$ |Helo WorldW|, |Helo World|, \dots
+% \end{quote}
+% I do not know what Acrobat Reader is doing here, thus feedback and
+% insights are welcome.
+%
+% \subsection{Driver options}
+%
+% Driver options are package options only.
+% The special \hologo{TeX} compilers \hologo{pdfTeX}, \hologo{LuaTeX} and \hologo{XeTeX}
+% are detected automatically. The default for unrecognized drivers can be
+% set by defining \cs{ActualTextDriverDefault}. This can be done
+% in the configuration file \xfile{accsupp.cfg}.
+%
+% \subsubsection{Option \xoption{pdftex}}\label{sec:pdftex}
+% Package option \xoption{pdftex} is used for \hologo{pdfTeX} in PDF mode.
+% Additionally \cs{BeginAccSupp} and \cs{EndAccSupp} understand
+% option \xoption{pdfliteral}. It controls
+% the modifier keyword for \cs{pdfliteral}:
+% \begin{quote}
+% |pdfliteral=direct| $\Rightarrow$ |\pdfliteral direct{...}|
+% \end{quote}
+%
+% \subsubsection{Option \xoption{luatex}}\label{sec:luatex}
+% Package option \xoption{luatex} is used for \hologo{LuaTeX} in PDF mode.
+% Additionally \cs{BeginAccSupp} and \cs{EndAccSupp} understand
+% option \xoption{pdfliteral}. It controls
+% the modifier keyword for \cs{pdfextension} literal:
+% \begin{quote}
+% |pdfliteral=direct| $\Rightarrow$ |\pdfextension literal direct{...}|
+% \end{quote}
+%
+% \subsubsection{Option \xoption{dvipdfm}}
+%
+% Package option \xoption{dvipdfm} and its aliases \xoption{dvipdfmx}
+% \xoption{xetex} are used for drivers that support
+% \textsf{dvipdfm} specials.
+%
+% \subsubsection{Option \xoption{dvips}}
+%
+% Package option \xoption{dvips} and its alias \xoption{dvipsone}
+% write pdfmark specials in the output. Unhappily these pdfmark
+% operators are ignored by \textsf{ghostscript} (latest tested
+% version is 8.54). Perhaps they are recognized by commercial
+% distiller applications.
+%
+% \subsubsection{Turning off page stream compression}
+%
+% For debugging it is useful to have uncompressed page stream objects.
+% This can be done afterwards via \textsf{pdftk}:
+% \begin{quote}
+% |pdftk file.pdf output file-uncompressed.pdf uncompress|
+% \end{quote}
+% Or the PDF file is generated uncompressed:
+% \begin{description}
+% \item[\hologo{pdfTeX}:] |\pdfcompresslevel=0|
+% \item[dvipdfm:] |dvipdfm -z0 ...|
+% \item[dvipdfmx:] |dvipdfmx -z0 ...|
+% \item[ghostscript/ps2pdf:]
+% |ps2pdf -dCompressPages=false input.ps output.pdf|
+% \end{description}
+%
+% \section{Example}
+% \label{sec:example}
+%
+% \subsection{Example \cs{notparallel}}
+% \label{sec:example:notparallel}
+%
+% \begin{macrocode}
+%<*example1>
+% \end{macrocode}
+% \begin{macrocode}
+%<<END
+\documentclass{article}
+\usepackage{accsupp}[2007/11/14]
+\usepackage{centernot}
+% U+2226 NOT PARALLEL
+% \mathrel{...} prevents page break in between
+\newcommand*{\notparallel}{%
+ \ensuremath{%
+ \mathrel{%
+ \BeginAccSupp{method=hex,unicode,ActualText=2226}%
+ \centernot{\parallel}%
+ \EndAccSupp{}%
+ }%
+ }%
+}
+\begin{document}
+\begin{equation}
+A\notparallel B
+\end{equation}
+\end{document}
+%END
+% \end{macrocode}
+% \begin{macrocode}
+%</example1>
+% \end{macrocode}
+%
+% \subsection{Example with \xoption{pdfstringdef}}
+%
+% \begin{macrocode}
+%<*example2>
+% \end{macrocode}
+% \begin{macrocode}
+%<<END
+\documentclass{article}
+\usepackage[unicode]{hyperref}
+\usepackage{accsupp}[2007/11/14]
+\begin{document}
+ \begin{equation}
+ \BeginAccSupp{
+ method=pdfstringdef,
+ unicode,
+ ActualText={%
+ a\texttwosuperior +b\texttwosuperior
+ =c\texttwosuperior
+ }
+ }
+ a^2 + b^2 = c^2
+ \EndAccSupp{}
+ \end{equation}
+\end{document}
+%END
+% \end{macrocode}
+% \begin{macrocode}
+%</example2>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Package}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \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 ACCSUPP@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\ACCSUPP@AtEnd{%
+ \ACCSUPP@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{94}{7}% ^ (superscript)
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{254}{12}% ^^fe
+\TMP@EnsureCode{255}{12}% ^^ff
+\edef\ACCSUPP@AtEnd{\ACCSUPP@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{accsupp}%
+ [2018/03/28 v0.5 Accessibility support by marked content (HO)]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{pdfescape}[2007/02/25]
+\RequirePackage{ifpdf}
+\RequirePackage{ifxetex}
+\RequirePackage{kvoptions}
+% \end{macrocode}
+% \begin{macrocode}
+\SetupKeyvalOptions{%
+ family=ACCSUPP,%
+ prefix=ACCSUPP@%
+}
+% \end{macrocode}
+%
+% \subsection{Space setup}
+%
+% \begin{macrocode}
+\DeclareBoolOption{space}
+\DeclareStringOption[phvr8r]{spacefont}
+\DeclareStringOption[32]{spacechar}
+% \end{macrocode}
+%
+% \subsection{Driver detection and setup}
+%
+% \paragraph{Driver declarations.}
+%
+% \begin{macrocode}
+\def\ACCSUPP@DefineDriverKey{%
+ \@dblarg\ACCSUPP@@DefineDriverKey
+}
+\def\ACCSUPP@@DefineDriverKey[#1]#2{%
+ \define@key{ACCSUPP}{#2}[]{%
+ \def\ACCSUPP@driver{#1}%
+ }%
+ \g@addto@macro\ACCSUPP@DisableOptions{%
+ \DisableKeyvalOption{ACCSUPP}{#2}%
+ }%
+}
+\let\ACCSUPP@DisableOptions\@empty
+\ACCSUPP@DefineDriverKey{pdftex}
+\ACCSUPP@DefineDriverKey{luatex}
+\ACCSUPP@DefineDriverKey{dvips}
+\ACCSUPP@DefineDriverKey[dvips]{dvipsone}
+\ACCSUPP@DefineDriverKey{dvipdfm}
+\ACCSUPP@DefineDriverKey[dvipdfm]{dvipdfmx}
+\ACCSUPP@DefineDriverKey[dvipdfm]{xetex}
+\let\ACCSUPP@driver\relax
+\InputIfFileExists{accsupp.cfg}{}{}
+\providecommand*{\ActualTextDriverDefault}{dvips}
+\ifpdf
+ \ifx\pdfextension\@undefined
+ \def\ACCSUPP@driver{pdftex}%
+ \else
+ \def\ACCSUPP@driver{luatex}%
+ \fi
+\else
+ \ifxetex
+ \def\ACCSUPP@driver{dvipdfm}%
+ \else
+ \ifx\ACCSUPP@driver\relax
+ \let\ACCSUPP@driver\ActualTextDriverDefault
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+%
+% \paragraph{Process options.}
+%
+% \begin{macrocode}
+\ProcessKeyvalOptions*
+\ACCSUPP@DisableOptions
+% \end{macrocode}
+%
+% \paragraph{Driver validation and loading.}
+%
+% \begin{macrocode}
+\def\ACCSUPP@temp{pdftex}%
+\ifpdf
+ \ifx\pdfextension\@undefined\else
+ \def\ACCSUPP@temp{luatex}%
+ \fi
+ \ifx\ACCSUPP@temp\ACCSUPP@driver
+ \else
+ \PackageWarningNoLine{accsupp}{%
+ Wrong driver `\ACCSUPP@driver', using `pdftex' instead%
+ }%
+ed as
+ \let\ACCSUPP@driver\ACCSUPP@temp
+ \fi
+\else
+ \ifx\ACCSUPP@temp\ACCSUPP@driver
+ \PackageError{accsupp}{%
+ Wrong driver, pdfTeX is not running in PDF mode.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \expandafter\expandafter\expandafter\ACCSUPP@AtEnd
+ \fi
+ \def\ACCSUPP@temp{dvipdfm}%
+ \ifxetex
+ \ifx\ACCSUPP@temp\ACCSUPP@driver
+ \else
+ \PackageWarningNoLine{accsupp}{%
+ Wrong driver `\ACCSUPP@driver',\MessageBreak
+ using `dvipdfm' for XeTeX instead%
+ }%
+ \let\ACCSUPP@driver\ACCSUPP@temp
+ \fi
+ \fi
+\fi%
+\ifx\ACCSUPP@driver\relax
+ \PackageError{accsupp}{%
+ Missing driver option.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \expandafter\ACCSUPP@AtEnd
+\fi%
+\InputIfFileExists{accsupp-\ACCSUPP@driver.def}{}{%
+ \PackageError{accsupp}{%
+ Unsupported driver `\ACCSUPP@driver'.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \ACCSUPP@AtEnd
+}%
+% \end{macrocode}
+%
+% \subsection{Main macro}
+%
+% \begin{macrocode}
+\DeclareBoolOption{unicode}
+\DeclareStringOption[page]{pdfliteral}
+\DeclareStringOption{Lang}
+\def\ACCSUPP@method{escape}
+\define@key{ACCSUPP}{method}{%
+ \@ifundefined{ACCSUPP@method@#1}{%
+ \PackageError{accsupp}{%
+ Ignoring unknown method `#1'%
+ }\@ehc
+ }{%
+ \edef\ACCSUPP@method{#1}%
+ }%
+}
+\let\ACCSUPP@Lang\relax
+\def\ACCSUPP@temp#1{%
+ \expandafter\ACCSUPP@@temp\csname ACCSUPP@#1\endcsname{#1}%
+}
+\def\ACCSUPP@@temp#1#2{%
+ \let#1\relax
+ \define@key{ACCSUPP}{#2}{%
+ \def#1{##1}%
+ \ifx#1\@empty
+ \def#1{()}%
+ \else
+ \csname ACCSUPP@method@\ACCSUPP@method\endcsname#1%
+ \fi
+ }%
+}
+\ACCSUPP@temp{Alt}
+\ACCSUPP@temp{ActualText}
+\ACCSUPP@temp{E}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand*{\BeginAccSupp}[1]{%
+ \begingroup
+ \setkeys{ACCSUPP}{#1}%
+ \edef\ACCSUPP@span{%
+ /Span<<%
+ \ifx\ACCSUPP@Lang\relax
+ \else
+ /Lang\ACCSUPP@Lang
+ \fi
+ \ifx\ACCSUPP@Alt\relax
+ \else
+ /Alt\ACCSUPP@Alt
+ \fi
+ \ifx\ACCSUPP@ActualText\relax
+ \else
+ /ActualText\ACCSUPP@ActualText
+ \fi
+ \ifx\ACCSUPP@E\relax
+ \else
+ /E\ACCSUPP@E
+ \fi
+ >>%
+ }%
+ \ACCSUPP@bdc
+ \ACCSUPP@space
+ \endgroup
+}
+\newcommand*{\EndAccSupp}[1]{%
+ \begingroup
+ \setkeys{ACCSUPP}{#1}%
+ \ACCSUPP@emc
+ \endgroup
+}
+\def\ACCSUPP@space{%
+ \ifACCSUPP@space
+ \begingroup
+ \@ifundefined{ACCSUPP@Font}{%
+ \global\font\ACCSUPP@Font=\ACCSUPP@spacefont\relax
+ }{}%
+ \leavevmode
+ \setbox\z@\hbox{\ACCSUPP@Font\char\ACCSUPP@spacechar}%
+ \wd\z@\z@
+ \ht\z@\z@
+ \dp\z@\z@
+ \copy\z@
+ \endgroup
+ \fi
+}
+\newcommand*{\AccSuppSetup}{%
+ \setkeys{ACCSUPP}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Input methods}
+%
+% \begin{macrocode}
+\def\ACCSUPP@method@plain#1{%
+ \csname @safe@activestrue\endcsname
+ \edef#1{%
+ (%
+ \ifACCSUPP@unicode
+ \string\376\string\377%
+ \fi
+ #1%
+ )%
+ }%
+ \@onelevel@sanitize#1%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\ACCSUPP@method@escape#1{%
+ \EdefEscapeString#1{%
+ \ifACCSUPP@unicode
+ ^^fe^^ff%
+ \fi
+ #1%
+ }%
+ \edef#1{(#1)}%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\ACCSUPP@method@hex#1{%
+ \edef#1{%
+ <%
+ \ifACCSUPP@unicode
+ FEFF%
+ \fi
+ #1%
+ >%
+ }%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\ACCSUPP@method@pdfstringdef#1{%
+ \ifACCSUPP@unicode
+ \@ifundefined{hypersetup}{}{%
+ \hypersetup{unicode}%
+ }%
+ \fi
+ \@ifundefined{pdfstringdef}{%
+ \PackageError{accsupp}{%
+ Method `pdfstringdef' requires package `hyperref'%
+ }\@ehc
+ \let\ACCSUPP@temp\@empty
+ }{%
+ \begingroup
+ \setbox0=\hbox{%
+ \pdfstringdef\ACCSUPP@temp#1%
+ \global\let\ACCSUPP@temp\ACCSUPP@temp
+ }%
+ \endgroup
+ }%
+ \edef#1{(\ACCSUPP@temp)}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ACCSUPP@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \subsection{Drivers}
+%
+% \subsubsection{Driver \xoption{pdftex}}
+%
+% \begin{macrocode}
+%<*pdftex>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{accsupp-pdftex.def}%
+ [2018/03/28 v0.5 accsupp driver for pdfTeX (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\ACCSUPP@bdc{%
+ \pdfliteral\ACCSUPP@pdfliteral{\ACCSUPP@span BDC}%
+}
+\def\ACCSUPP@emc{%
+ \pdfliteral\ACCSUPP@pdfliteral{EMC}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</pdftex>
+% \end{macrocode}
+%
+% \subsubsection{Driver \xoption{luatex}}
+%
+% \begin{macrocode}
+%<*luatex>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{accsupp-luatex.def}%
+ [2018/03/28 v0.5 accsupp driver for pdfTeX (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\protected\def\ACCSUPP@pdf@literal{\pdfextension literal}
+\def\ACCSUPP@bdc{%
+ \ACCSUPP@pdf@literal\ACCSUPP@pdfliteral{\ACCSUPP@span BDC}%
+}
+\def\ACCSUPP@emc{%
+ \ACCSUPP@pdf@literal\ACCSUPP@pdfliteral{EMC}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</luatex>
+% \end{macrocode}
+%
+% \subsubsection{Driver \xoption{dvipdfm}}
+%
+% \begin{macrocode}
+%<*dvipdfm>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{accsupp-dvipdfm.def}%
+ [2018/03/28 v0.5 accsupp driver for dvipdfm (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\ACCSUPP@bdc{%
+ \special{pdf:content \ACCSUPP@span BDC}%
+}
+\def\ACCSUPP@emc{%
+ \special{pdf:content EMC}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</dvipdfm>
+% \end{macrocode}
+%
+% \subsubsection{Driver \xoption{dvips}}
+%
+% \begin{macrocode}
+%<*dvips>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{accsupp-dvips.def}%
+ [2018/03/28 v0.5 accsupp driver for dvips (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\ACCSUPP@bdc{%
+ \special{ps:[\ACCSUPP@span/BDC pdfmark}%
+}
+\def\ACCSUPP@emc{%
+ \special{ps:[/EMC pdfmark}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</dvips>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Catcode checks for loading}
+%
+% \begin{macrocode}
+%<*test1>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\makeatletter
+\def\RestoreCatcodes{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@\@ne
+\repeat
+
+\def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@\@ne
+ \repeat
+}
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{127}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\[=12 %
+ \catcode`\]=12 %
+ \catcode`\%=14 %
+ \catcode`\ =10 %
+ \catcode13=5 %
+ \RequirePackage{accsupp}[2018/03/28]\relax
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/accsupp}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/accsupp.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/accsupp.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[\CTAN{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 accsupp.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@{}}
+% accsupp.sty & tex/latex/oberdiek/accsupp.sty\\
+% accsupp-pdftex.def & tex/latex/oberdiek/accsupp-pdftex.def\\
+% accsupp-luatex.def & tex/latex/oberdiek/accsupp-luatex.def\\
+% accsupp-dvipdfm.def & tex/latex/oberdiek/accsupp-dvipdfm.def\\
+% accsupp-dvips.def & tex/latex/oberdiek/accsupp-dvips.def\\
+% accsupp.pdf & doc/latex/oberdiek/accsupp.pdf\\
+% accsupp-example1.tex & doc/latex/oberdiek/accsupp-example1.tex\\
+% accsupp-example2.tex & doc/latex/oberdiek/accsupp-example2.tex\\
+% test/accsupp-test1.tex & doc/latex/oberdiek/test/accsupp-test1.tex\\
+% accsupp.dtx & source/latex/oberdiek/accsupp.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk accsupp.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{accsupp.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 accsupp.dtx
+%makeindex -s gind.ist accsupp.idx
+%pdflatex accsupp.dtx
+%makeindex -s gind.ist accsupp.idx
+%pdflatex accsupp.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{accsupp.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='accsupp'>
+ <name>accsupp</name>
+ <caption>Better accessibility support for PDF files.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2010'/>
+ <license type='lppl1.3'/>
+ <version number='0.4'/>
+ <description>
+ Since PDF 1.5 portions of a page can be marked for better accessibility
+ support. For example, replacement texts or expansions of abbreviations can
+ be provided. This package starts with providing a minimal low-level
+ interface for programmers; its status is experimental.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/accsupp.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/accsupp.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{pdfspec}
+% Adobe Systems Incorporated,
+% \textit{PDF Reference}, 6th edition, 2006.
+% \url{http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference.pdf}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/03/21 v0.1}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/11/14 v0.2}
+% \item
+% Various bug fixes.
+% \item
+% Catcode section rewritten, test added.
+% \end{Version}
+% \begin{Version}{2010/01/16 v0.3}
+% \item
+% \cs{AccSuppSetup} added.
+% \item
+% Options \xoption{space}, \xoption{spacefont}, \xoption{spacechar} added.
+% \end{Version}
+% \begin{Version}{2016/05/16 v0.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2018/03/28 v0.5}
+% \item
+% LuaTeX support added.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/accsupp.pdf b/macros/latex/contrib/oberdiek/accsupp.pdf
new file mode 100644
index 0000000000..ba0bff6bed
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/accsupp.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/aliascnt.dtx b/macros/latex/contrib/oberdiek/aliascnt.dtx
new file mode 100644
index 0000000000..aee644f62e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/aliascnt.dtx
@@ -0,0 +1,644 @@
+% \iffalse meta-comment
+%
+% File: aliascnt.dtx
+% Version: 2018/09/07 v1.5
+% Info: Alias counters
+%
+% Copyright (C) 2006, 2009 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file aliascnt.dtx
+% and the derived files
+% aliascnt.sty, aliascnt.pdf, aliascnt.ins, aliascnt.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/aliascnt.dtx
+% CTAN:macros/latex/contrib/oberdiek/aliascnt.pdf
+%
+% Unpacking:
+% (a) If aliascnt.ins is present:
+% tex aliascnt.ins
+% (b) Without aliascnt.ins:
+% tex aliascnt.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{aliascnt.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If aliascnt.drv is present:
+% latex aliascnt.drv
+% (b) Without aliascnt.drv:
+% latex aliascnt.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 aliascnt.dtx
+% makeindex -s gind.ist aliascnt.idx
+% pdflatex aliascnt.dtx
+% makeindex -s gind.ist aliascnt.idx
+% pdflatex aliascnt.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/aliascnt.sty
+% TDS:doc/latex/oberdiek/aliascnt.pdf
+% TDS:source/latex/oberdiek/aliascnt.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: aliascnt 2018/09/07 v1.5 Alias counters (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: aliascnt
+Version: 2018/09/07 v1.5
+
+Copyright (C) 2006, 2009 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file aliascnt.dtx
+and the derived files
+ aliascnt.sty, aliascnt.pdf, aliascnt.ins, aliascnt.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{aliascnt.ins}{\from{aliascnt.dtx}{install}}%
+ \file{aliascnt.drv}{\from{aliascnt.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{aliascnt.sty}{\from{aliascnt.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{aliascnt.xml}{\from{aliascnt.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{* aliascnt.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `aliascnt.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{aliascnt.drv}%
+ [2018/09/07 v1.5 Alias counters (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{aliascnt.dtx}%
+\end{document}
+%</driver>
+% \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{aliascnt.drv}
+%
+% \title{The \xpackage{aliascnt} package}
+% \date{2018/09/07 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{aliascnt} introduces \emph{alias counters} that
+% share the same counter register and clear list.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% \subsection{Introduction}
+%
+% There are features that rely on the name of counters. For
+% example, \xpackage{hyperref}'s \cs{autoref} indirectly uses
+% the counter name to determine which label text it puts in front
+% of the reference number (\cite{hyperref}).
+% In some circumstances this fail: several theorem environments
+% are defined by \cs{newtheorem} that share the same counter.
+%
+% \subsection{Syntax}
+%
+% Macro names in user land contain the package name
+% \texttt{aliascnt} in order to prevent name clashes.
+%
+% \newenvironment{desc}{^^A
+% \list{}{^^A
+% \setlength{\labelwidth}{0pt}^^A
+% \setlength{\itemindent}{-.5\marginparwidth}^^A
+% \setlength{\leftmargin}{0pt}^^A
+% \let\makelabel\desclabel
+% }^^A
+% }{^^A
+% \endlist
+% }
+% \newcommand*{\desclabel}[1]{^^A
+% \hspace{\labelsep}^^A
+% \normalfont
+% #1^^A
+% }
+% \newcommand*{\itemcs}[2]{^^A
+% \item[^^A
+% \expandafter\SpecialUsageIndex\csname #1\endcsname
+% {\cs{#1}#2}^^A
+% ]\mbox{}\\*[.5ex]^^A
+% \ignorespaces
+% }
+% \begin{desc}
+% \itemcs{newaliascnt}{\marg{ALIASCNT}\marg{BASECNT}}
+% An alias counter ALIASCNT is created that does not allocate
+% a new \TeX\ counter register. It shares the count register and
+% the clear list with counter BASECNT. If the value of either
+% the two registers is changed, the changes affects both.
+% \itemcs{aliascntresetthe}{\marg{ALIASCNT}}
+% This fixes a problem with \cs{newtheorem} if it
+% is fooled by an alias counter with the same name:
+% \begin{quote}
+%\begin{verbatim}
+%\newtheorem{foo}{Foo}% counter "foo"
+%\newaliascnt{bar}{foo}% alias counter "bar"
+%\newtheorem{bar}[bar]{Bar}
+%\aliascntresetthe{bar}
+%\end{verbatim}
+% \end{quote}
+% \end{desc}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{aliascnt}%
+ [2018/09/07 v1.5 Alias counters (HO)]%
+% \end{macrocode}
+%
+% \subsection{Create new alias counter}
+%
+% \begin{macro}{\newaliascnt}
+% A new alias counter is set up by \cs{newaliascnt}.
+% The following properties are added for the new counter CNT:
+% \begin{description}
+% \item[\mdseries\cs{theH}\meta{CNT}:] Compatibility for \xpackage{hyperref}
+% \item[\mdseries\cs{AC@cnt@}\meta{CNT}:] Name of the referenced counter
+% in the definition.
+% \end{description}
+% \begin{macrocode}
+\newcommand*{\newaliascnt}[2]{%
+ \begingroup
+ \def\AC@glet##1{%
+ \global\expandafter\let\csname##1#1\expandafter\endcsname
+ \csname##1#2\endcsname
+ }%
+ \@ifundefined{c@#2}{%
+ \@nocounterr{#2}%
+ }{%
+ \expandafter\@ifdefinable\csname c@#1\endcsname{%
+ \AC@glet{c@}%
+ \AC@glet{the}%
+ \AC@glet{theH}%
+ \AC@glet{p@}%
+ \expandafter\gdef\csname AC@cnt@#1\endcsname{#2}%
+ \expandafter\gdef\csname cl@#1\expandafter\endcsname
+ \expandafter{\csname cl@#2\endcsname}%
+ }%
+ }%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\aliascntresetthe}
+% The \cs{the}\meta{CNT} macro is restored using the
+% main counter.
+% \begin{macrocode}
+\newcommand*{\aliascntresetthe}[1]{%
+ \@ifundefined{AC@cnt@#1}{%
+ \PackageError{aliascnt}{%
+ `#1' is not an alias counter%
+ }\@ehc
+ }{%
+ \expandafter\let\csname the#1\expandafter\endcsname
+ \csname the\csname AC@cnt@#1\endcsname\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Counter clear list}
+%
+% The alias counters share the same register and clear list.
+% Therefore we must ensure that manipulations to the clear list
+% are done with the clear list macro of a real counter.
+% \begin{macro}{\AC@findrootcnt}
+% \cs{AC@findrootcnt} walks throught the aliasing relations
+% to find the base counter.
+% \begin{macrocode}
+\newcommand*{\AC@findrootcnt}[1]{%
+ \@ifundefined{AC@cnt@#1}{%
+ #1%
+ }{%
+ \expandafter\AC@findrootcnt\csname AC@cnt@#1\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Clear lists are manipulated by \cs{@addtoreset} and
+% \cs{@removefromreset}. The latter one is provided by
+% the \xpackage{remreset} package (\cite{remreset} for old latex formats).
+%
+% \begin{macro}{\AC@patch}
+% The same patch principle is applicable to both
+% \cs{@addtoreset} and \cs{@removefromreset}.
+% \begin{macrocode}
+\def\AC@patch#1{%
+ \expandafter\let\csname AC@org@#1reset\expandafter\endcsname
+ \csname @#1reset\endcsname
+ \expandafter\def\csname @#1reset\endcsname##1##2{%
+ \csname AC@org@#1reset\endcsname{##1}{\AC@findrootcnt{##2}}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% If \xpackage{remreset} is not loaded we cannot delay
+% the patch to \cs{AtBeginDocument}, because \cs{@removefromreset}
+% can be called in between. Therefore we force the loading of
+% the package.
+% \begin{macrocode}
+\ifx\@removefromreset\@undefined
+ \RequirePackage{remreset}
+\fi
+\AC@patch{addto}
+\AC@patch{removefrom}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/aliascnt}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/aliascnt.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/aliascnt.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[\CTAN{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 aliascnt.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@{}}
+% aliascnt.sty & tex/latex/oberdiek/aliascnt.sty\\
+% aliascnt.pdf & doc/latex/oberdiek/aliascnt.pdf\\
+% aliascnt.dtx & source/latex/oberdiek/aliascnt.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk aliascnt.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{aliascnt.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 aliascnt.dtx
+%makeindex -s gind.ist aliascnt.idx
+%pdflatex aliascnt.dtx
+%makeindex -s gind.ist aliascnt.idx
+%pdflatex aliascnt.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{aliascnt.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='aliascnt'>
+ <name>aliascnt</name>
+ <caption>Alias counters.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006,2009'/>
+ <license type='lppl1.3'/>
+ <version number='1.5'/>
+ <description>
+ This package introduces aliases for counters, that
+ share the same counter register and clear list.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/aliascnt.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/aliascnt.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \section{Acknowledgement}
+%
+% \begin{description}
+% \item[Ulrich Schwarz:] The package is based on his draft for
+% ``Die \TeX nische Kom\"odie'', see \cite{schwarz}.
+% \end{description}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{schwarz}
+% Ulrich Schwarz:
+% \textit{Was hinten herauskommt z\"ahlt: Counter Aliasing in \LaTeX},
+% \textit{Die \TeX nische Kom\"odie}, 3/2006, pages 8--14, Juli 2006.
+%
+% \bibitem{remreset}
+% David Carlisle: \textit{The \xpackage{remreset} package};
+% 1997/09/28;
+% \CTAN{macros/latex/contrib/carlisle/remreset.sty}.
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz, Heiko Oberdiek:
+% \textit{The \xpackage{hyperref} package};
+% 2006/08/16 v6.75c;
+% \CTAN{macros/latex/contrib/hyperref/}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/02/20 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2006/08/16 v1.1}
+% \item
+% Update of bibliography.
+% \end{Version}
+% \begin{Version}{2006/09/25 v1.2}
+% \item
+% Bug fix (\cs{aliascntresetthe}).
+% \end{Version}
+% \begin{Version}{2009/09/08 v1.3}
+% \item
+% Bug fix of \cs{@ifdefinable}'s use (thanks to Uwe L\"uck).
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2018/09/07 v1.5}
+% \item
+% Avoid loading obsolete remreset package..
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/aliascnt.pdf b/macros/latex/contrib/oberdiek/aliascnt.pdf
new file mode 100644
index 0000000000..58baffc06a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/aliascnt.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/alphalph.dtx b/macros/latex/contrib/oberdiek/alphalph.dtx
new file mode 100644
index 0000000000..4eeb4c1ffb
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/alphalph.dtx
@@ -0,0 +1,1963 @@
+% \iffalse meta-comment
+%
+% File: alphalph.dtx
+% Version: 2016/05/16 v2.5
+% Info: Convert numbers to letters
+%
+% Copyright (C) 1999, 2006-2008, 2010, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 alphalph.dtx
+% and the derived files
+% alphalph.sty, alphalph.pdf, alphalph.ins, alphalph.drv,
+% alphalph-test1.tex, alphalph-test2.tex, alphalph-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/alphalph.dtx
+% CTAN:macros/latex/contrib/oberdiek/alphalph.pdf
+%
+% Unpacking:
+% (a) If alphalph.ins is present:
+% tex alphalph.ins
+% (b) Without alphalph.ins:
+% tex alphalph.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{alphalph.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If alphalph.drv is present:
+% latex alphalph.drv
+% (b) Without alphalph.drv:
+% latex alphalph.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 alphalph.dtx
+% makeindex -s gind.ist alphalph.idx
+% pdflatex alphalph.dtx
+% makeindex -s gind.ist alphalph.idx
+% pdflatex alphalph.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/alphalph.sty
+% TDS:doc/latex/oberdiek/alphalph.pdf
+% TDS:doc/latex/oberdiek/test/alphalph-test1.tex
+% TDS:doc/latex/oberdiek/test/alphalph-test2.tex
+% TDS:doc/latex/oberdiek/test/alphalph-test3.tex
+% TDS:source/latex/oberdiek/alphalph.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: alphalph 2016/05/16 v2.5 Convert numbers to letters (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: alphalph
+Version: 2016/05/16 v2.5
+
+Copyright (C) 1999, 2006-2008, 2010, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 alphalph.dtx
+and the derived files
+ alphalph.sty, alphalph.pdf, alphalph.ins, alphalph.drv,
+ alphalph-test1.tex, alphalph-test2.tex, alphalph-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{alphalph.ins}{\from{alphalph.dtx}{install}}%
+ \file{alphalph.drv}{\from{alphalph.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{alphalph.sty}{\from{alphalph.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{alphalph-test1.tex}{\from{alphalph.dtx}{test1}}%
+% \file{alphalph-test2.tex}{\from{alphalph.dtx}{test2,etex}}%
+% \file{alphalph-test3.tex}{\from{alphalph.dtx}{test2,noetex}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{alphalph.xml}{\from{alphalph.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{* alphalph.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `alphalph.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{alphalph.drv}%
+ [2016/05/16 v2.5 Convert numbers to letters (HO)]%
+\documentclass{ltxdoc}
+\usepackage{alphalph}[2016/05/16]
+\makeatletter
+\newalphalph{\fnsymbolwrap}[wrap]{\@fnsymbol}{}
+\newcommand*{\fnsymbolsingle}[1]{%
+ \ensuremath{%
+ \ifcase#1%
+ \or *%
+ \or \dagger
+ \or \ddagger
+ \or \mathsection
+ \or \mathparagraph
+ \else
+ \@ctrerr
+ \fi
+ }%
+}
+\makeatother
+\newalphalph{\fnsymbolmult}[mult]{\fnsymbolsingle}{}
+\usepackage{amsmath}
+\DeclareMathOperator{\opDiv}{div}
+\DeclareMathOperator{\opMod}{mod}
+\newcommand*{\Def}{%
+ \ensuremath{%
+ \mathrel{\mathop{:}}=%
+ }%
+}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{alphalph.dtx}%
+\end{document}
+%</driver>
+% \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{alphalph.drv}
+%
+% \title{The \xpackage{alphalph} package}
+% \date{2016/05/16 v2.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package provides methods to represent numbers with a limited
+% set of symbols. Both \hologo{LaTeX} and \hologo{plainTeX} are supported.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+% \hologo{LaTeX} counters can be represented in different ways
+% by using presentation commands:
+% \begin{quote}
+% \cs{arabic}, \cs{roman}, \cs{Roman},\\
+% \cs{alph}, \cs{Alph}, \cs{fnsymbol}
+% \end{quote}
+% The ranges of supported counter values are more or less
+% restricted. Only \cs{arabic} can be used with any counter
+% value \hologo{TeX} supports.
+% \begin{quote}
+% \catcode`\|=12 %
+% \begin{tabular}{@{}l|l|l|l@{}}
+% Presentation & Supported & Ignored & Error message\\
+% command & domain & values & ``Counter too large''\\
+% \hline
+% \cs{arabic}
+% & \ttfamily -MAX..MAX & &\\
+% \cs{roman}, \cs{Roman}
+% & \ttfamily 1..MAX & \ttfamily -MAX..0 &\\
+% \cs{alph}, \cs{Alph}
+% & \ttfamily 1..26 & 0 & \ttfamily -MAX..-1, 27..MAX\\
+% \cs{fnsymbol}
+% & \ttfamily 1..9 & 0 & \ttfamily -MAX..-1, 10..MAX\\
+% \hline
+% \end{tabular}\\[1ex]
+% \texttt{MAX} = \texttt{2147483647}
+% \end{quote}
+% Ordinal numbers are often used in documents: numbering
+% of chapters, sections, figures, footnotes and so on.
+% The layouter chooses \cs{Alph} for chapter numbers
+% and \cs{fnsymbol} for footnotes. But what can be done
+% if there are more than 26 chapters or more than 10 footnotes?
+% This package \xpackage{alphalph} allows to define new
+% presentation commands. They rely on a existing command
+% and define presentations for values greater the limits.
+% Three different methods are provided by the package.
+% In the following use cases they are presentated.
+%
+% \subsection{Use cases}
+%
+% \subsubsection{Number system based on symbols}
+%
+% Asume you are writing a book and your lecturer demands
+% that chapter numbers must be letters. But you have already
+% 30 chapters and you have only 26 letters?
+%
+% In the decimal system the situation would be clear.
+% If you run out of digits, you are using more digits
+% to represent a number. This method can be also be used
+% for letters. After chapter 26 with |Z| we us |AA|, |AB|, |AC|, and |AD|
+% for the remaining chapters.
+%
+% Happily this package already defines this presentation command:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage{alphalph}
+%\renewcommand*{\thechapter}{%
+% \AlphAlph{\value{chapter}}%
+%}
+%\end{verbatim}
+%\end{quote}
+% \cs{AlphAlph} generates:
+% \AlphAlph{1}, \AlphAlph{2}, \AlphAlph{3}, \dots,
+% \AlphAlph{26}, \AlphAlph{27}, \AlphAlph{28}, \dots
+%
+% The other presentation command is \cs{alphalph} for lowercase letters.
+%
+% \subsubsection{Wrap symbols around}
+%
+% Nine footnote symbols are quite a few.
+% Too soon the symbols are consumed
+% and \hologo{LaTeX} complains with the error ``Counter too large''.
+% However, it could be acceptable to start again with the symbols
+% from the beginning, especially if there are less than nine symbols
+% on a page.
+% This could be achieved by a counter reset.
+% But finding the right place can be difficult or needs manual
+% actions. Also a
+% unique counter value can be desirable (e.g. for generating
+% unique anchor/link names).
+% Package \xpackage{alphalph} allows you to define
+% a macro that implements a ``wrap around'', but letting
+% the value of the counter untouched:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage{alphalph}
+%\makeatletter
+%\newalphalph{\fnsymbolwrap}[wrap]{\@fnsymbol}{}
+%\makeatother
+%\renewcommand*{\thefootnote}{%
+% \fnsymbolwrap{\value{footnote}}%
+%}
+%\end{verbatim}
+%\end{quote}
+% \cs{fnsymbolwrap} generates:
+% \fnsymbolwrap{1}~(1), \fnsymbolwrap{2}~(2), \fnsymbolwrap{3}~(3), \dots,
+% \fnsymbolwrap{9}~(9), \fnsymbolwrap{10}~(10), \fnsymbolwrap{11}~11, \dots
+%
+% \subsubsection{Multiple symbols}
+%
+% \Hologo{LaTeX}'s standard set of footnote symbols contains doubled
+% symbols at the higher positions. Could this principle
+% be generalized?
+% Yes, but first we need a clean footnote symbol list without
+% doubled entries, example:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage{alphalph}
+%\makeatletter
+%\newcommand*{\fnsymbolsingle}[1]{%
+% \ensuremath{%
+% \ifcase#1%
+% \or *%
+% \or \dagger
+% \or \ddagger
+% \or \mathsection
+% \or \mathparagraph
+% \else
+% \@ctrerr
+% \fi
+% }%
+%}
+%\makeatother
+%\newalphalph{\fnsymbolmult}[mult]{\fnsymbolsingle}{}
+%\renewcommand*{\thefootnote}{%
+% \fnsymbolmult{\value{footnote}}%
+%}
+%\end{verbatim}
+%\end{quote}
+% The own definition of \cs{fnsymbolsingle} has the
+% advantage that this list can easily modified.
+% Otherwise you can use \cs{@fnsymbol} directly,
+% because it uses the same first five symbols.
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage{alphalph}
+%\makeatletter
+%\newalphalph{\fnsymbolmult}[mult]{\@fnsymbol}{5}
+%\makeatother
+%\renewcommand*{\thefootnote}{%
+% \fnsymbolmult{\value{footnote}}%
+%}
+%\end{verbatim}
+%\end{quote}
+% \cs{fnsymbolmult} generates:
+% \fnsymbolmult{1}~(1), \fnsymbolmult{2}~(2), \fnsymbolmult{3}~(3),
+% \fnsymbolmult{4}~(4), \fnsymbolmult{5}~(5), \fnsymbolmult{6}~(6),
+% \dots, \fnsymbolmult{16}~16, \fnsymbolmult{17}~17, \dots
+%
+% \bigskip
+% The same method can also be used for the chapter problem
+% in the first discussed use case:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage{alphalph}
+%\makeatletter
+%\newalphalph{\AlphMult}[mult]{\@Alph}{26}
+%\makeatother
+%\renewcommand*{\chapter}{%
+% \AlphMult{\value{chapter}}%
+%}
+%\end{verbatim}
+%\end{quote}
+% \cs{AlphMult} then generates AA, BB, CC, and DD for chapters 27--30.
+%
+% \subsection{Glossary}
+%
+% \begin{description}
+% \item[Counter presentation command] is a macro that
+% expects a \hologo{LaTeX} counter name as argument.
+% Numbers cannot be used. Examples:
+% \cs{arabic}, \cs{alph}, \cs{fnsymbol}.
+% \item[Number presentation command] is a macro that
+% expects a number as argument. A number is anything
+% that \hologo{TeX} accepts as number including \cs{value}.
+% Examples: \cs{alphalph}, \cs{AlphAlph}, \cs{alphalph@alph}
+%
+% However, \cs{alph} or \cs{fnsymbol} are not number
+% presentation commands because they expect a counter
+% name as argument. Happily \hologo{LaTeX} counter presentation
+% commands internally uses number presentation commands
+% with the same name, but prefixed by `@'. Thus
+% \cs{@alph}, \cs{@fnsymbol} are number presentation commands.
+% \item[Symbols provider] is a command that can be used
+% to get a list of symbols. For example, \cs{@Alph}
+% provides the 26 uppercase letters from `A' to `Z'.
+% Basically a symbol provider is a number presentation
+% command, usually with a limited range.
+% \item[Number of symbols] is the number of the
+% last symbol slot of a symbol provider. Thus \cs{@Alph}
+% generates 26 symbols, \cs{@fnsymbol} provides 9 symbols.
+% \end{description}
+%
+% \subsection{Package usage}
+%
+% The package \Package{alphalph} can be used with both \hologo{plainTeX}
+% and \hologo{LaTeX}:
+% \begin{description}
+% \item[\hologo{plainTeX}:] |\input alphalph.sty|
+% \item[\hologo{LaTeX2e}:] |\usepackage{alphalph}|\\
+% There aren't any options.
+% \end{description}
+%
+% \subsection{User commands}
+%
+% \begin{declcs}{AlphAlph} \M{number}\\
+% \cs{alphalph} \M{number}
+% \end{declcs}
+% Both macros are number presentation commands that
+% expects a number as argument. \hologo{LaTeX} counters
+% are used with \cs{value}.
+%
+% The macros represents a number by letters.
+% First single letters |A..Z| are used, then
+% two letters |AA..ZZ|, three letters |AAA...ZZZ|, \dots
+% follow.
+%
+% Macro \cs{AlphAlph} uses uppercase letters,
+% \cs{alphalph} generates the lowercase variant.
+% \begin{quote}
+% \catcode`\|=12
+% \def\entry#1{
+% \texttt{#1}
+% & \texttt{\AlphAlph{#1}}
+% & \texttt{\alphalph{#1}}
+% }
+% \begin{tabular}{@{}l|l|l@{}}
+% \meta{number} & \verb|\AlphAlph{|\meta{number}\verb|}|
+% & \verb|\alphalph{|\meta{number}\verb|}|\\
+% \hline
+% \entry{1}\\
+% \entry{2}\\
+% \entry{26}\\
+% \entry{27}\\
+% \entry{30}\\
+% \entry{2000}\\
+% \entry{3752127}\\
+% \entry{10786572}\\
+% \entry{2147483647}\\
+% \end{tabular}
+% \end{quote}
+%
+% \begin{declcs}{newalphalph}
+% \M{cmd}
+% |[|\meta{method}|]|
+% \M{symbols provider}
+% \M{number of symbols}
+% \end{declcs}
+% Macro \cs{newalphalph} defines \meta{cmd} as new
+% number presentation command. Like \cs{newcommand} an error
+% is thrown, if macro \meta{cmd} already exists.
+%
+% The \meta{method} is one of |alph|, |wrap|, or |mult|.
+% The default is |alph|.
+%
+% As symbol provider a number presentation command
+% can be used, e.g. \cs{@fnsymbol}, \cs{@Alph}, or
+% \cs{alphalph@alph}.
+%
+% The last argument is the number of symbols.
+% If the argument is empty, then \cs{newalphalph} tries
+% to find this number itself. \hologo{LaTeX}'s number presentation
+% commands throw an error message, if the number is too large.
+% This error message is put in a macro \cs{@ctrerr}.
+% Thus \cs{newalphalph} calls the symbol provider and tests
+% a number by typesetting it in a temporary box. The error
+% macro \cs{@ctrerr} is catched, it proofs that the number
+% is not supported. Also if the width of the result is zero
+% the number is considered as unavailable.
+%
+% The empty argument is useful for potentially variable lists.
+% However if the end cannot be detected, then the number of
+% symbols must be given. This is also a lot faster. Therefore don't
+% let the argument empty without reason.
+%
+% \subsection{Programmer commands}
+%
+% \begin{declcs}{alphalph@Alph} \M{number}\\
+% \cs{alphalph@alph} \M{number}
+% \end{declcs}
+% They are basically the same as \cs{@Alph} and \cs{@alph}.
+% Some languages of package \xpackage{babel} redefine
+% \hologo{LaTeX}'s macros to include some font setup that
+% breaks expandibility. Therefore \cs{AlphAlph} and \cs{alphalph}
+% are based on \cs{alphalph@Alph} and \cs{alphalph@alph} to get
+% the letters. The behaviour of these symbol providers for numbers
+% outside the range |1..26| is undefined.
+%
+% \subsection{Design principles}
+%
+% \subsubsection{Number presentation commands}
+%
+% All number presentation commands that this package defines
+% (including \cs{alphalph} and \cs{AlphAlph}) have the following
+% properties:
+% \begin{itemize}
+% \item They are fully expandable. This means that they can safely
+% \begin{itemize}
+% \item be written to a file,
+% \item used in moving arguments (\hologo{LaTeX}: they are \emph{robust}),
+% \item used in a \cmd{\csname}-\cmd{\endcsname} pair.
+% \end{itemize}
+% \item If the argument is zero or negative, the commands expand
+% to nothing like \cmd{\romannumeral}.
+% \item The argument is a \hologo{TeX} number. Anything that would be
+% accepted by \cmd{\number} is a valid argument:
+% \begin{itemize}
+% \item explicite constants,
+% \item macros that expand to a number,
+% \item count registers, \hologo{LaTeX} counter can used
+% via \cmd{\value}, e.\,g.:\\
+% |\alphalph{\value{page}}|
+% \item \dots
+% \end{itemize}
+% \item \hologo{eTeX}'s numeric expressions are supported, if \hologo{eTeX} is
+% available. Then \cs{numexpr} is applied to the argument.
+% Package \cs{calc}'s expressions are not supported.
+% That would violate the expandibility.
+% \end{itemize}
+%
+% \subsubsection{General usability}
+%
+% \begin{description}
+% \item[\hologo{TeX} format:]
+% The package does not depend on \hologo{LaTeX}, it can also be used
+% by \hologo{plainTeX}, for example.
+% \item[\hologo{eTeX}:] \eTeX is supported, the macros are shorter and
+% faster. But \eTeX's extensions are not requirements.
+% Without \hologo{eTeX}, just the implementation changes. The properties
+% remain unchanged.
+% \end{description}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \subsection{Begin\texorpdfstring{ of package}{}}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@alphalph.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{alphalph}{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@alphalph.sty\endcsname
+\ProvidesPackage{alphalph}%
+ [2016/05/16 v2.5 Convert numbers to letters (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 AlPh@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\AlPh@AtEnd{%
+ \AlPh@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{59}{12}% ;
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{124}{12}% |
+\edef\AlPh@AtEnd{\AlPh@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Package loading}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+ \input intcalc.sty\relax
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{intcalc}[2007/09/09]%
+\fi
+% \end{macrocode}
+%
+% \subsection{\hologo{eTeX} detection}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+ \catcode124=9 % '!': ignore
+ \catcode43=14 % '+': comment
+\else
+ \catcode124=14 % '!': comment
+ \catcode43=9 % '+': ignore
+\fi
+% \end{macrocode}
+%
+% \subsection{Help macros}
+%
+% \begin{macro}{\AlPh@Error}
+% \begin{macrocode}
+\def\AlPh@Error#1{%
+ \begingroup
+ \escapechar=92 % backslash
+ \@PackageError{alphalph}{#1}\@ehc
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AlPh@IfDefinable}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname @ifdefinable\endcsname\relax
+ \def\AlPh@IfDefinable#1#2{%
+ \ifcase\ifx#1\@undefined\else\ifx#1\relax\else1\fi\fi0 %
+ #2%
+ \else
+ \AlPh@Error{%
+ Command \string#1 already defined%
+ }%
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\else
+% \end{macrocode}
+% \begin{macro}{\AlPh@IfDefinable}
+% \begin{macrocode}
+ \let\AlPh@IfDefinable\@ifdefinable
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\@ReturnAfterElseFi}
+% \begin{macro}{\@ReturnAfterFi}
+% The following commands moves the `then' and `else' part respectively
+% behind the |\if|-construct. This prevents a too deep |\if|-nesting
+% and so a \hologo{TeX} capacity error because of a limited input stack size.
+% I use this trick in several packages, so I don't prefix these internal
+% commands in order not to have the same macros with different names.
+% (It saves memory.)
+% \begin{macrocode}
+\long\def\@ReturnAfterElseFi#1\else#2\fi{\fi#1}
+\long\def\@ReturnAfterFi#1\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@gobblefour}
+% \Hologo{LaTeX} defines commands for eating arguments.
+% Define \cs{@gobblefour} if it is not defined (\hologo{plainTeX}).
+% \begin{macrocode}
+\expandafter\ifx\csname @gobblefour\endcsname\relax
+ \long\def\@gobblefour#1#2#3#4{}%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{AlPh@IfOptArg}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname kernel@ifnextchar\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname @ifnextchar\endcsname\relax
+ \def\AlPh@IfOptArg#1#2{%
+ \def\AlPh@TempA{#1}%
+ \def\AlPh@TempB{#2}%
+ \futurelet\AlPh@Token\AlPh@IfOptArgNext
+ }%
+ \let\AlPh@BracketLeft=[%]
+ \def\AlPh@IfOptArgNext{%
+ \ifx\AlPh@Token\AlPh@BracketLeft
+ \expandafter\AlPh@TempA
+ \else
+ \expandafter\AlPh@TempB
+ \fi
+ }%
+ \else
+ \def\AlPh@IfOptArg{\@ifnextchar[}%]
+ \fi
+\else
+ \def\AlPh@IfOptArg{\kernel@ifnextchar[}%]
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Symbol provider}
+%
+% \subsubsection{Alphabet}
+%
+% The output of \cs{alphalph} and \cs{AlphAlph} should be
+% usable as part of command names (see \cs{@namedef}, \cs{csname}, \dots).
+% Unhappily some languages of package \xpackage{babel}
+% redefine \hologo{LaTeX}'s \cs{@alph} and \cs{@Alph} in a manner that
+% they cannot be used in expandable context any more.
+% Therefore package \xpackage{alphalph} provides its own
+% commands.
+%
+% \begin{macro}{\alphalph@Alph}
+% \begin{macro}{\alphalph@alph}
+% The two commands \cmd{\AlPh@Alph} and \cmd{\AlPh@alph} convert a
+% number into a letter (uppercase and lowercase respectivly).
+% The character |@| is used as an error symbol,
+% if the number isn't in the range of 1 until 26.
+% Here we need no space after the number |#1|, because the error
+% symbol |@| for the zero case stops scanning the number.
+% This error symbol should not appear anywhere (except for bugs).
+% \begin{macrocode}
+\def\alphalph@Alph#1{%
+ \ifcase#1%
+ @%
+ \or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
+ \or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z%
+ \else
+ \AlPh@ctrerr
+ @%
+ \fi
+}
+\def\alphalph@alph#1{%
+ \ifcase#1%
+ @%
+ \or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
+ \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z%
+ \else
+ \AlPh@ctrerr
+ @%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\AlPh@ctrerr}
+% Macro \cs{AlPh@ctrerr} is used as hook for the algorithm
+% to get the available number of symbols.
+% \begin{macrocode}
+\def\AlPh@ctrerr{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Finding number of symbols}
+%
+% \begin{macro}{\AlPh@GetNumberOfSymbols}
+% \noindent
+% |#1|: symbols provider
+% \begin{macrocode}
+\def\AlPh@GetNumberOfSymbols#1{%
+ \AlPh@TestNumber1!{#1}%
+ \ifAlPh@Unavailable
+ \def\AlPh@Number{0}%
+ \AlPh@Error{No symbols found}%
+ \else
+ \def\AlPh@Number{1}%
+ \AlPh@ExpSearch2!{#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifAlPh@Unavailable}
+% \begin{macrocode}
+\let\ifAlPh@Unavailable\iffalse
+\def\AlPh@Unavailabletrue{%
+ \global\let\ifAlPh@Unavailable\iftrue
+}
+\def\AlPh@Unavailablefalse{%
+ \global\let\ifAlPh@Unavailable\iffalse
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@TestNumber}
+% |#1|: number to be tested\\
+% |#2|: symbols provider
+% \begin{macrocode}
+\def\AlPh@TestNumber#1!#2{%
+ \AlPh@Unavailablefalse
+ \begingroup
+ \setbox0=\hbox{%
+ \begingroup % color
+ \let\@ctrerr\AlPh@Unavailabletrue
+ \let\AlPh@ctrerr\AlPh@Unavailabletrue
+ #2{#1}%
+ \endgroup
+ }%
+ \ifdim\wd0=0pt %
+ \AlPh@Unavailabletrue
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@ExpSearch}
+% |#1|: number to be tested\\
+% |#2|: symbols provider
+% \begin{macrocode}
+\def\AlPh@ExpSearch#1!#2{%
+ \let\AlPh@Next\relax
+ \AlPh@TestNumber#1!{#2}%
+ \ifAlPh@Unavailable
+ \expandafter\AlPh@BinSearch\AlPh@Number!#1!{#2}%
+ \else
+ \def\AlPh@Number{#1}%
+ \ifnum#1>1073741823 %
+ \AlPh@TestNumber2147483647!{#2}%
+ \ifAlPh@Unavailable
+ \AlPh@BinSearch#1!2147483647!{#2}%
+ \else
+ \def\AlPh@Number{0}%
+ \AlPh@Error{%
+ Maximal symbol number not found%
+ }%
+ \fi
+ \else
+ \def\AlPh@Next{%
+ \expandafter\AlPh@ExpSearch\number\intcalcShl{#1}!{#2}%
+ }%
+ \fi
+ \fi
+ \AlPh@Next
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@BinSearch}
+% |#1|: available number\\
+% |#2|: unavailable number, |#2| $>$ |#1|\\
+% |#3|: symbols provider
+% \begin{macrocode}
+\def\AlPh@BinSearch#1!#2!#3{%
+ \expandafter\AlPh@ProcessBinSearch
+ \number\intcalcShr{\intcalcAdd{#1}{#2}}!%
+ #1!#2!{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@ProcessBinSearch}
+% |#1|: number to be tested, |#2| $\leq$ |#1| $\leq$ |#3|\\
+% |#2|: available number\\
+% |#3|: unavailable number\\
+% |#4|: symbols provider
+% \begin{macrocode}
+\def\AlPh@ProcessBinSearch#1!#2!#3!#4{%
+ \let\AlPh@Next\relax
+ \ifnum#1>#2 %
+ \ifnum#1<#3 %
+ \AlPh@TestNumber#1!{#4}%
+ \ifAlPh@Unavailable
+ \def\AlPh@Next{%
+ \AlPh@BinSearch#2!#1!{#4}%
+ }%
+ \else
+ \def\AlPh@Next{%
+ \AlPh@BinSearch#1!#3!{#4}%
+ }%
+ \fi
+ \else
+ \def\AlPh@Number{#2}%
+ \fi
+ \else
+ \def\AlPh@Number{#2}%
+ \fi
+ \AlPh@Next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Methods}
+%
+% The names of method macros start with \cs{AlPh@Method}.
+% These macros do the main job in converting a number to
+% its representation.
+% A method command is called with three arguments.
+% The first argument is the number of symbols. The
+% second argument is the basic macro for converting
+% a number with limited number range. The last parameter
+% is the number that needs converting.
+%
+% \subsubsection{Common methods}
+%
+% \begin{macro}{\AlPh@CheckPositive}
+% \noindent
+% |#1|: number to be checked
+% |#2|: continuation macro\\
+% |#3|: number of symbols (hidden here)\\
+% |#4|: symbol provider (hidden here)
+% \begin{macrocode}
+\def\AlPh@CheckPositive#1!#2{%
+ \ifnum#1<1 %
+ \expandafter\@gobblefour
+ \fi
+ #2{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Method `alph'}
+%
+% \begin{macro}{\AlPh@Method@alph}
+% \noindent
+% |#1|: number of symbols\\
+% |#2|: symbols provider\\
+% |#3|: number to be converted
+% \begin{macrocode}
+\def\AlPh@Method@alph#1#2#3{%
+ \expandafter\AlPh@CheckPositive
+| \number#3!%
++ \the\numexpr#3!%
+ \AlPh@ProcessAlph
+ {#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@ProcessAlph}
+% |#1|: current number\\
+% |#2|: number of symbols\\
+% |#3|: symbols provider
+% \begin{macrocode}
+\def\AlPh@ProcessAlph#1#2#3{%
+ \ifnum#1>#2 %
+ \@ReturnAfterElseFi{%
+ \expandafter\AlPh@StepAlph\number
+ \intcalcInc{%
+ \intcalcMod{\intcalcDec{#1}}{#2}%
+ }%
+ \expandafter!\number
+ \intcalcDiv{\intcalcDec{#1}}{#2}%
+ !{#2}{#3}%
+ }%
+ \else
+ \@ReturnAfterFi{%
+ #3{#1}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@StepAlph}
+% |#1|: current last digit\\
+% |#2|: new current number\\
+% |#3|: number of symbols\\
+% |#4|: symbols provider
+% \begin{macrocode}
+\def\AlPh@StepAlph#1!#2!#3#4{%
+ \AlPh@ProcessAlph{#2}{#3}{#4}%
+ #4{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Method `wrap'}
+%
+% \begin{macro}{\AlPh@Method@wrap}
+% \noindent
+% |#1|: number of symbols\\
+% |#2|: symbols provider\\
+% |#3|: number to be converted
+% \begin{macrocode}
+\def\AlPh@Method@wrap#1#2#3{%
+ \expandafter\AlPh@CheckPositive
+| \number#3!%
++ \the\numexpr#3!%
+ \AlPh@ProcessWrap
+ {#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AlPh@ProcessWrap}
+% |#1|: number to be converted\\
+% |#2|: number of symbols\\
+% |#3|: symbols provider
+% \begin{macrocode}
+\def\AlPh@ProcessWrap#1#2#3{%
+ \ifnum#1>#2 %
+ \@ReturnAfterElseFi{%
+ \expandafter\AlPh@StepWrap\number
+ \intcalcInc{\intcalcMod{\intcalcDec{#1}}{#2}}%
+ !{#3}%
+ }%
+ \else
+ \@ReturnAfterFi{%
+ #3{#1}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@StepWrap}
+% |#1|: final number\\
+% |#2|: symbols provider
+% \begin{macrocode}
+\def\AlPh@StepWrap#1!#2{%
+ #2{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Method `mult'}
+%
+% After the number of symbols is exhausted,
+% repetitions of the symbol are used.
+% \begin{gather*}
+% x \Def \text{number to be converted}\\
+% n \Def \text{number of symbols}\\
+% r \Def \text{repetition length}\\
+% s \Def \text{symbol slot}\\
+% r = ((x - 1) \div n) + 1\\
+% s = ((x - 1) \mod n) + 1
+% \end{gather*}
+% \begin{macro}{\AlPh@Method@mult}
+% \noindent
+% |#1|: number of symbols\\
+% |#2|: symbols provider\\
+% |#3|: number to be converted
+% \begin{macrocode}
+\def\AlPh@Method@mult#1#2#3{%
+ \expandafter\AlPh@CheckPositive
+| \number#3!%
++ \the\numexpr#3!%
+ \AlPh@ProcessMult
+ {#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AlPh@ProcessMult}
+% |#1|: number to be converted\\
+% |#2|: number of symbols\\
+% |#3|: symbols provider
+% \begin{macrocode}
+\def\AlPh@ProcessMult#1#2#3{%
+ \ifnum#1>#2 %
+ \@ReturnAfterElseFi{%
+ \expandafter\AlPh@StepMult\romannumeral
+ \intcalcInc{\intcalcDiv{\intcalcDec{#1}}{#2}}%
+ 000%
+ \expandafter!\number
+ \intcalcInc{\intcalcMod{\intcalcDec{#1}}{#2}}%
+ !{#3}%
+ }%
+ \else
+ \@ReturnAfterFi{%
+ #3{#1}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@StepMult}
+% |#1#2|: repetitions coded as list of character `m'\\
+% |#3|: symbol slot\\
+% |#4|: symbols provider
+% \begin{macrocode}
+\def\AlPh@StepMult#1#2!#3!#4{%
+ \ifx\\#2\\%
+ \else
+ \@ReturnAfterFi{%
+ \AlPh@StepMult#2!#3!{#4}%
+ }%
+ \fi
+ #4{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{User interface}
+%
+% \begin{macro}{\newalphalph}
+% Macro \cs{newalphalph} had three arguments in versions below 2.0.
+% For the new method argument we use an optional argument an first
+% position.\\
+% |#1|: cmd\\
+% |[#2]|: method name: |alph| (default), |wrap|, |mult|\\ % hash-ok
+% |#3|: symbols provider\\
+% |#4|: number of symbols
+% \begin{macrocode}
+\AlPh@IfDefinable\newalphalph{%
+ \def\newalphalph#1{%
+ \AlPh@IfOptArg{%
+ \AlPh@newalphalph{#1}%
+ }{%
+ \AlPh@newalphalph{#1}[alph]%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@newalphalph}
+% |#1|: cmd
+% |#2|: method name\\
+% |#3|: symbols provider\\
+% |#4|: number of symbols
+% \begin{macrocode}
+\def\AlPh@newalphalph#1[#2]#3#4{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname AlPh@Method@#2\endcsname\relax
+ \AlPh@Error{%
+ Unknown method %
+| `#2'%
++ `\detokenize{#2}'%
+ }%
+ \else
+ \ifx\\#4\\%
+ \AlPh@GetNumberOfSymbols{#3}%
+ \ifcase\AlPh@Number
+ \else
+ \begingroup
+ \escapechar=92 % backslash
+ \@PackageInfo{alphalph}{%
+ Number of symbols for \string#1 is \AlPh@Number
+ }%
+ \endgroup
+ \expandafter\AlPh@NewAlphAlph
+ \csname AlPh@Method@#2\expandafter\endcsname
+ \AlPh@Number!{#1}{#3}%
+ \fi
+ \else
+ \expandafter\AlPh@NewAlphAlph
+ \csname AlPh@Method@#2\expandafter\endcsname
+| \number#4!%
++ \the\numexpr#4!%
+ {#1}{#3}%
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AlPh@NewAlphAlph}
+% |#1|: method macro\\
+% |#2|: number of symbols\\
+% |#3|: cmd\\
+% |#4|: symbols provider
+% \begin{macrocode}
+\def\AlPh@NewAlphAlph#1#2!#3#4{%
+ \AlPh@IfDefinable#3{%
+ \ifnum#2>0 %
+ \def#3{#1{#2}{#4}}%
+ \else
+ \AlPh@Error{%
+ Definition of \string#3 failed,\MessageBreak
+ because number of symbols (#2) is not positive%
+ }%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AlphAlph}
+% \begin{macrocode}
+\newalphalph\AlphAlph\alphalph@Alph{26}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\alphalph}
+% \begin{macrocode}
+\newalphalph\alphalph\alphalph@alph{26}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\AlPh@AtEnd%
+%</package>
+% \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 alphalph.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Macro tests}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{article}
+%<*noetex>
+\makeatletter
+\let\saved@numexpr\numexpr
+\newcommand*{\DisableNumexpr}{%
+ \let\numexpr\@undefined
+}
+\newcommand*{\RestoreNumexpr}{%
+ \let\numexpr\saved@numexpr
+}
+\DisableNumexpr
+%</noetex>
+\usepackage{alphalph}[2016/05/16]
+%<noetex>\RestoreNumexpr
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\newcommand*{\TestCmd}[3]{%
+ \setbox0=\hbox{%
+%<noetex> \DisableNumexpr
+ \edef\TestString{#1{#2}}%
+ \expandafter\Expect\expandafter{\TestString}{#3}%
+ \edef\TestString{#1{#2} }%
+ \expandafter\Expect\expandafter{\TestString}{#3 }%
+ }%
+ \Expect*{\the\wd0}{0.0pt}%
+}
+
+\makeatletter
+\newalphalph\LaTeXAlphAlph\@Alph{26}
+\newalphalph\LaTeXalphalph\@alph{26}
+\newalphalph\AlphWrap[wrap]\alphalph@Alph{26}
+\newalphalph\alphwrap[wrap]\alphalph@alph{26}
+\newalphalph\LaTeXAlphWrap[wrap]\@Alph{26}
+\newalphalph\LaTeXalphwrap[wrap]\@alph{26}
+\def\LastSymbol#1{%
+ \ifx\\#1\\%
+ \else
+ \@LastSymbol#1\@nil
+ \fi
+}
+\def\@LastSymbol#1#2\@nil{%
+ \ifx\\#2\\%
+ #1%
+ \else
+ \@LastSymbol#2\@nil
+ \fi
+}
+\makeatother
+\newcommand*{\TestAlph}[2]{%
+ \uppercase{\TestCallCmd\AlphAlph{#2}}{#1}%
+ \lowercase{\TestCallCmd\alphalph{#2}}{#1}%
+ \uppercase{\TestCallCmd\LaTeXAlphAlph{#2}}{#1}%
+ \lowercase{\TestCallCmd\LaTeXalphalph{#2}}{#1}%
+ \edef\WrapString{\LastSymbol{#2}}%
+ \expandafter\TestAlphWrap\expandafter{\WrapString}{#1}%
+}
+\newcommand*{\TestAlphWrap}[2]{%
+ \uppercase{\TestCallCmd\AlphWrap{#1}}{#2}%
+ \lowercase{\TestCallCmd\alphwrap{#1}}{#2}%
+ \uppercase{\TestCallCmd\LaTeXAlphWrap{#1}}{#2}%
+ \lowercase{\TestCallCmd\LaTeXalphwrap{#1}}{#2}%
+}
+\newcommand*{\TestCallCmd}[3]{%
+ \TestCmd#1{#3}{#2}%
+}
+\begin{qstest}{AlphSymbols}{alphalph, AlphAlph, symbols}
+ \TestAlph{1}{a}%
+ \TestAlph{2}{b}%
+ \TestAlph{3}{c}%
+ \TestAlph{4}{d}%
+ \TestAlph{5}{e}%
+ \TestAlph{6}{f}%
+ \TestAlph{7}{g}%
+ \TestAlph{8}{h}%
+ \TestAlph{9}{i}%
+ \TestAlph{10}{j}%
+ \TestAlph{11}{k}%
+ \TestAlph{12}{l}%
+ \TestAlph{13}{m}%
+ \TestAlph{14}{n}%
+ \TestAlph{15}{o}%
+ \TestAlph{16}{p}%
+ \TestAlph{17}{q}%
+ \TestAlph{18}{r}%
+ \TestAlph{19}{s}%
+ \TestAlph{20}{t}%
+ \TestAlph{21}{u}%
+ \TestAlph{22}{v}%
+ \TestAlph{23}{w}%
+ \TestAlph{24}{x}%
+ \TestAlph{25}{y}%
+ \TestAlph{26}{z}%
+\end{qstest}
+\begin{qstest}{AlphRange}{alphalph, range}
+ \TestAlph{0}{}%
+ \TestAlph{-1}{}%
+ \TestAlph{-2147483647}{}%
+ \TestAlph{27}{aa}%
+ \TestAlph{28}{ab}%
+ \TestAlph{52}{az}%
+ \TestAlph{53}{ba}%
+ \TestAlph{78}{bz}%
+ \TestAlph{79}{ca}%
+ \TestAlph{702}{zz}%
+ \TestAlph{703}{aaa}%
+ \TestAlph{2147483647}{fxshrxw}%
+\end{qstest}
+
+\makeatletter
+\newcommand*{\myvocals}[1]{%
+ \ifcase#1X\or A\or E\or I\or O\or U\else Y\fi
+}
+\makeatother
+\newalphalph\vocalsvocals\myvocals{5}
+\newcommand*{\TestVocals}{%
+ \TestCmd\vocalsvocals
+}
+\begin{qstest}{vocals}{vocals}
+ \TestVocals{0}{}%
+ \TestVocals{1}{A}%
+ \TestVocals{2}{E}%
+ \TestVocals{3}{I}%
+ \TestVocals{4}{O}%
+ \TestVocals{5}{U}%
+ \TestVocals{6}{AA}%
+ \TestVocals{7}{AE}%
+ \TestVocals{8}{AI}%
+ \TestVocals{9}{AO}%
+ \TestVocals{10}{AU}%
+ \TestVocals{11}{EA}%
+ \TestVocals{24}{OO}%
+ \TestVocals{25}{OU}%
+ \TestVocals{26}{UA}%
+ \TestVocals{29}{UO}%
+ \TestVocals{30}{UU}%
+ \TestVocals{31}{AAA}%
+ \TestVocals{155}{UUU}%
+ \TestVocals{156}{AAAA}%
+ \TestVocals{2147483647}{AIIOOEEIOIIUOE}%
+\end{qstest}
+
+\makeatletter
+\newalphalph\AlphMult[mult]{\alphalph@Alph}{26}
+\newalphalph\alphmult[mult]{\alphalph@alph}{26}
+\newalphalph\LaTeXAlphMult[mult]{\@Alph}{26}
+\newalphalph\LaTeXalphmult[mult]{\@alph}{26}
+\makeatother
+\newcommand*{\TestMult}[2]{%
+ \uppercase{\TestCallCmd\AlphMult{#2}}{#1}%
+ \lowercase{\TestCallCmd\alphmult{#2}}{#1}%
+ \uppercase{\TestCallCmd\LaTeXAlphMult{#2}}{#1}%
+ \lowercase{\TestCallCmd\LaTeXalphmult{#2}}{#1}%
+}
+\begin{qstest}{mult}{mult}
+ \TestMult{0}{}%
+ \TestMult{-1}{}%
+ \TestMult{-2147483647}{}%
+ \TestMult{1}{a}%
+ \TestMult{2}{b}%
+ \TestMult{26}{z}%
+ \TestMult{27}{aa}%
+ \TestMult{28}{bb}%
+ \TestMult{52}{zz}%
+ \TestMult{53}{aaa}%
+ \TestMult{54}{bbb}%
+ \TestMult{259}{yyyyyyyyyy}%
+ \TestMult{260}{zzzzzzzzzz}%
+ \TestMult{261}{aaaaaaaaaaa}%
+ \TestMult{262}{bbbbbbbbbbb}%
+\end{qstest}
+
+\def\myvocalsB#1{%
+ \ifcase#1\or A\or E\or I\or O\or U\fi
+}
+\begin{qstest}{symbolnum}{symbolnum}
+ \makeatletter
+ \def\Test#1#2{%
+ \let\TestCmd\relax
+ \newalphalph\TestCmd{#1}{}%
+ \Expect*{\AlPh@Number}{#2}%
+ }%
+ \Test\@alph{26}%
+ \Test\@Alph{26}%
+ \Test\@fnsymbol{9}%
+ \Test\myvocalsB{5}%
+ \Test\alphalph@alph{26}%
+ \Test\alphalph@Alph{26}%
+\end{qstest}
+
+\begin{qstest}{list}{list}
+ \makeatletter
+ \def\catch#1\relax{%
+ \def\FoundList{\catch#1}%
+ }%
+ \def\Test[#1]#2#3#4{%
+ \let\testcmd\relax
+ \newalphalph\testcmd[{#1}]{\catch}{#2}%
+ \testcmd{#3}|\relax
+ \expandafter\Expect\expandafter{\FoundList}{#4|}%
+ %
+ \let\SavedCatch\catch
+ \def\catch{\noexpand\catch\noexpand\foo}%
+ \edef\Result{#4|}%
+ \@onelevel@sanitize\Result
+ \let\catch\SavedCatch
+ \let\testcmd\relax
+ \newalphalph\testcmd[{#1}]{\catch\foo}{#2}%
+ \testcmd{#3}|\relax
+ \@onelevel@sanitize\FoundList
+ \Expect*{\FoundList}*{\Result}%
+ }%
+ \Test[alph]{26}{3}{\catch{3}}%
+ \Test[alph]{26}{12}{\catch{12}}%
+ \Test[alph]{26}{27}{\catch{1}\catch{1}}%
+ \Test[alph]{26}{78}{\catch{2}\catch{26}}%
+ \Test[wrap]{26}{7}{\catch{7}}%
+ \Test[wrap]{26}{14}{\catch{14}}%
+ \Test[wrap]{26}{80}{\catch{2}}%
+ \Test[wrap]{26}{700}{\catch{24}}%
+ \Test[mult]{26}{4}{\catch{4}}%
+ \Test[mult]{26}{17}{\catch{17}}%
+ \Test[mult]{26}{54}{\catch{2}\catch{2}\catch{2}}%
+\end{qstest}
+
+\begin{document}
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/alphalph}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/alphalph.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/alphalph.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[\CTAN{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 alphalph.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@{}}
+% alphalph.sty & tex/generic/oberdiek/alphalph.sty\\
+% alphalph.pdf & doc/latex/oberdiek/alphalph.pdf\\
+% test/alphalph-test1.tex & doc/latex/oberdiek/test/alphalph-test1.tex\\
+% test/alphalph-test2.tex & doc/latex/oberdiek/test/alphalph-test2.tex\\
+% test/alphalph-test3.tex & doc/latex/oberdiek/test/alphalph-test3.tex\\
+% alphalph.dtx & source/latex/oberdiek/alphalph.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk alphalph.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{alphalph.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 alphalph.dtx
+%makeindex -s gind.ist alphalph.idx
+%pdflatex alphalph.dtx
+%makeindex -s gind.ist alphalph.idx
+%pdflatex alphalph.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{alphalph.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='alphalph'>
+ <name>alphalph</name>
+ <caption>Convert numbers to letters.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1999,2006-2008,2010,2011'/>
+ <license type='lppl1.3'/>
+ <version number='2.5'/>
+ <description>
+ Provides commands <tt>\alphalph</tt> and <tt>\AlphAlph.</tt> They
+ are like <tt>\number</tt> but the expansion consists of lowercase
+ and uppercase letters respectively (1 to a, 26 to z, 27 to aa, 52
+ to zz, 53 to ba, 702 to zz, 703 to aaa, etc.). Can be used as a
+ replacement for LaTeX's <tt>\@alph</tt> and <tt>\@Alph</tt>
+ macros.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/alphalph.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/alphalph.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1999/03/19 v0.1}
+% \item
+% The first version was built as a response to a
+% \URL{\link{question}}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/17a74cd721641038}^^A
+% of \NameEmail{Will Douglas}{william.douglas@wolfson.ox.ac.uk}
+% and the
+% \URL{\link{request}}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/8f9768825640315f}^^A
+% of \NameEmail{Donald Arsenau}{asnd@reg.triumf.ca},
+% published in the newsgroup
+% \href{news:comp.text.tex}{comp.text.tex}:
+% \URL{``\link{Re: alph counters \textgreater\ 26}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/cec563eef8bf65d0}
+% \item
+% Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt})
+% \end{Version}
+% \begin{Version}{1999/04/12 v1.0}
+% \item
+% Documentation added in dtx format.
+% \item
+% \hologo{eTeX} support added.
+% \end{Version}
+% \begin{Version}{1999/04/13 v1.1}
+% \item
+% Minor documentation change.
+% \item
+% First CTAN release.
+% \end{Version}
+% \begin{Version}{1999/06/26 v1.2}
+% \item
+% First generic code about \cmd{\ProvidesPackage} improved.
+% \item
+% Documentation: Installation part revised.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.3}
+% \item
+% Reload check (for \hologo{plainTeX})
+% \item
+% New DTX framework.
+% \item
+% LPPL 1.3
+% \end{Version}
+% \begin{Version}{2006/05/30 v1.4}
+% \item
+% \cs{newalphalph} added.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.5}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/09/09 v2.0}
+% \item
+% New implementation that uses package \cs{intcalc}.
+% This removes the dependency on \hologo{eTeX}.
+% \item
+% \cs{newalphalph} is extended to support new methods `wrap' and 'multi'.
+% \item
+% Documentation rewritten.
+% \end{Version}
+% \begin{Version}{2008/08/11 v2.1}
+% \item
+% Code is not changed.
+% \item
+% URLs updated from \texttt{www.dejanews.com}
+% to \texttt{groups.google.com}.
+% \end{Version}
+% \begin{Version}{2010/03/01 v2.2}
+% \item
+% Compatibility with \hologo{iniTeX}.
+% \end{Version}
+% \begin{Version}{2010/04/18 v2.3}
+% \item
+% Documentation fixes (Martin M\"unch).
+% \end{Version}
+% \begin{Version}{2011/05/13 v2.4}
+% \item
+% Documentation fixes (Jim Diamond) and using package
+% \xpackage{hologo} for the documentation.
+% \item
+% Catalogue file added.
+% \end{Version}
+% \begin{Version}{2016/05/16 v2.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/alphalph.pdf b/macros/latex/contrib/oberdiek/alphalph.pdf
new file mode 100644
index 0000000000..5536dddd92
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/alphalph.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/askinclude.dtx b/macros/latex/contrib/oberdiek/askinclude.dtx
new file mode 100644
index 0000000000..160c0de918
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/askinclude.dtx
@@ -0,0 +1,3062 @@
+% \iffalse meta-comment
+%
+% File: askinclude.dtx
+% Version: 2018/11/01 v2.4
+% Info: Interactive asking of included files
+%
+% Copyright (C) 1991-1994 by Pablo A. Straub
+% Copyright (C) 2007, 2008, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file askinclude.dtx
+% and the derived files
+% askinclude.sty, askinclude.pdf, askinclude.ins, askinclude.drv,
+% askinclude.bib, askinclude-a.tex, askinclude-b.tex,
+% askinclude-c.tex, askinclude-test1.tex,
+% askinclude-test2.tex, askinclude-test3.tex,
+% askinclude-test4.tex, askinclude-test5.tex,
+% askinclude-test6.tex, askinclude-test7.tex,
+% askinclude-test8.tex, askinclude-test9.tex,
+% askinclude-test10.tex, askinclude-test11.tex,
+% askinclude-test12.tex, askinclude-test13.tex,
+% askinclude-test14.tex, askinclude-test15.tex,
+% askinclude-test16.tex, askinclude-test17.tex,
+% askinclude-test18.tex, askinclude-test19.tex,
+% askinclude-test20.tex, askinclude-test21.tex,
+% askinclude-test22.tex, askinclude-test23.tex,
+% askinclude-test24.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/askinclude.dtx
+% CTAN:macros/latex/contrib/oberdiek/askinclude.pdf
+%
+% Unpacking:
+% (a) If askinclude.ins is present:
+% tex askinclude.ins
+% (b) Without askinclude.ins:
+% tex askinclude.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{askinclude.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If askinclude.drv is present:
+% latex askinclude.drv
+% (b) Without askinclude.drv:
+% latex askinclude.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 askinclude.dtx
+% bibtex askinclude.aux
+% makeindex -s gind.ist askinclude.idx
+% pdflatex askinclude.dtx
+% makeindex -s gind.ist askinclude.idx
+% pdflatex askinclude.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/askinclude.sty
+% TDS:doc/latex/oberdiek/askinclude.pdf
+% TDS:doc/latex/oberdiek/test/askinclude-a.tex
+% TDS:doc/latex/oberdiek/test/askinclude-b.tex
+% TDS:doc/latex/oberdiek/test/askinclude-c.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test1.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test2.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test3.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test4.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test5.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test6.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test7.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test8.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test9.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test10.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test11.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test12.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test13.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test14.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test15.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test16.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test17.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test18.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test19.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test20.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test21.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test22.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test23.tex
+% TDS:doc/latex/oberdiek/test/askinclude-test24.tex
+% TDS:source/latex/oberdiek/askinclude.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: askinclude 2018/11/01 v2.4 Interactive asking of included files}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: askinclude
+Version: 2018/11/01 v2.4
+
+Copyright (C) 1991-1994 by Pablo A. Straub
+Copyright (C) 2007, 2008, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file askinclude.dtx
+and the derived files
+ askinclude.sty, askinclude.pdf, askinclude.ins, askinclude.drv,
+ askinclude.bib, askinclude-a.tex, askinclude-b.tex,
+ askinclude-c.tex, askinclude-test1.tex,
+ askinclude-test2.tex, askinclude-test3.tex,
+ askinclude-test4.tex, askinclude-test5.tex,
+ askinclude-test6.tex, askinclude-test7.tex,
+ askinclude-test8.tex, askinclude-test9.tex,
+ askinclude-test10.tex, askinclude-test11.tex,
+ askinclude-test12.tex, askinclude-test13.tex,
+ askinclude-test14.tex, askinclude-test15.tex,
+ askinclude-test16.tex, askinclude-test17.tex,
+ askinclude-test18.tex, askinclude-test19.tex,
+ askinclude-test20.tex, askinclude-test21.tex,
+ askinclude-test22.tex, askinclude-test23.tex,
+ askinclude-test24.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{askinclude.ins}{\from{askinclude.dtx}{install}}%
+ \file{askinclude.drv}{\from{askinclude.dtx}{driver}}%
+ \nopreamble
+ \nopostamble
+ \file{askinclude.bib}{\from{askinclude.dtx}{bib}}%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \usedir{tex/latex/oberdiek}%
+ \file{askinclude.sty}{\from{askinclude.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+ \file{askinclude-a.tex}{\from{askinclude.dtx}{a}}%
+ \file{askinclude-b.tex}{\from{askinclude.dtx}{b}}%
+ \file{askinclude-c.tex}{\from{askinclude.dtx}{c}}%
+% \file{askinclude-test1.tex}{\from{askinclude.dtx}{test0,test1}}%
+% \file{askinclude-test2.tex}{\from{askinclude.dtx}{test0,test2}}%
+% \file{askinclude-test3.tex}{\from{askinclude.dtx}{test0,test3}}%
+% \file{askinclude-test4.tex}{\from{askinclude.dtx}{test0,test4}}%
+% \file{askinclude-test5.tex}{\from{askinclude.dtx}{test0,test5}}%
+% \file{askinclude-test6.tex}{\from{askinclude.dtx}{test0,test6}}%
+% \file{askinclude-test7.tex}{\from{askinclude.dtx}{test0,test7}}%
+% \file{askinclude-test8.tex}{\from{askinclude.dtx}{test0,test8}}%
+% \file{askinclude-test9.tex}{\from{askinclude.dtx}{test0,test9}}%
+% \file{askinclude-test10.tex}{\from{askinclude.dtx}{test0,test10}}%
+% \file{askinclude-test11.tex}{\from{askinclude.dtx}{test0,test11}}%
+% \file{askinclude-test12.tex}{\from{askinclude.dtx}{test0,test12}}%
+% \file{askinclude-test13.tex}{\from{askinclude.dtx}{test0,test13}}%
+% \file{askinclude-test14.tex}{\from{askinclude.dtx}{test0,test14}}%
+% \file{askinclude-test15.tex}{\from{askinclude.dtx}{test0,test15}}%
+% \file{askinclude-test16.tex}{\from{askinclude.dtx}{test0,test16}}%
+% \file{askinclude-test17.tex}{\from{askinclude.dtx}{test0,test17}}%
+% \file{askinclude-test18.tex}{\from{askinclude.dtx}{test0,test18}}%
+% \file{askinclude-test19.tex}{\from{askinclude.dtx}{test0,test19}}%
+% \file{askinclude-test20.tex}{\from{askinclude.dtx}{test0,test20}}%
+% \file{askinclude-test21.tex}{\from{askinclude.dtx}{test0,test21}}%
+% \file{askinclude-test22.tex}{\from{askinclude.dtx}{test0,test22}}%
+% \file{askinclude-test23.tex}{\from{askinclude.dtx}{test0,test23}}%
+% \file{askinclude-test24.tex}{\from{askinclude.dtx}{test0,test24}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{askinclude.xml}{\from{askinclude.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{* askinclude.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `askinclude.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*bib>
+@online{texlive,
+ author={Fairbairns, Robin},
+ title={[tex-live] licence on includeonly.sty},
+ date={2007-10-13},
+ url={http://www.tug.org/pipermail/tex-live/2007-October/014928.html},
+ urldate={2011-12-02},
+}
+@online{newsthread,
+ author={Vo{\ss}, Herbert},
+ title={askinclude.sty},
+ note={Thread in newsgroup {\xnewsgroup{comp.text.tex}};
+ Message-ID: {\texttt{fev72m\$b35\$02\$2@news.t-online.com}}},
+ date={2007-10-15},
+ url={http://groups.google.com/group/comp.text.tex/browse_thread/thread/728a3e73c04c6789/349e31865c40d00c},
+ urldate={2011-12-02},
+}
+@manual{makematch,
+ author={Kastrup, David},
+ title={makematch.sty: Pattern matching with wildcards},
+ date={2007-02-23},
+ version={1.7925},
+ url={http://mirror.ctan.org/macros/latex/contrib/qstest/makematch.pdf},
+ urldate={2011-12-02},
+}
+@manual{excludeonly,
+ author={Luecking, Daniel H. and Arseneau, Donald},
+ title={The excludeonly package},
+ date={2003-03-14},
+ url={http://mirror.ctan.org/macros/latex/contrib/excludeonly/excludeonly.pdf},
+ urldate={2011-12-02},
+}
+%</bib>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{askinclude.drv}%
+ [2018/11/01 v2.4 Interactive asking of included files]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{ifluatex}
+\ifluatex
+\else
+ \usepackage[T1]{fontenc}%
+ \usepackage{lmodern}%
+\fi
+\usepackage{csquotes}
+\usepackage[
+ backend=bibtex,
+ bibencoding=ascii,
+ alldates=iso8601,
+]{biblatex}[2011/11/13]
+\bibliography{oberdiek-source}
+\bibliography{askinclude}
+\begin{document}
+ \DocInput{askinclude.dtx}%
+\end{document}
+%</driver>
+% \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{askinclude.drv}
+%
+% \title{The \xpackage{askinclude} package}
+% \date{2018/11/01 v2.4}
+% \author{
+% Pablo A. Straub\\[1ex]
+% Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package replaces \cs{includeonly} by an interactive user
+% interface.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{User interface}
+%
+% The \cs{include} feature of \LaTeX\ allows the division of
+% the text body in separate compilation units. It is page
+% based and stores counter settings in additional auxiliary
+% files. \cs{includeonly} limits the actually included files
+% to the ones, listed in its argument.
+%
+% Example:
+%\begin{quote}
+%\begin{verbatim}
+%\documentclass{report}
+%
+%\usepackage{askinclude}
+%
+% % Don't use \include in the preamble.
+% % Instead \input can be used or make a package
+%
+%\begin{document}
+%\include{title}
+%\include{introduction}
+%\include{summary}
+%\include{index}
+%\end{document}
+%\end{verbatim}
+%\end{quote}
+%
+% Package \xpackage{askinclude} adds an interactive user interface.
+% The user is asked which files he want to include and sets
+% \cs{includeonly} accordingly.
+%
+% The first time the package is used the question looks like:
+%\begin{quote}
+%\begin{verbatim}
+%***********************************
+%*** Package askinclude Question ***
+%***********************************
+%
+%Previous answer (noregexp):
+% [*]
+%
+%Regular expressions:
+% --> [noregexp] disabled
+% [makematch] enabled, using package `makematch'
+% [pdfmatch] enabled, using pdfTeX's \pdfmatch
+%
+%Which files do you want to include?
+% [foo,bar] comma separated file or pattern list
+% [*] all files
+% [-] no files
+% [?] ask for each file
+% [] use the previous answer
+%
+%\answer=chapter2,summary
+%\end{verbatim}
+%\end{quote}
+% Square brackets are used as quotation symbols,
+% they are not part of the answer.
+% The answer by the user follows in the last line after |\answer=|.
+% \begin{description}
+% \def\Item[#1]{\item[{[\texttt{#1}]:}]}
+% \Item[foo,bar]
+% A comma separated file list (also one file only) is passed
+% to macro \cs{includeonly} directly. If regular expression support
+% is enabled, the entries in the list are interpreted as
+% file name patterns that will be matched against the file names
+% in \cs{include}, see \hyperref[sec:regexp]{section \ref*{sec:regexp}}.
+% \Item[*] This is a shortcut for specifying \emph{all} files.
+% \Item[-] This means \emph{none} of the files is included.
+% \Item[?] The switches in single asking mode.
+% The user will be asked at each \cs{include}.
+% See section \hyperref[sec:single]{section \ref*{sec:single}}.
+% \Item[] Just pressing return (empty string) uses the default
+% answer, that was stored in the auxiliary file (\xfile{.aux})
+% of the previous \LaTeX run with package \xpackage{askinclude}.
+% Without previous runs the default is [|*|] for all files.
+% \Item[noregexp] Turns regular expression support off.
+% \Item[makematch] Enables regular expression support
+% package \xpackage{makematch} provides.
+% \Item[pdfmatch] It is shown, if \pdfTeX~1.30 or later is used.
+% It relies on an undocumented feature \cs{pdfmatch} that may
+% change in future versions of \pdfTeX.
+% \end{description}
+% Package \xpackage{askinclude} remembers the files of \cs{include}
+% in the auxiliary file and the given answer. they are
+% presented at the next run
+% at the start of the question:
+%\begin{quote}
+%\begin{verbatim}
+%***********************************
+%*** Package askinclude Question ***
+%***********************************
+%
+%Files, found by previous run in \include:
+% (-) title
+% (-) introduction
+% (-) chapter1
+% (+) chapter2
+% (-) chapter3
+% (+) summary
+%
+%Previous answer (noregexp):
+% [chapter2,summary]
+%...
+%\end{verbatim}
+%\end{quote}
+% |(+)| and |(-)| marks files that were and were not included in
+% the previous run. The file list and marks are not always correct.
+% For example, if \cs{include} statements are added or removed.
+% If the method of regular expression support is different,
+% then the marks only reflects the mode of the previous answer.
+%
+% \subsection{Single asking mode}
+% \label{sec:single}
+%
+% The special answer `|?|' trigger single asking mode,
+% at the next \cs{include} the user is asked again:
+%\begin{quote}
+%\begin{verbatim}
+%***********************************
+%*** Package askinclude Question ***
+%***********************************
+%
+%Include `title'? [y]es, [n]o, [A]ll, [N]one, [D]efault (n):
+%
+%\answer=
+%\end{verbatim}
+%\end{quote}
+% Use the letter inside the square brackets as answer.
+% An empty string uses the default answer, the letter in parentheses.
+% The answers are:
+% \begin{description}
+% \def\Item[#1]{\item[{[\texttt{#1}]:}]}
+% \Item[y] The file is included.
+% \Item[n] The file is excluded.
+% \Item[A] This file and all following files are included.
+% \Item[N] This file and all following files are excluded.
+% \Item[D] Use the default answer for this and all following files.
+% \end{description}
+% If the file is known from the previous run, then the
+% default is `|y|' or `|n|' corresponding to the mark
+% `|(+)|' or `|(-)|' in the list of previous files.
+% Otherwise `|y|' is used as default.
+%
+% \subsection{Regular expressions}
+% \label{sec:regexp}
+%
+% Three methods are available that can also set by package options:
+% \begin{description}
+% \def\Item[#1]{\item[\xoption{#1}:]}
+% \Item[noregexp] Regular expression support is disabled.
+% \Item[makematch] Use package \xpackage{makematch}.
+% \Item[pdfmatch] Use \pdfTeX's \cs{pdfmatch} if available.
+% \end{description}
+% Without options the value remembered in the auxiliary file
+% is used, otherwise the default is \xoption{noregexp}.
+%
+% \subsubsection{Method \xoption{makematch}}
+%
+% Package \xpackage{makematch} (part of \xpackage{qstest}), written
+% by David Kastrup provides pattern matching based on wildcards:
+% \begin{description}
+% \item[{[\texttt{*}]}:] The star matches zero or more characters.
+% Thus a lonely star machtes anything.
+% \item[{[\texttt{!}]}:] The exclamation mark at the begin of a
+% pattern negates it, thus the matching files are excluded.
+% \end{description}
+% The pattern list is evaluated for a file name from left to
+% right. Always a file name must match the whole pattern.
+% The file is included if it is matched by a pattern and
+% not excluded afterwards. Examples:
+% \begin{quote}
+% \def\no{\textrm{$\emptyset$}}
+% \begin{tabular}{>{\ttfamily}l|>{\ttfamily}l|>{\ttfamily}l}
+% \textrm{Pattern list} & \textrm{File names} & \textrm{Result}\\
+% \hline
+% foobar & foobar,dummy & foobar\\
+% foo* & foobar,xfoobar & foobar\\
+% \relax *foo* & xfoobar & xfoobar\\
+% f*b*r & foobar & foobar\\
+% \relax * & any & any\\
+% !foobar & foobar,other & other\\
+% !foo* & xfoobar & xfoobar\\
+% in*,!*dex & intro,index & intro\\
+% !index,in* & intro,index & intro,index\\
+% \relax *,!chap2 & chap1,chap2,chap3 & chap1,chap3\\
+% \end{tabular}
+% \end{quote}
+% The example in the last line shows, how the behaviour of package
+% \xpackage{excludeonly} \cite{excludeonly} can be simulated.
+%
+% The documentation of package \xpackage{makematch} tells the
+% the empty pattern does not match anything. But if you answer
+% the question with an empty string the answer of the previous
+% run is used. Also curly braces are not reliable because the
+% can get stripped during the processing of the answer.
+% Using a pair of empty curly braces or the comma for two empty
+% patterns currently works, but this is specific for the current
+% implementation and may change in future. But the special
+% answer `-' is available.
+%
+% \subsubsection{Method \xoption{pdfmatch}}
+%
+% In \pdfTeX\ 1.30 the new primitive \cs{pdfmatch} was introduced.
+% It is not documented yet, because it was not decided if it remains
+% and which implementation of regular expressions should be used.
+% Thus the situation may change in later versions of \pdfTeX.
+% Currently (1.30 until 1.40) it uses a library for POSIX 1003.2 regular
+% expressions, see manual page ``regex(7)''.
+%
+% If a pattern in the pattern list is invalid, the package prints
+% a warning and removes the pattern from the list. Actually there
+% are two warnings, the other warning is generated by \pdfTeX\ itself.
+%
+% In opposite to \xoption{makematch} the pattern only needs to
+% match the specified part of the file name.
+% For matching the whole name, the symbols `|^|' and `|$|' for
+% begin and end of string must be included.
+%
+% Additionally an initial exclamation mark `|!|' implements the
+% same logic as method \xoption{makematch}. The match result is
+% inverted, the matched file excluded.
+%
+% Examples:
+% \begin{quote}
+% \def\no{\textrm{$\emptyset$}}
+% \begin{tabular}{>{\ttfamily}l|>{\ttfamily}l|>{\ttfamily}l}
+% \textrm{Pattern list} & \textrm{File names} & \textrm{Result}\\
+% \hline
+% foobar & foobar,dummy & foobar\\
+% foo.* & foobar,xfoobar & foobar,xfoobar\\
+% |^|foo.* & foobar,xfoobar & foobar\\
+% foo|$| & foo,foobar & foo\\
+% fo?bar & fbar,fobar,foobar & fbar,fobar\\
+% fo+bar & fbar,fobar,foobar & fobar,foobar\\
+% fo*bar & fbar,fobar,foobar & fbar,fobar,foobar\\
+% chap3 & chap3,chap32 & chap1,chap3,chap32\\
+% chap[13] & chap1,chap2,chap3 & chap1,chap3\\
+% chap(1\string|3)|$| & chap1,chap3,chap33 & chap1,chap3\\
+% .* & any & any\\
+% !foobar & foobar,other & other\\
+% in.*,!dex & intro,index & intro\\
+% !index,in.* & intro,index & intro,index\\
+% .*,!chap2 & chap1,chap2,chap3 & chap1,chap3\\
+% .*,!bla & foo,bla,blabla & foo\\
+% .*,!|^|bla|$| & foo,bla,blabla & foo,blabla\\
+% \end{tabular}
+% \end{quote}
+% The example in the last line shows, how the behaviour of package
+% \xpackage{excludeonly} \cite{excludeonly} can be simulated.
+% As the third last line shows, that sometimes `|^|' and `|$|' can
+% be omitted, but this will not work always, shown in the second
+% last line.
+%
+% \subsection{History}
+%
+% Package \xpackage{askinclude} was invented by Pablo A. Straub in 1991
+% and maintained until 1994.
+% ^^A Email address: pablo.straub \symbol{64} gmail.com
+%
+% In October 2007 it was removed from ``TeX Live'' because of
+% the no-commercial license \cite{texlive}. Herbert Vo\ss\ initiated
+% a search for the author in the newsgroup \xnewsgroup{comp.text.tex}
+% \cite{newsthread} to ask him to change the license.
+%
+% It seems that the author could not be reached any more.
+% Joseph Wright suggested a reimplementation that I (HO) have done
+% as package \xpackage{askinc}. Soon it was enhanced by
+% feature requests.
+%
+% Then Ulrike Fischer found email addresses of the original author
+% and Jim Hefferon succeeded in contacting him. He allowed a change
+% of the license to LPPL and the transfer of the maintainership
+% to someone else.
+%
+% Thus I merged both packages as \xpackage{askinclude} in a new
+% major version 2. The license is LPPL.
+%
+% \subsection{New features of version 2}
+%
+% \begin{itemize}
+% \item License is now LPPL.
+% \item A list of \cs{include} files that are detected by the previous
+% run is printed before the question.
+% \item If the special answer `|?|' is given, then the user is
+% asked at each \cs{include}.
+% \item Support for regular expressions.
+% \item The remaining stuff in the \xfile{.aux} file does not
+% cause errors, if the package is removed.
+% \item The use of \cs{includeonly} before the package loading time
+% is detected and respected by taking precedence. After the package
+% is loaded, \cs{includeonly} is disabled and prints a warning.
+% \end{itemize}
+%
+% \subsection{Compatibility to version 1}
+%
+% \begin{itemize}
+% \item The user interface of version 1 with its special answers
+% `|*|', `|-|', and `' remain unchanged, but it is extended by
+% version 2 with the special answer `|?|' and support for
+% regular expressions can be enabled.
+% \item As reimplementation the internal macros have changed of course.
+% \item \xfile{.aux} files that are written by version 1.x will work
+% with version 2.x because \cs{@includeonly} is recognized.
+% \item \LaTeX\ 2.09: The package works as \cs{documentstyle} option
+% in compatibility mode of \LaTeXe. It is possible that it
+% will not work in pure \LaTeX\ 2.09.
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Header and catcodes}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \catcode64=11 % @
+ \def\x{\endgroup
+ \expandafter\edef\csname AskInc@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\AskInc@AtEnd{%
+ \AskInc@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+\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{62}{12}% >
+\TMP@EnsureCode{63}{12}% ?
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\AskInc@AtEnd{\AskInc@AtEnd\noexpand\endinput}
+\ProvidesPackage{askinclude}%
+ [2018/11/01 v2.4 Interactive asking of included files]%
+% \end{macrocode}
+%
+% Luatex compat
+% \begin{macrocode}
+\ifx\pdfextension\@undefined\else
+ \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax}
+ \protected\def\pdfnames {\pdfextension names }
+ \protected\def\pdfobj {\pdfextension obj }
+ \let\pdfoutput \outputmode
+\fi
+% \end{macrocode}
+%
+% \subsection{Delay action after preamble}
+%
+% \begin{macro}{\AskInc@AtBeginDocument}
+% Some actions such as \xfile{.aux} file writing cannot be
+% performed in the preamble. \cs{AtBeginDocument} delays
+% such action until |\begin{document}|. However \cs{AtBeginDocument}
+% must not be used after that time (\cs{@onlypreamble}).
+% Thus \cs{AskInc@AtBeginDocument} uses \cs{AtBeginDocument}
+% in the preamble and afterwards executes the code immediately.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \let\AskInc@AtBeginDocument\@firstofone
+}
+\providecommand*{\AskInc@AtBeginDocument}{\AtBeginDocument}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Write entry in \xfile{.aux} file}
+%
+% \begin{macro}{\AskInc@WriteAux}
+% The first argument is written to the main \xfile{.aux} file
+% and the second argument is executed if writing was possible.
+% Remember \cs{nofiles} prevents writing to auxiliary files.
+% \begin{macrocode}
+\def\AskInc@WriteAux#1#2{%
+ \AskInc@AtBeginDocument{%
+ \if@filesw
+ \immediate\write\@mainaux{#1}%
+ #2%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Remember \cs{include} files}
+%
+% \begin{macro}{\AskInc@CharHash}
+% \begin{macrocode}
+\edef\AskInc@CharHash{\string#}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AskInc@WriteDefAddList}
+% \begin{macrocode}
+\def\AskInc@WriteDefAddList{%
+ \AskInc@WriteAux{%
+% \end{macrocode}
+% \begin{macro}{\AskInc@AddList}
+% \begin{macrocode}
+ \string\providecommand*\string\AskInc@AddList[2]{%
+ \string\ifcase\string\ifx\AskInc@CharHash1\string\@undefined
+ \string\else
+ \string\ifx\AskInc@CharHash1\string\relax
+ \string\else
+ \string\ifx\AskInc@CharHash1\string\@empty
+ \string\else
+ 1%
+ \string\fi
+ \string\fi
+ \string\fi
+ 0 %
+ \string\gdef\AskInc@CharHash1{\AskInc@CharHash2}%
+ \string\else
+ \string\g@addto@macro\AskInc@CharHash1{,\AskInc@CharHash2}%
+ \string\fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ }{%
+ \global\let\AskInc@WriteDefAddList\relax
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@WriteDefAddFile}
+% \begin{macrocode}
+\def\AskInc@WriteDefAddFile{%
+ \AskInc@WriteDefAddList
+ \AskInc@WriteAux{%
+% \end{macrocode}
+% \begin{macro}{\AskInc@AddFile}
+% \begin{macrocode}
+ \string\providecommand\string\AskInc@AddFile{%
+ \string\AskInc@AddList\string\AskInc@Files
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ }{%
+ \global\let\AskInc@WriteDefAddFile\relax
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@AddFile}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \global\let\AskInc@AddFile\@gobble
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@WriteAddFile}
+% \begin{macrocode}
+\def\AskInc@WriteAddFile#1{%
+ \AskInc@WriteDefAddFile
+ \AskInc@WriteAux{%
+ \string\AskInc@AddFile{#1}%
+ }{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@Files}
+% \begin{macrocode}
+\providecommand*{\AskInc@Files}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Summary:}
+% Now \cs{AskInc@Files} is always defined
+% and either empty or contains a comma separated list of
+% \cs{include} files of previous run.
+%
+% The \cs{include} files are remembered by using
+% \cs{AskInc@WriteAddFile} at each \cs{include}.
+%
+% \subsection{Redefine \cs{include}}
+%
+% \begin{macro}{\AskInc@OrgInclude}
+% \begin{macrocode}
+\newcommand{\AskInc@OrgInclude}{}
+\let\AskInc@OrgInclude\include
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@AskFile}
+% \begin{macrocode}
+\let\AskInc@AskFile\@gobble
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@MatchFile}
+% \begin{macrocode}
+\let\AskInc@MatchFile\@gobble
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\include}
+% \begin{macrocode}
+\renewcommand*{\include}[1]{%
+ \AskInc@WriteAddFile{#1}%
+ \AskInc@AskFile{#1}%
+ \AskInc@MatchFile{#1}%
+ \AskInc@OrgInclude{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Store answer and match method in \xfile{.aux} file}
+%
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \AtBeginDocument{%
+ \@ifundefined{AskInc@Answer}{}{%
+ \AskInc@WriteAux{%
+ \string\gdef\string\AskInc@Answer{\AskInc@Answer}%
+ }{}%
+ }%
+ \@ifundefined{AskInc@MatchMethod}{}{%
+ \AskInc@WriteAux{%
+ \string\gdef\string\AskInc@MatchMethod{\AskInc@MatchMethod}%
+ }{}%
+ }%
+ }%
+}
+% \end{macrocode}
+%
+% \subsection{Support for \cs{@includeonly}}
+%
+% \begin{macro}{\@includeonly}
+% Macro \cs{@includeonly} is defined for compatiblity reasons only,
+% if the \xfile{.aux} file was written by versions before 2 of package
+% \xpackage{askinclude}.
+% \begin{macrocode}
+\providecommand*{\@includeonly}[1]{%
+ \gdef\AskInc@Answer{#1}%
+ \ifx\AskInc@Answer\@empty
+ \gdef\AskInc@Answer{-}%
+ \fi
+ \global\let\AskInc@MatchMethod\@empty
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Stop if \cs{includeonly} is active}
+%
+% If \cs{includeonly} is used before, the questions are skipped
+% and the data in the main auxiliary file is preserved.
+% \begin{macrocode}
+\if@partsw
+ \PackageWarningNoLine{askinclude}{%
+ Previous \string\includeonly\space detected,\MessageBreak
+ therefore asking for files is suppressed%
+ }%
+% \end{macrocode}
+% Dummy options.
+% \begin{macrocode}
+ \DeclareOption{makematch}{}%
+ \DeclareOption{pdfmatch}{}%
+ \DeclareOption{noregexp}{}%
+ \ProcessOptions*%
+% \end{macrocode}
+% Preserve \cs{AskInc@MatchFiles}.
+% \begin{macrocode}
+ \@ifundefined{AskInc@MatchFiles}{%
+ }{%
+ \ifx\AskInc@MatchMethod\@empty
+ \else
+ \AskInc@WriteAux{%
+ \string\gdef\string\AskInc@MatchFiles{\AskInc@MatchFiles}%
+ }{}%
+ \fi
+ }%
+ \expandafter\AskInc@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{\cs{includeonly}}
+%
+% \begin{macro}{\AskInc@OrgIncludeOnly}
+% \begin{macrocode}
+\newcommand{\AskInc@OrgIncludeOnly}{}%
+\let\AskInc@OrgIncludeOnly\includeonly
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\includeonly}
+% \begin{macrocode}
+\renewcommand*{\includeonly}[1]{%
+ \PackageWarning{askinclude}{%
+ \string\includeonly\space is managed by package `askinclude',%
+ \MessageBreak
+ therefore it is ignored%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Options}
+%
+% \begin{macro}{\AskInc@StringNoRegExp}
+% \begin{macrocode}
+\def\AskInc@StringNoRegExp{noregexp}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@StringMakeMatch}
+% \begin{macrocode}
+\def\AskInc@StringMakeMatch{makematch}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@StringPdfMatch}
+% \begin{macrocode}
+\def\AskInc@StringPdfMatch{pdfmatch}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifAskInc@PdfMatchAvailable}
+% \begin{macrocode}
+\newif\ifAskInc@PdfMatchAvailable
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfmatch\endcsname\relax
+\else
+ \AskInc@PdfMatchAvailabletrue
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareOption{makematch}{%
+ \let\AskInc@MatchOption\AskInc@StringMakeMatch
+}
+\ifAskInc@PdfMatchAvailable
+ \DeclareOption{pdfmatch}{%
+ \let\AskInc@MatchOption\AskInc@StringPdfMatch
+ }%
+\else
+ \DeclareOption{pdfmatch}{%
+ \PackageWarningNoLine{askinclude}{%
+ Option `pdfmatch' is not available because\MessageBreak
+ your pdfTeX does not provide \string\pdfmatch
+ }%
+ }%
+\fi
+\DeclareOption{noregexp}{%
+ \let\AskInc@MatchOption\@empty
+}
+\ProcessOptions*
+% \end{macrocode}
+%
+% \subsection{Strings}
+%
+% \begin{macro}{\AskInc@CharAsterisk}
+% \begin{macrocode}
+\def\AskInc@CharAsterisk{*}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharMinus}
+% \begin{macrocode}
+\def\AskInc@CharMinus{-}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharPlus}
+% \begin{macrocode}
+\def\AskInc@CharPlus{+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharQuestion}
+% \begin{macrocode}
+\def\AskInc@CharQuestion{?}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharExclam}
+% \begin{macrocode}
+\def\AskInc@CharExclam{!}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharYes}
+% \begin{macrocode}
+\def\AskInc@CharYes{y}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharNo}
+% \begin{macrocode}
+\def\AskInc@CharNo{n}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharAll}
+% \begin{macrocode}
+\def\AskInc@CharAll{A}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharNone}
+% \begin{macrocode}
+\def\AskInc@CharNone{N}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CharDefault}
+% \begin{macrocode}
+\def\AskInc@CharDefault{D}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Set defaults}
+%
+% \begin{macro}{\AskInc@SanitizeAnswer}
+% \begin{macrocode}
+\def\AskInc@SanitizeAnswer#1#2{%
+ \begingroup
+ \escapechar=`\\%
+ \edef\[{\string\[}%
+ \edef\]{\string\]}%
+ \edef\({\string\(}%
+ \edef\){\string\)}%
+ \edef\*{\string\*}%
+ \edef\+{\string\+}%
+ \edef\?{\string\?}%
+ \edef\|{\string\|}%
+ \edef\^{\string\^}%
+ \edef\${\string\$}%
+ \edef\{{\string\{}%
+ \edef\}{\string\}}%
+ \edef\.{\string\.}%
+ \xdef#1{%
+ \expandafter\expandafter\expandafter\zap@space
+ \expandafter#2\space\@empty
+ }%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifundefined{AskInc@Answer}{%
+ \global\let\AskInc@Answer\AskInc@CharAsterisk
+ }{%
+ \AskInc@SanitizeAnswer\AskInc@Answer\AskInc@Answer
+ }%
+ \global\let\AskInc@PreviousAnswer\AskInc@Answer
+ \@ifundefined{AskInc@MatchMethod}{%
+ \global\let\AskInc@MatchMethod\@empty
+ }{}%
+ \global\let\AskInc@PreviousMatchMethod\AskInc@MatchMethod
+ \@ifundefined{AskInc@MatchOption}{%
+ \let\AskInc@MatchOption\AskInc@MatchMethod
+ }{}%
+ \ifx\AskInc@MatchOption\AskInc@StringPdfMatch
+ \ifAskInc@PdfMatchAvailable
+ \else
+ \let\AskInc@MatchOption\@empty
+ \fi
+ \fi
+ \@ifundefined{AskInc@MatchFiles}{%
+ \let\AskInc@MatchFiles\@empty
+ }{}%
+}
+% \end{macrocode}
+%
+% \subsection{Questions}
+%
+% \subsubsection{Generic question header}
+%
+% \begin{macro}{\AskInc@QuestionHeader}
+% \begin{macrocode}
+\def\AskInc@QuestionHeader{%
+ \typeout{}%
+ \typeout{***********************************}%
+ \typeout{*** Package askinclude Question ***}%
+ \typeout{***********************************}%
+ \typeout{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Display files}
+%
+% \begin{macro}{\AskInc@TypeoutFiles}
+% \begin{macrocode}
+\def\AskInc@TypeoutFiles{%
+ \global\let\AskInc@PreviousMatches\@empty
+ \ifx\AskInc@Files\@empty
+ \else
+ \typeout{Files, found by previous run in \string\include:}%
+ \@for\AskInc@File:=\AskInc@Files\do{%
+ \ifx\AskInc@Answer\AskInc@CharAsterisk
+ \let\AskInc@Mark\AskInc@CharPlus
+ \else
+ \let\AskInc@Mark\AskInc@CharMinus
+ \ifx\AskInc@Answer\AskInc@CharMinus
+ \else
+ \ifx\AskInc@MatchMethod\@empty
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\@for\AskInc@Temp:=\AskInc@Answer}%
+ {\@for\AskInc@Temp:=\AskInc@MatchFiles}%
+ \do{%
+ \ifx\AskInc@File\AskInc@Temp
+ \let\AskInc@Mark\AskInc@CharPlus
+ \fi
+ }%
+ \fi
+ \fi
+ \typeout{ \@spaces(\AskInc@Mark) \AskInc@File}%
+ \ifx\AskInc@Mark\AskInc@CharPlus
+ \ifx\AskInc@PreviousMatches\@empty
+ \global\let\AskInc@PreviousMatches\AskInc@File
+ \else
+ \expandafter\g@addto@macro
+ \expandafter\AskInc@PreviousMatches{%
+ \expandafter,\AskInc@File
+ }%
+ \fi
+ \fi
+ }%
+ \typeout{}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Previous answer}
+%
+% \begin{macro}{\AskInc@TypeoutPreviousAnswer}
+% \begin{macrocode}
+\def\AskInc@TypeoutPreviousAnswer{%
+ \typeout{%
+ Previous answer (%
+ \ifx\AskInc@MatchMethod\@empty
+ noregexp%
+ \else
+ \AskInc@MatchMethod
+ \fi
+ ):%
+ }%
+ \typeout{ \@spaces[\AskInc@Answer]}%
+ \typeout{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Current regular expression support}
+%
+% \begin{macro}{\AskInc@TypeoutMatchMethod}
+% \begin{macrocode}
+\def\AskInc@TypeoutMatchMethod{%
+ \typeout{Regular expressions:}%
+ \AskInc@TypeoutMethod\@empty{noregexp}{%
+ \space disabled%
+ }%
+ \AskInc@TypeoutMethod\AskInc@StringMakeMatch{makematch}{%
+ enabled, using package `makematch'%
+ }%
+ \ifAskInc@PdfMatchAvailable
+ \AskInc@TypeoutMethod\AskInc@StringPdfMatch{pdfmatch}{%
+ \space enabled, using pdfTeX's \string\pdfmatch
+ }%
+ \fi
+ \typeout{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@TypeoutMethod}
+% \begin{macrocode}
+\def\AskInc@TypeoutMethod#1#2#3{%
+ \typeout{%
+ \ifx#1\AskInc@MatchOption \space--> \else\@spaces\space\fi
+ [#2] #3% hash-ok
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Main question text}
+%
+% \begin{macro}{\AskInc@TypeoutMainQuestion}
+% \begin{macrocode}
+\def\AskInc@TypeoutMainQuestion{%
+ \typeout{Which files do you want to include?}%
+ \typeout{ \@spaces[foo,bar] \space\space
+ comma separated file or pattern list}%
+ \typeout{ \@spaces[*] \@spaces\@spaces all files}%
+ \typeout{ \@spaces[-] \@spaces\@spaces no files}%
+ \typeout{ \@spaces[?] \@spaces\@spaces ask for each file}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Main question}
+%
+% \begin{macro}{\AskInc@MainQuestion}
+% \begin{macrocode}
+\def\AskInc@MainQuestion{%
+ \AskInc@QuestionHeader
+ \AskInc@TypeoutFiles
+ \AskInc@TypeoutPreviousAnswer
+ \AskInc@TypeoutMatchMethod
+ \AskInc@TypeoutMainQuestion
+ \begingroup
+ \@makeother\*%
+ \@makeother\-%
+ \@makeother\?%
+ \@makeother\,%
+ \@makeother\!%
+ \@makeother\^%
+ \@makeother\$%
+ \@makeother\(%
+ \@makeother\)%
+ \@makeother\+%
+ \@makeother\[%
+ \@makeother\]%
+ \@makeother\\%
+ \@makeother\|%
+ \@makeother\:%
+ \@makeother\.%
+ \typein[\answer]%
+ { \@spaces[] \space\@spaces\@spaces use the previous answer}%
+ \typeout{}%
+ \AskInc@SanitizeAnswer\AskInc@@Answer\answer
+ \endgroup
+ \let\AskInc@Next\AskInc@MainQuestion
+ \ifx\AskInc@@Answer\AskInc@StringNoRegExp
+ \let\AskInc@MatchOption\@empty
+ \else
+ \ifx\AskInc@@Answer\AskInc@StringMakeMatch
+ \let\AskInc@MatchOption\AskInc@StringMakeMatch
+ \else
+ \ifx\AskInc@@Answer\AskInc@StringPdfMatch
+ \ifAskInc@PdfMatchAvailable
+ \let\AskInc@MatchOption\AskInc@StringPdfMatch
+ \else
+ \PackageWarning{askinclude}{%
+ Method `pdfmatch' is not available because\MessageBreak
+ your pdfTeX does not provide \string\pdfmatch
+ }%
+ \let\AskInc@MatchOption\@empty
+ \fi
+ \else
+ \ifx\AskInc@@Answer\@empty
+ \global\let\AskInc@@Answer\AskInc@Answer
+ \fi
+ \let\AskInc@Next\AskInc@MainAnswer
+ \fi
+ \fi
+ \fi
+ \AskInc@Next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Evaluate answer of main question}
+%
+% \begin{macro}{\AskInc@MainAnswer}
+% \begin{macrocode}
+\def\AskInc@MainAnswer{%
+ \ifx\AskInc@@Answer\AskInc@CharQuestion
+ \global\let\AskInc@Answer\@empty
+ \global\let\AskInc@MatchMethod\@empty
+ \global\let\AskInc@AskFile\AskInc@DoAskFile
+ \AskInc@OrgIncludeOnly{}%
+ \else
+ \global\let\AskInc@Answer\AskInc@@Answer
+ \ifx\AskInc@@Answer\AskInc@CharAsterisk
+ \global\let\AskInc@MatchMethod\@empty
+ \else
+ \ifx\AskInc@@Answer\AskInc@CharMinus
+ \global\let\AskInc@MatchMethod\@empty
+ \AskInc@OrgIncludeOnly{}%
+ \else
+ \global\let\AskInc@MatchMethod\AskInc@MatchOption
+ \ifx\AskInc@MatchOption\@empty
+ \expandafter\AskInc@OrgIncludeOnly\expandafter{%
+ \AskInc@Answer
+ }%
+ \else
+ \AskInc@MatchInit
+ \AskInc@OrgIncludeOnly{}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \let\AskInc@Include\AskInc@DoInclude
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AskInc@MatchInit}
+% \begin{macrocode}
+\def\AskInc@MatchInit{%
+ \RequirePackage{kvsetkeys}[2007/09/29]%
+ \expandafter\comma@normalize\expandafter{\AskInc@Answer}%
+ \global\let\AskInc@MatchList\comma@list
+% \end{macrocode}
+% \begin{macro}{\AskInc@MatchFile}
+% \begin{macrocode}
+ \def\AskInc@MatchFile##1{%
+ \AskInc@DoMatch{##1}{%
+ \AskInc@WriteAddMatch{##1}%
+ \ifx\@partlist\@empty
+ \gdef\@partlist{##1}%
+ \else
+ \g@addto@macro\@partlist{,##1}%
+ \fi
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \ifx\AskInc@MatchMethod\AskInc@StringMakeMatch
+ \AskInc@MakeMatchInit
+ \else
+ \AskInc@PdfMatchInit
+ \fi
+ \let\AskInc@MatchInit\@undefined
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@MakeMatchInit}
+% \begin{macrocode}
+\def\AskInc@MakeMatchInit{%
+ \RequirePackage{makematch}%
+% \end{macrocode}
+% \begin{macro}{\AskInc@DoMatch}
+% \begin{macrocode}
+ \def\AskInc@DoMatch##1{%
+ \def\AskInc@Temp{%
+ \MakeMatcher[,]\AskInc@Temp
+ }%
+ \expandafter\AskInc@Temp\expandafter{\AskInc@MatchList}%
+ \AskInc@Temp{{##1}}\@firstofone\@gobble
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \let\AskInc@MakeMatchInit\@undefined
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@PdfMatchInit}
+% \begin{macrocode}
+\def\AskInc@PdfMatchInit{%
+% \end{macrocode}
+% \begin{macro}{\ifAskInc@Found}
+% \begin{macrocode}
+ \newif\ifAskInc@Found
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@DoMatch}
+% \begin{macrocode}
+ \def\AskInc@DoMatch##1{%
+ \AskInc@Foundfalse
+ \expandafter\comma@parse@normalized\expandafter
+ {\AskInc@MatchList}{\AskInc@CheckMatch{##1}}%
+ \ifAskInc@Found
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@CheckMatch}
+% \begin{macrocode}
+ \def\AskInc@CheckMatch##1##2{%
+ \AskInc@@CheckMatch##2\@empty\@nil{##1}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@@CheckMatch}
+% \begin{macrocode}
+ \def\AskInc@@CheckMatch##1##2\@nil##3{%
+ \def\AskInc@Temp{##1}%
+ \ifx\AskInc@Temp\AskInc@CharExclam
+ \ifcase\pdfmatch{##2}{##3}=1 %
+ \or
+ \AskInc@Foundfalse
+ \else
+ \AskInc@InvalidPattern{##2}{##1##2}%
+ \fi
+ \else
+ \ifcase\pdfmatch{##1##2}{##3} %
+ \or
+ \AskInc@Foundtrue
+ \else
+ \AskInc@InvalidPattern{##1##2}{##1##2}%
+ \fi
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@InvalidPattern}
+% Prints a warning with the regular expression and
+% removes it from the list to prevent further warnings
+% for the same expression.
+% \begin{macrocode}
+ \def\AskInc@InvalidPattern##1##2{%
+ \edef\AskInc@Temp{##1}%
+ \PackageWarningNoLine{askinclude}{%
+ Invalid pattern `\AskInc@Temp' for \string\pdfmatch
+ }%
+ \edef\AskInc@Temp{##2}%
+ \global\expandafter\let\expandafter\AskInc@MatchList
+ \expandafter\@empty
+ \expandafter\comma@parse@normalized\expandafter
+ {\AskInc@MatchList}\AskInc@FilterPattern
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@FilterPattern}
+% \begin{macrocode}
+ \def\AskInc@FilterPattern##1{%
+ \edef\AskInc@Pattern{##1}%
+ \ifx\AskInc@Temp\AskInc@Pattern
+ \else
+ \ifx\AskInc@MatchList\@empty
+ \global\let\AskInc@MatchList\AskInc@Pattern
+ \else
+ \expandafter\g@addto@macro\expandafter\AskInc@MatchList{%
+ \expandafter,\AskInc@Pattern
+ }%
+ \fi
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \let\AskInc@PdfMatchInit\@undefined
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AskInc@WriteDefAddMatch}
+% \begin{macrocode}
+\def\AskInc@WriteDefAddMatch{%
+ \AskInc@WriteDefAddList
+ \AskInc@WriteAux{%
+% \end{macrocode}
+% \begin{macro}{\AskInc@AddMatch}
+% \begin{macrocode}
+ \string\providecommand\string\AskInc@AddMatch{%
+ \string\AskInc@AddList\string\AskInc@MatchFiles
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ }{%
+ \global\let\AskInc@WriteDefAddMatch\relax
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@AddMatch}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \global\let\AskInc@AddMatch\@gobble
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@WriteAddMatch}
+% \begin{macrocode}
+\def\AskInc@WriteAddMatch#1{%
+ \AskInc@WriteDefAddMatch
+ \AskInc@WriteAux{%
+ \string\AskInc@AddMatch{#1}%
+ }{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AskInc@SaveAnswer}
+% \begin{macrocode}
+\def\AskInc@SaveAnswer{%
+ \AskInc@WriteAux{%
+ \string\gdef\string\AskInc@Answer{\AskInc@Answer}%
+ }{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Ask for each file}
+%
+% \begin{macro}{\AskInc@PreviousAnswer}
+% \begin{macrocode}
+\@ifundefined{AskInc@PreviousAnswer}{%
+ \let\AskInc@PreviousAnswer\AskInc@CharAsterisk
+}{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@PreviousMatchMethod}
+% \begin{macrocode}
+\@ifundefined{AskInc@PreviousMatchMethod}{%
+ \let\AskInc@PreviousMatchMethod\@empty
+}{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@DoAskFile}
+% \begin{macrocode}
+\def\AskInc@DoAskFile#1{%
+ \edef\AskInc@File{#1}%
+ \ifx\AskInc@PreviousAnswer\AskInc@CharAsterisk
+ \let\AskInc@Default\AskInc@CharYes
+ \else
+ \let\AskInc@Default\AskInc@CharNo
+ \ifx\AskInc@PreviousAnswer\AskInc@CharMinus
+ \else
+ \ifx\AskInc@PreviousMatchMethod\@empty
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {\@for\AskInc@Temp:=\AskInc@PreviousAnswer}%
+ {\@for\AskInc@Temp:=\AskInc@MatchFiles}%
+ \do{%
+ \ifx\AskInc@Temp\AskInc@File
+ \let\AskInc@Default\AskInc@CharYes
+ \fi
+ }%
+ \fi
+ \ifx\AskInc@Default\AskInc@CharNo
+ \let\AskInc@Default\AskInc@CharYes
+ \@for\AskInc@Temp:=\AskInc@Files\do{%
+ \ifx\AskInc@Temp\AskInc@File
+ \let\AskInc@Default\AskInc@CharNo
+ \fi
+ }%
+ \fi
+ \fi
+ \let\AskInc@@QuestionHeader\AskInc@QuestionHeader
+ \AskInc@AskQuestion
+ \ifx\AskInc@AskResult\AskInc@CharYes
+ \ifx\AskInc@Answer\@empty
+ \gdef\AskInc@Answer{#1}%
+ \else
+ \g@addto@macro\AskInc@Answer{,#1}%
+ \fi
+ \AskInc@SaveAnswer
+ \let\@partlist\AskInc@Answer
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AskInc@AskQuestion}
+% \begin{macrocode}
+\def\AskInc@AskQuestion{%
+ \let\AskInc@Temp\answer
+ \AskInc@@QuestionHeader
+ \let\AskInc@@QuestionHeader\relax
+ \typein[\answer]{%
+ Include `\AskInc@File'? [y]es, [n]o, [A]ll, [N]one, [D]efault %
+ (\AskInc@Default):%
+ }%
+ \typeout{}%
+ \let\AskInc@AskResult\answer
+ \let\answer\AskInc@Temp
+ \ifx\AskInc@AskResult\@empty
+ \let\AskInc@AskResult\AskInc@Default
+ \let\AskInc@Next\relax
+ \else
+ \ifx\AskInc@AskResult\AskInc@CharYes
+ \let\AskInc@Next\relax
+ \else
+ \ifx\AskInc@AskResult\AskInc@CharNo
+ \let\AskInc@Next\relax
+ \else
+ \ifx\AskInc@AskResult\AskInc@CharAll
+ \gdef\AskInc@AskQuestion{%
+ \let\AskInc@AskResult\AskInc@CharYes
+ }%
+ \else
+ \ifx\AskInc@AskResult\AskInc@CharNone
+ \gdef\AskInc@AskQuestion{%
+ \let\AskInc@AskResult\AskInc@CharNo
+ }%
+ \else
+ \ifx\AskInc@AskResult\AskInc@CharDefault
+ \gdef\AskInc@AskQuestion{%
+ \let\AskInc@AskResult\AskInc@Default
+ }%
+ \else
+ \PackageWarningNoLine{askinclude}{%
+ Invalid answer [\AskInc@AskResult].\MessageBreak
+ Answer must be one letter out of [ynAND]%
+ }%
+ \fi
+ \fi
+ \fi
+ \let\AskInc@Next\AskInc@AskQuestion
+ \fi
+ \fi
+ \fi
+ \AskInc@Next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\AtBeginDocument{\AskInc@MainQuestion}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\AskInc@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Included files}
+%
+% \begin{macrocode}
+%<*a>
+\chapter{Chapter A}
+\let\filea=Y
+%</a>
+% \end{macrocode}
+% \begin{macrocode}
+%<*b>
+\chapter{Chapter B}
+\let\fileb=Y
+%</b>
+% \end{macrocode}
+% \begin{macrocode}
+%<*c>
+\chapter{Chapter C}
+\let\filec=Y
+%</c>
+% \end{macrocode}
+%
+% \subsection{Special test setup}
+%
+% \begin{macrocode}
+%<*test18>
+\includeonly{askinclude-b}
+%</test18>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test20|test21|test22>
+\let\AtBeginDocumentMode=N%
+%</test20|test21|test22>
+% \end{macrocode}
+%
+% \subsection{Common start}
+%
+% \begin{macrocode}
+%<*test0>
+\ifx\CompatibilityMode Y%
+ \documentstyle[filecontents,qstest,askinclude,pdftexcmds]{book}%
+\else
+ \documentclass{book}%
+ \usepackage{filecontents}%
+ \usepackage{qstest}%
+ \usepackage{pdftexcmds}%
+%<*test1>
+ \makeatletter
+ \def\RestoreCatcodes{}%
+ \count@=0 %
+ \loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+ \ifnum\count@<255 %
+ \advance\count@\@ne
+ \repeat
+ \def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@\@ne
+ \repeat
+ }%
+ \def\Test#1\EndTest{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\[=12 %
+ \catcode`\]=12 %
+ \catcode`\%=14 %
+ \catcode`\ =10 %
+ \catcode13=5 %
+ #1\relax
+ \RestoreCatcodes
+ \makeatother
+ }%
+ \Test
+%</test1>
+%<*!test1>
+ \ifx\AtBeginDocumentMode Y%
+ \AtBeginDocument{%
+ \usepackage{askinclude}[2018/11/01]%
+ }%
+ \else
+%</!test1>
+ \usepackage{askinclude}[2018/11/01]%
+%<*!test1>
+ \fi
+%</!test1>
+%<*test1>
+ \EndTest
+%</test1>
+\fi
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\makeatletter
+\let\org@typein\typein
+\def\typein[#1]#2{%
+ \ifx\@Stack\@StackEmpty
+ \begin{qstest}{StackNonEmpty}{StackNonEmpty}%
+ \Expect{Error: empty stack}{}%
+ \end{qstest}%
+ \org@typein[{#1}]{#2}%
+ \else
+ \edef#1{%
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \expandafter\@car\@Stack\@nil
+ }%
+ }%
+ \xdef\@Stack{%
+ \unexpanded\expandafter\expandafter\expandafter{%
+ \expandafter\@cdr\@Stack\@nil
+ }%
+ }%
+ \typeout{}%
+ \typeout{\string#1=#1}%
+ \fi
+}
+\def\@StackEmpty{\BOTTOM}
+\let\@Stack\@StackEmpty
+\newcommand*{\Stack}[1]{%
+ \def\@Stack{#1\BOTTOM}%
+}
+\AtEndDocument{%
+ \begin{qstest}{StackUsed}{StackUsed}%
+ \Expect*{%
+ \ifx\@Stack\@StackEmpty
+ \else
+ Error: Unused stack entries%
+ \fi
+ }{}%
+ \end{qstest}%
+}
+\newcommand*{\CheckInclude}[2]{%
+ \include{askinclude-#1}%
+ \begin{qstest}{CheckInclude-#1}{CheckInclude-#1}%
+ \Expect*{%
+ \expandafter\ifx\csname file#1\endcsname Ytrue\else false\fi
+ }{#2}%
+ \end{qstest}%
+}
+\def\@EndChecks{}
+\AtBeginDocument{%
+ \AtEndDocument{%
+ \if@filesw
+ \immediate\write\@mainaux{\string\@EndChecks}%
+ \fi
+ }%
+}
+\newcommand*{\CheckAnswer}[1]{%
+ \gdef\AnswerText{#1}%
+ \g@addto@macro\@EndChecks{\@CheckAnswer}%
+}
+\def\@CheckAnswer{%
+ \begin{qstest}{CheckAnswer}{CheckAnswer}%
+ \Expect*{\unexpanded\expandafter{\AskInc@Answer}}%
+ *{\unexpanded\expandafter{\AnswerText}}%
+ \end{qstest}%
+}
+\newcommand*{\CheckMatchMethod}[1]{%
+ \gdef\MatchMethodText{#1}%
+ \g@addto@macro\@EndChecks{\@CheckMatchMethod}%
+}
+\def\@CheckMatchMethod{%
+ \begin{qstest}{CheckMatchMethod}{CheckMatchMethod}%
+ \Expect*{\unexpanded\expandafter{\AskInc@MatchMethod}}%
+ *{\unexpanded\expandafter{\MatchMethodText}}%
+ \end{qstest}%
+}
+\def\@CheckAux{%
+ \begin{qstest}{CheckAux}{CheckAux}%
+ \def\GetFileContents##1{%
+ \pdf@unescapehex{%
+ \pdf@filedump{0}{\pdf@filesize{##1}}{##1}%
+ }%
+ }%
+ \Expect*{\GetFileContents{\jobname.aux}}%
+ *{\GetFileContents{\jobname-aux.aux}}%
+ \end{qstest}%
+}
+\g@addto@macro\@EndChecks{\@CheckAux}
+\let\org@filec@ntents\filec@ntents
+\def\filec@ntents{%
+ \catcode`\|=0 %
+ \org@filec@ntents
+}
+\begingroup
+ \endlinechar=-1 %
+ \catcode`\|=0 %
+ \@makeother\#%
+ \@makeother\\%
+ |gdef|AddList{%
+ \providecommand*\AskInc@AddList[2]{%
+ \ifcase\ifx#1\@undefined
+ \else\ifx#1\relax
+ \else\ifx#1\@empty
+ \else1\fi\fi\fi0 %
+ \gdef#1{#2}%
+ \else
+ \g@addto@macro#1{,#2}%
+ \fi
+ }%
+ }%
+ |gdef|AddFile{%
+ \providecommand\AskInc@AddFile{%
+ \AskInc@AddList\AskInc@Files
+ }%
+ }%
+ |gdef|AddMatch{%
+ \providecommand\AskInc@AddMatch{%
+ \AskInc@AddList\AskInc@MatchFiles
+ }%
+ }%
+|endgroup
+%</test0>
+% \end{macrocode}
+%
+% \subsection{First run tests}
+%
+% \begin{macrocode}
+%<*test1>
+\Stack{{}}
+\CheckAnswer{*}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{*}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{true}
+\CheckInclude{c}{true}
+%</test1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test2>
+\Stack{*}
+\CheckAnswer{*}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{*}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{true}
+\CheckInclude{c}{true}
+%</test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test3>
+\Stack{-}%
+\CheckAnswer{-}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{-}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{false}
+\CheckInclude{b}{false}
+\CheckInclude{c}{false}
+%</test3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test4>
+\Stack{{askinclude-b}}
+\CheckAnswer{askinclude-b}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{askinclude-b}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{false}
+\CheckInclude{b}{true}
+\CheckInclude{c}{false}
+%</test4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test5>
+\Stack{{askinclude-a,askinclude-c}}
+\CheckAnswer{askinclude-a,askinclude-c}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{askinclude-a,askinclude-c}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{true}
+%</test5>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test6>
+\Stack{?yny}
+\CheckAnswer{askinclude-a,askinclude-c}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\gdef\AskInc@Answer{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\gdef\AskInc@Answer{askinclude-a,askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{true}
+%</test6>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test7>
+\Stack{?yA}
+\CheckAnswer{askinclude-a,askinclude-b,askinclude-c}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\gdef\AskInc@Answer{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\gdef\AskInc@Answer{askinclude-a,askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\gdef\AskInc@Answer{askinclude-a,askinclude-b,askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{true}
+\CheckInclude{c}{true}
+%</test7>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test8>
+\Stack{?yD}
+\CheckAnswer{askinclude-a,askinclude-b,askinclude-c}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\gdef\AskInc@Answer{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\gdef\AskInc@Answer{askinclude-a,askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\gdef\AskInc@Answer{askinclude-a,askinclude-b,askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{true}
+\CheckInclude{c}{true}
+%</test8>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test9>
+\Stack{?yN}
+\CheckAnswer{askinclude-a}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\gdef\AskInc@Answer{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{false}
+%</test9>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test10>
+\Stack{?{}N}
+\CheckAnswer{askinclude-a}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\gdef\AskInc@Answer{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{false}
+%</test10>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test11>
+\Stack{?xxyxxN}
+\CheckAnswer{askinclude-a}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\gdef\AskInc@Answer{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{false}
+%</test11>
+% \end{macrocode}
+%
+% \subsection{Second run tests}
+%
+% \begin{macrocode}
+%<*test12>
+\Stack{{}}
+\CheckAnswer{askinclude-b}
+\begin{filecontents*}{\jobname.aux}
+\gdef\AskInc@Answer{askinclude-b}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\AskInc@AddFile{askinclude-b}
+\AskInc@AddFile{askinclude-c}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{askinclude-b}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{false}
+\CheckInclude{b}{true}
+\CheckInclude{c}{false}
+%</test12>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test13>
+\Stack{{}}
+\CheckAnswer{askinclude-b}
+\begin{filecontents*}{\jobname.aux}
+\gdef\AskInc@Answer{askinclude-b}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\AskInc@AddFile{askinclude-b}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{askinclude-b}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{false}
+\CheckInclude{b}{true}
+\CheckInclude{c}{false}
+%</test13>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test14>
+\Stack{{}}
+\CheckAnswer{*}
+\begin{filecontents*}{\jobname.aux}
+\gdef\AskInc@Answer{*}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\AskInc@AddFile{askinclude-b}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{*}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{true}
+\CheckInclude{c}{true}
+%</test14>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test15>
+\Stack{?D}
+\CheckAnswer{askinclude-a,askinclude-c}
+\begin{filecontents*}{\jobname.aux}
+\gdef\AskInc@Answer{askinclude-a}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\AskInc@AddFile{askinclude-b}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\gdef\AskInc@Answer{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\gdef\AskInc@Answer{askinclude-a,askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{true}
+%</test15>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test16>
+\Stack{?A}
+\CheckAnswer{askinclude-a,askinclude-b,askinclude-c}
+\begin{filecontents*}{\jobname.aux}
+\gdef\AskInc@Answer{askinclude-a}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\AskInc@AddFile{askinclude-b}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\gdef\AskInc@Answer{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\gdef\AskInc@Answer{askinclude-a,askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\gdef\AskInc@Answer{askinclude-a,askinclude-b,askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{true}
+\CheckInclude{c}{true}
+%</test16>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test17>
+\Stack{?N}
+\CheckAnswer{}
+\begin{filecontents*}{\jobname.aux}
+\gdef\AskInc@Answer{askinclude-a}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\AskInc@AddFile{askinclude-b}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{false}
+\CheckInclude{b}{false}
+\CheckInclude{c}{false}
+%</test17>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test18>
+\Stack{}
+\CheckAnswer{askinclude-a}
+\begin{filecontents*}{\jobname.aux}
+\gdef\AskInc@Answer{askinclude-a}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\AskInc@AddFile{askinclude-b}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{askinclude-a}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{false}
+\CheckInclude{b}{true}
+\CheckInclude{c}{false}
+%</test18>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test19>
+\Stack{?N}
+\CheckAnswer{}
+\begin{filecontents*}{\jobname.aux}
+\gdef\AskInc@Answer{askinclude-a}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\AskInc@AddFile{askinclude-b}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\ifx\AtBeginDocumentMode Y%
+ \AtBeginDocument{\includeonly{askinclude-b}}%
+\else
+ \includeonly{askinclude-b}%
+\fi
+\begin{document}
+\CheckInclude{a}{false}
+\CheckInclude{b}{false}
+\CheckInclude{c}{false}
+%</test19>
+% \end{macrocode}
+%
+% \subsection{Compatibility for changing from old to new}
+%
+% \begin{macrocode}
+%<*test20>
+\Stack{{}}
+\CheckAnswer{*}
+\begin{filecontents*}{\jobname.aux}
+\@includeonly{*}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{*}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{true}
+\CheckInclude{c}{true}
+%</test20>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test21>
+\Stack{{}}
+\CheckAnswer{-}
+\begin{filecontents*}{\jobname.aux}
+\@includeonly{}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{-}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{false}
+\CheckInclude{b}{false}
+\CheckInclude{c}{false}
+%</test21>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test22>
+\Stack{{}}
+\CheckAnswer{askinclude-a,askinclude-c}
+\begin{filecontents*}{\jobname.aux}
+\@includeonly{askinclude-a,askinclude-c}
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{askinclude-a,askinclude-c}
+\gdef\AskInc@MatchMethod{}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{true}
+%</test22>
+% \end{macrocode}
+%
+% \subsection{Regular expressions}
+%
+% \begin{macrocode}
+%<*test23>
+\Stack{{makematch}{*,!askinclude-b}}
+\CheckAnswer{*,!askinclude-b}
+\CheckMatchMethod{makematch}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{*,!askinclude-b}
+\gdef\AskInc@MatchMethod{makematch}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+|AddMatch
+\AskInc@AddMatch{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\AskInc@AddMatch{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{true}
+%</test23>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test24>
+\Stack{{pdfmatch}{.,!askinclude-b}}
+\CheckAnswer{.,!askinclude-b}
+\CheckMatchMethod{pdfmatch}
+\begin{filecontents*}{\jobname.aux}
+\relax
+\end{filecontents*}
+\begin{filecontents*}{\jobname-aux.aux}
+\relax|space
+\gdef\AskInc@Answer{.,!askinclude-b}
+\gdef\AskInc@MatchMethod{pdfmatch}
+|AddList
+|AddFile
+\AskInc@AddFile{askinclude-a}
+|AddMatch
+\AskInc@AddMatch{askinclude-a}
+\@input{askinclude-a.aux}
+\AskInc@AddFile{askinclude-b}
+\@input{askinclude-b.aux}
+\AskInc@AddFile{askinclude-c}
+\AskInc@AddMatch{askinclude-c}
+\@input{askinclude-c.aux}
+\@EndChecks
+\end{filecontents*}
+\begin{document}
+\CheckInclude{a}{true}
+\CheckInclude{b}{false}
+\CheckInclude{c}{true}
+%</test24>
+% \end{macrocode}
+%
+%
+% \subsection{Common end}
+%
+% \begin{macrocode}
+%<*test0>
+\end{document}
+%</test0>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/askinclude}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/askinclude.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/askinclude.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[\CTAN{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 askinclude.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@{}}
+% askinclude.sty & tex/latex/oberdiek/askinclude.sty\\
+% askinclude.pdf & doc/latex/oberdiek/askinclude.pdf\\
+% test/askinclude-a.tex & doc/latex/oberdiek/test/askinclude-a.tex\\
+% test/askinclude-b.tex & doc/latex/oberdiek/test/askinclude-b.tex\\
+% test/askinclude-c.tex & doc/latex/oberdiek/test/askinclude-c.tex\\
+% test/askinclude-test1.tex & doc/latex/oberdiek/test/askinclude-test1.tex\\
+% test/askinclude-test2.tex & doc/latex/oberdiek/test/askinclude-test2.tex\\
+% test/askinclude-test3.tex & doc/latex/oberdiek/test/askinclude-test3.tex\\
+% test/askinclude-test4.tex & doc/latex/oberdiek/test/askinclude-test4.tex\\
+% test/askinclude-test5.tex & doc/latex/oberdiek/test/askinclude-test5.tex\\
+% test/askinclude-test6.tex & doc/latex/oberdiek/test/askinclude-test6.tex\\
+% test/askinclude-test7.tex & doc/latex/oberdiek/test/askinclude-test7.tex\\
+% test/askinclude-test8.tex & doc/latex/oberdiek/test/askinclude-test8.tex\\
+% test/askinclude-test9.tex & doc/latex/oberdiek/test/askinclude-test9.tex\\
+% test/askinclude-test10.tex & doc/latex/oberdiek/test/askinclude-test10.tex\\
+% test/askinclude-test11.tex & doc/latex/oberdiek/test/askinclude-test11.tex\\
+% test/askinclude-test12.tex & doc/latex/oberdiek/test/askinclude-test12.tex\\
+% test/askinclude-test13.tex & doc/latex/oberdiek/test/askinclude-test13.tex\\
+% test/askinclude-test14.tex & doc/latex/oberdiek/test/askinclude-test14.tex\\
+% test/askinclude-test15.tex & doc/latex/oberdiek/test/askinclude-test15.tex\\
+% test/askinclude-test16.tex & doc/latex/oberdiek/test/askinclude-test16.tex\\
+% test/askinclude-test17.tex & doc/latex/oberdiek/test/askinclude-test17.tex\\
+% test/askinclude-test18.tex & doc/latex/oberdiek/test/askinclude-test18.tex\\
+% test/askinclude-test19.tex & doc/latex/oberdiek/test/askinclude-test19.tex\\
+% test/askinclude-test20.tex & doc/latex/oberdiek/test/askinclude-test20.tex\\
+% test/askinclude-test21.tex & doc/latex/oberdiek/test/askinclude-test21.tex\\
+% test/askinclude-test22.tex & doc/latex/oberdiek/test/askinclude-test22.tex\\
+% test/askinclude-test23.tex & doc/latex/oberdiek/test/askinclude-test23.tex\\
+% test/askinclude-test24.tex & doc/latex/oberdiek/test/askinclude-test24.tex\\
+% askinclude.dtx & source/latex/oberdiek/askinclude.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk askinclude.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{askinclude.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 askinclude.dtx
+%bibtex askinclude.aux
+%makeindex -s gind.ist askinclude.idx
+%pdflatex askinclude.dtx
+%makeindex -s gind.ist askinclude.idx
+%pdflatex askinclude.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{askinclude.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='askinclude'>
+ <name>askinclude</name>
+ <caption>Interactive use of \includeonly</caption>
+ <authorref id='auth:straub'/>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner="Pablo A. Straub" year='1991-1994'/>
+ <copyright owner="Heiko Oberdiek" year='2007,2008,2011'/>
+ <license type='lppl1.3'/>
+ <version number='2.4'/>
+ <description>
+ The package asks the user which files to put in a \includeonly
+ command. There is provision for answering &#x201C;same as last
+ time&#x201D; or &#x201C;all files&#x201D;.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/askinclude.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/askinclude.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \section{Acknowledgement}
+%
+% \begin{description}
+% \item[Tom Scavo]
+% suggested saving the include file list
+% from the previous run and a simplified user interface.
+% \item[Joseph Wright] suggested questions for each \cs{include}.
+% \end{description}
+%
+% \printbibliography[
+% heading=bibnumbered,
+% ]
+%
+% \begin{History}
+
+% \begin{Version}{1991/11/05 v0.95}
+% \item
+% First beta-test version (asked two questions).
+% \end{Version}
+% \begin{Version}{1991/11/05 v0.99}
+% \item
+% Second beta-test version (asks one question; uses `|*|' and `|-|').
+% \end{Version}
+% \begin{Version}{1991/11/07 v1.0}
+% \item
+% Changed prompts (sent to \xnewsgroup{comp.text.tex}):
+% \URL{``\link{Interactive inclusion of files in LaTeX}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/34b770a7c277e79c}
+% \end{Version}
+% \begin{Version}{1991/12/13 v1.1}
+% \item
+% \textit{Unknown}.
+% \end{Version}
+% \begin{Version}{1994/11/02 v1.2e}
+% \item
+% Two small changes to run under LaTeX2e [RF].
+% \item
+% Additional documentation [TRS].
+% \end{Version}
+% \begin{Version}{2007/10/15 v1.0 (askinc)}
+% \item
+% Reimplementation, published as \xpackage{askinc} in
+% newsgroup \xnewsgroup{comp.text.tex}:\\
+% \URL{``\link{Re: askinclude.sty}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/2d638b84a858fdc8}
+% \item
+% Listing of included files, collected from the previous run before
+% the question.
+% \item
+% No error message by \xfile{.aux} file if package is removed.
+% \end{Version}
+% \begin{Version}{2007/10/23 v2.0}
+% \item
+% The next version of \xpackage{askinc} becomes
+% version 2.0 of \xpackage{askinclude}.
+% \item
+% `|?|' added for questioning each file.
+% \item
+% \cs{includeonly} has precedence until package loading.
+% Then it is disabled by a warning.
+% \item
+% Documentation rewritten/added.
+% \item
+% Tests added.
+% \end{Version}
+% \begin{Version}{2008/08/11 v2.1}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2011/12/02 v2.2}
+% \item
+% Bibliography rewritten for biblatex.
+% \end{Version}
+% \begin{Version}{2016/05/14 v2.3}
+% \item
+% Luatex compatibility
+% \end{Version}
+% \begin{Version}{2018/11/01 v2.4}
+% \item
+% Remove luatex85 package dependency
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
+% \begin{Version}{1991/11/05 v0.95}
+% \item
+% First beta-test version (asked two questions).
+% \end{Version}
+% \begin{Version}{1991/11/05 v0.99}
+% \item
+% Second beta-test version (asks one question; uses `|*|' and `|-|').
+% \end{Version}
+% \begin{Version}{1991/11/07 v1.0}
+% \item
+% Changed prompts (sent to \xnewsgroup{comp.text.tex}):
+% \URL{``\link{Interactive inclusion of files in LaTeX}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/34b770a7c277e79c}
+% \end{Version}
+% \begin{Version}{1991/12/13 v1.1}
+% \item
+% \textit{Unknown}.
+% \end{Version}
+% \begin{Version}{1994/11/02 v1.2e}
+% \item
+% Two small changes to run under LaTeX2e [RF].
+% \item
+% Additional documentation [TRS].
+% \end{Version}
+% \begin{Version}{2007/10/15 v1.0 (askinc)}
+% \item
+% Reimplementation, published as \xpackage{askinc} in
+% newsgroup \xnewsgroup{comp.text.tex}:\\
+% \URL{``\link{Re: askinclude.sty}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/2d638b84a858fdc8}
+% \item
+% Listing of included files, collected from the previous run before
+% the question.
+% \item
+% No error message by \xfile{.aux} file if package is removed.
+% \end{Version}
+% \begin{Version}{2007/10/23 v2.0}
+% \item
+% The next version of \xpackage{askinc} becomes
+% version 2.0 of \xpackage{askinclude}.
+% \item
+% `|?|' added for questioning each file.
+% \item
+% \cs{includeonly} has precedence until package loading.
+% Then it is disabled by a warning.
+% \item
+% Documentation rewritten/added.
+% \item
+% Tests added.
+% \end{Version}
+% \begin{Version}{2008/08/11 v2.1}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2011/12/02 v2.2}
+% \item
+% Bibliography rewritten for biblatex.
+% \end{Version}
+% \begin{Version}{2016/05/14 v2.3}
+% \item
+% Luatex compatibility
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/askinclude.pdf b/macros/latex/contrib/oberdiek/askinclude.pdf
new file mode 100644
index 0000000000..1b4737443e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/askinclude.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/atbegshi.dtx b/macros/latex/contrib/oberdiek/atbegshi.dtx
new file mode 100644
index 0000000000..2b249fa386
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/atbegshi.dtx
@@ -0,0 +1,2458 @@
+% \iffalse meta-comment
+%
+% File: atbegshi.dtx
+% Version: 2016/06/09 v1.18
+% Info: At begin shipout hook
+%
+% Copyright (C) 2007-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 atbegshi.dtx
+% and the derived files
+% atbegshi.sty, atbegshi.pdf, atbegshi.ins, atbegshi.drv,
+% atbegshi-example1.tex, atbegshi-example2.tex,
+% atbegshi-test1.tex, atbegshi-test2.tex, atbegshi-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/atbegshi.dtx
+% CTAN:macros/latex/contrib/oberdiek/atbegshi.pdf
+%
+% Unpacking:
+% (a) If atbegshi.ins is present:
+% tex atbegshi.ins
+% (b) Without atbegshi.ins:
+% tex atbegshi.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{atbegshi.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If atbegshi.drv is present:
+% latex atbegshi.drv
+% (b) Without atbegshi.drv:
+% latex atbegshi.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 atbegshi.dtx
+% makeindex -s gind.ist atbegshi.idx
+% pdflatex atbegshi.dtx
+% makeindex -s gind.ist atbegshi.idx
+% pdflatex atbegshi.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/atbegshi.sty
+% TDS:doc/latex/oberdiek/atbegshi.pdf
+% TDS:doc/latex/oberdiek/atbegshi-example1.tex
+% TDS:doc/latex/oberdiek/atbegshi-example2.tex
+% TDS:doc/latex/oberdiek/test/atbegshi-test1.tex
+% TDS:doc/latex/oberdiek/test/atbegshi-test2.tex
+% TDS:doc/latex/oberdiek/test/atbegshi-test3.tex
+% TDS:source/latex/oberdiek/atbegshi.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: atbegshi 2016/06/09 v1.18 At begin shipout hook (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: atbegshi
+Version: 2016/06/09 v1.18
+
+Copyright (C) 2007-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 atbegshi.dtx
+and the derived files
+ atbegshi.sty, atbegshi.pdf, atbegshi.ins, atbegshi.drv,
+ atbegshi-example1.tex, atbegshi-example2.tex,
+ atbegshi-test1.tex, atbegshi-test2.tex, atbegshi-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{atbegshi.ins}{\from{atbegshi.dtx}{install}}%
+ \file{atbegshi.drv}{\from{atbegshi.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{atbegshi.sty}{\from{atbegshi.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{atbegshi-example1.tex}{\from{atbegshi.dtx}{example1}}%
+ \file{atbegshi-example2.tex}{\from{atbegshi.dtx}{example2}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{atbegshi-test1.tex}{\from{atbegshi.dtx}{test1}}%
+% \file{atbegshi-test2.tex}{\from{atbegshi.dtx}{test2}}%
+% \file{atbegshi-test3.tex}{\from{atbegshi.dtx}{test3}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{atbegshi.xml}{\from{atbegshi.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{* atbegshi.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `atbegshi.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{atbegshi.drv}%
+ [2016/06/09 v1.18 At begin shipout hook (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{atbegshi.dtx}%
+\end{document}
+%</driver>
+% \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{atbegshi.drv}
+%
+% \title{The \xpackage{atbegshi} package}
+% \date{2016/06/09 v1.18}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package is a modern reimplementation of package \xpackage{everyshi}
+% without the burden of compatibility. It makes use of \eTeX's if available.
+% Both \LaTeX\ and \plainTeX\ are supported.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% Package \xpackage{atbegshi} redefines \cs{shipout} to insert
+% hooks for user code that is executed before the page is shipped out.
+% The code may modify or even discard the output page.
+% Three hooks are implemented:
+% \begin{enumerate}
+% \item A hook that is executed for every page, see\\
+% \cs{AtBeginShipout}
+% \item A hook that is executed for the next page only, see\\
+% \cs{AtBeginShipoutNext}
+% \item A hook that is only executed for the first page, see\\
+% \cs{AtBeginShipoutFirst}
+% \end{enumerate}
+% The hooks are executed in this order. The following three macros
+% provide the user interface for adding code to these hooks:
+%
+% \begin{declcs}{AtBeginShipout} \M{code}\\
+% \cs{AtBeginShipoutBox}
+% \end{declcs}
+% Execute the \meta{code} for every page.
+% The page contents is held in box register \cs{AtBeginShipoutBox}
+% and may be modified. Use \cs{AtBeginShipoutDiscard} if you want to
+% discard the page.
+%
+% \emph{Note:} Package \xpackage{everyshi} uses box register 255. With
+% package \xpackage{atbegshi} you must use \cs{AtBeginShipoutBox} instead.
+%
+% If \LaTeX\ calls \cs{shipout} in \cs{@outputpage} (part of its output
+% routine),
+% the meaning of \cs{protect} is \cs{noexpand}. \LaTeX\ sets
+% \cs{protect} to the appropriate \cs{@typeset@protect} in the box
+% that is shipped out. This is too late for the hooks, they
+% are called earlier in the redefined \cs{shipout}. Therefore
+% package \xpackage{atbegshi} sets \cs{protect} to \cs{@typeset@protect}
+% before it calls the hooks.
+% (In \cs{EveryShipout} of package \xpackage{everyshi} the
+% user is responsible for the correct setting of \cs{protect}.)
+%
+% \begin{declcs}{AtBeginShipoutNext} \M{code}
+% \end{declcs}
+% This reimplements package \xpackage{everyshi}'s \cs{AtNextShipout}.
+% The \meta{code} is executed at shipout time of the next page only.
+% It is just a convenience macro, it can be easily replaced by something
+% like:
+%\begin{quote}
+%\begin{verbatim}
+%\newcommand{\MyShipoutHook}{}%
+%\AtBeginShipout{\MyShipoutHook}
+%\gdef\MyShipoutHook{%
+% ... do something with next page ...
+% \gdef\MyShipoutHook{}%
+% }
+%\end{verbatim}
+%\end{quote}
+% (This can be necessary, if hook order does matter).
+%
+% \begin{declcs}{AtBeginShipoutFirst} \M{code}
+% \end{declcs}
+% This reimplements \LaTeX's \cs{AtBeginDvi}. This hook is
+% usually used for \cs{special} commands that include PostScript
+% header files. The \cs{code} is directly executed in a \cs{vbox}
+% that is put at the beginning of the output page. Dealing with
+% the output box \cs{AtBeginShipoutBox} is not necessary and
+% not permitted here.
+%
+% \begin{declcs}{AtBeginShipoutDiscard}
+% \end{declcs}
+% This macro notifies package \xpackage{atbegshi} that
+% the output page is discarded. The remaining hook code
+% and the remaining hooks are not executed and the page is thrown away.
+% Also \cs{deadcycles} is cleared to zero like an ordinary \cs{shipout}
+% would do.
+%
+% \begin{declcs}{AtBeginShipoutInit}
+% \end{declcs}
+% Usually the redefinition of \cs{shipout} is delayed by
+% \cs{AtBeginDocument} (if this macro exists). This can be
+% too late, if other packages also redefines \cs{shipout}
+% and the order does matter.
+% \cs{AtBeginShipoutInit} forces the immediate redefinition
+% of \cs{shipout}.
+%
+% \begin{declcs}{AtBeginShipoutAddToBox} \M{stuff}\\
+% \cs{AtBeginShipoutAddToBoxForeground} \M{stuff}
+% \end{declcs}
+% A quite common use case is the addition of \cs{special}
+% or other whatsits to the page output box. Macro
+% \cs{AtBeginShipoutAddToBox} puts \meta{stuff} in a
+% box with zeroed dimensions. The box with the \meta{stuff}
+% is put in the upper left corner of the shipout box
+% \cs{AtBeginShipoutBox}. Macro \cs{AtBeginShipoutAddToBox}
+% puts the \meta{stuff} in the background, the other macro
+% \cs{AtBeginShipoutAddToBoxForeground} in the foreground
+% after the original shipout box contents is set.
+%
+% A void shipout box (that means a discarded page)
+% remains void that means \meta{stuff} is ignored in this case.
+% The box type of \cs{AtBeginShipoutBox} is preserved.
+% Also the box nesting level for the original contents
+% of \cs{AtBeginShipoutBox} remains, for example, to avoid trouble
+% with links across pages in case of \hologo{pdfTeX}.
+%
+% \begin{declcs}{AtBeginShipoutUpperLeft} \M{background material}
+% \end{declcs}
+% This is a macro that puts material in the background of
+% box \cs{AtBeginShipoutBox}.
+% The \meta{background material} is set in an \cs{hbox}, the
+% reference point is the upper left corner of the output page.
+% In case of \pdfTeX\ in PDF mode, the settings of
+% \cs{pdfhorigin} and \cs{pdfvorigin} are respected.
+%
+% The macro \cs{AtBeginShipoutUpperLeft} is intended to be used
+% in one of the hook setting macros, such as
+% \cs{AtBeginShipout}, \cs{AtBeginShipoutFirst}, or
+% \cs{AtBeginShipoutNext}.
+%
+% For \LaTeX\ users the \meta{background material} is set
+% inside a \texttt{picture} environment:
+% \begin{quote}
+% |\begin{picture}(0,0)|\\
+% \mbox{}\quad |\setlength{\unitlength}{1pt}%|\\
+% \mbox{}\quad \meta{background material}\\
+% |\end{picture}|
+% \end{quote}
+%
+% \begin{declcs}{AtBeginShipoutUpperLeftForeground} \M{foreground material}
+% \end{declcs}
+% See \cs{AtBeginShipoutUpperLeft}. The difference is that the material
+% is put in the foreground.
+%
+% \begin{declcs}{AtBeginShipoutOriginalShipout} \meta{box}
+% \end{declcs}
+% It stores the meaning of \cs{shipout} at the time this package
+% is loaded.
+%
+% \begin{declcs}{AtBeginShipoutBoxWidth}\\
+% \cs{AtBeginShipoutBoxHeight}\\
+% \cs{AtBeginShipoutBoxDepth}\\
+% \end{declcs}
+% These macros store the dimensions of the output box \cs{AtBeginShipoutBox}
+% before the original shipout is called. If \cs{shipout} is not
+% redefined before the package loading or the box dimensions
+% are not changed by the redefined \cs{shipout}, these macros
+% contain the dimensions of the shipout box. These values can be
+% remembered by \cs{label} and \cs{ref}. For example, this is done
+% by the package module \xpackage{zref-pagelayout} of project \xpackage{zref}.
+% The dimensions of the shipout page can be used in some \hologo{TeX}
+% engines (\hologo{pdfTeX} in PDF mode, \hologo{XeTeX}) to calculate
+% the media size of the shipout page if \cs{pdfpagewidth} and
+% \cs{pdfpageheight} are not set.
+%
+% \subsection{Examples}
+%
+% \subsubsection{Example: circle in background}
+%
+% In this example we put a circle in the background in the middle
+% of the paper.
+%
+% \begin{macrocode}
+%<*example1>
+% \end{macrocode}
+% \begin{macrocode}
+\documentclass[a4paper]{article}
+\usepackage{color}
+\usepackage{atbegshi}
+% \end{macrocode}
+% Package \xpackage{picture} makes life a little easier, because
+% we can now also use length specifications in |picture|'s commands.
+% \begin{macrocode}
+\usepackage{picture}
+% \end{macrocode}
+% Now we draw the circle in the middle of the paper.
+% \cs{put} moves downwards, because the origin is at the top
+% of the page, not at its bottom.
+% \begin{macrocode}
+\AtBeginShipout{%
+ \AtBeginShipoutUpperLeft{%
+ \put(0.5\paperwidth,-0.5\paperheight){\circle{10}}%
+ }%
+}
+\begin{document}
+\section{Hello World}
+\newpage
+\AtBeginShipoutNext{%
+ \AtBeginShipoutUpperLeft{%
+ \color{red}%
+ \put(0,-0.5\paperheight){\line(1,0){\paperwidth}}%
+ \put(0.5\paperwidth, 0){\line(0,-1){\paperheight}}%
+ }%
+}
+Only on this page we add a red cross.
+\newpage
+This page has the circle only.
+\par
+\vspace{\fill}
+The next page will be discarded.
+\newpage
+\AtBeginShipoutNext{%
+ \AtBeginShipoutDiscard
+}
+This page is discarded.
+\newpage
+The last page.
+\end{document}
+% \end{macrocode}
+% \begin{macrocode}
+%</example1>
+% \end{macrocode}
+%
+% \subsubsection{Example: adding TrimBox for dvipdfmx}
+%
+% Now an example from ``real life'' follows. Someone from the mailing list
+% for dvipdfmx wants to put a TrimBox on every page. If we use
+% \cs{AtBeginShipout}, we have to put the \cs{special} inside the
+% box \cs{AtBeginShipoutBox} that gets shipped out.
+% \begin{macrocode}
+%<*example2>
+\documentclass{minimal}
+\usepackage{atbegshi}
+\usepackage[
+ dvipdfm,
+ paperwidth=630bp,
+ paperheight=810bp
+]{geometry}
+\AtBeginShipout{%
+ \setbox\AtBeginShipoutBox=\hbox{%
+ \special{pdf: put @thispage <</TrimBox[9 9 621 801]>>}%
+ \box\AtBeginShipoutBox
+ }%
+}
+\begin{document}
+ First page
+ \newpage
+ Second page
+\end{document}
+%</example2>
+% \end{macrocode}
+% Remember, in \cs{AtBeginShipoutBoxFirst} the \cs{setbox} wrapper code
+% is implicitly given and the \cs{special} is used directly.
+%
+% \section{Method of \cs{shipout} overloading}
+%
+% \subsection{\cs{shipout}}
+%
+% The \TeX\ primitive command \cs{shipout} takes a box specification
+% and puts the box as a new page in the output file.
+% There are two kinds of box specifications:
+% \begin{description}
+% \item[Direct boxes:]
+% They are given by \cs{hbox}, \cs{vbox}, or \cs{vtop},\\
+% e.g. |\shipout\hbox{Hello World}|.
+% \item[Indirect boxes:]
+% \cs{box} or \cs{copy} references a box register by number.
+% The box register contains the contents of the box.
+%
+% \emph{Note:} \cs{box} also clears the box register globally.
+% \end{description}
+% Then we have to differentiate between void and empty boxes:
+% \begin{description}
+% \item[Void:]
+% Initially or after \cs{box} there is no box in the box register.
+% In this cases the box register is not empty, but \emph{void}.
+% \item[Empty:]
+% A box with empty contents, such as
+% |\hbox{}| (= \cs{null}) or |\vbox{}| is an \emph{empty \cs{hbox}}
+% or \emph{empty \cs{vbox}}. If a box register holds such a
+% box, the box still exists, therefore the box register is
+% \emph{not void}.
+% \end{description}
+%
+% \subsection{\cs{afterassignment}}
+%
+% We want to overload \cs{shipout} to do something with the box.
+% It is quite impossible to do this reliable by catching the box
+% using macro arguments. The
+% variety of box specifications is too large, Examples:
+% \begin{quote}
+% |\shipout\null|\\
+% |\shipout\vbox{...}|\\
+% |\shipout\vtop\bgroup ...\egroup|\\
+% |\shipout\box255|
+% \end{quote}
+% Even worse, the braces don't need to be balanced:
+% \begin{quote}
+% |\shipout\hbox\bgroup}|\\
+% |\shipout\vbox{\egroup|
+% \end{quote}
+% Happily TeX provides a reliable way via \cs{afterassignment}.
+% It takes a macro name and executes it just after the assignment.
+%
+% Now we can redefine \cs{shipout}. The box specification that
+% follows \cs{shipout} is catched by \cs{setbox}. This is an
+% assignment to a box register. \cs{afterassignment}
+% notifies \TeX, that we want to call \cs{@test} right after
+% the assignment:
+%\begin{quote}
+%\begin{verbatim}
+%\shipout :=
+% \afterassignment\@test
+% \setbox\mybox=
+%\end{verbatim}
+%\end{quote}
+% We have seen different box specifications. Indirect boxes are easy
+% to understand:
+% \begin{quote}
+% |\shipout\box0| $\Rightarrow$ |\setbox\mybox=\box0 |\fbox{\cs{@test}}
+% \end{quote}
+% However direct boxes can have arbitrary contents with lots of
+% other assignments. It would be quite inpredictable if \TeX\ would
+% put |\@test| after the first of such an assignment or after the
+% box specification if the box lacks of assignments.
+% Therefore \TeX\ puts |\@test| right at the beginning of the
+% box specification, e.g:
+% \begin{quote}
+% |\shipout\hbox{Hello World}|\\
+% $\Rightarrow$
+% |\setbox\mybox=\hbox{|\fbox{\cs{@test}}| Hello World}|
+% \end{quote}
+%
+% \subsection{Test for direct or indirect boxes}
+%
+% Now we want to execute \cs{@test}, but where are we?
+% We can be after the completed box assignment, if \cs{shipout}
+% was called with an indirect box. Or we are right at the beginning
+% of a direct box.
+%
+% \subsubsection{With \eTeX}
+%
+% With the \eTeX's extensions the answer is very easy:
+% Being inside the direct box means that we are inside a new group.
+% The new primitive command \cs{currentgrouplevel} tells how
+% deeply the groups are currently nested. Macro \cs{@test} just
+% compares the previously stored group level with the current one:
+%\begin{quote}
+%\begin{verbatim}
+%\shipout :=
+% \edef\saved@grouplevel{\number\currentgrouplevel}
+% \afterassignment\@test
+% \setbox\mybox=
+%
+%\@test :=
+% \ifnum\saved@grouplevel=\currentgrouplevel
+% % case: indirect box, the assignment is completed
+% \@output
+% \else
+% % case: direct box, we are inside the box
+% \aftergroup\@outbox
+% \fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{Without \eTeX}
+%
+% Life becomes complicate without \eTeX. We cannot ask the
+% group level. However, if we are inside a direct box,
+% the box register \cs{mybox} is not yet changed by \cs{setbox}.
+% Thus we need a special initial value and compare
+% it in \cs{@test} with the current value of the box.
+%
+% What can be used as initial value? Arbitrary box contents cannot
+% be compared. \TeX\ only tells us a few properties:
+% \begin{itemize}
+% \item Box type:\cs{ifhbox}, \cs{ifvbox}
+% \item Dimensions: \cs{wd}, \cs{ht}, \cs{dp}
+% \item Voidness: \cs{ifvoid}
+% \end{itemize}
+% Unhappily all these qualities even combined are not sufficient
+% for constructing an initial box value, because \cs{shipout} can be
+% called with a box that is accidently just the same as the choosen
+% initial value.
+%
+% Nevertheless we have two alternatives for an initial value:
+% \begin{itemize}
+% \item A box of some type with some funny settings that are
+% unlikely to occur in real life, e.g a height of |4911sp-\maxdimen|.
+% \item A void box.
+% \end{itemize}
+% A collision between this initial value and an indirect \cs{shipout}
+% box with just the same value is possible.
+% Then \cs{@test} will make a wrong decision that it is executed
+% inside a direct box and delays \cs{@output} by \cs{aftergroup}.
+% Thus \cs{@output} is not called at the place we want.
+% In contrary, the result is an uncertainty about the place:
+% \begin{itemize}
+% \item \cs{shipout} is used in a group that perhaps closes some
+% pages later. A bad place for \cs{@output}.
+% \item Without a surrounding group \cs{aftergroup} effectively kills
+% its argument.
+% \end{itemize}
+% In the first case of a box with special dimensions we can even loose
+% the page. However in the case of the void box, this effect is even
+% desired, because the original \cs{shipout} does not output void boxes.
+% All we have to do is to ensure that our box \cs{mybox} is always
+% void except for the phase when the overloaded \cs{shipout} is executed.
+% And secondly we must keep this semantics of \cs{shipout} for the void case
+% in our macros, namely \cs{@output}.
+%\begin{quote}
+%\begin{verbatim}
+%\shipout :=
+% % trick to get a void box \mybox
+% \begingroup
+% \setbox\mybox=\box\mybox
+% \endgroup
+% \afterassignment\@test
+% \setbox\mybox=
+%
+%\@test :=
+% \ifvoid\mybox
+% \aftergroup\@output
+% \else
+% \@output
+% \fi
+%\end{verbatim}
+%\end{quote}
+% The nasty case is |\shipout\box\voidb@x| where the indirect box
+% is void and that must not generate an output page.
+% If a surrounding group is missing the output is ignored
+% because of \cs{aftergroup}.
+% Otherwise \@output is called some time
+% later when the surrounding group closes.
+% But \cs{mybox} is void outside the execution phase
+% of the redefined \cs{shipout}. Also \cs{@output} checks for a
+% void box and cancels the page output.
+% The disadvantage remains that the hook in \cs{@output} is called
+% for a page that will not be output.
+%
+% \subsubsection{\cs{lastkern} method}
+%
+% At the beginning of a new box, there is no \cs{kern}, the contents
+% of the box is still empty and \cs{lastkern} returns 0\,pt.
+% This can be used to distinguish between direct and indirect boxes:
+% We execute \cs{setbox} in a box with a preceding non-zero kern.
+% After an indirect box, \cs{lastkern} sees this kern, otherwise
+% it returns 0\,pt.
+%\begin{quote}
+%\begin{verbatim}
+%\shipout :=
+% \begingroup
+% \setbox\mybox=\hbox\bgroup
+% \kern1pt
+% \afterassignment\shipout@test
+% \global\setbox\mybox=
+%\@test :=
+% \ifdim\lastkern=0pt
+% % direct box
+% \aftergroup\egroup
+% \aftergroup\endgroup
+% \aftergroup\@output
+% \else
+% \egroup
+% \endgroup
+% \@output
+% \fi
+%\end{verbatim}
+%\end{quote}
+% We have two \cs{setbox} commands. The first creates a controlled
+% context box where we can safely insert a \cs{kern}. We get rid of
+% this temporarily used context box by putting the local \cs{setbox}
+% in a group.
+%
+% After the group we want to have our shipout box in \cs{mybox}.
+% Therefore we use a global assignment here.
+%
+% \subsection{Output}
+%
+% With or without \eTeX\ we ensure the original behaviour of
+% \cs{shipout} that void boxes do not generate output pages.
+%
+% Now we can place the hook \cs{@hook} for the user code that
+% wants to manipulate the output box.
+%\begin{quote}
+%\begin{verbatim}
+%\@output :=
+% \ifvoid\mybox
+% % cancel output of void box
+% \else
+% \@hook
+% \ifvoid\mybox
+% % user code in \@hook could has voided the box
+% \else
+% \original@shipout\box\mybox
+% \fi
+% \fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsection{Separate box register}
+%
+% So far we have said nothing about the box number of \cs{mybox}.
+% The following case that outputs the same page twice
+% shows that we are not free in the use
+% of the box register:
+% \begin{quote}
+% |\shipout\copy<num> \shipout\box<num>|
+% \end{quote}
+% We manipulate the box by the hook and without \eTeX\ the box
+% must even be voided. However, the use case above requires that
+% the box contents does not change at all. Therefore we must
+% reserve a separate box register to avoid collisions with
+% user box registers.
+%
+% \emph{Note:} Box register number 255 is special for the output
+% routine, because TeX complains if this box is not voided
+% by the output routine.
+% However, this requirement does not apply to \cs{shipout} at all.
+% In fact \cs{shipout} does not change any box register. This is
+% usually done by a call of \cs{box}, but the output routine
+% can do it later \emph{after} invoking of \cs{shipout}.
+%
+% \subsection{Summary}
+%
+% \subsubsection{With \eTeX}
+%
+% Putting the pieces together we get for \eTeX:
+%\begin{quote}
+%\begin{verbatim}
+%\newbox\mybox
+%\let\original@shipout\shipout
+%
+%\shipout :=
+% \edef\saved@grouplevel{\number\currentgrouplevel}
+% \afterassignment\@test
+% \setbox\mybox=
+%
+%\@test :=
+% \ifnum\saved@grouplevel<\currentgrouplevel
+% \expandafter\aftergroup
+% \fi
+% \@output
+%
+%\@output :=
+% \ifvoid\mybox
+% % cancel output of void box
+% \else
+% \@hook
+% \ifvoid\mybox
+% % user code in \@hook could have voided the box
+% \else
+% \original@shipout\box\mybox
+% \fi
+% \fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{Without \eTeX, traditional way}
+%
+% And for \TeX\ without \eTeX:
+%\begin{quote}
+%\begin{verbatim}
+%\newbox\mybox
+%\begingroup
+% \setbox\mybox=\box\mybox % ensure \mybox is void
+%\endgroup
+%\let\original@shipout\shipout
+%
+%\shipout :=
+% % trick to get a void box \mybox
+% \begingroup
+% \setbox\mybox=\box\mybox
+% \endgroup
+% \afterassignment\@test
+% \setbox\mybox=
+%
+%\@test :=
+% \ifvoid\mybox
+% \expandafter\aftergroup
+% \fi
+% \@output
+%
+%\@output :=
+% \ifvoid\mybox
+% % cancel output of void box
+% \else
+% \@hook
+% \ifvoid\mybox
+% % user code in \@hook could have voided the box
+% \else
+% \original@shipout\box\mybox
+% \fi
+% \fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\cs{lastkern} method}
+%
+% And for \TeX\ without \eTeX\ using the \cs{lastkern} method:
+%\begin{quote}
+%\begin{verbatim}
+%\newbox\mybox
+%\let\original@shipout\shipout
+%
+%\shipout :=
+% \begingroup
+% \setbox\mybox=\hbox\bgroup
+% \kern1pt
+% \afterassignment\@test
+% \setbox\mybox=
+%
+%\@test :=
+% \ifdim\lastkern=0pt
+% \expandafter\aftergroup
+% \fi
+% \@output
+%
+%\@output :=
+% \egroup
+% \endgroup
+% \ifvoid\mybox
+% % cancel output of void box
+% \else
+% \@hook
+% \ifvoid\mybox
+% % user code in \@hook could have voided the box
+% \else
+% \original@shipout\box\mybox
+% \fi
+% \fi
+%\end{verbatim}
+%\end{quote}
+%
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% Package \xpackage{atbegshi} uses \eTeX's \cs{currentgrouplevel},
+% if it is available. Otherwise the \cs{lastkern} method is used.
+%
+% \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@atbegshi.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{atbegshi}{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@atbegshi.sty\endcsname
+\ProvidesPackage{atbegshi}%
+ [2016/06/09 v1.18 At begin shipout hook (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 AtBegShi@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\AtBegShi@AtEnd{%
+ \AtBegShi@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^(superscript)
+\TMP@EnsureCode{96}{12}% `
+\edef\AtBegShi@AtEnd{\AtBegShi@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Preparations}
+%
+% \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{ltxcmds}[2010/03/01]%
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{ltxcmds}[2010/03/01]%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\AtBegShi@CheckDefinable}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname @ifdefinable\endcsname\relax
+ \def\AtBegShi@CheckDefinable#1{%
+ \ifcase\ifx#1\relax
+ \ltx@one
+ \else
+ \ifx#1\@undefined
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \fi
+ \@PackageError{atbegshi}{%
+ \string#1\space is already defined%
+ }\@ehd
+ \fi
+ }%
+\else
+ \def\AtBegShi@CheckDefinable#1{%
+ \@ifdefinable{#1}{}%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifAtBegShi@Discarded}
+% \begin{macrocode}
+\ltx@newif\ifAtBegShi@Discarded
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBeginShipoutDiscard}
+% \begin{macrocode}
+\AtBegShi@CheckDefinable\AtBeginShipoutDiscard
+\def\AtBeginShipoutDiscard{%
+ \deadcycles=\ltx@zero
+ \global\AtBegShi@Discardedtrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname currentgrouplevel\endcsname\relax
+ \catcode`X=9 % ignore
+ \catcode`E=14 % comment
+\else
+ \catcode`X=14 % comment
+ \catcode`E=9 % ignore
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\AtBegShi@Shipout}
+% \begin{macrocode}
+\def\AtBegShi@Shipout{%
+X \begingroup
+X \setbox\AtBeginShipoutBox=\hbox\bgroup
+X \kern\p@
+E \edef\AtBegShi@GroupLevel{\number\currentgrouplevel}%
+ \afterassignment\AtBegShi@Test
+X \global
+ \setbox\AtBeginShipoutBox=%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBegShi@Test}
+% \begin{macrocode}
+\def\AtBegShi@Test{%
+X \ifdim\lastkern=0pt %
+E \ifnum\AtBegShi@GroupLevel<\currentgrouplevel
+ \expandafter\aftergroup
+ \fi
+ \AtBegShi@Output
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBegShi@Output}
+% \begin{macrocode}
+\def\AtBegShi@Output{%
+X \egroup
+X \endgroup
+ \ifvoid\AtBeginShipoutBox
+ \@PackageWarning{atbegshi}{Ignoring void shipout box}%
+ \else
+ \let\AtBegShi@OrgProtect\protect
+ \csname set@typeset@protect\endcsname
+ \global\AtBegShi@Discardedfalse
+ \AtBegShi@Hook
+ \expandafter\gdef\expandafter\AtBegShi@HookNext
+ \expandafter{\expandafter}%
+ \AtBegShi@HookNext
+ \ifAtBegShi@Discarded
+ \@PackageInfoNoLine{atbegshi}{Shipout page discarded}%
+ \global\AtBegShi@Discardedfalse
+ \begingroup
+ \setbox\AtBeginShipoutBox\box\AtBeginShipoutBox
+ \endgroup
+ \let\protect\AtBegShi@OrgProtect
+ \else
+ \AtBegShi@First
+ \let\protect\AtBegShi@OrgProtect
+ \AtBegShi@GetBoxSize\AtBeginShipoutBox
+ \ltx@ifundefined{AtNextShipout}{%
+ }{%
+ \AtNextShipout{\AtBegShi@GetBoxSize\@cclv}%
+ }%
+ \AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBegShi@GetBoxSize}
+% \begin{macrocode}
+\def\AtBegShi@GetBoxSize#1{%
+ \xdef\AtBeginShipoutBoxWidth{\the\wd#1}%
+ \xdef\AtBeginShipoutBoxHeight{\the\ht#1}%
+ \xdef\AtBeginShipoutBoxDepth{\the\dp#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBeginShipoutBoxWidth}
+% \begin{macrocode}
+\def\AtBeginShipoutBoxWidth{0pt}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBeginShipoutBoxHeight}
+% \begin{macrocode}
+\def\AtBeginShipoutBoxHeight{0pt}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBeginShipoutBoxDepth}
+% \begin{macrocode}
+\def\AtBeginShipoutBoxDepth{0pt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\catcode`\X=11 %
+\catcode`\E=11 %
+% \end{macrocode}
+%
+% \begin{macro}{\AtBegShi@First}
+% \begin{macrocode}
+\def\AtBegShi@First{%
+ \ifx\AtBegShi@HookFirst\ltx@empty
+ \else
+ \AtBeginShipoutAddToBox{\AtBegShi@HookFirst}%
+ \fi
+ \global\let\AtBegShi@First\ltx@empty
+ \global\let\AtBeginShipoutFirst\AtBegShi@FirstDisabled
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBegShi@Hook}
+% \begin{macrocode}
+\gdef\AtBegShi@Hook{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBegShi@HookNext}
+% \begin{macrocode}
+\gdef\AtBegShi@HookNext{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBegShi@HookFirst}
+% \begin{macrocode}
+\gdef\AtBegShi@HookFirst{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBeginShipout}
+% \begin{macrocode}
+\AtBegShi@CheckDefinable\AtBeginShipout
+\def\AtBeginShipout{%
+ \AtBegShi@AddHook\AtBegShi@Hook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBeginShipoutNext}
+% \begin{macrocode}
+\AtBegShi@CheckDefinable\AtBeginShipoutNext
+\def\AtBeginShipoutNext{%
+ \AtBegShi@AddHook\AtBegShi@HookNext
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBeginShipoutFirst}
+% \begin{macrocode}
+\AtBegShi@CheckDefinable\AtBeginShipoutFirst
+\def\AtBeginShipoutFirst{%
+ \AtBegShi@AddTo\AtBegShi@HookFirst
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBegShi@FirstDisabled}
+% \begin{macrocode}
+\long\def\AtBegShi@FirstDisabled#1{%
+ \@PackageWarning{atbegshi}{%
+ First page is already shipped out, ignoring\MessageBreak
+ \string\AtBeginShipoutFirst
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBegShi@AddTo}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname g@addto@macro\endcsname\relax
+ \long\def\AtBegShi@AddTo#1#2{%
+ \begingroup
+ \toks\ltx@zero\expandafter{#1#2}%
+ \xdef#1{\the\toks\ltx@zero}%
+ \endgroup
+ }%
+\else
+ \let\AtBegShi@AddTo\g@addto@macro
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBegShi@AddHook}
+% \begin{macrocode}
+\long\def\AtBegShi@AddHook#1#2{%
+ \AtBegShi@AddTo#1{\AtBegShi@Item{#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBegShi@Item}
+% \begin{macrocode}
+\long\def\AtBegShi@Item#1{%
+ \ifAtBegShi@Discarded
+ \else
+ #1%
+ \ifAtBegShi@Discarded
+ \else
+ \ifvoid\AtBeginShipoutBox
+ \@PackageWarning{atbegshi}{%
+ Shipout box was voided by hook,\MessageBreak
+ ignoring shipout box%
+ }%
+ \AtBeginShipoutDiscard
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginShipoutInit}
+% \begin{macrocode}
+\AtBegShi@CheckDefinable\AtBeginShipoutInit
+\def\AtBeginShipoutInit{%
+ \ltx@IfUndefined{newbox}{%
+ \@PackageError{atbegshi}{%
+ \string\AtBeginShipoutInit\space failed\MessageBreak
+ because of missing \expandafter\string\csname newbox\endcsname
+ }\@ehc
+ }{%
+ \csname newbox\endcsname\AtBeginShipoutBox
+ \AtBegShi@CheckDefinable\AtBeginShipoutOriginalShipout
+ \global\let\AtBeginShipoutOriginalShipout\shipout
+ \global\let\shipout\AtBegShi@Shipout
+ }%
+ \gdef\AtBeginShipoutInit{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname AtBeginDocument\endcsname\relax
+ \AtBeginShipoutInit
+\else
+ \AtBeginDocument{\AtBeginShipoutInit}%
+\fi
+% \end{macrocode}
+%
+% \subsection{Additions to the shipout box}
+%
+% \begin{macro}{\AtBeginShipoutAddToBox}
+% \begin{macrocode}
+\def\AtBeginShipoutAddToBox#1{%
+ \ifhbox\AtBeginShipoutBox
+ \edef\AtBegShi@restore{%
+ \hfuzz=\the\hfuzz\relax
+ \hbadness=\the\hbadness\relax
+ }%
+ \hfuzz=1073741823sp\relax
+ \hbadness=2147483647\relax
+ \setbox\AtBeginShipoutBox=\hbox to \wd\AtBeginShipoutBox{%
+ \setbox\ltx@zero=\hbox{%
+ \begingroup
+ \AtBegShi@restore
+ #1%
+ \endgroup
+ }%
+ \wd\ltx@zero=0pt\relax
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \raise\ht\AtBeginShipoutBox\copy\ltx@zero
+ \unhcopy\AtBeginShipoutBox
+ }%
+ \AtBegShi@restore
+ \else
+ \ifvbox\AtBeginShipoutBox
+ \edef\AtBegShi@restore{%
+ \vfuzz=\the\vfuzz\relax
+ \vbadness=\the\vbadness\relax
+ \dimen\ltx@zero=\the\dimen\ltx@zero\relax
+ }%
+ \edef\AtBegShi@restorebox{%
+ \ht\AtBeginShipoutBox=\the\ht\AtBeginShipoutBox\relax
+ \dp\AtBeginShipoutBox=\the\dp\AtBeginShipoutBox\relax
+ }%
+ \vfuzz=1073741823sp\relax
+ \vbadness=2147483647\relax
+ \dimen\ltx@zero=\ht\AtBeginShipoutBox
+ \advance\dimen\ltx@zero by \dp\AtBeginShipoutBox
+ \setbox\AtBeginShipoutBox=\vbox to \dimen\ltx@zero{%
+ \setbox\ltx@zero=\hbox{%
+ \begingroup
+ \AtBegShi@restore
+ #1%
+ \endgroup
+ }%
+ \wd\ltx@zero=0pt\relax
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \baselineskip=0pt\relax
+ \lineskip=0pt\relax
+ \lineskiplimit=0pt\relax
+ \copy\ltx@zero
+ \unvbox\AtBeginShipoutBox
+ \kern0pt%
+ }%
+ \AtBegShi@restore
+ \AtBegShi@restorebox
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginShipoutAddToBoxForeground}
+% \begin{macrocode}
+\def\AtBeginShipoutAddToBoxForeground#1{%
+ \ifhbox\AtBeginShipoutBox
+ \edef\AtBegShi@restore{%
+ \hfuzz=\the\hfuzz\relax
+ \hbadness=\the\hbadness\relax
+ }%
+ \hfuzz=1073741823sp\relax
+ \hbadness=2147483647\relax
+ \setbox\AtBeginShipoutBox=\hbox to \wd\AtBeginShipoutBox{%
+ \unhcopy\AtBeginShipoutBox
+ \kern-\wd\AtBeginShipoutBox
+ \setbox\ltx@zero=\hbox{%
+ \begingroup
+ \AtBegShi@restore
+ #1%
+ \endgroup
+ }%
+ \wd\ltx@zero=0pt\relax
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \raise\ht\AtBeginShipoutBox\copy\ltx@zero
+ \kern\wd\AtBeginShipoutBox
+ }%
+ \AtBegShi@restore
+ \else
+ \ifvbox\AtBeginShipoutBox
+ \edef\AtBegShi@restore{%
+ \vfuzz=\the\vfuzz\relax
+ \vbadness=\the\vbadness\relax
+ \dimen\ltx@zero=\the\dimen\ltx@zero\relax
+ }%
+ \edef\AtBegShi@restorebox{%
+ \ht\AtBeginShipoutBox=\the\ht\AtBeginShipoutBox\relax
+ \dp\AtBeginShipoutBox=\the\dp\AtBeginShipoutBox\relax
+ }%
+ \vfuzz=1073741823sp\relax
+ \vbadness=2147483647\relax
+ \dimen\ltx@zero=\ht\AtBeginShipoutBox
+ \advance\dimen\ltx@zero by \dp\AtBeginShipoutBox
+ \setbox\AtBeginShipoutBox=\vbox to \dimen\ltx@zero{%
+ \setbox\ltx@zero=\hbox{%
+ \begingroup
+ \AtBegShi@restore
+ #1%
+ \endgroup
+ }%
+ \wd\ltx@zero=0pt\relax
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \baselineskip=0pt\relax
+ \lineskip=0pt\relax
+ \lineskiplimit=0pt\relax
+ \unvbox\AtBeginShipoutBox
+ \kern-\dimen\ltx@zero
+ \copy\ltx@zero
+ \kern\dimen\ltx@zero
+ }%
+ \AtBegShi@restore
+ \AtBegShi@restorebox
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Positioning}
+%
+% \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{ifpdf}[2011/01/30]%
+\else
+ \RequirePackage{ifpdf}[2011/01/30]%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifpdf
+ \def\AtBegShi@horigin{%
+ \ifx\pdfhorigin\@undefined\pdfvariable horigin\else\pdfhorigin\fi}%
+ \def\AtBegShi@vorigin{%
+ \ifx\pdfvorigin\@undefined\pdfvariable vorigin\else\pdfvorigin\fi}%
+\else
+ \def\AtBegShi@horigin{72.27pt}%
+ \def\AtBegShi@vorigin{72.27pt}%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begingroup
+\ifcase
+ \expandafter\ifx\csname picture\endcsname\relax
+ 1%
+ \else
+ \expandafter\ifx\csname endpicture\endcsname\relax
+ 1%
+ \else
+ 0%
+ \fi
+ \fi
+ \endgroup
+ \def\AtBegShi@BeginPicture{%
+ \begingroup
+ \picture(0,0)\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname unitlength\endcsname\relax
+ \else
+ \unitlength=1pt\relax
+ \fi
+ \ignorespaces
+ }%
+ \def\AtBegShi@EndPicture{%
+ \endpicture
+ \endgroup
+ }%
+\else
+ \endgroup
+ \def\AtBegShi@BeginPicture{%
+ \setbox\ltx@zero=\hbox\bgroup
+ \begingroup
+ \ignorespaces
+ }%
+ \def\AtBegShi@EndPicture{%
+ \endgroup
+ \egroup
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \copy\ltx@zero
+ }%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\AtBeginShipoutUpperLeft}
+% A surrounding \cs{rlap} is not necessary, because
+% the stuff is put in an \cs{hbox} with zero width.
+% \begin{macrocode}
+\def\AtBeginShipoutUpperLeft#1{%
+ \AtBeginShipoutAddToBox{%
+ \kern-\AtBegShi@horigin\relax
+ \vbox to 0pt{%
+ \kern-\AtBegShi@vorigin\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginShipoutUpperLeftForeground}
+% \begin{macrocode}
+\def\AtBeginShipoutUpperLeftForeground#1{%
+ \AtBeginShipoutAddToBoxForeground{%
+ \kern-\AtBegShi@horigin\relax
+ \vbox to 0pt{%
+ \kern-\AtBegShi@vorigin\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Patches}
+%
+% Patches for \LaTeX\ packages that redefine \cs{shipout}.
+% \LaTeX\ is now supposed to use \eTeX. Thus we do not patch,
+% without \LaTeX\ and \eTeX.
+% \begin{macrocode}
+\def\AtBegShi@AbortIfUndefined#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname#1\endcsname\relax
+ \expandafter\AtBegShi@AtEnd
+ \fi
+}
+\AtBegShi@AbortIfUndefined{currentgrouplevel}%
+\AtBegShi@AbortIfUndefined{AtBeginDocument}%
+\AtBegShi@AbortIfUndefined{@ifpackageloaded}%
+\AtBegShi@AbortIfUndefined{@ifclassloaded}%
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{crop}}
+%
+% Fix of method and box.
+% \begin{macrocode}
+\def\AtBegShi@PatchCrop{%
+ \begingroup
+ \def\AtBegShi@Crop@shipout{%
+ \afterassignment\CROP@ship
+ \setbox\@cclv=%
+ }%
+ \def\AtBegShi@Crop@ship{%
+ \ifvoid\@cclv
+ \expandafter\aftergroup
+ \fi
+ \CROP@@ship
+ }%
+ \def\AtBegShi@Crop@shiplist{%
+ \lineskip\z@
+ \lineskiplimit\z@
+ \baselineskip\z@
+ \CROP@kernel
+ \box\@cclv
+ }%
+ \def\AtBegShi@Crop@@ship{%
+ \CROP@shipout\vbox{%
+ \CROP@shiplist
+ }%
+ }%
+ \ifx\AtBegShi@Crop@ship\CROP@ship
+ \ifx\AtBegShi@Crop@shiplist\CROP@shiplist
+ \ifx\AtBegShi@Crop@@ship\CROP@@ship
+ \let\AtBegShi@found\relax
+ \ifx\shipout\AtBegShi@Crop@shipout
+ \def\AtBegShi@found{\shipout}%
+ \else\ifx\AtBeginShipoutOriginalShipout\AtBegShi@Crop@shipout
+ \def\AtBegShi@found{\AtBeginShipoutOriginalShipout}%
+ \else\ifx\@EveryShipout@Org@Shipout\AtBegShi@Crop@shipout
+ \def\AtBegShi@found{\@EveryShipout@Org@Shipout}%
+ \else\ifx\GPTorg@shipout\AtBegShi@Crop@shipout
+ \def\AtBegShi@found{\GPTorg@shipout}%
+ \else\ifx\THBorg@shipout\AtBegShi@Crop@shipout
+ \def\AtBegShi@found{\THBorg@shipout}%
+ \else\ifx\mem@oldshipout\AtBegShi@Crop@shipout
+ \def\AtBegShi@found{\mem@oldshipout}%
+ \fi\fi\fi\fi\fi\fi
+ \ifx\AtBegShi@found\relax
+ \else
+ \expandafter\endgroup
+ \expandafter\def\AtBegShi@found{%
+ \edef\AtBegShi@GroupLevel{\number\currentgrouplevel}%
+ \afterassignment\CROP@ship
+ \setbox\AtBeginShipoutBox=%
+ }%
+ \def\CROP@ship{%
+ \ifnum\AtBegShi@GroupLevel=\currentgrouplevel
+ \else
+ \expandafter\aftergroup
+ \fi
+ \CROP@@ship
+ }%
+ \def\CROP@shiplist{%
+ \lineskip 0pt\relax
+ \lineskiplimit 0pt\relax
+ \baselineskip 0pt\relax
+ \CROP@kernel
+ \box\AtBeginShipoutBox
+ }%
+ \def\CROP@@ship{%
+ \ifvoid\AtBeginShipoutBox
+ \else
+ \setbox\AtBeginShipoutBox=\vbox{%
+ \CROP@shiplist
+ }%
+ \AtBegShi@GetBoxSize\AtBeginShipoutBox
+ \expandafter\CROP@shipout
+ \expandafter\box
+ \expandafter\AtBeginShipoutBox
+ \fi
+ }%
+ \@PackageInfoNoLine{atbegshi}{Package `crop' patched}%
+ \begingroup
+ \fi
+ \fi
+ \fi
+ \fi
+ \endgroup
+ \let\AtBegShi@PatchCrop\relax
+}
+\@ifpackageloaded{crop}{%
+ \AtBegShi@PatchCrop
+}{%
+ \AtBeginDocument{\AtBegShi@PatchCrop}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{everyshi}}
+%
+% Fix of method. Use of box 255 is not changed.
+% \begin{macrocode}
+\def\AtBegShi@PatchEveryshi{%
+ \begingroup
+ \long\def\AtBegShi@Everyshi@shipout{%
+ \afterassignment\@EveryShipout@Test
+ \global\setbox\@cclv= %
+ }%
+ \long\def\AtBegShi@Everyshi@Test{%
+ \ifvoid\@cclv\relax
+ \aftergroup\@EveryShipout@Output
+ \else
+ \@EveryShipout@Output
+ \fi
+ }%
+ \ifx\AtBegShi@Everyshi@Test\@EveryShipout@Test
+ \let\AtBegShi@found\relax
+ \ifx\shipout\AtBegShi@Everyshi@shipout
+ \def\AtBegShi@found{\shipout}%
+ \else\ifx\AtBeginShipoutOriginalShipout\AtBegShi@Everyshi@shipout
+ \def\AtBegShi@found{\AtBeginShipoutOriginalShipout}%
+ \else\ifx\CROP@shipout\AtBegShi@Everyshi@shipout
+ \def\AtBegShi@found{\CROP@shipout}%
+ \else\ifx\GPTorg@shipout\AtBegShi@Everyshi@shipout
+ \def\AtBegShi@found{\GPTorg@shipout}%
+ \else\ifx\THBorg@shipout\AtBegShi@Everyshi@shipout
+ \def\AtBegShi@found{\THBorg@shipout}%
+ \else\ifx\mem@oldshipout\AtBegShi@Everyshi@shipout
+ \def\AtBegShi@found{\mem@oldshipout}%
+ \else
+ \expandafter\ifx\csname @EveryShipout@Org@Shipout\endcsname
+ \relax
+ \ifx\@EveryShipout@Shipout\AtBegShi@Everyshi@shipout
+ \def\AtBegShi@found{\@EveryShipout@Shipout}%
+ \fi
+ \fi
+ \fi\fi\fi\fi\fi\fi
+ \ifx\AtBegShi@found\relax
+ \else
+ \expandafter\endgroup
+ \expandafter\def\AtBegShi@found{%
+ \edef\AtBegShi@GroupLevel{\number\currentgrouplevel}%
+ \afterassignment\@EveryShipout@Test
+ \setbox\AtBeginShipoutBox=%
+ }%
+ \def\@EveryShipout@Test{%
+ \ifnum\AtBegShi@GroupLevel=\currentgrouplevel
+ \else
+ \expandafter\aftergroup
+ \fi
+ \AtBegShi@Everyshi@Output
+ }%
+ \def\AtBegShi@Everyshi@Output{%
+ \ifvoid\AtBeginShipoutBox
+ \else
+ \global\setbox\ltx@cclv\box\AtBeginShipoutBox
+ \expandafter\@EveryShipout@Output
+ \fi
+ }%
+ \@PackageInfoNoLine{atbegshi}{Package `everyshi' patched}%
+ \begingroup
+ \fi
+ \fi
+ \endgroup
+ \let\AtBegShi@PatchEveryshi\relax
+}
+\@ifpackageloaded{everyshi}{%
+ \AtBegShi@PatchEveryshi
+}{%
+ \AtBeginDocument{\AtBegShi@PatchEveryshi}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Class \xpackage{memoir}}
+%
+% Fix of method and box.
+% \begin{macrocode}
+\def\AtBegShi@PatchMemoir{%
+ \begingroup
+ \def\AtBegShi@Memoir@shipout{%
+ \afterassignment\mem@shipi
+ \setbox\@cclv=%
+ }%
+ \def\AtBegShi@Memoir@shipi{%
+ \ifvoid\@cclv
+ \expandafter\aftergroup
+ \fi
+ \mem@shipii
+ }%
+ \def\AtBegShi@Memoir@shipiiA{%
+ \mem@oldshipout\vbox{%
+ \trimmarks
+ \unvbox\@cclv
+ }%
+ }%
+ \def\AtBegShi@Memoir@shipiiB{%
+ \ifvoid\@cclv
+ \mem@oldshipout\box\@cclv
+ \else
+ \mem@oldshipout\vbox{%
+ \trimmarks
+ \unvbox\@cclv
+ }%
+ \fi
+ }%
+ \def\AtBegShi@Memoir@PatchAB{%
+ \ifvoid\AtBeginShipoutBox
+ \else
+ \setbox\AtBeginShipoutBox=\vbox{%
+ \trimmarks
+ \ifvbox\AtBeginShipoutBox
+ \unvbox\AtBeginShipoutBox
+ \else
+ \box\AtBeginShipoutBox
+ \fi
+ }%
+ \AtBegShi@GetBoxSize\AtBeginShipoutBox
+ \expandafter\mem@oldshipout
+ \expandafter\box
+ \expandafter\AtBeginShipoutBox
+ \fi
+ }%
+ \def\AtBegShi@Memoir@shipiiC{% 2008/08/07 v1.6180339a
+ \ifvoid\@cclv
+ \mem@oldshipout\box\@cclv
+ \else
+ \ifshowtrims
+ \mem@oldshipout\vbox{\trimmarks\unvbox\@cclv}%
+ \else
+ \mem@oldshipout\box\@cclv
+ \fi
+ \fi
+ }%
+ \def\AtBegShi@Memoir@shipiiD{% 2011/03/06 v3.6j
+ \ifvoid\@cclv
+ \mem@oldshipout\box\@cclv
+ \else
+ \ifshowtrims
+ \mem@oldshipout\vbox{%
+ \trimmarks
+ \nointerlineskip
+ \box\@cclv
+ }%
+ \else
+ \mem@oldshipout\box\@cclv
+ \fi
+ \fi
+ }%
+ \def\AtBegShi@Memoir@PatchCD{%
+ \ifvoid\AtBeginShipoutBox
+ \else
+ \ifshowtrims
+ \setbox\AtBeginShipoutBox=\vbox{%
+ \trimmarks
+ \nointerlineskip
+ \box\AtBeginShipoutBox
+ }%
+ \fi
+ \AtBegShi@GetBoxSize\AtBeginShipoutBox
+ \expandafter\mem@oldshipout
+ \expandafter\box
+ \expandafter\AtBeginShipoutBox
+ \fi
+ }%
+ \ifx\AtBegShi@Memoir@shipi\mem@shipi
+ \let\AtBegShi@found\ltx@one
+ \ifx\AtBegShi@Memoir@shipiiA\mem@shipii
+ \let\AtBegShi@found\ltx@zero
+ \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchAB
+ \else\ifx\AtBegShi@Memoir@shipiiB\mem@shipii
+ \let\AtBegShi@found\ltx@zero
+ \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchAB
+ \else\ifx\AtBegShi@Memoir@shipiiC\mem@shipii
+ \let\AtBegShi@found\ltx@zero
+ \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchCD
+ \else\ifx\AtBegShi@Memoir@shipiiD\mem@shipii
+ \let\AtBegShi@found\ltx@zero
+ \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchCD
+ \fi\fi\fi\fi
+ \ifcase\AtBegShi@found
+ \let\AtBegShi@found\relax
+ \ifx\shipout\AtBegShi@Memoir@shipout
+ \def\AtBegShi@found{\shipout}%
+ \else\ifx\AtBeginShipoutOriginalShipout\AtBegShi@Memoir@shipout
+ \def\AtBegShi@found{\AtBeginShipoutOriginalShipout}%
+ \else\ifx\CROP@shipout\AtBegShi@Memoir@shipout
+ \def\AtBegShi@found{\CROP@shipout}%
+ \else\ifx\GPTorg@shipout\AtBegShi@Memoir@shipout
+ \def\AtBegShi@found{\GPTorg@shipout}%
+ \else\ifx\THBorg@shipout\AtBegShi@Memoir@shipout
+ \def\AtBegShi@found{\THBorg@shipout}%
+ \else\ifx\@EveryShipout@Org@Shipout\AtBegShi@Memoir@shipout
+ \def\AtBegShi@found{\@EveryShipout@Org@Shipout}%
+ \fi\fi\fi\fi\fi\fi
+ \ifx\AtBegShi@found\relax
+ \else
+ \expandafter\endgroup
+ \expandafter\def\AtBegShi@found{%
+ \edef\AtBegShi@GroupLevel{\number\currentgrouplevel}%
+ \afterassignment\mem@shipi
+ \setbox\AtBeginShipoutBox=%
+ }%
+ \def\mem@shipi{%
+ \ifnum\AtBegShi@GroupLevel=\currentgrouplevel
+ \else
+ \expandafter\aftergroup
+ \fi
+ \mem@shipii
+ }%
+ \let\mem@shipii\AtBegShi@Memoir@PatchX
+ \@PackageInfoNoLine{atbegshi}{Class `memoir' patched}%
+ \begingroup
+ \fi
+ \fi
+ \fi
+ \endgroup
+ \let\AtBegShi@PatchMemoir\relax
+}
+\@ifclassloaded{memoir}{%
+ \AtBegShi@PatchMemoir
+}{%
+ \AtBeginDocument{\AtBegShi@PatchMemoir}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\AtBegShi@AtEnd%
+%</package>
+% \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 atbegshi.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test2>
+\input atbegshi.sty\relax
+\def\msg#{\immediate\write16}
+\msg{File: atbegshi-test2.tex 2016/06/09 v1.18 Test file for plain-TeX}
+\def\testmsg#1#2{%
+ \msg{}%
+ \msg{*** Test with box (#1), expected page output [#2]}% hash-ok
+}
+
+\newbox\voidbox
+\def\void{\box\voidbox}
+\begingroup
+ \setbox\voidbox=\void
+\endgroup
+
+\count0=0\relax
+\AtBeginShipout{%
+ \global\advance\count0 by 1\relax
+ \msg{* Inside \string\AtBeginShipout: [\the\count0]}%
+}
+
+\AtBeginShipoutFirst{%
+ \msg{* Inside \string\AtBeginShipoutFirst}%
+ Hello World%
+}
+
+\testmsg{\string\null}{1}
+\shipout\null
+
+\AtBeginShipoutFirst{%
+ This is too late%
+}
+
+\testmsg{void}{}
+\shipout\void
+
+\testmsg{\string\copy255 (not void)}{2}
+\setbox255\hbox{\vrule height 10bp width 10bp}
+\shipout\copy255 %
+
+\testmsg{\string\copy255 (again)}{3}
+\shipout\copy255 %
+
+\testmsg{\string\box255}{4}
+\shipout\box255 %
+
+\testmsg{\string\box255 (again)}{}
+\shipout\box255 %
+
+\testmsg{\string\hbox}{5}
+\shipout\hbox{\vrule height 5bp width 20bp}
+
+\testmsg{\string\vbox}{6}
+\shipout\vbox{\hrule height 20bp width 5bp}
+
+\testmsg{\string\null, voided by hook}{}
+\def\VoidBox{%
+ \begingroup
+ \setbox\AtBeginShipoutBox=\box\AtBeginShipoutBox
+ \endgroup
+}
+\AtBeginShipout{\VoidBox}
+\shipout\null
+\def\VoidBox{}
+
+\msg{*** \string\begingroup}
+\begingroup
+ \testmsg{void}{}%
+ \shipout\void
+\msg{*** \string\endgroup}
+\endgroup
+
+\msg{*** \string\begingroup}
+\begingroup
+ \testmsg{void}{}%
+ \shipout\void
+ \testmsg{\string\null}{8}%
+ \shipout\null
+\msg{*** \string\endgroup}
+\endgroup
+
+\testmsg{output routine}{9}
+Hello World
+\vfill
+\eject
+
+\testmsg{\string\null\space(discarded)}{}
+\AtBeginShipout{%
+ \msg{* Inside \string\AtBeginShipout: DISCARD}%
+ \AtBeginShipoutDiscard
+}
+\shipout\null
+
+\end
+%</test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test3>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{atbegshi-test3.tex}[2016/06/09 v1.18 Test file for LaTeX]
+\RequirePackage{color}
+\pagecolor{yellow}
+\documentclass[a5paper,showtrims]{memoir}
+\usepackage{atbegshi}
+\AtBeginShipout{%
+ \setbox\AtBeginShipoutBox=\vbox{%
+ \vbox to 0pt{%
+ \kern-1.5in %
+ \hbox to 0pt{%
+ \kern-1.5in %
+ \color{blue}%
+ \rule{1in}{1in}%
+ \hss
+ }%
+ \vss
+ }%
+ \hrule
+ \hbox{\vrule\box\AtBeginShipoutBox\vrule}%
+ \hrule
+ }%
+}
+\usepackage{eso-pic}
+\makeatletter
+\@ifundefined{@EveryShipout@Init}{%
+ \typeout{Test skipped}%
+ \@@end
+}{}
+\@EveryShipout@Init
+\let\@EveryShipout@Init\relax
+\makeatother
+\AddToShipoutPicture{%
+ \hspace{.52\paperwidth}%
+ \colorbox{cyan}{%
+ \rule{0mm}{\paperheight}%
+ \hspace{.48\paperwidth}%
+ }%
+}
+% \end{macrocode}
+% Newer versions of class \xclass{memoir} emulate package
+% \xpackage{crop} and prevents its loading. This is undone
+% in next line for this test file.
+% \begin{macrocode}
+\expandafter\let\csname ver@crop.sty\endcsname\relax
+\usepackage[color=red,cross,a4,center]{crop}
+\begin{document}
+\shipout\null
+\shipout\box\csname voidb@x\endcsname
+\section{Hello World}
+\end{document}
+%</test3>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/atbegshi}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/atbegshi.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/atbegshi.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[\CTAN{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 atbegshi.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@{}}
+% atbegshi.sty & tex/generic/oberdiek/atbegshi.sty\\
+% atbegshi.pdf & doc/latex/oberdiek/atbegshi.pdf\\
+% atbegshi-example1.tex & doc/latex/oberdiek/atbegshi-example1.tex\\
+% atbegshi-example2.tex & doc/latex/oberdiek/atbegshi-example2.tex\\
+% test/atbegshi-test1.tex & doc/latex/oberdiek/test/atbegshi-test1.tex\\
+% test/atbegshi-test2.tex & doc/latex/oberdiek/test/atbegshi-test2.tex\\
+% test/atbegshi-test3.tex & doc/latex/oberdiek/test/atbegshi-test3.tex\\
+% atbegshi.dtx & source/latex/oberdiek/atbegshi.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk atbegshi.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{atbegshi.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 atbegshi.dtx
+%makeindex -s gind.ist atbegshi.idx
+%pdflatex atbegshi.dtx
+%makeindex -s gind.ist atbegshi.idx
+%pdflatex atbegshi.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{atbegshi.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='atbegshi'>
+ <name>atbegshi</name>
+ <caption>Execute stuff at \shipout time.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.18'/>
+ <description>
+ This package is a modern reimplementation of package
+ <xref refid='everyshi'>everyshi</xref>, providing various commands
+ to be executed before a <tt>\shipout</tt> command. It makes use of
+ e-TeX&#x2019;s facilities if they are available. The package may
+ be used either with LaTeX or with plain TeX.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/atbegshi.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/atbegshi.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/04/17 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/04/18 v1.1}
+% \item
+% New method based on \cs{lastkern} is used if \eTeX\ is missing.
+% \item
+% \cs{AtBeginShipoutDiscard} also resets \cs{deadcycles}.
+% \end{Version}
+% \begin{Version}{2007/04/19 v1.2}
+% \item
+% \cs{AtBeginShipoutEarly} removed for simplification reasons.
+% \item
+% Forgotten definition of \cs{AtBegShi@Info} added.
+% \item
+% Patches for packages \xpackage{crop} and \xpackage{everyshi}
+% and class \xclass{memoir} added.
+% \end{Version}
+% \begin{Version}{2007/04/26 v1.3}
+% \item
+% Use of package \xpackage{infwarerr}.
+% \item
+% Catcode section after generic header.
+% \end{Version}
+% \begin{Version}{2007/04/27 v1.4}
+% \item
+% Small optimizations.
+% \end{Version}
+% \begin{Version}{2007/06/06 v1.5}
+% \item
+% \cs{AtBeginShipoutUpperLeft} added.
+% \item
+% Example added.
+% \item
+% Fix in second test file for newer version of \xclass{memoir}.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.6}
+% \item
+% Catcode section rewritten.
+% \end{Version}
+% \begin{Version}{2008/07/18 v1.7}
+% \item
+% Documentation of \cs{AtBeginShipoutUpperLeft} fixed and extended.
+% \end{Version}
+% \begin{Version}{2008/07/19 v1.8}
+% \item
+% \cs{AtBeginShipoutUpperLeftForeground} added.
+% \end{Version}
+% \begin{Version}{2008/07/31 v1.9}
+% \item
+% Second example (TrimBox for dvipdfmx) added.
+% \item
+% No changes in package code.
+% \end{Version}
+% \begin{Version}{2009/12/02 v1.10}
+% \item
+% \cs{AtBeginShipoutOriginalShipout} added.
+% \item
+% Test file fixed.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.11}
+% \item
+% Compatibility with \iniTeX\ except for \cs{newbox}.
+% \end{Version}
+% \begin{Version}{2010/03/25 v1.12}
+% \item
+% \cs{AtBeginShipoutNext} can now be used inside
+% \cs{AtBeginShipoutNext}.
+% \end{Version}
+% \begin{Version}{2010/08/18 v1.13}
+% \item
+% Fixes for \cs{AtBegShi@CheckDefinable}.
+% \end{Version}
+% \begin{Version}{2010/12/02 v1.14}
+% \item
+% Remove the warning because of void box if the hook
+% calls \AtBeginShipoutDiscard.
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.15}
+% \item
+% Already loaded package files are not input in \hologo{plainTeX}.
+% \end{Version}
+% \begin{Version}{2011/10/05 v1.16}
+% \item
+% \cs{AtBeginShipoutAddToBox}, \cs{AtBeginShipoutAddToBoxForeground} added.
+% \item
+% \cs{AtBeginShipoutBoxWidth}, \cs{AtBeginShipoutBoxHeight},
+% \cs{AtBeginShipoutBoxDepth} added.
+% \item
+% Updates for patches of class \xclass{memoir}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.17}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/06/09 v1.18}
+% \item
+% Update for \cs{pdfhorign} in new LuaTeX.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/atbegshi.pdf b/macros/latex/contrib/oberdiek/atbegshi.pdf
new file mode 100644
index 0000000000..24387f0a05
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/atbegshi.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/atenddvi.dtx b/macros/latex/contrib/oberdiek/atenddvi.dtx
new file mode 100644
index 0000000000..5738ab584a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/atenddvi.dtx
@@ -0,0 +1,624 @@
+% \iffalse meta-comment
+%
+% File: atenddvi.dtx
+% Version: 2016/05/16 v1.2
+% Info: At end DVI hook
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file atenddvi.dtx
+% and the derived files
+% atenddvi.sty, atenddvi.pdf, atenddvi.ins, atenddvi.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/atenddvi.dtx
+% CTAN:macros/latex/contrib/oberdiek/atenddvi.pdf
+%
+% Unpacking:
+% (a) If atenddvi.ins is present:
+% tex atenddvi.ins
+% (b) Without atenddvi.ins:
+% tex atenddvi.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{atenddvi.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If atenddvi.drv is present:
+% latex atenddvi.drv
+% (b) Without atenddvi.drv:
+% latex atenddvi.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 atenddvi.dtx
+% makeindex -s gind.ist atenddvi.idx
+% pdflatex atenddvi.dtx
+% makeindex -s gind.ist atenddvi.idx
+% pdflatex atenddvi.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/atenddvi.sty
+% TDS:doc/latex/oberdiek/atenddvi.pdf
+% TDS:source/latex/oberdiek/atenddvi.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: atenddvi 2016/05/16 v1.2 At end DVI hook (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: atenddvi
+Version: 2016/05/16 v1.2
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file atenddvi.dtx
+and the derived files
+ atenddvi.sty, atenddvi.pdf, atenddvi.ins, atenddvi.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{atenddvi.ins}{\from{atenddvi.dtx}{install}}%
+ \file{atenddvi.drv}{\from{atenddvi.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{atenddvi.sty}{\from{atenddvi.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{atenddvi.xml}{\from{atenddvi.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{* atenddvi.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `atenddvi.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{atenddvi.drv}%
+ [2016/05/16 v1.2 At end DVI hook (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{atenddvi.dtx}%
+\end{document}
+%</driver>
+% \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{atenddvi.drv}
+%
+% \title{The \xpackage{atenddvi} package}
+% \date{2016/05/16 v1.2}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% \LaTeX\ offers \cs{AtBeginDvi}. This package \xpackage{atenddvi}
+% provides the counterpart \cs{AtEndDvi}. The execution of its
+% argument is delayed to the end of the document at the end of the
+% last page. Thus \cs{special} and \cs{write} remain effective, because
+% they are put into the last page. This is the main difference
+% to \cs{AtEndDocument}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \begin{declcs}{AtEndDvi} \M{code}
+% \end{declcs}
+% Macro \cs{AtEndDvi} provides a hook mechanism to put \meta{code}
+% at the end of the last output page. It is the logical counterpart
+% to \cs{AtBeginDvi}. Despite the name the output type DVI, PDF or whatever
+% does not matter.
+%
+% Unlike \cs{AtBeginDvi} the \meta{code} is not put in a box and
+% therefore executed immediately. The hook for \cs{AtEndDvi} is based on
+% a macro similar to \cs{AtBeginDocument} or \cs{AtEndDocument}. The
+% execution of \meta{code} is delayed until the hook is executed on
+% the last page.
+%
+% Commands such as \cs{special} or \cs{write} (not the \cs{immediate}
+% variant) must go as nodes into the contents of a page to have the
+% desired effect.
+% When the hook for \cs{AtEndDocument} is executed, the last intended
+% page may already be shipped out. Therefore \cs{special} or \cs{write}
+% cannot be used in a reliable way without generating new page.
+%
+% This gap is closed by \cs{AtEndDvi} of this package \xpackage{atenddvi}.
+% If the document is compiled the first time, the package remembers
+% the last page in a reference. In the sceond run, it puts the hook
+% on the page that has been detected in the previous run as last page.
+% The package detectes if the number of pages has changed, and then
+% generates a warning to rerun \LaTeX.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{atenddvi}%
+ [2016/05/16 v1.2 At end DVI hook (HO)]%
+% \end{macrocode}
+%
+% Load the required packages
+% \begin{macrocode}
+\RequirePackage{zref-abspage,zref-lastpage}[2007/03/19]
+\RequirePackage{atbegshi}
+% \end{macrocode}
+%
+% \begin{macro}{\AtEndDvi@Hook}
+% Macro \cs{AtEndDvi@Hook} is the data storage macro
+% for the code that is executed later at end of the last page.
+% \begin{macrocode}
+\let\AtEndDvi@Hook\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtEndDvi}
+% Macro \cs{AtEndDvi} is called in the same way as
+% \cs{AtBeginDocument}. The argument is added to the hook macro.
+% \begin{macrocode}
+\newcommand*{\AtEndDvi}{%
+ \g@addto@macro\AtEndDvi@Hook
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndDvi@AtBeginShipout}
+% \begin{macrocode}
+\def\AtEndDvi@AtBeginShipout{%
+ \begingroup
+% \end{macrocode}
+% The reference `LastPage' is marked used. If the reference
+% is not yet defined, then the user gets the warning because of
+% the undefined reference and the rerun warning at the end of
+% the compile run. However, we do not need a warning each page,
+% the first page is enough.
+% \begin{macrocode}
+ \ifnum\value{abspage}=1 %
+ \zref@refused{LastPage}%
+ \fi
+% \end{macrocode}
+% The current absolute page number is compared with the
+% absolute page number of the reference `LastPage'.
+% \begin{macrocode}
+ \ifnum\zref@extractdefault{LastPage}{abspage}{0}=\value{abspage}%
+% \end{macrocode}
+% \begin{macro}{\AtEndDvi@LastPage}
+% We found the right page and remember it in a macro.
+% \begin{macrocode}
+ \xdef\AtEndDvi@LastPage{\number\value{abspage}}%
+% \end{macrocode}
+% \end{macro}
+% The hook of \cs{AtEndDvi} is now put on the last page
+% after the contents of the page.
+% \begin{macrocode}
+ \global\setbox\AtBeginShipoutBox=\vbox{%
+ \hbox{%
+ \box\AtBeginShipoutBox
+ \setbox\AtBeginShipoutBox=\hbox{%
+ \begingroup
+ \AtEndDvi@Hook
+ \endgroup
+ }%
+ \wd\AtBeginShipoutBox=\z@
+ \ht\AtBeginShipoutBox=\z@
+ \dp\AtBeginShipoutBox=\z@
+ \box\AtBeginShipoutBox
+ }%
+ }%
+% \end{macrocode}
+% We do not need the every page hook.
+% \begin{macrocode}
+ \global\let\AtEndDvi@AtBeginShipout\@empty
+% \end{macrocode}
+% The hook is consumed, \cs{AtEndDvi} does not have an effect.
+% \begin{macrocode}
+ \global\let\AtEndDvi\@gobble
+% \end{macrocode}
+% Make a protocol entry, which page is used by this package
+% as last page.
+% \begin{macrocode}
+ \let\on@line\@empty
+ \PackageInfo{atenddvi}{Last page = \AtEndDvi@LastPage}%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndDvi@AtBeginDocument}
+% In order to get as late as possible in the chain of the
+% every shipout hook, the call of \cs{AtBeginShipout} is delayed.
+% \begin{macrocode}
+\def\AtEndDvi@AtBeginDocument{%
+ \AtBeginShipout{\AtEndDvi@AtBeginShipout}%
+% \end{macrocode}
+% \begin{macro}{\AtEndDvi@Check}
+% After \cs{AtEndDocument} \LaTeX\ reads its \xfile{.aux} files
+% again. Code in \cs{AtEndDocument} could generate additional
+% pages. This is unlikely by code in the \xfile{.aux} file,
+% thus we use the \xfile{.aux} file to run macro
+% \cs{AtEndDvi@Check} for checking the last page.
+%
+% During the first reading of the \xfile{.aux} file,
+% \cs{AtEndDvi@Check} is disabled, its real meaning
+% is assigned afterwards.
+% \begin{macrocode}
+ \if@filesw
+ \immediate\write\@mainaux{%
+ \string\providecommand\string\AtEndDvi@Check{}%
+ }%
+ \immediate\write\@mainaux{%
+ \string\AtEndDvi@Check
+ }%
+ \fi
+ \let\AtEndDvi@Check\AtEndDvi@CheckImpl
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AtBeginDocument{\AtEndDvi@AtBeginDocument}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtEndDvi@CheckImpl}
+% First check is whether a last page was found at all.
+% Secondly the found last page is compared with the real last page.
+% \begin{macrocode}
+\def\AtEndDvi@CheckImpl{%
+ \@ifundefined{AtEndDvi@LastPage}{%
+ \PackageWarningNoLine{atenddvi}{%
+ Rerun LaTeX, last page not yet found%
+ }%
+ }{%
+ \ifnum\AtEndDvi@LastPage=\value{abspage}%
+ \else
+ \PackageWarningNoLine{atenddvi}{%
+ Rerun LaTeX, last page has changed%
+ }%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/atenddvi}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/atenddvi.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/atenddvi.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[\CTAN{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 atenddvi.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@{}}
+% atenddvi.sty & tex/latex/oberdiek/atenddvi.sty\\
+% atenddvi.pdf & doc/latex/oberdiek/atenddvi.pdf\\
+% atenddvi.dtx & source/latex/oberdiek/atenddvi.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk atenddvi.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{atenddvi.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 atenddvi.dtx
+%makeindex -s gind.ist atenddvi.idx
+%pdflatex atenddvi.dtx
+%makeindex -s gind.ist atenddvi.idx
+%pdflatex atenddvi.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{atenddvi.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='atenddvi'>
+ <name>atenddvi</name>
+ <caption>Provides the \AtEndDvi command.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.2'/>
+ <description>
+ LaTeX offers <tt>\AtBeginDvi</tt>. This package provides the
+ counterpart <tt>\AtEndDvi</tt>. The execution of its argument is
+ delayed to the end of the document at the end of the last page.
+ At this point <tt>\special</tt> and <tt>\write</tt> remain
+ effective, because they are put into the last page. This is the
+ main difference from the LaTeX command <tt>\AtEndDocument</tt>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/atenddvi.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/atenddvi.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/03/20 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/04/17 v1.1}
+% \item
+% Package \xpackage{atbegshi} replaces package \xpackage{everyshi}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.2}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/atenddvi.pdf b/macros/latex/contrib/oberdiek/atenddvi.pdf
new file mode 100644
index 0000000000..9153ed314c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/atenddvi.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/attachfile2.dtx b/macros/latex/contrib/oberdiek/attachfile2.dtx
new file mode 100644
index 0000000000..0fd7e1f6a3
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/attachfile2.dtx
@@ -0,0 +1,3335 @@
+% \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 <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file 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
+%</ignore>
+%<*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 <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file 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
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*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}
+%</driver>
+% \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 https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \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{<timezone in PDF format>}|
+% \item
+%\begin{verbatim}
+%\attachfile@file[
+% Size=<size>,
+% CreationDate=<date>, % <date> local time without "D:" and timezone
+% ModDateTZ=<date+TZ>,
+% ModDate=<date>,
+% CheckSum=<checksum>
+%]{<filename as hex string>}
+%\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}
+%</package>
+% \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{<fill color>}{<stroke color>}
+\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}
+%</pdftex>
+% \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}%
+}
+%</luatex>
+% \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%
+ %
+ % <seconds since 1970-01-01> 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 %
+ %
+ % <filename> atfi_calc_checksum -> /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}
+%</dvips>
+% \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}
+%</dvipdfmx>
+% \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
+# http://www.latex-project.org/lppl/lppl-1-3c.txt
+# and the latest version of this license is in
+# http://www.latex-project.org/lppl.txt
+# and version 1.3 or later is part of all distributions of
+# LaTeX version 2005/12/01 or later.
+#
+# This work has the LPPL maintenance status "maintained".
+#
+# This Current Maintainer of this work is Heiko Oberdiek.
+#
+# 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] <file[.atfi]>
+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(<IN>) {
+ # 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}
+%</pdfatfi>
+% \end{macrocode}
+%
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/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[\CTAN{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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk attachfile2.pdf unpack_files output .|
+% \end{quote}
+%
+% \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}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{attachfile2.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='attachfile2'>
+ <name>attachfile2</name>
+ <caption>Attach files into PDF.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2005-2010,2012'/>
+ <license type='lppl1.3'/>
+ <version number='2.9'/>
+ <description>
+ This package can be used to attach files to a PDF document.
+ It is a further development of Scott Pakin&#x2019;s package
+ <xref refid='attachfile'>attachfile</xref> for
+ <xref refid='pdftex'>pdfTeX</xref>. Apart from bug fixes,
+ this package adds support for dvips,
+ some new options, and gets and writes meta information data about
+ the attached files.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/attachfile2.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/attachfile2.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{attachfile}
+% Scott Pakin: \textit{The \xpackage{attachfile} package};
+% 2005/02/20 v1.2;
+% \CTAN{macros/latex/contrib/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{http://partners.adobe.com/public/developer/en/pdf/PDFReference16.pdf}%
+% {\textit{PDF Reference, Fifth Edition, Version 1.6}},%
+% November 2004;
+% \url{http://partners.adobe.com/public/developer/pdf/index_reference.html}.
+%
+% \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<driver>.def} to
+% \texttt{atfi-<driver>.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
new file mode 100644
index 0000000000..78b77f1bb3
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/attachfile2.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/atveryend.dtx b/macros/latex/contrib/oberdiek/atveryend.dtx
new file mode 100644
index 0000000000..5e4dcdb759
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/atveryend.dtx
@@ -0,0 +1,1624 @@
+% \iffalse meta-comment
+%
+% File: atveryend.dtx
+% Version: 2016/05/16 v1.9
+% Info: Hooks at the very end of document
+%
+% Copyright (C) 2009-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file atveryend.dtx
+% and the derived files
+% atveryend.sty, atveryend.pdf, atveryend.ins, atveryend.drv,
+% atveryend-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/atveryend.dtx
+% CTAN:macros/latex/contrib/oberdiek/atveryend.pdf
+%
+% Unpacking:
+% (a) If atveryend.ins is present:
+% tex atveryend.ins
+% (b) Without atveryend.ins:
+% tex atveryend.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{atveryend.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If atveryend.drv is present:
+% latex atveryend.drv
+% (b) Without atveryend.drv:
+% latex atveryend.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 atveryend.dtx
+% makeindex -s gind.ist atveryend.idx
+% pdflatex atveryend.dtx
+% makeindex -s gind.ist atveryend.idx
+% pdflatex atveryend.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/atveryend.sty
+% TDS:doc/latex/oberdiek/atveryend.pdf
+% TDS:doc/latex/oberdiek/test/atveryend-test1.tex
+% TDS:source/latex/oberdiek/atveryend.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: atveryend 2016/05/16 v1.9 Hooks at the very end of document (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: atveryend
+Version: 2016/05/16 v1.9
+
+Copyright (C) 2009-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file atveryend.dtx
+and the derived files
+ atveryend.sty, atveryend.pdf, atveryend.ins, atveryend.drv,
+ atveryend-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{atveryend.ins}{\from{atveryend.dtx}{install}}%
+ \file{atveryend.drv}{\from{atveryend.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{atveryend.sty}{\from{atveryend.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{atveryend-test1.tex}{\from{atveryend.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{atveryend.xml}{\from{atveryend.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{* atveryend.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `atveryend.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{atveryend.drv}%
+ [2016/05/16 v1.9 Hooks at the very end of document (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{atveryend.dtx}%
+\end{document}
+%</driver>
+% \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{atveryend.drv}
+%
+% \title{The \xpackage{atveryend} package}
+% \date{2016/05/16 v1.9}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This \LaTeX\ package provides two hooks for \verb|\end{document}|
+% that are executed after the hook of \cs{AtEndDocument}.
+% \cs{AfterLastShipout} can be used for code that is to be executed
+% right after the last \cs{clearpage} before the \xext{aux} file
+% is closed. \cs{AtVeryEndDocument} is used for code after closing
+% and final reading of the \xext{aux} file.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% There are packages (e.g. \xpackage{hyperref} \cite{hyperref},
+% \xpackage{lastpage} \cite{lastpage})
+% that want to call code after the typesetting is done, for example
+% to remember the last page number. \LaTeX\ provides the hook
+% \cs{AtEndDocument} (\xpackage{clsguide} \cite{clsguide}).
+% There are packages that use this hook to do their job for
+% typesetting pages (e.g. \xpackage{endfloat} emits the floats here
+% \cite{endfloat}).
+% Also a user might provide additional code in \cs{AtEndDocument}.
+% Therefore packages have to call \cs{clearpage} in \cs{AtEndDocument}
+% to get after the last shipout page. But this is not too reliable,
+% because the right timing is important between packages that want
+% or have to do things before the last page is output and packages
+% that only work properly if they can reach the point after the
+% last shipout.
+%
+% Therefore the task of this package is to provide additional
+% hooks for |\end{document}|. All hooks are called after
+% the hook of \cs{AtEndDocument}.
+% \begin{declcs}{BeforeClearDocument} \M{code}
+% \end{declcs}
+% The code is called before the final \cs{clearpage} in
+% \cs{enddocument}. However it is unknown, whether the last
+% page is already shipped out or if this will be triggered by the
+% final \cs{clearpage}.
+%
+% \begin{declcs}{AfterLastShipout} \M{code}
+% \end{declcs}
+% The code is called after the final \cs{clearpage} of \cs{enddocument}
+% before the main \xext{aux} file is closed. This is the right place
+% to remember the last page in the \xext{aux} file, for instance.
+%
+% \begin{declcs}{AtVeryEndDocument} \M{code}
+% \end{declcs}
+% The code is called after the \xext{aux} file is closed and read in again.
+% It is the place for final checks, rerun hints, final messages.
+%
+% \begin{declcs}{AtEndAfterFileList} \M{code}
+% \end{declcs}
+% After the \xext{aux} file closing and reading \hologo{LaTeX}
+% prints the file list if requested by \cs{listfiles}.
+% Then this hook is executed.
+%
+% \begin{declcs}{AtVeryVeryEnd} \M{code}
+% \end{declcs}
+% This code is called right before the final \cs{@@end}.
+%
+% \subsection{Related work}
+%
+% \begin{description}
+% \item[Package \xpackage{scrfile}:]
+% Markus Kohm has written package \xpackage{scrlfile}
+% (part of KOMA-Script \cite{koma})
+% that provides
+% hooks \cs{BeforeClosingMainAux} and after \cs{AfterReadingMainAux}.
+% They have the same function as the hooks of this package. In fact
+% this package uses them, if they are available.
+% \item[Class \xclass{revtex4-1}:]
+% This class calls \cs{clear@document} in \cs{enddocument}
+% that wraps the final call of \cs{clearpage}.
+% Thus it can be used as hook to call stuff after that \cs{clearpage}.
+% This is also done by this package.
+% \item[Package \xpackage{etoolbox}:]
+% It provides \cs{AfterEndDocument}, a hook right before
+% \cs{deadcycles} or \cs{@@end} \cite{etoolbox}.
+% \end{description}
+% This package tries to combine as many approaches as possible:
+% \begin{itemize}
+% \item It looks for a known \cs{enddocument} and redefines it.
+% \item Hooks that are provided by others are used (package
+% \xpackage{scrlfile} or class \xclass{revtex4-1}.
+% \item It redefines \cs{@checkend} and \cs{@dofilelist} to insert
+% the hooks similar to package \xpackage{scrlfile}.
+% \item The hook execution is wrapped in a macro that
+% is redefined by its first call to prevent calling the hook
+% more than once.
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \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 AtVeryEnd@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\AtVeryEnd@AtEnd{%
+ \AtVeryEnd@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{9}{10}% (tab)
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\AtVeryEnd@AtEnd{\AtVeryEnd@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{atveryend}%
+ [2016/05/16 v1.9 Hooks at the very end of document (HO)]
+% \end{macrocode}
+%
+% \subsection{Tools}
+%
+% \begin{macro}{\AtVeryEnd@ifundefined}
+% \begin{macrocode}
+\def\AtVeryEnd@ifundefined#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Hooks}
+%
+% \begin{macro}{\AtVeryEnd@BeforeClearDocumentHook}
+% \begin{macrocode}
+\let\AtVeryEnd@BeforeClearDocumentHook\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@AfterLastShipoutHook}
+% \begin{macrocode}
+\let\AtVeryEnd@AfterLastShipoutHook\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@AtVeryEndDocumentHook}
+% \begin{macrocode}
+\let\AtVeryEnd@AtVeryEndDocumentHook\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@AtEndAfterFileListHook}
+% \begin{macrocode}
+\let\AtVeryEnd@AtEndAfterFileListHook\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@AtVeryVeryEndHook}
+% \begin{macrocode}
+\let\AtVeryEnd@AtVeryVeryEndHook\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BeforeClearDocument}
+% \begin{macrocode}
+\newcommand*{\BeforeClearDocument}{%
+ \g@addto@macro\AtVeryEnd@BeforeClearDocumentHook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AfterLastShipout}
+% \begin{macrocode}
+\newcommand*{\AfterLastShipout}{%
+ \g@addto@macro\AtVeryEnd@AfterLastShipoutHook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEndDocument}
+% \begin{macrocode}
+\newcommand*{\AtVeryEndDocument}{%
+ \g@addto@macro\AtVeryEnd@AtVeryEndDocumentHook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtEndAfterFileList}
+% \begin{macrocode}
+\newcommand*{\AtEndAfterFileList}{%
+ \g@addto@macro\AtVeryEnd@AtEndAfterFileListHook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryVeryEnd}
+% \begin{macrocode}
+\newcommand*{\AtVeryVeryEnd}{%
+ \g@addto@macro\AtVeryEnd@AtVeryVeryEndHook
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Call@BeforeClearDocument}
+% \begin{macrocode}
+\newcommand*{\Call@BeforeClearDocument}{%
+ \let\BeforeClearDocument\@firstofone
+ \ifx\AtVeryEnd@BeforeClearDocumentHook\@empty
+ \PackageInfo{atveryend}{Empty hook `BeforeClearDocument'}%
+ \else
+ \PackageInfo{atveryend}{Executing hook `BeforeClearDocument'}%
+ \AtVeryEnd@BeforeClearDocumentHook
+ \fi
+ \global\let\AtVeryEnd@BeforeClearDocumentHook\@undefined
+ \global\let\Call@BeforeClearDocument\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Call@AfterLastShipout}
+% \begin{macrocode}
+\newcommand*{\Call@AfterLastShipout}{%
+ \let\AfterLastShipout\@firstofone
+ \ifx\AtVeryEnd@AfterLastShipoutHook\@empty
+ \PackageInfo{atveryend}{Empty hook `AfterLastShipout'}%
+ \else
+ \PackageInfo{atveryend}{Executing hook `AfterLastShipout'}%
+ \AtVeryEnd@AfterLastShipoutHook
+ \fi
+ \global\let\AtVeryEnd@AfterLastShipoutHook\@undefined
+ \global\let\Call@AfterLastShipout\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Call@AtVeryEndDocument}
+% \begin{macrocode}
+\newcommand*{\Call@AtVeryEndDocument}{%
+ \let\AtVeryEndDocument\@firstofone
+ \ifx\AtVeryEnd@AtVeryEndDocumentHook\@empty
+ \PackageInfo{atveryend}{Empty hook `AtVeryEndDocument'}%
+ \else
+ \PackageInfo{atveryend}{Executing hook `AtVeryEndDocument'}%
+ \AtVeryEnd@AtVeryEndDocumentHook
+ \fi
+ \global\let\AtVeryEnd@AtVeryEndDocumentHook\@undefined
+ \global\let\Call@AtVeryEndDocument\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Call@AtEndAfterFileList}
+% \begin{macrocode}
+\newcommand*{\Call@AtEndAfterFileList}{%
+ \Call@AtVeryEndDocument
+ \let\AtEndAfterFileList\@firstofone
+ \ifx\AtVeryEnd@AtEndAfterFileListHook\@empty
+ \PackageInfo{atveryend}{Empty hook `AtEndAfterFileList'}%
+ \else
+ \PackageInfo{atveryend}{Executing hook `AtEndAfterFileList'}%
+ \AtVeryEnd@AtEndAfterFileListHook
+ \fi
+ \global\let\AtVeryEnd@AtEndAfterFileListHook\@undefined
+ \global\let\Call@AtEndAfterFileList\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Call@AtVeryVeryEnd}
+% \begin{macrocode}
+\newcommand*{\Call@AtVeryVeryEnd}{%
+ \Call@AtEndAfterFileList
+ \let\AtVeryVeryEnd\@firstofone
+ \ifx\AtVeryEnd@AtVeryVeryEndHook\@empty
+ \PackageInfo{atveryend}{Empty hook `AtVeryVeryEnd'}%
+ \else
+ \PackageInfo{atveryend}{Executing hook `AtVeryVeryEnd'}%
+ \AtVeryEnd@AtVeryVeryEndHook
+ \fi
+ \global\let\AtVeryEnd@AtVeryVeryEndHook\@undefined
+ \global\let\Call@AtVeryVeryEnd\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Redefining \cs{enddocument}}
+%
+% This approach looks for known versions of \cs{enddocument}
+% and redefines it. Class \xclass{seminar}
+% and package \xpackage{slidesec} are not checked, because
+% there would be too much combinations to check.
+%
+% \subsubsection{\LaTeX\ kernel}
+%
+% \begin{macro}{\AtVeryEnd@test@standard}
+% \begin{macrocode}
+\def\AtVeryEnd@test@standard{%
+ \let\AtEndDocument\@firstofone
+ \@enddocumenthook
+ \@checkend{document}%
+ \clearpage
+ \begingroup
+ \if@filesw
+ \immediate\closeout\@mainaux
+ \let\@setckpt\@gobbletwo
+ \let\@newl@bel\@testdef
+ \@tempswafalse
+ \makeatletter
+ \input\jobname.aux %
+ \fi
+ \@dofilelist
+ \ifdim \font@submax >\fontsubfuzz\relax
+ \@font@warning{Size substitutions with differences\MessageBreak
+ up to \font@submax\space have occurred.\@gobbletwo}%
+ \fi
+ \@defaultsubs
+ \@refundefined
+ \if@filesw
+ \ifx \@multiplelabels \relax
+ \if@tempswa
+ \@latex@warning@no@line{Label(s) may have changed. %
+ Rerun to get cross-references right}%
+ \fi
+ \else
+ \@multiplelabels
+ \fi
+ \fi
+ \endgroup
+ \deadcycles\z@
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@enddocument@standard}
+% \begin{macrocode}
+\def\AtVeryEnd@enddocument@standard{%
+ \let\AtEndDocument\@firstofone
+ \@enddocumenthook
+ \@checkend{document}%
+ \Call@BeforeClearDocument
+ \clearpage
+ \Call@AfterLastShipout
+ \begingroup
+ \if@filesw
+ \immediate\closeout\@mainaux
+ \let\@setckpt\@gobbletwo
+ \let\@newl@bel\@testdef
+ \@tempswafalse
+ \makeatletter
+ \input\jobname.aux %
+ \fi
+ \Call@AtVeryEndDocument
+ \@dofilelist
+ \Call@AtEndAfterFileList
+ \ifdim \font@submax >\fontsubfuzz\relax
+ \@font@warning{Size substitutions with differences\MessageBreak
+ up to \font@submax\space have occurred.\@gobbletwo}%
+ \fi
+ \@defaultsubs
+ \@refundefined
+ \if@filesw
+ \ifx \@multiplelabels \relax
+ \if@tempswa
+ \@latex@warning@no@line{Label(s) may have changed. %
+ Rerun to get cross-references right}%
+ \fi
+ \else
+ \@multiplelabels
+ \fi
+ \fi
+ \endgroup
+ \deadcycles\z@
+ \Call@AtVeryVeryEnd
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\LaTeX\ kernel 2011/06/27}
+%
+% The \hologo{LaTeX2e} release 2011/06/27 has changed \cs{enddocument}
+% (\cs{input} is replaced by \cs{@@input}).
+% \begin{macro}{\AtVeryEnd@test@standard20110627}
+% \begin{macrocode}
+\expandafter\def\csname AtVeryEnd@test@standard20110627\endcsname{%
+ \let\AtEndDocument\@firstofone
+ \@enddocumenthook
+ \@checkend{document}%
+ \clearpage
+ \begingroup
+ \if@filesw
+ \immediate\closeout\@mainaux
+ \let\@setckpt\@gobbletwo
+ \let\@newl@bel\@testdef
+ \@tempswafalse
+ \makeatletter
+ \@@input\jobname.aux %
+ \fi
+ \@dofilelist
+ \ifdim \font@submax >\fontsubfuzz\relax
+ \@font@warning{Size substitutions with differences\MessageBreak
+ up to \font@submax\space have occurred.\@gobbletwo}%
+ \fi
+ \@defaultsubs
+ \@refundefined
+ \if@filesw
+ \ifx \@multiplelabels \relax
+ \if@tempswa
+ \@latex@warning@no@line{Label(s) may have changed. %
+ Rerun to get cross-references right}%
+ \fi
+ \else
+ \@multiplelabels
+ \fi
+ \fi
+ \endgroup
+ \deadcycles\z@
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@enddocument@standard20110627}
+% \begin{macrocode}
+\expandafter\def\csname AtVeryEnd@enddocument@standard20110627\endcsname{%
+ \let\AtEndDocument\@firstofone
+ \@enddocumenthook
+ \@checkend{document}%
+ \Call@BeforeClearDocument
+ \clearpage
+ \Call@AfterLastShipout
+ \begingroup
+ \if@filesw
+ \immediate\closeout\@mainaux
+ \let\@setckpt\@gobbletwo
+ \let\@newl@bel\@testdef
+ \@tempswafalse
+ \makeatletter
+ \@@input\jobname.aux %
+ \fi
+ \Call@AtVeryEndDocument
+ \@dofilelist
+ \Call@AtEndAfterFileList
+ \ifdim \font@submax >\fontsubfuzz\relax
+ \@font@warning{Size substitutions with differences\MessageBreak
+ up to \font@submax\space have occurred.\@gobbletwo}%
+ \fi
+ \@defaultsubs
+ \@refundefined
+ \if@filesw
+ \ifx \@multiplelabels \relax
+ \if@tempswa
+ \@latex@warning@no@line{Label(s) may have changed. %
+ Rerun to get cross-references right}%
+ \fi
+ \else
+ \@multiplelabels
+ \fi
+ \fi
+ \endgroup
+ \deadcycles\z@
+ \Call@AtVeryVeryEnd
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Package \xpackage{booklet}, file \xpackage{2up.tex}}
+%
+% \begin{macro}{\AtVeryEnd@test@booklet}
+% \begin{macrocode}
+\expandafter\def\expandafter\AtVeryEnd@test@booklet\expandafter{%
+ \expandafter\twoupclearpage
+ \AtVeryEnd@test@standard
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@enddocument@booklet}
+% \begin{macrocode}
+\expandafter\def\expandafter\AtVeryEnd@enddocument@booklet\expandafter{%
+ \expandafter\twoclearpage
+ \AtVeryEnd@enddocument@standard
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Class \xclass{dinbrief}}
+%
+% \begin{macro}{\AtVeryEnd@test@dinbrief}
+% \begin{macrocode}
+\def\AtVeryEnd@test@dinbrief{%
+ \@checkend{document} %
+ \newpage
+ \begingroup
+ \if@filesw
+ \ifnum\c@labelgen>0 %
+ \immediate\closeout\@mainlbl
+ \makeatletter
+ \input \jobname@lbl\relax
+ \clearpage
+ \fi
+ \immediate\closeout\@mainaux
+ \fi
+ \endgroup
+ \deadcycles\z@
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@enddocument@dinbrief}
+% \begin{macrocode}
+\def\AtVeryEnd@enddocument@dinbrief{%
+ \@checkend{document}%
+ \Call@BeforeClearDocument
+ \newpage
+ \Call@AfterLastShipout
+ \begingroup
+ \if@filesw
+ \ifnum\c@labelgen>\z@
+ \immediate\closeout\@mainlbl
+ \makeatletter
+ \input \jobname@lbl\relax
+ \clearpage
+ \fi
+ \immediate\closeout\@mainaux
+ \fi
+ \Call@AtVeryEndDocument
+ \csname @dofilelist\endcsname
+ \Call@AtEndAfterFileList
+ \endgroup
+ \deadcycles\z@
+ \Call@AtVeryVeryEnd
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Class \xclass{combine}}
+%
+% \begin{macro}{\AtVeryEnd@test@combine}
+% \begin{macrocode}
+\def\AtVeryEnd@test@combine{%
+ \@enddocumenthook
+ \@checkend{document}%
+ \clearpage
+ \begingroup
+ \if@filesw
+ \immediate\closeout\@mainaux
+ \immediate\closeout\@partaux
+ \let\@setckpt\@gobbletwo
+ \let\@newl@bel\@testdef
+ \@tempswafalse
+ \makeatletter \input\c@lmainauxfile %% change here
+ \fi
+ \c@lenddoca %% a replacement
+ \@refundefined
+ \endgroup
+ \deadcycles\z@
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@enddocument@combine}
+% \begin{macrocode}
+\def\AtVeryEnd@enddocument@combine{%
+ \@enddocumenthook
+ \@checkend{document}%
+ \Call@BeforeClearDocument
+ \clearpage
+ \Call@AfterLastShipout
+ \begingroup
+ \if@filesw
+ \immediate\closeout\@mainaux
+ \immediate\closeout\@partaux
+ \let\@setckpt\@gobbletwo
+ \let\@newl@bel\@testdef
+ \@tempswafalse
+ \makeatletter \input\c@lmainauxfile %% change here
+ \fi
+ \Call@AtVeryEndDocument
+ \c@lenddoca %% a replacement
+ \@refundefined
+ \endgroup
+ \deadcycles\z@
+ \Call@AtVeryVeryEnd
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtVeryEnd@test@c@lenddoca}
+% \begin{macrocode}
+\long\def\AtVeryEnd@test@c@lenddoca{%
+ \@dofilelist
+ \ifdim\font@submax>\fontsubfuzz\relax
+ \@font@warning{%
+ Size substitutions with differences\MessageBreak
+ up to \font@submax\space have occured.\@gobbletwo
+ }%
+ \fi
+ \@defaultsubs
+ \if@filesw
+ \ifx\@multiplelabels\relax
+ \if@tempswa
+ \@latex@warning@no@line{%
+ Label(s) may have changed. %
+ Rerun to get cross-references right%
+ }%
+ \fi
+ \else
+ \@multiplelabels
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\c@lenddoca}
+% \begin{macrocode}
+\ifx\AtVeryEnd@c@lenddoca\c@lenddoca
+ \def\c@lenddoca{%
+ \@dofilelist
+ \Call@AtEndAfterFileList
+ \ifdim\font@submax>\fontsubfuzz\relax
+ \@font@warning{%
+ Size substitutions with differences\MessageBreak
+ up to \font@submax\space have occured.\@gobbletwo
+ }%
+ \fi
+ \@defaultsubs
+ \if@filesw
+ \ifx\@multiplelabels\relax
+ \if@tempswa
+ \@latex@warning@no@line{%
+ Label(s) may have changed. %
+ Rerun to get cross-references right%
+ }%
+ \fi
+ \else
+ \@multiplelabels
+ \fi
+ \fi
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Class \xpackage{jpsj2}}
+%
+% \begin{macro}{\AtVeryEnd@test@jpsj}
+% \begin{macrocode}
+\def\AtVeryEnd@test@jpsj{%
+ \if@lastpagebalancing
+ \global\let\@outputdblcol=\balancing@outputdblcol
+ \fi
+ \@checkend{document}%
+ \clearpage
+ \begingroup
+ \if@filesw
+ \immediate\closeout\@mainaux
+ \def\global\@namedef##1##2{}%
+ \def\newlabel{\@testdef r}%
+ \def\bibcite{\@testdef b}%
+ \@tempswafalse
+ \makeatletter
+ \input \jobname.aux %
+ \if@tempswa
+ \@warning{%
+ Label(s) may have changed. %
+ Rerun to get cross-references right%
+ }%
+ \fi
+ \fi
+ \endgroup
+ \deadcycles\z@
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@enddocument@jpsj}
+% \begin{macrocode}
+\def\AtVeryEnd@enddocument@jpsj{%
+ \if@lastpagebalancing
+ \global\let\@outputdblcol=\balancing@outputdblcol
+ \fi
+ \@checkend{document}%
+ \Call@BeforeClearDocument
+ \clearpage
+ \Call@AfterLastShipout
+ \begingroup
+ \if@filesw
+ \immediate\closeout\@mainaux
+ \def\global\@namedef##1##2{}%
+ \def\newlabel{\@testdef r}%
+ \def\bibcite{\@testdef b}%
+ \@tempswafalse
+ \makeatletter
+ \input \jobname.aux %
+ \if@tempswa
+ \@warning{%
+ Label(s) may have changed. %
+ Rerun to get cross-references right%
+ }%
+ \fi
+ \fi
+ \Call@AtVeryEndDocument
+ \csname @dofilelist\endcsname
+ \Call@AtEndAfterFileList
+ \endgroup
+ \deadcycles\z@
+ \Call@AtVeryVeryEnd
+ \@@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Testing and redefining}
+%
+% \begin{macro}{\AtVeryEnd@Test}
+% \begin{macrocode}
+\def\AtVeryEnd@Test#1#2{%
+ \expandafter\ifx\csname AtVeryEnd@test@#2\endcsname#1%
+ \expandafter\let\expandafter#1%
+ \csname AtVeryEnd@enddocument@#2\endcsname
+ \begingroup
+ \let\on@line\@empty
+ \PackageInfo{atveryend}{%
+ \string#1 detected (#2)%
+ }%
+ \endgroup
+ \expandafter\AtVeryEnd@SkipToNil
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@SkipToNil}
+% \begin{macrocode}
+\def\AtVeryEnd@SkipToNil#1\@nil{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtVeryEnd@RedefEndDocument}
+% \begin{macrocode}
+\def\AtVeryEnd@RedefEndDocument#1{%
+ \ifx#1\@undefined
+ \else
+ \AtVeryEnd@Test#1{standard20110627}%
+ \AtVeryEnd@Test#1{standard}%
+ \AtVeryEnd@Test#1{booklet}%
+ \AtVeryEnd@Test#1{dinbrief}%
+ \AtVeryEnd@Test#1{combine}%
+ \AtVeryEnd@Test#1{jpsj}%
+ \AtVeryEnd@SkipToNil
+ \@nil
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AtVeryEnd@RedefEndDocument\enddocument
+\AtVeryEnd@RedefEndDocument\AP@enddocument % afterpage.sty
+\AtVeryEnd@RedefEndDocument\hyper@back@cite@enddocument % htx-bc.sty
+\AtVeryEnd@RedefEndDocument\hyper@enddocument % hyper.sty
+\AtVeryEnd@RedefEndDocument\hyper@fn@enddocument % hyper.sty
+\AtVeryEnd@RedefEndDocument\cweb@save@enddocument % cweb.cls
+\AtVeryEnd@RedefEndDocument\prev@enddocument % flushend.sty
+\AtVeryEnd@RedefEndDocument\endorigdocument % gaceta.cls
+\AtVeryEnd@RedefEndDocument\keependdoc % aguplus.sty
+\AtVeryEnd@RedefEndDocument\EMenddocument % t-angles.sty
+\AtVeryEnd@RedefEndDocument\docmute@enddocument % docmute.sty
+\AtVeryEnd@RedefEndDocument\a@enddocument % alatex.sty
+\AtVeryEnd@RedefEndDocument\enddocumentasusual % frenchle.sty
+\AtVeryEnd@RedefEndDocument\old@enddocument % uwthesis.cls
+% \end{macrocode}
+%
+% \subsection{Hack into \cs{enddocument}}
+%
+% \begin{macrocode}
+\def\AtVeryEnd@document{document}%
+\def\AtVeryEnd@RedefCheckEnd{%
+ \expandafter\def\expandafter\@checkend
+ \expandafter##\expandafter1\expandafter{%
+ \@checkend{##1}%
+ \def\AtVeryEnd@temp{##1}%
+ \ifx\AtVeryEnd@temp\AtVeryEnd@document
+ \let\AtVeryEnd@OrgClearpage\clearpage
+ \def\clearpage{%
+ \let\clearpage\AtVeryEnd@OrgClearpage
+ \Call@BeforeClearDocument
+ \clearpage
+ \Call@AfterLastShipout
+ }%
+ \fi
+ }%
+ \aftergroup\AtVeryEnd@RedefCheckEnd
+}%
+\AtBeginDocument{%
+ \AtEndDocument{%
+ \AtVeryEnd@RedefCheckEnd
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\AtEndDocument{%
+ \@ifundefined{@dofilelist}{%
+ \gdef\@dofilelist{%
+ \Call@AtVeryEndDocument
+ \Call@AtEndAfterFileList
+ }%
+ }{%
+ \begingroup
+ \toks@\expandafter{\@dofilelist}%
+ \xdef\@dofilelist{%
+ \noexpand\Call@AtVeryEndDocument
+ \the\toks@
+ \noexpand\Call@AtEndAfterFileList
+ }%
+ \endgroup
+ }%
+}
+% \end{macrocode}
+%
+% \subsection{Using hooks of other packages}
+%
+% \subsubsection{Package \xpackage{scrlfile}}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifpackageloaded{scrlfile}{%
+ \AtVeryEnd@ifundefined{BeforeClosingMainAux}{}{%
+ \BeforeClosingMainAux{\Call@AfterLastShipout}%
+ }%
+ \AtVeryEnd@ifundefined{AfterReadingMainAux}{}{%
+ \AfterReadingMainAux{\Call@AtVeryEndDocument}%
+ }%
+ }{}%
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{etoolbox}}
+%
+% \begin{macrocode}
+ \@ifpackageloaded{etoolbox}{%
+ \AtVeryEnd@ifundefined{AfterEndDocument}{}{%
+ \AfterEndDocument{\Call@AtVeryEndDocument}%
+ }%
+ }{}%
+% \end{macrocode}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Class \xclass{letter}}
+%
+% The class \xclass{letter} and some similar classes
+% insert material (\cs{@startlabels}) at the end of the document.
+% However, this method violates
+% a precondition of this package that the \cs{clearpage} in
+% \cs{enddocument} is the final call with no material at
+% later times. Therefore we move the label making
+% from the \xext{aux} file to \cs{AtEndDocument}.
+% \begin{macrocode}
+\def\AtVeryEnd@temp{%
+ \AtBeginDocument{%
+ \let\@startlabels\startlabels
+ \let\@mlabel\mlabel
+ \if@filesw
+ \immediate\write\@mainaux{\string\@startlabels}%
+ \fi
+ }%
+ \AtEndDocument{%
+ \if@filesw
+ \immediate\write\@mainaux{\string\clearpage}%
+ \fi
+ }%
+}
+\ifx\makelabels\AtVeryEnd@temp
+\else
+ \expandafter\AtVeryEnd@AtEnd
+\fi%
+\let\AtVeryEnd@PatchLetter=N%
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname endletter\endcsname\relax
+\else
+ \long\def\AtVeryEnd@TestEndLetter#1\@auxout#2#3\AtVeryEnd@Nil{%
+ \def\AtVeryEnd@temp{#2}%
+ \ifx\AtVeryEnd@temp\@empty
+ \else
+ \@onelevel@sanitize\AtVeryEnd@temp
+ \edef\AtVeryEnd@StringMlabel{%
+ \string\string
+ \string\@mlabel
+ \expandafter\@gobble\string\{%
+ }%
+ \def\AtVeryEnd@CatchFirst##1##2##3##4##5##6##7##8{%
+ ##1##2##3##4##5##6##7##8\AtVeryEnd@CatchSecond
+ }%
+ \def\AtVeryEnd@CatchSecond##1##2##3##4##5##6##7##8##9\@nil{%
+ ##1##2##3##4##5##6##7##8%
+ }%
+ \edef\AtVeryEnd@temp{%
+ \expandafter\AtVeryEnd@CatchFirst\AtVeryEnd@temp
+ {}{}{}{}{}{}{}{}%
+ {}{}{}{}{}{}{}{}%
+ \@nil
+ }%
+ \ifx\AtVeryEnd@temp\AtVeryEnd@StringMlabel
+ \expandafter\def\expandafter\endletter\expandafter{%
+ \endletter
+ \begingroup
+ \let\\=\relax
+ \let\protect\@unexpandable@protect
+ \let\@mlabel=\relax
+ \edef\x{\endgroup
+ \noexpand\AtEndDocument{%
+ \@gobble#2%
+ }%
+ }%
+ \x
+ }%
+ \let\AtVeryEnd@PatchLetter=Y%
+ \fi
+ \fi
+ }%
+ \expandafter\AtVeryEnd@TestEndLetter\endletter
+ \@auxout{}\AtVeryEnd@Nil
+\fi
+\ifx\AtVeryEnd@PatchLetter Y%
+ \begingroup
+ \let\on@line\@empty
+ \PackageInfo{atveryend}{%
+ \@backslashchar makelabels detected. %
+ Moving labels\MessageBreak
+ from `.aux' file to \@backslashchar AtEndDocument%
+ }%
+ \endgroup
+ \def\makelabels{%
+ \AtBeginDocument{%
+ \let\@startlabels\startlabels
+ \let\@mlabel\mlabel
+ }%
+ }%
+ \AtEndDocument{%
+ \AtVeryEnd@ifundefined{@startlabels}{%
+ }{%
+ \clearpage
+ \@startlabels
+ }%
+ }%
+ \AfterLastShipout{%
+ \let\@startlabels\relax
+ \let\@mlabel\@gobbletwo
+ }%
+\else
+ \PackageWarningNoLine{atveryend}{%
+ \@backslashchar makelabels detected, but labels cannot\MessageBreak
+ be moved to \@backslashchar AtEndDocument, because\MessageBreak
+ \@backslashchar endletter is not in expected form%
+ }%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\AtVeryEnd@AtEnd%
+%</package>
+% \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 atveryend.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/atveryend}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/atveryend.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/atveryend.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[\CTAN{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 atveryend.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@{}}
+% atveryend.sty & tex/latex/oberdiek/atveryend.sty\\
+% atveryend.pdf & doc/latex/oberdiek/atveryend.pdf\\
+% test/atveryend-test1.tex & doc/latex/oberdiek/test/atveryend-test1.tex\\
+% atveryend.dtx & source/latex/oberdiek/atveryend.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk atveryend.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{atveryend.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 atveryend.dtx
+%makeindex -s gind.ist atveryend.idx
+%pdflatex atveryend.dtx
+%makeindex -s gind.ist atveryend.idx
+%pdflatex atveryend.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{atveryend.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='atveryend'>
+ <name>atveryend</name>
+ <caption>Hooks at the very end of a document.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.9'/>
+ <description>
+ This LaTeX packages provides two hooks for <tt>\end{document}</tt>
+ that are executed after the hook of <tt>\AtEndDocument</tt>:
+ <tt>\AfterLastShipout</tt> can be used for code that is to be executed
+ right after the last <tt>\clearpage</tt> before the `<tt>.aux</tt>' file
+ is closed. <tt>\AtVeryEndDocument</tt> is used for code after closing
+ and final reading of the `<tt>.aux</tt>' file.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/atveryend.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/atveryend.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \section{Acknowledgement}
+%
+% \begin{description}
+% \item[Arthur Ogawa:] He proposed the new API with \cs{AfterLastShipout}
+% and gave me much feedback, comprehensive class/package lists, many
+% suggestions and comments.
+% \end{description}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{clsguide}
+% The \LaTeX3 Project:
+% \textit{\LaTeX2e\ for class and package writers}
+% 2006/02/15;
+% \CTAN{macros/latex/doc/clsguide.pdf}.
+%
+% \bibitem{endfloat}
+% James Darrell McCauley, Jeff Goldberg:
+% \textit{The \xpackage{endfloat} package};
+% 1995/10/11 v2.4i;
+% \CTAN{macros/latex/contrib/endfloat/endfloat.pdf}.
+%
+% \bibitem{etoolbox}
+% Philipp Lehmann:
+% \textit{The \xpackage{etoolbox} package};
+% 2009/08/06 v1.8;
+% \CTAN{macros/latex/contrib/etoolbox/etoolbox.pdf}.
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz, Heiko Oberdiek:
+% \textit{The \xpackage{hyperref} package};
+% 2009/12/05 v6.79l;
+% \CTAN{macros/latex/contrib/hyperref/}.
+%
+% \bibitem{koma}
+% Markus Kohm:
+% \textit{KOMA-Script};
+% 2009/07/24 v3.04a;
+% \url{http://www.komascript.de/}.
+%
+% \bibitem{lastpage}
+% Jeff Goldberg:
+% \textit{The \xpackage{lastpage} package};
+% 1994/07/20 v0.1b;
+% \CTAN{macros/latex/contrib/lastpage/lastpage.pdf}.
+%
+% \bibitem{revtex}
+% APS, AIP, Arthur Orgawa;
+% ReVTeX 4.1;
+% 2009/10/13 v4.1;
+% \url{http://authors.aps.org/revtex4/}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2009/12/06 v1.0}
+% \item
+% The first version.
+% \end{Version}
+% \begin{Version}{2009/12/07 v1.1}
+% \item
+% Bug fixes.
+% \end{Version}
+% \begin{Version}{2009/12/09 v1.2}
+% \item
+% Additional support of classes and packages.
+% \end{Version}
+% \begin{Version}{2009/12/11 v1.3}
+% \item
+% Patch for letter like classes that puts label into the `.aux' file.
+% \item
+% Hook \cs{BeforeClearDocument} added (request from Arthur Ogawa).
+% \item
+% Patch of \cs{clear@document} removed (Arthur Ogawa).
+% \item
+% A nested \cs{AtBeginDocument} removed.
+% \end{Version}
+% \begin{Version}{2010/01/25 v1.4}
+% \item
+% Moved from \texttt{TDS:*/generic/*} to \texttt{TDS:*/latex/*}.
+% \end{Version}
+% \begin{Version}{2010/03/24 v1.5}
+% \item
+% \cs{Call@BeforeClearDocument} fixed (Ahmed Musa).
+% \end{Version}
+% \begin{Version}{2011/04/15 v1.6}
+% \item
+% \cs{Call@AtEndAfterFileList} and \cs{Call@AtVeryVeryEnd} added.
+% \end{Version}
+% \begin{Version}{2011/04/23 v1.7}
+% \item
+% Some fix for \cs{AtVeryEnd@RedefCheckEnd}
+% to avoid error because of undefined control sequence
+% in some circumstances (thanks to D.P. Story for bug report).
+% \end{Version}
+% \begin{Version}{2011/06/30 v1.8}
+% \item
+% Support of changed \cs{enddocument} of \hologo{LaTeX2e} 2011/06/27.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.9}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/atveryend.pdf b/macros/latex/contrib/oberdiek/atveryend.pdf
new file mode 100644
index 0000000000..a9030f1cff
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/atveryend.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/auxhook.dtx b/macros/latex/contrib/oberdiek/auxhook.dtx
new file mode 100644
index 0000000000..5ca41d3d43
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/auxhook.dtx
@@ -0,0 +1,677 @@
+% \iffalse meta-comment
+%
+% File: auxhook.dtx
+% Version: 2016/05/16 v1.4
+% Info: Hooks for auxiliary files
+%
+% Copyright (C) 2006, 2007, 2009, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file auxhook.dtx
+% and the derived files
+% auxhook.sty, auxhook.pdf, auxhook.ins, auxhook.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/auxhook.dtx
+% CTAN:macros/latex/contrib/oberdiek/auxhook.pdf
+%
+% Unpacking:
+% (a) If auxhook.ins is present:
+% tex auxhook.ins
+% (b) Without auxhook.ins:
+% tex auxhook.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{auxhook.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If auxhook.drv is present:
+% latex auxhook.drv
+% (b) Without auxhook.drv:
+% latex auxhook.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 auxhook.dtx
+% makeindex -s gind.ist auxhook.idx
+% pdflatex auxhook.dtx
+% makeindex -s gind.ist auxhook.idx
+% pdflatex auxhook.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/auxhook.sty
+% TDS:doc/latex/oberdiek/auxhook.pdf
+% TDS:source/latex/oberdiek/auxhook.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: auxhook 2016/05/16 v1.4 Hooks for auxiliary files (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: auxhook
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2006, 2007, 2009, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file auxhook.dtx
+and the derived files
+ auxhook.sty, auxhook.pdf, auxhook.ins, auxhook.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{auxhook.ins}{\from{auxhook.dtx}{install}}%
+ \file{auxhook.drv}{\from{auxhook.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{auxhook.sty}{\from{auxhook.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{auxhook.xml}{\from{auxhook.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{* auxhook.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `auxhook.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{auxhook.drv}%
+ [2016/05/16 v1.4 Hooks for auxiliary files (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{auxhook.dtx}%
+\end{document}
+%</driver>
+% \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{auxhook.drv}
+%
+% \title{The \xpackage{auxhook} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{auxhook} provides hooks for adding stuff at
+% the begin of \xfile{.aux} files.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% There are two kinds of \xfile{.aux} files, the main \xfile{.aux} file
+% and the \xfile{.aux} file that belongs to an included file, specified
+% by \cs{include}.
+%
+% Some packages write macros in the auxiliary files.
+% If the user stops using the package, these macros will usually
+% cause error messages because of unknown commands. Prominent example
+% is package \xpackage{babel}'s \cs{select@language}.
+%
+% But such a package could be written more cooperative. It can
+% also provide a definition in the auxiliary file (\cs{providecommand})
+% that silently disables the macros of the package
+% if the package is no longer in use.
+%
+% In case of the main auxiliary file, \cs{AtBeginDocument} can be used
+% for this purpose. Especially if several packages are involved, the
+% order cannot be controlled always (e.g., see package
+% \xpackage{hypdestopt} that hooks into \xpackage{hyperref}'s macros).
+% And there isn't any hook for the auxiliary files of the \cs{include}
+% feature.
+%
+% Thus this package patches \LaTeX's macros \cs{document} and
+% \cs{@include} to add the hooks where the auxiliary files
+% are opend and the first line with \cs{relax} is written.
+%
+% The patching can fail, if these macros are redefined by some
+% other package. If the other package still uses the original
+% definition, then load package \xpackage{auxhook} earlier.
+% (With \cs{RequirePackage} the package also can be loaded before
+% the class). If the redefinition doesn't use the original meaning,
+% then you can try to load package \xpackage{auxhook} afterwards,
+% but you need luck that the patch succeeds.
+%
+% The hooks are macros:
+% \begin{description}
+% \item[\cs{@beginmainauxhook}:] Start of the main auxiliary file.
+% The hook is called after the first line with \cs{relax} is written.
+% \item[\cs{@beginpartauxhook}:] The same for the auxiliary files
+% that belongs to the files that are included by \cs{include}.
+% \end{description}
+% If you want to add something to these hooks, you can use
+% \cs{g@addto@macro} from \LaTeX's kernel. But the package provides
+% macros to add code that adds a line to the auxiliary file:
+%
+% \begin{declcs}{AddLineBeginMainAux}\,\M{line}\\
+% \cs{AddLineBeginPartAux}\,\M{line}\\
+% \cs{AddLineBeginAux}\,\M{line}
+% \end{declcs}
+% The \meta{line} is added at the begin of the main auxiliary file
+% by \cs{AddLineBeginMainAux} and at the begin of the auxiliary files
+% of included files by \cs{AddLineBeginPartAux}. \cs{AddLineBeginAux} writes
+% in both kinds of auxiliary files.
+%
+% Examples, see packages \xpackage{hypdestopt} (\cite{hypdestopt}) and
+% \xpackage{zref} (\cite{zref}).
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{auxhook}%
+ [2016/05/16 v1.4 Hooks for auxiliary files (HO)]%
+% \end{macrocode}
+%
+% \subsection{Hook setup}
+%
+% \begin{macro}{\@beginmainauxhook}
+% The hook for the main auxiliary file, initially empty.
+% \begin{macrocode}
+\providecommand*{\@beginmainauxhook}{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@beginpartauxhook}
+% The hook for auxiliary files of included files, initially empty.
+% \begin{macrocode}
+\providecommand*{\@beginpartauxhook}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ifx\AtBeginDocument\@firstofone
+ \global\let\@beginmainauxhook\relax
+\else
+ \g@addto@macro{\@beginmainauxhook}{%
+ \global\let\@beginmainauxhook\relax
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsection{User macros}
+%
+% \begin{macro}{\AddLineBeginMainAux}
+% \begin{macrocode}
+\newcommand{\AddLineBeginMainAux}[1]{%
+ \ifx\@beginmainauxhook\relax
+ \if@filesw
+ \PackageInfo{auxhook}{%
+ \@backslashchar AddLineBeginMainAux comes a little late,%
+ \MessageBreak
+ because the main .aux file is already opened%
+ }%
+ \immediate\write\@mainaux{#1}%
+ \fi
+ \else
+ \g@addto@macro\@beginmainauxhook{%
+ \immediate\write\@mainaux{#1}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AtBeginPartAuxLine}
+% \begin{macrocode}
+\newcommand{\AddLineBeginPartAux}[1]{%
+ \g@addto@macro\@beginpartauxhook{%
+ \immediate\write\@partaux{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AddLineBeginAux}
+% \begin{macrocode}
+\newcommand{\AddLineBeginAux}[1]{%
+ \AddLineBeginMainAux{#1}%
+ \AddLineBeginPartAux{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Patches}
+%
+% \subsubsection{\cs{document}}
+%
+% \begin{macrocode}
+\begingroup
+ \@ifundefined{beamer@origdocument}{%
+ \def\auxhook@document{\document}%
+ }{%
+ \def\auxhook@document{\beamer@origdocument}%
+ }%
+ \long\def\y#1\immediate\write\@mainaux#2#3\auxhook@nil{%
+ \toks@{%
+ #1\immediate\write\@mainaux{#2}%
+ \@beginmainauxhook
+ #3%
+ }%
+ \expandafter\xdef\auxhook@document{\the\toks@}%
+ \endgroup
+ }%
+ \long\def\x#1\immediate\write\@mainaux#2#3\auxhook@nil{%
+ \toks@{#3}%
+ \edef\x{\the\toks@}%
+ \ifx\x\@empty
+ \PackageWarningNoLine{auxhook}{%
+ Cannot patch \expandafter\string\auxhook@document,%
+ \MessageBreak
+ using \string\AtBeginDocument\space instead%
+ }%
+ \endgroup
+ \AtBeginDocument{%
+ \if@filesw
+ \@beginmainauxhook
+ \fi
+ }%
+ \else
+ \expandafter\expandafter\expandafter\y\auxhook@document
+ \auxhook@nil
+ \fi
+ }%
+\expandafter\expandafter\expandafter\x\auxhook@document
+ \immediate\write\@mainaux{}\auxhook@nil
+% \end{macrocode}
+%
+% \subsubsection{\cs{@include}}
+%
+% \begin{macrocode}
+\begingroup
+ \long\def\y#1\immediate\write\@partaux#2#3\auxhook@nil#4{%
+ \endgroup
+ \def#4##1 {%
+ #1\immediate\write\@partaux{#2}%
+ \@beginpartauxhook
+ #3%
+ }%
+ }%
+ \long\def\x#1\immediate\write\@partaux#2#3\auxhook@nil#4{%
+ \toks@{#3}%
+ \edef\x{\the\toks@}%
+ \ifx\x\@empty
+ \PackageWarningNoLine{auxhook}{%
+ Cannot patch \string#4,\MessageBreak
+ patch dropped%
+ }%
+ \endgroup
+ \else
+ \expandafter\y#4{##1} \auxhook@nil#4%
+ \fi
+ }%
+\@ifundefined{ReFiCh@org@include}{%
+ \expandafter\x\@include{#1} %
+ \immediate\write\@partaux{}\auxhook@nil\@include
+}{%
+ \expandafter\x\ReFiCh@org@include{#1} %
+ \immediate\write\@partaux{}\auxhook@nil\ReFiCh@org@include
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/auxhook}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/auxhook.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/auxhook.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[\CTAN{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 auxhook.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@{}}
+% auxhook.sty & tex/latex/oberdiek/auxhook.sty\\
+% auxhook.pdf & doc/latex/oberdiek/auxhook.pdf\\
+% auxhook.dtx & source/latex/oberdiek/auxhook.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk auxhook.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{auxhook.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 auxhook.dtx
+%makeindex -s gind.ist auxhook.idx
+%pdflatex auxhook.dtx
+%makeindex -s gind.ist auxhook.idx
+%pdflatex auxhook.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{auxhook.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='auxhook'>
+ <name>auxhook</name>
+ <caption>Hooks for auxiliary files.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006,2007,2009,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ This package auxhook provides hooks for adding stuff at
+ the begin of <tt>.aux</tt> files.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/auxhook.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/auxhook.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{hypdestopt}
+% Heiko Oberdiek: \textit{The \xpackage{hypdestopt} package};
+% 2006/05/30 v1.0;
+% \CTAN{macros/latex/contrib/oberdiek/hypdestopt.pdf}.
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz, Heiko Oberdiek:
+% \textit{The \xpackage{hyperref} package};
+% 2006/08/16 v6.75c;
+% \CTAN{macros/latex/contrib/hyperref/}.
+%
+% \bibitem{zref}
+% Heiko Oberdiek: \textit{The \xpackage{zref} package};
+% 2006/05/25 v1.2;
+% \CTAN{macros/latex/contrib/oberdiek/zref.pdf}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/05/31 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/04/06 v1.1}
+% \item
+% Fix for class \xclass{beamer}.
+% \end{Version}
+% \begin{Version}{2009/12/14 v1.2}
+% \item
+% Support for package \xpackage{rerunfilecheck} added (\cs{@include}).
+% \end{Version}
+% \begin{Version}{2011/03/04 v1.3}
+% \item
+% \cs{AddLineBeginMainAux} also supports write requests after
+% the main \xext{aux} file is opened.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/auxhook.pdf b/macros/latex/contrib/oberdiek/auxhook.pdf
new file mode 100644
index 0000000000..ba21ee3dda
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/auxhook.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/bigintcalc.dtx b/macros/latex/contrib/oberdiek/bigintcalc.dtx
new file mode 100644
index 0000000000..33f380783c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/bigintcalc.dtx
@@ -0,0 +1,4562 @@
+% \iffalse meta-comment
+%
+% File: bigintcalc.dtx
+% Version: 2016/05/16 v1.4
+% Info: Expandable calculations on big integers
+%
+% Copyright (C) 2007, 2011, 2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 bigintcalc.dtx
+% and the derived files
+% bigintcalc.sty, bigintcalc.pdf, bigintcalc.ins, bigintcalc.drv,
+% bigintcalc-test1.tex, bigintcalc-test2.tex,
+% bigintcalc-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/bigintcalc.dtx
+% CTAN:macros/latex/contrib/oberdiek/bigintcalc.pdf
+%
+% Unpacking:
+% (a) If bigintcalc.ins is present:
+% tex bigintcalc.ins
+% (b) Without bigintcalc.ins:
+% tex bigintcalc.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{bigintcalc.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If bigintcalc.drv is present:
+% latex bigintcalc.drv
+% (b) Without bigintcalc.drv:
+% latex bigintcalc.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 bigintcalc.dtx
+% makeindex -s gind.ist bigintcalc.idx
+% pdflatex bigintcalc.dtx
+% makeindex -s gind.ist bigintcalc.idx
+% pdflatex bigintcalc.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/bigintcalc.sty
+% TDS:doc/latex/oberdiek/bigintcalc.pdf
+% TDS:doc/latex/oberdiek/test/bigintcalc-test1.tex
+% TDS:doc/latex/oberdiek/test/bigintcalc-test2.tex
+% TDS:doc/latex/oberdiek/test/bigintcalc-test3.tex
+% TDS:source/latex/oberdiek/bigintcalc.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: bigintcalc 2016/05/16 v1.4 Expandable calculations on big integers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: bigintcalc
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2007, 2011, 2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 bigintcalc.dtx
+and the derived files
+ bigintcalc.sty, bigintcalc.pdf, bigintcalc.ins, bigintcalc.drv,
+ bigintcalc-test1.tex, bigintcalc-test2.tex,
+ bigintcalc-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{bigintcalc.ins}{\from{bigintcalc.dtx}{install}}%
+ \file{bigintcalc.drv}{\from{bigintcalc.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{bigintcalc.sty}{\from{bigintcalc.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{bigintcalc-test1.tex}{\from{bigintcalc.dtx}{test1}}%
+% \file{bigintcalc-test2.tex}{\from{bigintcalc.dtx}{test2,etex}}%
+% \file{bigintcalc-test3.tex}{\from{bigintcalc.dtx}{test2,noetex}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{bigintcalc.xml}{\from{bigintcalc.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{* bigintcalc.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `bigintcalc.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bigintcalc.drv}%
+ [2016/05/16 v1.4 Expandable calculations on big integers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{wasysym}
+\let\iint\relax
+\let\iiint\relax
+\usepackage[fleqn]{amsmath}
+
+\DeclareMathOperator{\opInv}{Inv}
+\DeclareMathOperator{\opAbs}{Abs}
+\DeclareMathOperator{\opSgn}{Sgn}
+\DeclareMathOperator{\opMin}{Min}
+\DeclareMathOperator{\opMax}{Max}
+\DeclareMathOperator{\opCmp}{Cmp}
+\DeclareMathOperator{\opOdd}{Odd}
+\DeclareMathOperator{\opInc}{Inc}
+\DeclareMathOperator{\opDec}{Dec}
+\DeclareMathOperator{\opAdd}{Add}
+\DeclareMathOperator{\opSub}{Sub}
+\DeclareMathOperator{\opShl}{Shl}
+\DeclareMathOperator{\opShr}{Shr}
+\DeclareMathOperator{\opMul}{Mul}
+\DeclareMathOperator{\opSqr}{Sqr}
+\DeclareMathOperator{\opFac}{Fac}
+\DeclareMathOperator{\opPow}{Pow}
+\DeclareMathOperator{\opDiv}{Div}
+\DeclareMathOperator{\opMod}{Mod}
+\DeclareMathOperator{\opInt}{Int}
+\DeclareMathOperator{\opODD}{ifodd}
+
+\newcommand*{\Def}{%
+ \ensuremath{%
+ \mathrel{\mathop{:}}=%
+ }%
+}
+\newcommand*{\op}[1]{%
+ \textsf{#1}%
+}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{bigintcalc.dtx}%
+\end{document}
+%</driver>
+% \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{bigintcalc.drv}
+%
+% \title{The \xpackage{bigintcalc} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides expandable arithmetic operations
+% with big integers that can exceed \TeX's number limits.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% Package \xpackage{bigintcalc} defines arithmetic operations
+% that deal with big integers. Big integers can be given
+% either as explicit integer number or as macro code
+% that expands to an explicit number. \emph{Big} means that
+% there is no limit on the size of the number. Big integers
+% may exceed \TeX's range limitation of -2147483647 and 2147483647.
+% Only memory issues will limit the usable range.
+%
+% In opposite to package \xpackage{intcalc}
+% unexpandable command tokens are not supported, even if
+% they are valid \TeX\ numbers like count registers or
+% commands created by \cs{chardef}. Nevertheless they may
+% be used, if they are prefixed by \cs{number}.
+%
+% Also \eTeX's \cs{numexpr} expressions are not supported
+% directly in the manner of package \xpackage{intcalc}.
+% However they can be given if \cs{the}\cs{numexpr}
+% or \cs{number}\cs{numexpr} are used.
+%
+% The operations have the form of macros that take one or
+% two integers as parameter and return the integer result.
+% The macro name is a three letter operation name prefixed
+% by the package name, e.g. \cs{bigintcalcAdd}|{10}{43}| returns
+% |53|.
+%
+% The macros are fully expandable, exactly two expansion
+% steps generate the result. Therefore the operations
+% may be used nearly everywhere in \TeX, even inside
+% \cs{csname}, file names, or other
+% expandable contexts.
+%
+% \subsection{Conditions}
+%
+% \subsubsection{Preconditions}
+%
+% \begin{itemize}
+% \item
+% Arguments can be anything that expands to a number that consists
+% of optional signs and digits.
+% \item
+% The arguments and return values must be sound.
+% Zero as divisor or factorials of negative numbers will cause errors.
+% \end{itemize}
+%
+% \subsubsection{Postconditions}
+%
+% Additional properties of the macros apart from calculating
+% a correct result (of course \smiley):
+% \begin{itemize}
+% \item
+% The macros are fully expandable. Thus they can
+% be used inside \cs{edef}, \cs{csname},
+% for example.
+% \item
+% Furthermore exactly two expansion steps calculate the result.
+% \item
+% The number consists of one optional minus sign and one or more
+% digits. The first digit is larger than zero for
+% numbers that consists of more than one digit.
+%
+% In short, the number format is exactly the same as
+% \cs{number} generates, but without its range limitation.
+% And the tokens (minus sign, digits)
+% have catcode 12 (other).
+% \item
+% Call by value is simulated. First the arguments are
+% converted to numbers. Then these numbers are used
+% in the calculations.
+%
+% Remember that arguments
+% may contain expensive macros or \eTeX\ expressions.
+% This strategy avoids multiple evaluations of such
+% arguments.
+% \end{itemize}
+%
+% \subsection{Error handling}
+%
+% Some errors are detected by the macros, example: division by zero.
+% In this cases an undefined control sequence is called and causes
+% a TeX error message, example: \cs{BigIntCalcError:DivisionByZero}.
+% The name of the control sequence contains
+% the reason for the error. The \TeX\ error may be ignored.
+% Then the operation returns zero as result.
+% Because the macros are supposed to work in expandible contexts.
+% An traditional error message, however, is not expandable and
+% would break these contexts.
+%
+% \subsection{Operations}
+%
+% Some definition equations below use the function $\opInt$
+% that converts a real number to an integer. The number
+% is truncated that means rounding to zero:
+% \begin{gather*}
+% \opInt(x) \Def
+% \begin{cases}
+% \lfloor x\rfloor & \text{if $x\geq0$}\\
+% \lceil x\rceil & \text{otherwise}
+% \end{cases}
+% \end{gather*}
+%
+% \subsubsection{\op{Num}}
+%
+% \begin{declcs}{bigintcalcNum} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcNum} converts its argument to a normalized integer
+% number without unnecessary leading zeros or signs.
+% The result matches the regular expression:
+%\begin{quote}
+%\begin{verbatim}
+%0|-?[1-9][0-9]*
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Inv}, \op{Abs}, \op{Sgn}}
+%
+% \begin{declcs}{bigintcalcInv} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcInv} switches the sign.
+% \begin{gather*}
+% \opInv(x) \Def -x
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcAbs} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcAbs} returns the absolute value
+% of integer \meta{x}.
+% \begin{gather*}
+% \opAbs(x) \Def \vert x\vert
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcSgn} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcSgn} encodes the sign of \meta{x} as number.
+% \begin{gather*}
+% \opSgn(x) \Def
+% \begin{cases}
+% -1& \text{if $x<0$}\\
+% 0& \text{if $x=0$}\\
+% 1& \text{if $x>0$}
+% \end{cases}
+% \end{gather*}
+% These return values can easily be distinguished by \cs{ifcase}:
+%\begin{quote}
+%\begin{verbatim}
+%\ifcase\bigintcalcSgn{<x>}
+% $x=0$
+%\or
+% $x>0$
+%\else
+% $x<0$
+%\fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Min}, \op{Max}, \op{Cmp}}
+%
+% \begin{declcs}{bigintcalcMin} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcMin} returns the smaller of the two integers.
+% \begin{gather*}
+% \opMin(x,y) \Def
+% \begin{cases}
+% x & \text{if $x<y$}\\
+% y & \text{otherwise}
+% \end{cases}
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcMax} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcMax} returns the larger of the two integers.
+% \begin{gather*}
+% \opMax(x,y) \Def
+% \begin{cases}
+% x & \text{if $x>y$}\\
+% y & \text{otherwise}
+% \end{cases}
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcCmp} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcCmp} encodes the comparison result as number:
+% \begin{gather*}
+% \opCmp(x,y) \Def
+% \begin{cases}
+% -1 & \text{if $x<y$}\\
+% 0 & \text{if $x=y$}\\
+% 1 & \text{if $x>y$}
+% \end{cases}
+% \end{gather*}
+% These values can be distinguished by \cs{ifcase}:
+%\begin{quote}
+%\begin{verbatim}
+%\ifcase\bigintcalcCmp{<x>}{<y>}
+% $x=y$
+%\or
+% $x>y$
+%\else
+% $x<y$
+%\fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Odd}}
+%
+% \begin{declcs}{bigintcalcOdd} \M{x}
+% \end{declcs}
+% \begin{gather*}
+% \opOdd(x) \Def
+% \begin{cases}
+% 1 & \text{if $x$ is odd}\\
+% 0 & \text{if $x$ is even}
+% \end{cases}
+% \end{gather*}
+%
+% \subsubsection{\op{Inc}, \op{Dec}, \op{Add}, \op{Sub}}
+%
+% \begin{declcs}{bigintcalcInc} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcInc} increments \meta{x} by one.
+% \begin{gather*}
+% \opInc(x) \Def x + 1
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcDec} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcDec} decrements \meta{x} by one.
+% \begin{gather*}
+% \opDec(x) \Def x - 1
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcAdd} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcAdd} adds the two numbers.
+% \begin{gather*}
+% \opAdd(x, y) \Def x + y
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcSub} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcSub} calculates the difference.
+% \begin{gather*}
+% \opSub(x, y) \Def x - y
+% \end{gather*}
+%
+% \subsubsection{\op{Shl}, \op{Shr}}
+%
+% \begin{declcs}{bigintcalcShl} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcShl} implements shifting to the left that
+% means the number is multiplied by two.
+% The sign is preserved.
+% \begin{gather*}
+% \opShl(x) \Def x*2
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcShr} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcShr} implements shifting to the right.
+% That is equivalent to an integer division by two.
+% The sign is preserved.
+% \begin{gather*}
+% \opShr(x) \Def \opInt(x/2)
+% \end{gather*}
+%
+% \subsubsection{\op{Mul}, \op{Sqr}, \op{Fac}, \op{Pow}}
+%
+% \begin{declcs}{bigintcalcMul} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcMul} calculates the product of
+% \meta{x} and \meta{y}.
+% \begin{gather*}
+% \opMul(x,y) \Def x*y
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcSqr} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcSqr} returns the square product.
+% \begin{gather*}
+% \opSqr(x) \Def x^2
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcFac} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcFac} returns the factorial of \meta{x}.
+% Negative numbers are not permitted.
+% \begin{gather*}
+% \opFac(x) \Def x!\qquad\text{for $x\geq0$}
+% \end{gather*}
+% ($0! = 1$)
+%
+% \begin{declcs}{bigintcalcPow} M{x} M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcPow} calculates the value of \meta{x} to the
+% power of \meta{y}. The error ``division by zero'' is thrown
+% if \meta{x} is zero and \meta{y} is negative.
+% permitted:
+% \begin{gather*}
+% \opPow(x,y) \Def
+% \opInt(x^y)\qquad\text{for $x\neq0$ or $y\geq0$}
+% \end{gather*}
+% ($0^0 = 1$)
+%
+% \subsubsection{\op{Div}, \op{Mul}}
+%
+% \begin{declcs}{bigintcalcDiv} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcDiv} performs an integer division.
+% Argument \meta{y} must not be zero.
+% \begin{gather*}
+% \opDiv(x,y) \Def \opInt(x/y)\qquad\text{for $y\neq0$}
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcMod} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcMod} gets the remainder of the integer
+% division. The sign follows the divisor \meta{y}.
+% Argument \meta{y} must not be zero.
+% \begin{gather*}
+% \opMod(x,y) \Def x\mathrel{\%}y\qquad\text{for $y\neq0$}
+% \end{gather*}
+% The result ranges:
+% \begin{gather*}
+% -\vert y\vert < \opMod(x,y) \leq 0\qquad\text{for $y<0$}\\
+% 0 \leq \opMod(x,y) < y\qquad\text{for $y\geq0$}
+% \end{gather*}
+%
+% \subsection{Interface for programmers}
+%
+% If the programmer can ensure some more properties about
+% the arguments of the operations, then the following
+% macros are a little more efficient.
+%
+% In general numbers must obey the following constraints:
+% \begin{itemize}
+% \item Plain number: digit tokens only, no command tokens.
+% \item Non-negative. Signs are forbidden.
+% \item Delimited by exclamation mark. Curly braces
+% around the number are not allowed and will
+% break the code.
+% \end{itemize}
+%
+% \begin{declcs}{BigIntCalcOdd} \meta{number} |!|
+% \end{declcs}
+% |1|/|0| is returned if \meta{number} is odd/even.
+%
+% \begin{declcs}{BigIntCalcInc} \meta{number} |!|
+% \end{declcs}
+% Incrementation.
+%
+% \begin{declcs}{BigIntCalcDec} \meta{number} |!|
+% \end{declcs}
+% Decrementation, positive number without zero.
+%
+% \begin{declcs}{BigIntCalcAdd} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Addition, $A\geq B$.
+%
+% \begin{declcs}{BigIntCalcSub} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Subtraction, $A\geq B$.
+%
+% \begin{declcs}{BigIntCalcShl} \meta{number} |!|
+% \end{declcs}
+% Left shift (multiplication with two).
+%
+% \begin{declcs}{BigIntCalcShr} \meta{number} |!|
+% \end{declcs}
+% Right shift (integer division by two).
+%
+% \begin{declcs}{BigIntCalcMul} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Multiplication, $A\geq B$.
+%
+% \begin{declcs}{BigIntCalcDiv} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Division operation.
+%
+% \begin{declcs}{BigIntCalcMod} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Modulo operation.
+%
+%
+% \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@bigintcalc.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{bigintcalc}{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@bigintcalc.sty\endcsname
+\ProvidesPackage{bigintcalc}%
+ [2016/05/16 v1.4 Expandable calculations on big integers (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 BIC@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\BIC@AtEnd{%
+ \BIC@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{36}{14}% $ (comment!)
+\TMP@EnsureCode{38}{14}% & (comment!)
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{11}% : (letter!)
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{63}{14}% ? (comment!)
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\BIC@AtEnd{\BIC@AtEnd\noexpand\endinput}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname BIC@TestMode\endcsname\relax
+\else
+ \catcode63=9 % ? (ignore)
+\fi
+? \let\BIC@@TestMode\BIC@TestMode
+% \end{macrocode}
+%
+% \subsection{\eTeX\ detection}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+ \catcode36=9 % $ (ignore)
+\else
+ \catcode38=9 % & (ignore)
+\fi
+% \end{macrocode}
+%
+% \subsection{Help macros}
+%
+% \begin{macro}{\BIC@Fi}
+% \begin{macrocode}
+\let\BIC@Fi\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@AfterFi}
+% \begin{macrocode}
+\def\BIC@AfterFi#1#2\BIC@Fi{\fi#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@AfterFiFi}
+% \begin{macrocode}
+\def\BIC@AfterFiFi#1#2\BIC@Fi{\fi\fi#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@AfterFiFiFi}
+% \begin{macrocode}
+\def\BIC@AfterFiFiFi#1#2\BIC@Fi{\fi\fi\fi#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BIC@Space}
+% \begin{macrocode}
+\begingroup
+ \def\x#1{\endgroup
+ \let\BIC@Space= #1%
+ }%
+\x{ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Expand number}
+%
+% \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{pdftexcmds}[2007/11/11]%
+\else
+ \RequirePackage{pdftexcmds}[2007/11/11]%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@escapehex\endcsname\relax
+% \end{macrocode}
+%
+% \begin{macro}{\BIC@Expand}
+% \begin{macrocode}
+ \def\BIC@Expand#1{%
+ \romannumeral0%
+ \BIC@@Expand#1!\@nil{}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@Expand}
+% \begin{macrocode}
+ \def\BIC@@Expand#1#2\@nil#3{%
+ \expandafter\ifcat\noexpand#1\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \expandafter\BIC@@Expand#1#2\@nil{#3}%
+ }{%
+ \ifx#1!%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ { #3}{%
+ \BIC@@Expand#2\@nil{#3#1}%
+ }%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@firstoftwo}
+% \begin{macrocode}
+ \expandafter\ifx\csname @firstoftwo\endcsname\relax
+ \long\def\@firstoftwo#1#2{#1}%
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@secondoftwo}
+% \begin{macrocode}
+ \expandafter\ifx\csname @secondoftwo\endcsname\relax
+ \long\def\@secondoftwo#1#2{#2}%
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\else
+% \end{macrocode}
+% \begin{macro}{\BIC@Expand}
+% \begin{macrocode}
+ \def\BIC@Expand#1{%
+ \romannumeral0\expandafter\expandafter\expandafter\BIC@Space
+ \pdf@unescapehex{%
+ \expandafter\expandafter\expandafter
+ \BIC@StripHexSpace\pdf@escapehex{#1}20\@nil
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@StripHexSpace}
+% \begin{macrocode}
+ \def\BIC@StripHexSpace#120#2\@nil{%
+ #1%
+ \ifx\\#2\\%
+ \else
+ \BIC@AfterFi{%
+ \BIC@StripHexSpace#2\@nil
+ }%
+ \BIC@Fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \subsection{Normalize expanded number}
+%
+% \begin{macro}{\BIC@Normalize}
+% |#1|: result sign\\
+% |#2|: first token of number
+% \begin{macrocode}
+\def\BIC@Normalize#1#2{%
+ \ifx#2-%
+ \ifx\\#1\\%
+ \BIC@AfterFiFi{%
+ \BIC@Normalize-%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@Normalize{}%
+ }%
+ \fi
+ \else
+ \ifx#2+%
+ \BIC@AfterFiFi{%
+ \BIC@Normalize{#1}%
+ }%
+ \else
+ \ifx#20%
+ \BIC@AfterFiFiFi{%
+ \BIC@NormalizeZero{#1}%
+ }%
+ \else
+ \BIC@AfterFiFiFi{%
+ \BIC@NormalizeDigits#1#2%
+ }%
+ \fi
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@NormalizeZero}
+% \begin{macrocode}
+\def\BIC@NormalizeZero#1#2{%
+ \ifx#2!%
+ \BIC@AfterFi{ 0}%
+ \else
+ \ifx#20%
+ \BIC@AfterFiFi{%
+ \BIC@NormalizeZero{#1}%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@NormalizeDigits#1#2%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@NormalizeDigits}
+% \begin{macrocode}
+\def\BIC@NormalizeDigits#1!{ #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Num}}
+%
+% \begin{macro}{\bigintcalcNum}
+% \begin{macrocode}
+\def\bigintcalcNum#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Normalize
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \BIC@Expand{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Inv}, \op{Abs}, \op{Sgn}}
+%
+%
+% \begin{macro}{\bigintcalcInv}
+% \begin{macrocode}
+\def\bigintcalcInv#1{%
+ \romannumeral0\expandafter\expandafter\expandafter\BIC@Space
+ \bigintcalcNum{-#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bigintcalcAbs}
+% \begin{macrocode}
+\def\bigintcalcAbs#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Abs
+ \bigintcalcNum{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Abs}
+% \begin{macrocode}
+\def\BIC@Abs#1{%
+ \ifx#1-%
+ \expandafter\BIC@Space
+ \else
+ \expandafter\BIC@Space
+ \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bigintcalcSgn}
+% \begin{macrocode}
+\def\bigintcalcSgn#1{%
+ \number
+ \expandafter\expandafter\expandafter\BIC@Sgn
+ \bigintcalcNum{#1}! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Sgn}
+% \begin{macrocode}
+\def\BIC@Sgn#1#2!{%
+ \ifx#1-%
+ -1%
+ \else
+ \ifx#10%
+ 0%
+ \else
+ 1%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Cmp}, \op{Min}, \op{Max}}
+%
+% \begin{macro}{\bigintcalcCmp}
+% \begin{macrocode}
+\def\bigintcalcCmp#1#2{%
+ \number
+ \expandafter\expandafter\expandafter\BIC@Cmp
+ \bigintcalcNum{#2}!{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Cmp}
+% \begin{macrocode}
+\def\BIC@Cmp#1!#2{%
+ \expandafter\expandafter\expandafter\BIC@@Cmp
+ \bigintcalcNum{#2}!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@Cmp}
+% \begin{macrocode}
+\def\BIC@@Cmp#1#2!#3#4!{%
+ \ifx#1-%
+ \ifx#3-%
+ \BIC@AfterFiFi{%
+ \BIC@@Cmp#4!#2!%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ -1 %
+ }%
+ \fi
+ \else
+ \ifx#3-%
+ \BIC@AfterFiFi{%
+ 1 %
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@CmpLength#1#2!#3#4!#1#2!#3#4!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@PosCmp}
+% \begin{macrocode}
+\def\BIC@PosCmp#1!#2!{%
+ \BIC@CmpLength#1!#2!#1!#2!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@CmpLength}
+% \begin{macrocode}
+\def\BIC@CmpLength#1#2!#3#4!{%
+ \ifx\\#2\\%
+ \ifx\\#4\\%
+ \BIC@AfterFiFi\BIC@CmpDiff
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@CmpResult{-1}%
+ }%
+ \fi
+ \else
+ \ifx\\#4\\%
+ \BIC@AfterFiFi{%
+ \BIC@CmpResult1%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@CmpLength#2!#4!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@CmpResult}
+% \begin{macrocode}
+\def\BIC@CmpResult#1#2!#3!{#1 }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@CmpDiff}
+% \begin{macrocode}
+\def\BIC@CmpDiff#1#2!#3#4!{%
+ \ifnum#1<#3 %
+ \BIC@AfterFi{%
+ -1 %
+ }%
+ \else
+ \ifnum#1>#3 %
+ \BIC@AfterFiFi{%
+ 1 %
+ }%
+ \else
+ \ifx\\#2\\%
+ \BIC@AfterFiFiFi{%
+ 0 %
+ }%
+ \else
+ \BIC@AfterFiFiFi{%
+ \BIC@CmpDiff#2!#4!%
+ }%
+ \fi
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bigintcalcMin}
+% \begin{macrocode}
+\def\bigintcalcMin#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@MinMax
+ \bigintcalcNum{#1}!-!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bigintcalcMax}
+% \begin{macrocode}
+\def\bigintcalcMax#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@MinMax
+ \bigintcalcNum{#1}!!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@MinMax}
+% |#1|: $x$\\
+% |#2|: sign for comparison\\
+% |#3|: $y$
+% \begin{macrocode}
+\def\BIC@MinMax#1!#2!#3{%
+ \expandafter\expandafter\expandafter\BIC@@MinMax
+ \bigintcalcNum{#3}!#1!#2!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@MinMax}
+% |#1|: $y$\\
+% |#2|: $x$\\
+% |#3|: sign for comparison
+% \begin{macrocode}
+\def\BIC@@MinMax#1!#2!#3!{%
+ \ifnum\BIC@@Cmp#1!#2!=#31 %
+ \BIC@AfterFi{ #1}%
+ \else
+ \BIC@AfterFi{ #2}%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Odd}}
+%
+% \begin{macro}{\bigintcalcOdd}
+% \begin{macrocode}
+\def\bigintcalcOdd#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Odd
+ \bigintcalcAbs{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BigIntCalcOdd}
+% \begin{macrocode}
+\def\BigIntCalcOdd#1!{%
+ \romannumeral0%
+ \BIC@Odd#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Odd}
+% |#1|: $x$
+% \begin{macrocode}
+\def\BIC@Odd#1#2{%
+ \ifx#2!%
+ \ifodd#1 %
+ \BIC@AfterFiFi{ 1}%
+ \else
+ \BIC@AfterFiFi{ 0}%
+ \fi
+ \else
+ \expandafter\BIC@Odd\expandafter#2%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Inc}, \op{Dec}}
+%
+% \begin{macro}{\bigintcalcInc}
+% \begin{macrocode}
+\def\bigintcalcInc#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@IncSwitch
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@IncSwitch}
+% \begin{macrocode}
+\def\BIC@IncSwitch#1#2!{%
+ \ifcase\BIC@@Cmp#1#2!-1!%
+ \BIC@AfterFi{ 0}%
+ \or
+ \BIC@AfterFi{%
+ \BIC@Inc#1#2!{}%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \expandafter-\romannumeral0%
+ \BIC@Dec#2!{}%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bigintcalcDec}
+% \begin{macrocode}
+\def\bigintcalcDec#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@DecSwitch
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DecSwitch}
+% \begin{macrocode}
+\def\BIC@DecSwitch#1#2!{%
+ \ifcase\BIC@Sgn#1#2! %
+ \BIC@AfterFi{ -1}%
+ \or
+ \BIC@AfterFi{%
+ \BIC@Dec#1#2!{}%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \expandafter-\romannumeral0%
+ \BIC@Inc#2!{}%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BigIntCalcInc}
+% \begin{macrocode}
+\def\BigIntCalcInc#1!{%
+ \romannumeral0\BIC@Inc#1!{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BigIntCalcDec}
+% \begin{macrocode}
+\def\BigIntCalcDec#1!{%
+ \romannumeral0\BIC@Dec#1!{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BIC@Inc}
+% \begin{macrocode}
+\def\BIC@Inc#1#2!#3{%
+ \ifx\\#2\\%
+ \BIC@AfterFi{%
+ \BIC@@Inc1#1#3!{}%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \BIC@Inc#2!{#1#3}%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@Inc}
+% \begin{macrocode}
+\def\BIC@@Inc#1#2#3!#4{%
+ \ifcase#1 %
+ \ifx\\#3\\%
+ \BIC@AfterFiFi{ #2#4}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@@Inc0#3!{#2#4}%
+ }%
+ \fi
+ \else
+ \ifnum#2<9 %
+ \BIC@AfterFiFi{%
+& \expandafter\BIC@@@Inc\the\numexpr#2+1\relax
+$ \expandafter\expandafter\expandafter\BIC@@@Inc
+$ \ifcase#2 \expandafter1%
+$ \or\expandafter2%
+$ \or\expandafter3%
+$ \or\expandafter4%
+$ \or\expandafter5%
+$ \or\expandafter6%
+$ \or\expandafter7%
+$ \or\expandafter8%
+$ \or\expandafter9%
+$? \else\BigIntCalcError:ThisCannotHappen%
+$ \fi
+ 0#3!{#4}%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@@@Inc01#3!{#4}%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@@Inc}
+% \begin{macrocode}
+\def\BIC@@@Inc#1#2#3!#4{%
+ \ifx\\#3\\%
+ \ifnum#2=1 %
+ \BIC@AfterFiFi{ 1#1#4}%
+ \else
+ \BIC@AfterFiFi{ #1#4}%
+ \fi
+ \else
+ \BIC@AfterFi{%
+ \BIC@@Inc#2#3!{#1#4}%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BIC@Dec}
+% \begin{macrocode}
+\def\BIC@Dec#1#2!#3{%
+ \ifx\\#2\\%
+ \BIC@AfterFi{%
+ \BIC@@Dec1#1#3!{}%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \BIC@Dec#2!{#1#3}%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@Dec}
+% \begin{macrocode}
+\def\BIC@@Dec#1#2#3!#4{%
+ \ifcase#1 %
+ \ifx\\#3\\%
+ \BIC@AfterFiFi{ #2#4}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@@Dec0#3!{#2#4}%
+ }%
+ \fi
+ \else
+ \ifnum#2>0 %
+ \BIC@AfterFiFi{%
+& \expandafter\BIC@@@Dec\the\numexpr#2-1\relax
+$ \expandafter\expandafter\expandafter\BIC@@@Dec
+$ \ifcase#2
+$? \BigIntCalcError:ThisCannotHappen%
+$ \or\expandafter0%
+$ \or\expandafter1%
+$ \or\expandafter2%
+$ \or\expandafter3%
+$ \or\expandafter4%
+$ \or\expandafter5%
+$ \or\expandafter6%
+$ \or\expandafter7%
+$ \or\expandafter8%
+$? \else\BigIntCalcError:ThisCannotHappen%
+$ \fi
+ 0#3!{#4}%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@@@Dec91#3!{#4}%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@@Dec}
+% \begin{macrocode}
+\def\BIC@@@Dec#1#2#3!#4{%
+ \ifx\\#3\\%
+ \ifcase#1 %
+ \ifx\\#4\\%
+ \BIC@AfterFiFiFi{ 0}%
+ \else
+ \BIC@AfterFiFiFi{ #4}%
+ \fi
+ \else
+ \BIC@AfterFiFi{ #1#4}%
+ \fi
+ \else
+ \BIC@AfterFi{%
+ \BIC@@Dec#2#3!{#1#4}%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Add}, \op{Sub}}
+%
+% \begin{macro}{\bigintcalcAdd}
+% \begin{macrocode}
+\def\bigintcalcAdd#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Add
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Add}
+% \begin{macrocode}
+\def\BIC@Add#1!#2{%
+ \expandafter\expandafter\expandafter
+ \BIC@AddSwitch\bigintcalcNum{#2}!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bigintcalcSub}
+% \begin{macrocode}
+\def\bigintcalcSub#1#2{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Add
+ \bigintcalcNum{-#2}!{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BIC@AddSwitch}
+% Decision table for \cs{BIC@AddSwitch}.
+% \begin{quote}
+% \begin{tabular}[t]{@{}|l|l|l|l|l|@{}}
+% \hline
+% $x<0$ & $y<0$ & $-x>-y$ & $-$ & $\opAdd(-x,-y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opAdd(-y,-x)$\\
+% \cline{2-5}
+% & else & $-x> y$ & $-$ & $\opSub(-x, y)$\\
+% \cline{3-5}
+% & & $-x= y$ & & $0$\\
+% \cline{3-5}
+% & & else & $+$ & $\opSub( y,-x)$\\
+% \hline
+% else & $y<0$ & $ x>-y$ & $+$ & $\opSub( x,-y)$\\
+% \cline{3-5}
+% & & $ x=-y$ & & $0$\\
+% \cline{3-5}
+% & & else & $-$ & $\opSub(-y, x)$\\
+% \cline{2-5}
+% & else & $ x> y$ & $+$ & $\opAdd( x, y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opAdd( y, x)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\BIC@AddSwitch#1#2!#3#4!{%
+ \ifx#1-% x < 0
+ \ifx#3-% y < 0
+ \expandafter-\romannumeral0%
+ \ifnum\BIC@PosCmp#2!#4!=1 % -x > -y
+ \BIC@AfterFiFiFi{%
+ \BIC@AddXY#2!#4!!!%
+ }%
+ \else % -x <= -y
+ \BIC@AfterFiFiFi{%
+ \BIC@AddXY#4!#2!!!%
+ }%
+ \fi
+ \else % y >= 0
+ \ifcase\BIC@PosCmp#2!#3#4!% -x = y
+ \BIC@AfterFiFiFi{ 0}%
+ \or % -x > y
+ \expandafter-\romannumeral0%
+ \BIC@AfterFiFiFi{%
+ \BIC@SubXY#2!#3#4!!!%
+ }%
+ \else % -x <= y
+ \BIC@AfterFiFiFi{%
+ \BIC@SubXY#3#4!#2!!!%
+ }%
+ \fi
+ \fi
+ \else % x >= 0
+ \ifx#3-% y < 0
+ \ifcase\BIC@PosCmp#1#2!#4!% x = -y
+ \BIC@AfterFiFiFi{ 0}%
+ \or % x > -y
+ \BIC@AfterFiFiFi{%
+ \BIC@SubXY#1#2!#4!!!%
+ }%
+ \else % x <= -y
+ \expandafter-\romannumeral0%
+ \BIC@AfterFiFiFi{%
+ \BIC@SubXY#4!#1#2!!!%
+ }%
+ \fi
+ \else % y >= 0
+ \ifnum\BIC@PosCmp#1#2!#3#4!=1 % x > y
+ \BIC@AfterFiFiFi{%
+ \BIC@AddXY#1#2!#3#4!!!%
+ }%
+ \else % x <= y
+ \BIC@AfterFiFiFi{%
+ \BIC@AddXY#3#4!#1#2!!!%
+ }%
+ \fi
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BigIntCalcAdd}
+% \begin{macrocode}
+\def\BigIntCalcAdd#1!#2!{%
+ \romannumeral0\BIC@AddXY#1!#2!!!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BigIntCalcSub}
+% \begin{macrocode}
+\def\BigIntCalcSub#1!#2!{%
+ \romannumeral0\BIC@SubXY#1!#2!!!%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BIC@AddXY}
+% \begin{macrocode}
+\def\BIC@AddXY#1#2!#3#4!#5!#6!{%
+ \ifx\\#2\\%
+ \ifx\\#3\\%
+ \BIC@AfterFiFi{%
+ \BIC@DoAdd0!#1#5!#60!%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@DoAdd0!#1#5!#3#6!%
+ }%
+ \fi
+ \else
+ \ifx\\#4\\%
+ \ifx\\#3\\%
+ \BIC@AfterFiFiFi{%
+ \BIC@AddXY#2!{}!#1#5!#60!%
+ }%
+ \else
+ \BIC@AfterFiFiFi{%
+ \BIC@AddXY#2!{}!#1#5!#3#6!%
+ }%
+ \fi
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@AddXY#2!#4!#1#5!#3#6!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DoAdd}
+% |#1|: carry\\
+% |#2|: reverted result\\
+% |#3#4|: reverted $x$\\
+% |#5#6|: reverted $y$
+% \begin{macrocode}
+\def\BIC@DoAdd#1#2!#3#4!#5#6!{%
+ \ifx\\#4\\%
+ \BIC@AfterFi{%
+& \expandafter\BIC@Space
+& \the\numexpr#1+#3+#5\relax#2%
+$ \expandafter\expandafter\expandafter\BIC@AddResult
+$ \BIC@AddDigit#1#3#5#2%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \expandafter\expandafter\expandafter\BIC@DoAdd
+ \BIC@AddDigit#1#3#5#2!#4!#6!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@AddResult}
+% \begin{macrocode}
+$ \def\BIC@AddResult#1{%
+$ \ifx#10%
+$ \expandafter\BIC@Space
+$ \else
+$ \expandafter\BIC@Space\expandafter#1%
+$ \fi
+$ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@AddDigit}
+% |#1|: carry\\
+% |#2|: digit of $x$\\
+% |#3|: digit of $y$
+% \begin{macrocode}
+\def\BIC@AddDigit#1#2#3{%
+ \romannumeral0%
+& \expandafter\BIC@@AddDigit\the\numexpr#1+#2+#3!%
+$ \expandafter\BIC@@AddDigit\number%
+$ \csname
+$ BIC@AddCarry%
+$ \ifcase#1 %
+$ #2%
+$ \else
+$ \ifcase#2 1\or2\or3\or4\or5\or6\or7\or8\or9\or10\fi
+$ \fi
+$ \endcsname#3!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@AddDigit}
+% \begin{macrocode}
+\def\BIC@@AddDigit#1!{%
+ \ifnum#1<10 %
+ \BIC@AfterFi{ 0#1}%
+ \else
+ \BIC@AfterFi{ #1}%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@AddCarry0}
+% \begin{macrocode}
+$ \expandafter\def\csname BIC@AddCarry0\endcsname#1{#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@AddCarry10}
+% \begin{macrocode}
+$ \expandafter\def\csname BIC@AddCarry10\endcsname#1{1#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@AddCarry[1-9]}
+% \begin{macrocode}
+$ \def\BIC@Temp#1#2{%
+$ \expandafter\def\csname BIC@AddCarry#1\endcsname##1{%
+$ \ifcase##1 #1\or
+$ #2%
+$? \else\BigIntCalcError:ThisCannotHappen%
+$ \fi
+$ }%
+$ }%
+$ \BIC@Temp 0{1\or2\or3\or4\or5\or6\or7\or8\or9}%
+$ \BIC@Temp 1{2\or3\or4\or5\or6\or7\or8\or9\or10}%
+$ \BIC@Temp 2{3\or4\or5\or6\or7\or8\or9\or10\or11}%
+$ \BIC@Temp 3{4\or5\or6\or7\or8\or9\or10\or11\or12}%
+$ \BIC@Temp 4{5\or6\or7\or8\or9\or10\or11\or12\or13}%
+$ \BIC@Temp 5{6\or7\or8\or9\or10\or11\or12\or13\or14}%
+$ \BIC@Temp 6{7\or8\or9\or10\or11\or12\or13\or14\or15}%
+$ \BIC@Temp 7{8\or9\or10\or11\or12\or13\or14\or15\or16}%
+$ \BIC@Temp 8{9\or10\or11\or12\or13\or14\or15\or16\or17}%
+$ \BIC@Temp 9{10\or11\or12\or13\or14\or15\or16\or17\or18}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BIC@SubXY}
+% Preconditions:
+% \begin{itemize}
+% \item $x > y$, $x \geq 0$, and $y >= 0$
+% \item digits($x$) = digits($y$)
+% \end{itemize}
+% \begin{macrocode}
+\def\BIC@SubXY#1#2!#3#4!#5!#6!{%
+ \ifx\\#2\\%
+ \ifx\\#3\\%
+ \BIC@AfterFiFi{%
+ \BIC@DoSub0!#1#5!#60!%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@DoSub0!#1#5!#3#6!%
+ }%
+ \fi
+ \else
+ \ifx\\#4\\%
+ \ifx\\#3\\%
+ \BIC@AfterFiFiFi{%
+ \BIC@SubXY#2!{}!#1#5!#60!%
+ }%
+ \else
+ \BIC@AfterFiFiFi{%
+ \BIC@SubXY#2!{}!#1#5!#3#6!%
+ }%
+ \fi
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@SubXY#2!#4!#1#5!#3#6!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DoSub}
+% |#1|: carry\\
+% |#2|: reverted result\\
+% |#3#4|: reverted x\\
+% |#5#6|: reverted y
+% \begin{macrocode}
+\def\BIC@DoSub#1#2!#3#4!#5#6!{%
+ \ifx\\#4\\%
+ \BIC@AfterFi{%
+ \expandafter\expandafter\expandafter\BIC@SubResult
+ \BIC@SubDigit#1#3#5#2%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \expandafter\expandafter\expandafter\BIC@DoSub
+ \BIC@SubDigit#1#3#5#2!#4!#6!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@SubResult}
+% \begin{macrocode}
+\def\BIC@SubResult#1{%
+ \ifx#10%
+ \expandafter\BIC@SubResult
+ \else
+ \expandafter\BIC@Space\expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@SubDigit}
+% |#1|: carry\\
+% |#2|: digit of $x$\\
+% |#3|: digit of $y$
+% \begin{macrocode}
+\def\BIC@SubDigit#1#2#3{%
+ \romannumeral0%
+& \expandafter\BIC@@SubDigit\the\numexpr#2-#3-#1!%
+$ \expandafter\BIC@@AddDigit\number
+$ \csname
+$ BIC@SubCarry%
+$ \ifcase#1 %
+$ #3%
+$ \else
+$ \ifcase#3 1\or2\or3\or4\or5\or6\or7\or8\or9\or10\fi
+$ \fi
+$ \endcsname#2!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@SubDigit}
+% \begin{macrocode}
+& \def\BIC@@SubDigit#1!{%
+& \ifnum#1<0 %
+& \BIC@AfterFi{%
+& \expandafter\BIC@Space
+& \expandafter1\the\numexpr#1+10\relax
+& }%
+& \else
+& \BIC@AfterFi{ 0#1}%
+& \BIC@Fi
+& }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@SubCarry0}
+% \begin{macrocode}
+$ \expandafter\def\csname BIC@SubCarry0\endcsname#1{#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@SubCarry10}%
+% \begin{macrocode}
+$ \expandafter\def\csname BIC@SubCarry10\endcsname#1{1#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@SubCarry[1-9]}
+% \begin{macrocode}
+$ \def\BIC@Temp#1#2{%
+$ \expandafter\def\csname BIC@SubCarry#1\endcsname##1{%
+$ \ifcase##1 #2%
+$? \else\BigIntCalcError:ThisCannotHappen%
+$ \fi
+$ }%
+$ }%
+$ \BIC@Temp 1{19\or0\or1\or2\or3\or4\or5\or6\or7\or8}%
+$ \BIC@Temp 2{18\or19\or0\or1\or2\or3\or4\or5\or6\or7}%
+$ \BIC@Temp 3{17\or18\or19\or0\or1\or2\or3\or4\or5\or6}%
+$ \BIC@Temp 4{16\or17\or18\or19\or0\or1\or2\or3\or4\or5}%
+$ \BIC@Temp 5{15\or16\or17\or18\or19\or0\or1\or2\or3\or4}%
+$ \BIC@Temp 6{14\or15\or16\or17\or18\or19\or0\or1\or2\or3}%
+$ \BIC@Temp 7{13\or14\or15\or16\or17\or18\or19\or0\or1\or2}%
+$ \BIC@Temp 8{12\or13\or14\or15\or16\or17\or18\or19\or0\or1}%
+$ \BIC@Temp 9{11\or12\or13\or14\or15\or16\or17\or18\or19\or0}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Shl}, \op{Shr}}
+%
+% \begin{macro}{\bigintcalcShl}
+% \begin{macrocode}
+\def\bigintcalcShl#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Shl
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Shl}
+% \begin{macrocode}
+\def\BIC@Shl#1#2!{%
+ \ifx#1-%
+ \BIC@AfterFi{%
+ \expandafter-\romannumeral0%
+& \BIC@@Shl#2!!%
+$ \BIC@AddXY#2!#2!!!%
+ }%
+ \else
+ \BIC@AfterFi{%
+& \BIC@@Shl#1#2!!%
+$ \BIC@AddXY#1#2!#1#2!!!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BigIntCalcShl}
+% \begin{macrocode}
+\def\BigIntCalcShl#1!{%
+ \romannumeral0%
+& \BIC@@Shl#1!!%
+$ \BIC@AddXY#1!#1!!!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@Shl}
+% \begin{macrocode}
+& \def\BIC@@Shl#1#2!{%
+& \ifx\\#2\\%
+& \BIC@AfterFi{%
+& \BIC@@@Shl0!#1%
+& }%
+& \else
+& \BIC@AfterFi{%
+& \BIC@@Shl#2!#1%
+& }%
+& \BIC@Fi
+& }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@@Shl}
+% |#1|: carry\\
+% |#2|: result\\
+% |#3#4|: reverted number
+% \begin{macrocode}
+& \def\BIC@@@Shl#1#2!#3#4!{%
+& \ifx\\#4\\%
+& \BIC@AfterFi{%
+& \expandafter\BIC@Space
+& \the\numexpr#3*2+#1\relax#2%
+& }%
+& \else
+& \BIC@AfterFi{%
+& \expandafter\BIC@@@@Shl\the\numexpr#3*2+#1!#2!#4!%
+& }%
+& \BIC@Fi
+& }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@@@Shl}
+% \begin{macrocode}
+& \def\BIC@@@@Shl#1!{%
+& \ifnum#1<10 %
+& \BIC@AfterFi{%
+& \BIC@@@Shl0#1%
+& }%
+& \else
+& \BIC@AfterFi{%
+& \BIC@@@Shl#1%
+& }%
+& \BIC@Fi
+& }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bigintcalcShr}
+% \begin{macrocode}
+\def\bigintcalcShr#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Shr
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Shr}
+% \begin{macrocode}
+\def\BIC@Shr#1#2!{%
+ \ifx#1-%
+ \expandafter-\romannumeral0%
+ \BIC@AfterFi{%
+ \BIC@@Shr#2!%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \BIC@@Shr#1#2!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BigIntCalcShr}
+% \begin{macrocode}
+\def\BigIntCalcShr#1!{%
+ \romannumeral0%
+ \BIC@@Shr#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@Shr}
+% \begin{macrocode}
+\def\BIC@@Shr#1#2!{%
+ \ifcase#1 %
+ \BIC@AfterFi{ 0}%
+ \or
+ \ifx\\#2\\%
+ \BIC@AfterFiFi{ 0}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@@@Shr#1#2!!%
+ }%
+ \fi
+ \else
+ \BIC@AfterFi{%
+ \BIC@@@Shr0#1#2!!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@@Shr}
+% |#1|: carry\\
+% |#2#3|: number\\
+% |#4|: result
+% \begin{macrocode}
+\def\BIC@@@Shr#1#2#3!#4!{%
+ \ifx\\#3\\%
+ \ifodd#1#2 %
+ \BIC@AfterFiFi{%
+& \expandafter\BIC@ShrResult\the\numexpr(#1#2-1)/2\relax
+$ \expandafter\expandafter\expandafter\BIC@ShrResult
+$ \csname BIC@ShrDigit#1#2\endcsname
+ #4!%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+& \expandafter\BIC@ShrResult\the\numexpr#1#2/2\relax
+$ \expandafter\expandafter\expandafter\BIC@ShrResult
+$ \csname BIC@ShrDigit#1#2\endcsname
+ #4!%
+ }%
+ \fi
+ \else
+ \ifodd#1#2 %
+ \BIC@AfterFiFi{%
+& \expandafter\BIC@@@@Shr\the\numexpr(#1#2-1)/2\relax1%
+$ \expandafter\expandafter\expandafter\BIC@@@@Shr
+$ \csname BIC@ShrDigit#1#2\endcsname
+ #3!#4!%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+& \expandafter\BIC@@@@Shr\the\numexpr#1#2/2\relax0%
+$ \expandafter\expandafter\expandafter\BIC@@@@Shr
+$ \csname BIC@ShrDigit#1#2\endcsname
+ #3!#4!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ShrResult}
+% \begin{macrocode}
+& \def\BIC@ShrResult#1#2!{ #2#1}%
+$ \def\BIC@ShrResult#1#2#3!{ #3#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@@@Shr}
+% |#1|: new digit\\
+% |#2|: carry\\
+% |#3|: remaining number\\
+% |#4|: result
+% \begin{macrocode}
+\def\BIC@@@@Shr#1#2#3!#4!{%
+ \BIC@@@Shr#2#3!#4#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ShrDigit[00-19]}
+% \begin{macrocode}
+$ \def\BIC@Temp#1#2#3#4{%
+$ \expandafter\def\csname BIC@ShrDigit#1#2\endcsname{#3#4}%
+$ }%
+$ \BIC@Temp 0000%
+$ \BIC@Temp 0101%
+$ \BIC@Temp 0210%
+$ \BIC@Temp 0311%
+$ \BIC@Temp 0420%
+$ \BIC@Temp 0521%
+$ \BIC@Temp 0630%
+$ \BIC@Temp 0731%
+$ \BIC@Temp 0840%
+$ \BIC@Temp 0941%
+$ \BIC@Temp 1050%
+$ \BIC@Temp 1151%
+$ \BIC@Temp 1260%
+$ \BIC@Temp 1361%
+$ \BIC@Temp 1470%
+$ \BIC@Temp 1571%
+$ \BIC@Temp 1680%
+$ \BIC@Temp 1781%
+$ \BIC@Temp 1890%
+$ \BIC@Temp 1991%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{BIC@Tim}}
+%
+% \begin{macro}{\BIC@Tim}
+% Macro \cs{BIC@Tim} implements ``Number \emph{tim}es digit''.\\
+% |#1|: plain number without sign\\
+% |#2|: digit
+\def\BIC@Tim#1!#2{%
+ \romannumeral0%
+ \ifcase#2 % 0
+ \BIC@AfterFi{ 0}%
+ \or % 1
+ \BIC@AfterFi{ #1}%
+ \or % 2
+ \BIC@AfterFi{%
+ \BIC@Shl#1!%
+ }%
+ \else % 3-9
+ \BIC@AfterFi{%
+ \BIC@@Tim#1!!#2%
+ }%
+ \BIC@Fi
+}
+% \begin{macrocode}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@Tim}
+% |#1#2|: number\\
+% |#3|: reverted number
+% \begin{macrocode}
+\def\BIC@@Tim#1#2!{%
+ \ifx\\#2\\%
+ \BIC@AfterFi{%
+ \BIC@ProcessTim0!#1%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \BIC@@Tim#2!#1%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ProcessTim}
+% |#1|: carry\\
+% |#2|: result\\
+% |#3#4|: reverted number\\
+% |#5|: digit
+% \begin{macrocode}
+\def\BIC@ProcessTim#1#2!#3#4!#5{%
+ \ifx\\#4\\%
+ \BIC@AfterFi{%
+ \expandafter\BIC@Space
+& \the\numexpr#3*#5+#1\relax
+$ \romannumeral0\BIC@TimDigit#3#5#1%
+ #2%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \expandafter\BIC@@ProcessTim
+& \the\numexpr#3*#5+#1%
+$ \romannumeral0\BIC@TimDigit#3#5#1%
+ !#2!#4!#5%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@ProcessTim}
+% |#1#2|: carry?, new digit\\
+% |#3|: new number\\
+% |#4|: old number\\
+% |#5|: digit
+% \begin{macrocode}
+\def\BIC@@ProcessTim#1#2!{%
+ \ifx\\#2\\%
+ \BIC@AfterFi{%
+ \BIC@ProcessTim0#1%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \BIC@ProcessTim#1#2%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@TimDigit}
+% |#1|: digit 0--9\\
+% |#2|: digit 3--9\\
+% |#3|: carry 0--9
+% \begin{macrocode}
+$ \def\BIC@TimDigit#1#2#3{%
+$ \ifcase#1 % 0
+$ \BIC@AfterFi{ #3}%
+$ \or % 1
+$ \BIC@AfterFi{%
+$ \expandafter\BIC@Space
+$ \number\csname BIC@AddCarry#2\endcsname#3 %
+$ }%
+$ \else
+$ \ifcase#3 %
+$ \BIC@AfterFiFi{%
+$ \expandafter\BIC@Space
+$ \number\csname BIC@MulDigit#2\endcsname#1 %
+$ }%
+$ \else
+$ \BIC@AfterFiFi{%
+$ \expandafter\BIC@Space
+$ \romannumeral0%
+$ \expandafter\BIC@AddXY
+$ \number\csname BIC@MulDigit#2\endcsname#1!%
+$ #3!!!%
+$ }%
+$ \fi
+$ \BIC@Fi
+$ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@MulDigit[3-9]}
+% \begin{macrocode}
+$ \def\BIC@Temp#1#2{%
+$ \expandafter\def\csname BIC@MulDigit#1\endcsname##1{%
+$ \ifcase##1 0%
+$ \or ##1%
+$ \or #2%
+$? \else\BigIntCalcError:ThisCannotHappen%
+$ \fi
+$ }%
+$ }%
+$ \BIC@Temp 3{6\or9\or12\or15\or18\or21\or24\or27}%
+$ \BIC@Temp 4{8\or12\or16\or20\or24\or28\or32\or36}%
+$ \BIC@Temp 5{10\or15\or20\or25\or30\or35\or40\or45}%
+$ \BIC@Temp 6{12\or18\or24\or30\or36\or42\or48\or54}%
+$ \BIC@Temp 7{14\or21\or28\or35\or42\or49\or56\or63}%
+$ \BIC@Temp 8{16\or24\or32\or40\or48\or56\or64\or72}%
+$ \BIC@Temp 9{18\or27\or36\or45\or54\or63\or72\or81}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Mul}}
+%
+% \begin{macro}{\bigintcalcMul}
+% \begin{macrocode}
+\def\bigintcalcMul#1#2{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Mul
+ \bigintcalcNum{#1}!{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Mul}
+% \begin{macrocode}
+\def\BIC@Mul#1!#2{%
+ \expandafter\expandafter\expandafter\BIC@MulSwitch
+ \bigintcalcNum{#2}!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@MulSwitch}
+% Decision table for \cs{BIC@MulSwitch}.
+% \begin{quote}
+% \begin{tabular}[t]{@{}|l|l|l|l|l|@{}}
+% \hline
+% $x=0$ &\multicolumn{3}{l}{} &$0$\\
+% \hline
+% $x>0$ & $y=0$ &\multicolumn2l{}&$0$\\
+% \cline{2-5}
+% & $y>0$ & $ x> y$ & $+$ & $\opMul( x, y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opMul( y, x)$\\
+% \cline{2-5}
+% & $y<0$ & $ x>-y$ & $-$ & $\opMul( x,-y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opMul(-y, x)$\\
+% \hline
+% $x<0$ & $y=0$ &\multicolumn2l{}&$0$\\
+% \cline{2-5}
+% & $y>0$ & $-x> y$ & $-$ & $\opMul(-x, y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opMul( y,-x)$\\
+% \cline{2-5}
+% & $y<0$ & $-x>-y$ & $+$ & $\opMul(-x,-y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opMul(-y,-x)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\BIC@MulSwitch#1#2!#3#4!{%
+ \ifcase\BIC@Sgn#1#2! % x = 0
+ \BIC@AfterFi{ 0}%
+ \or % x > 0
+ \ifcase\BIC@Sgn#3#4! % y = 0
+ \BIC@AfterFiFi{ 0}%
+ \or % y > 0
+ \ifnum\BIC@PosCmp#1#2!#3#4!=1 % x > y
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessMul0!#1#2!#3#4!%
+ }%
+ \else % x <= y
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessMul0!#3#4!#1#2!%
+ }%
+ \fi
+ \else % y < 0
+ \expandafter-\romannumeral0%
+ \ifnum\BIC@PosCmp#1#2!#4!=1 % x > -y
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessMul0!#1#2!#4!%
+ }%
+ \else % x <= -y
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessMul0!#4!#1#2!%
+ }%
+ \fi
+ \fi
+ \else % x < 0
+ \ifcase\BIC@Sgn#3#4! % y = 0
+ \BIC@AfterFiFi{ 0}%
+ \or % y > 0
+ \expandafter-\romannumeral0%
+ \ifnum\BIC@PosCmp#2!#3#4!=1 % -x > y
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessMul0!#2!#3#4!%
+ }%
+ \else % -x <= y
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessMul0!#3#4!#2!%
+ }%
+ \fi
+ \else % y < 0
+ \ifnum\BIC@PosCmp#2!#4!=1 % -x > -y
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessMul0!#2!#4!%
+ }%
+ \else % -x <= -y
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessMul0!#4!#2!%
+ }%
+ \fi
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BigIntCalcMul}
+% \begin{macrocode}
+\def\BigIntCalcMul#1!#2!{%
+ \romannumeral0%
+ \BIC@ProcessMul0!#1!#2!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ProcessMul}
+% |#1|: result\\
+% |#2|: number $x$\\
+% |#3#4|: number $y$
+% \begin{macrocode}
+\def\BIC@ProcessMul#1!#2!#3#4!{%
+ \ifx\\#4\\%
+ \BIC@AfterFi{%
+ \expandafter\expandafter\expandafter\BIC@Space
+ \bigintcalcAdd{\BIC@Tim#2!#3}{#10}%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \expandafter\expandafter\expandafter\BIC@ProcessMul
+ \bigintcalcAdd{\BIC@Tim#2!#3}{#10}!#2!#4!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Sqr}}
+%
+% \begin{macro}{\bigintcalcSqr}
+% \begin{macrocode}
+\def\bigintcalcSqr#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Sqr
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Sqr}
+% \begin{macrocode}
+\def\BIC@Sqr#1{%
+ \ifx#1-%
+ \expandafter\BIC@@Sqr
+ \else
+ \expandafter\BIC@@Sqr\expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@Sqr}
+% \begin{macrocode}
+\def\BIC@@Sqr#1!{%
+ \BIC@ProcessMul0!#1!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Fac}}
+%
+% \begin{macro}{\bigintcalcFac}
+% \begin{macrocode}
+\def\bigintcalcFac#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Fac
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Fac}
+% \begin{macrocode}
+\def\BIC@Fac#1#2!{%
+ \ifx#1-%
+ \BIC@AfterFi{ 0\BigIntCalcError:FacNegative}%
+ \else
+ \ifnum\BIC@PosCmp#1#2!13!<0 %
+ \ifcase#1#2 %
+ \BIC@AfterFiFiFi{ 1}% 0!
+ \or\BIC@AfterFiFiFi{ 1}% 1!
+ \or\BIC@AfterFiFiFi{ 2}% 2!
+ \or\BIC@AfterFiFiFi{ 6}% 3!
+ \or\BIC@AfterFiFiFi{ 24}% 4!
+ \or\BIC@AfterFiFiFi{ 120}% 5!
+ \or\BIC@AfterFiFiFi{ 720}% 6!
+ \or\BIC@AfterFiFiFi{ 5040}% 7!
+ \or\BIC@AfterFiFiFi{ 40320}% 8!
+ \or\BIC@AfterFiFiFi{ 362880}% 9!
+ \or\BIC@AfterFiFiFi{ 3628800}% 10!
+ \or\BIC@AfterFiFiFi{ 39916800}% 11!
+ \or\BIC@AfterFiFiFi{ 479001600}% 12!
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@ProcessFac#1#2!479001600!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ProcessFac}
+% |#1|: $n$\\
+% |#2|: result
+% \begin{macrocode}
+\def\BIC@ProcessFac#1!#2!{%
+ \ifnum\BIC@PosCmp#1!12!=0 %
+ \BIC@AfterFi{ #2}%
+ \else
+ \BIC@AfterFi{%
+ \expandafter\BIC@@ProcessFac
+ \romannumeral0\BIC@ProcessMul0!#2!#1!%
+ !#1!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@ProcessFac}
+% |#1|: result\\
+% |#2|: $n$
+% \begin{macrocode}
+\def\BIC@@ProcessFac#1!#2!{%
+ \expandafter\BIC@ProcessFac
+ \romannumeral0\BIC@Dec#2!{}%
+ !#1!%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Pow}}
+%
+% \begin{macro}{\bigintcalcPow}
+% |#1|: basis\\
+% |#2|: power
+% \begin{macrocode}
+\def\bigintcalcPow#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Pow
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Pow}
+% |#1|: basis\\
+% |#2|: power
+% \begin{macrocode}
+\def\BIC@Pow#1!#2{%
+ \expandafter\expandafter\expandafter\BIC@PowSwitch
+ \bigintcalcNum{#2}!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@PowSwitch}
+% |#1#2|: power $y$\\
+% |#3#4|: basis $x$\\
+% Decision table for \cs{BIC@PowSwitch}.
+% \begin{quote}
+% \def\M#1{\multicolumn{#1}{l}{}}%
+% \begin{tabular}[t]{@{}|l|l|l|l|@{}}
+% \hline
+% $y=0$ & \M{2} & $1$\\
+% \hline
+% $y=1$ & \M{2} & $x$\\
+% \hline
+% $y=2$ & $x<0$ & \M{1} & $\opMul(-x,-x)$\\
+% \cline{2-4}
+% & else & \M{1} & $\opMul(x,x)$\\
+% \hline
+% $y<0$ & $x=0$ & \M{1} & DivisionByZero\\
+% \cline{2-4}
+% & $x=1$ & \M{1} & $1$\\
+% \cline{2-4}
+% & $x=-1$ & $\opODD(y)$ & $-1$\\
+% \cline{3-4}
+% & & else & $1$\\
+% \cline{2-4}
+% & else ($\string|x\string|>1$) & \M{1} & $0$\\
+% \hline
+% $y>2$ & $x=0$ & \M{1} & $0$\\
+% \cline{2-4}
+% & $x=1$ & \M{1} & $1$\\
+% \cline{2-4}
+% & $x=-1$ & $\opODD(y)$ & $-1$\\
+% \cline{3-4}
+% & & else & $1$\\
+% \cline{2-4}
+% & $x<-1$ ($x<0$) & $\opODD(y)$ & $-\opPow(-x,y)$\\
+% \cline{3-4}
+% & & else & $\opPow(-x,y)$\\
+% \cline{2-4}
+% & else ($x>1$) & \M{1} & $\opPow(x,y)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\BIC@PowSwitch#1#2!#3#4!{%
+ \ifcase\ifx\\#2\\%
+ \ifx#100 % y = 0
+ \else\ifx#111 % y = 1
+ \else\ifx#122 % y = 2
+ \else4 % y > 2
+ \fi\fi\fi
+ \else
+ \ifx#1-3 % y < 0
+ \else4 % y > 2
+ \fi
+ \fi
+ \BIC@AfterFi{ 1}% y = 0
+ \or % y = 1
+ \BIC@AfterFi{ #3#4}%
+ \or % y = 2
+ \ifx#3-% x < 0
+ \BIC@AfterFiFi{%
+ \BIC@ProcessMul0!#4!#4!%
+ }%
+ \else % x >= 0
+ \BIC@AfterFiFi{%
+ \BIC@ProcessMul0!#3#4!#3#4!%
+ }%
+ \fi
+ \or % y < 0
+ \ifcase\ifx\\#4\\%
+ \ifx#300 % x = 0
+ \else\ifx#311 % x = 1
+ \else3 % x > 1
+ \fi\fi
+ \else
+ \ifcase\BIC@MinusOne#3#4! %
+ 3 % |x| > 1
+ \or
+ 2 % x = -1
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+ \fi
+ \BIC@AfterFiFi{ 0\BigIntCalcError:DivisionByZero}% x = 0
+ \or % x = 1
+ \BIC@AfterFiFi{ 1}% x = 1
+ \or % x = -1
+ \ifcase\BIC@ModTwo#2! % even(y)
+ \BIC@AfterFiFiFi{ 1}%
+ \or % odd(y)
+ \BIC@AfterFiFiFi{ -1}%
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+ \or % |x| > 1
+ \BIC@AfterFiFi{ 0}%
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+ \or % y > 2
+ \ifcase\ifx\\#4\\%
+ \ifx#300 % x = 0
+ \else\ifx#311 % x = 1
+ \else4 % x > 1
+ \fi\fi
+ \else
+ \ifx#3-%
+ \ifcase\BIC@MinusOne#3#4! %
+ 3 % x < -1
+ \else
+ 2 % x = -1
+ \fi
+ \else
+ 4 % x > 1
+ \fi
+ \fi
+ \BIC@AfterFiFi{ 0}% x = 0
+ \or % x = 1
+ \BIC@AfterFiFi{ 1}% x = 1
+ \or % x = -1
+ \ifcase\BIC@ModTwo#1#2! % even(y)
+ \BIC@AfterFiFiFi{ 1}%
+ \or % odd(y)
+ \BIC@AfterFiFiFi{ -1}%
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+ \or % x < -1
+ \ifcase\BIC@ModTwo#1#2! % even(y)
+ \BIC@AfterFiFiFi{%
+ \BIC@PowRec#4!#1#2!1!%
+ }%
+ \or % odd(y)
+ \expandafter-\romannumeral0%
+ \BIC@AfterFiFiFi{%
+ \BIC@PowRec#4!#1#2!1!%
+ }%
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+ \or % x > 1
+ \BIC@AfterFiFi{%
+ \BIC@PowRec#3#4!#1#2!1!%
+ }%
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Help macros}
+%
+% \begin{macro}{\BIC@ModTwo}
+% Macro \cs{BIC@ModTwo} expects a number without sign
+% and returns digit |1| or |0| if the number is odd or even.
+% \begin{macrocode}
+\def\BIC@ModTwo#1#2!{%
+ \ifx\\#2\\%
+ \ifodd#1 %
+ \BIC@AfterFiFi1%
+ \else
+ \BIC@AfterFiFi0%
+ \fi
+ \else
+ \BIC@AfterFi{%
+ \BIC@ModTwo#2!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BIC@MinusOne}
+% Macro \cs{BIC@MinusOne} expects a number and returns
+% digit |1| if the number equals minus one and returns |0| otherwise.
+% \begin{macrocode}
+\def\BIC@MinusOne#1#2!{%
+ \ifx#1-%
+ \BIC@@MinusOne#2!%
+ \else
+ 0%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@MinusOne}
+% \begin{macrocode}
+\def\BIC@@MinusOne#1#2!{%
+ \ifx#11%
+ \ifx\\#2\\%
+ 1%
+ \else
+ 0%
+ \fi
+ \else
+ 0%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Recursive calculation}
+%
+% \begin{macro}{\BIC@PowRec}
+%\begin{quote}
+%\begin{verbatim}
+%Pow(x, y) {
+% PowRec(x, y, 1)
+%}
+%PowRec(x, y, r) {
+% if y == 1 then
+% return r
+% else
+% ifodd y then
+% return PowRec(x*x, y div 2, r*x) % y div 2 = (y-1)/2
+% else
+% return PowRec(x*x, y div 2, r)
+% fi
+% fi
+%}
+%\end{verbatim}
+%\end{quote}
+% |#1|: $x$ (basis)\\
+% |#2#3|: $y$ (power)\\
+% |#4|: $r$ (result)
+% \begin{macrocode}
+\def\BIC@PowRec#1!#2#3!#4!{%
+ \ifcase\ifx#21\ifx\\#3\\0 \else1 \fi\else1 \fi % y = 1
+ \ifnum\BIC@PosCmp#1!#4!=1 % x > r
+ \BIC@AfterFiFi{%
+ \BIC@ProcessMul0!#1!#4!%
+ }%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@ProcessMul0!#4!#1!%
+ }%
+ \fi
+ \or
+ \ifcase\BIC@ModTwo#2#3! % even(y)
+ \BIC@AfterFiFi{%
+ \expandafter\BIC@@PowRec\romannumeral0%
+ \BIC@@Shr#2#3!%
+ !#1!#4!%
+ }%
+ \or % odd(y)
+ \ifnum\BIC@PosCmp#1!#4!=1 % x > r
+ \BIC@AfterFiFiFi{%
+ \expandafter\BIC@@@PowRec\romannumeral0%
+ \BIC@ProcessMul0!#1!#4!%
+ !#1!#2#3!%
+ }%
+ \else
+ \BIC@AfterFiFiFi{%
+ \expandafter\BIC@@@PowRec\romannumeral0%
+ \BIC@ProcessMul0!#1!#4!%
+ !#1!#2#3!%
+ }%
+ \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@PowRec}
+% |#1|: $y/2$\\
+% |#2|: $x$\\
+% |#3|: new $r$ ($r$ or $r*x$)
+% \begin{macrocode}
+\def\BIC@@PowRec#1!#2!#3!{%
+ \expandafter\BIC@PowRec\romannumeral0%
+ \BIC@ProcessMul0!#2!#2!%
+ !#1!#3!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@@PowRec}
+% |#1|: $r*x$
+% |#2|: $x$
+% |#3|: $y$
+% \begin{macrocode}
+\def\BIC@@@PowRec#1!#2!#3!{%
+ \expandafter\BIC@@PowRec\romannumeral0%
+ \BIC@@Shr#3!%
+ !#2!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Div}}
+%
+% \begin{macro}{\bigintcalcDiv}
+% |#1|: $x$\\
+% |#2|: $y$ (divisor)
+% \begin{macrocode}
+\def\bigintcalcDiv#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Div
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Div}
+% |#1|: $x$\\
+% |#2|: $y$
+% \begin{macrocode}
+\def\BIC@Div#1!#2{%
+ \expandafter\expandafter\expandafter\BIC@DivSwitchSign
+ \bigintcalcNum{#2}!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BigIntCalcDiv}
+% \begin{macrocode}
+\def\BigIntCalcDiv#1!#2!{%
+ \romannumeral0%
+ \BIC@DivSwitchSign#2!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivSwitchSign}
+% Decision table for \cs{BIC@DivSwitchSign}.
+% \begin{quote}
+% \begin{tabular}{@{}|l|l|l|@{}}
+% \hline
+% $y=0$ & \multicolumn{1}{l}{} & DivisionByZero\\
+% \hline
+% $y>0$ & $x=0$ & $0$\\
+% \cline{2-3}
+% & $x>0$ & DivSwitch$(+,x,y)$\\
+% \cline{2-3}
+% & $x<0$ & DivSwitch$(-,-x,y)$\\
+% \hline
+% $y<0$ & $x=0$ & $0$\\
+% \cline{2-3}
+% & $x>0$ & DivSwitch$(-,x,-y)$\\
+% \cline{2-3}
+% & $x<0$ & DivSwitch$(+,-x,-y)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% |#1|: $y$ (divisor)\\
+% |#2|: $x$
+% \begin{macrocode}
+\def\BIC@DivSwitchSign#1#2!#3#4!{%
+ \ifcase\BIC@Sgn#1#2! % y = 0
+ \BIC@AfterFi{ 0\BigIntCalcError:DivisionByZero}%
+ \or % y > 0
+ \ifcase\BIC@Sgn#3#4! % x = 0
+ \BIC@AfterFiFi{ 0}%
+ \or % x > 0
+ \BIC@AfterFiFi{%
+ \BIC@DivSwitch{}#3#4!#1#2!%
+ }%
+ \else % x < 0
+ \BIC@AfterFiFi{%
+ \BIC@DivSwitch-#4!#1#2!%
+ }%
+ \fi
+ \else % y < 0
+ \ifcase\BIC@Sgn#3#4! % x = 0
+ \BIC@AfterFiFi{ 0}%
+ \or % x > 0
+ \BIC@AfterFiFi{%
+ \BIC@DivSwitch-#3#4!#2!%
+ }%
+ \else % x < 0
+ \BIC@AfterFiFi{%
+ \BIC@DivSwitch{}#4!#2!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivSwitch}
+% Decision table for \cs{BIC@DivSwitch}.
+% \begin{quote}
+% \begin{tabular}{@{}|l|l|l|@{}}
+% \hline
+% $y=x$ & \multicolumn{1}{l}{} & sign $1$\\
+% \hline
+% $y>x$ & \multicolumn{1}{l}{} & $0$\\
+% \hline
+% $y<x$ & $y=1$ & sign $x$\\
+% \cline{2-3}
+% & $y=2$ & sign Shr$(x)$\\
+% \cline{2-3}
+% & $y=4$ & sign Shr(Shr$(x)$)\\
+% \cline{2-3}
+% & else & sign ProcessDiv$(x,y)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% |#1|: sign\\
+% |#2|: $x$\\
+% |#3#4|: $y$ ($y\ne 0$)
+% \begin{macrocode}
+\def\BIC@DivSwitch#1#2!#3#4!{%
+ \ifcase\BIC@PosCmp#3#4!#2!% y = x
+ \BIC@AfterFi{ #11}%
+ \or % y > x
+ \BIC@AfterFi{ 0}%
+ \else % y < x
+ \ifx\\#1\\%
+ \else
+ \expandafter-\romannumeral0%
+ \fi
+ \ifcase\ifx\\#4\\%
+ \ifx#310 % y = 1
+ \else\ifx#321 % y = 2
+ \else\ifx#342 % y = 4
+ \else3 % y > 2
+ \fi\fi\fi
+ \else
+ 3 % y > 2
+ \fi
+ \BIC@AfterFiFi{ #2}% y = 1
+ \or % y = 2
+ \BIC@AfterFiFi{%
+ \BIC@@Shr#2!%
+ }%
+ \or % y = 4
+ \BIC@AfterFiFi{%
+ \expandafter\BIC@@Shr\romannumeral0%
+ \BIC@@Shr#2!!%
+ }%
+ \or % y > 2
+ \BIC@AfterFiFi{%
+ \BIC@DivStartX#2!#3#4!!!%
+ }%
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ProcessDiv}
+% |#1#2|: $x$\\
+% |#3#4|: $y$\\
+% |#5|: collect first digits of $x$\\
+% |#6|: corresponding digits of $y$
+% \begin{macrocode}
+\def\BIC@DivStartX#1#2!#3#4!#5!#6!{%
+ \ifx\\#4\\%
+ \BIC@AfterFi{%
+ \BIC@DivStartYii#6#3#4!{#5#1}#2=!%
+ }%
+ \else
+ \BIC@AfterFi{%
+ \BIC@DivStartX#2!#4!#5#1!#6#3!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivStartYii}
+% |#1|: $y$\\
+% |#2|: $x$, |=|
+% \begin{macrocode}
+\def\BIC@DivStartYii#1!{%
+ \expandafter\BIC@DivStartYiv\romannumeral0%
+ \BIC@Shl#1!%
+ !#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivStartYiv}
+% |#1|: $2y$\\
+% |#2|: $y$\\
+% |#3|: $x$, |=|
+% \begin{macrocode}
+\def\BIC@DivStartYiv#1!{%
+ \expandafter\BIC@DivStartYvi\romannumeral0%
+ \BIC@Shl#1!%
+ !#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivStartYvi}
+% |#1|: $4y$\\
+% |#2|: $2y$\\
+% |#3|: $y$\\
+% |#4|: $x$, |=|
+% \begin{macrocode}
+\def\BIC@DivStartYvi#1!#2!{%
+ \expandafter\BIC@DivStartYviii\romannumeral0%
+ \BIC@AddXY#1!#2!!!%
+ !#1!#2!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivStartYviii}
+% |#1|: $6y$\\
+% |#2|: $4y$\\
+% |#3|: $2y$\\
+% |#4|: $y$\\
+% |#5|: $x$, |=|
+% \begin{macrocode}
+\def\BIC@DivStartYviii#1!#2!{%
+ \expandafter\BIC@DivStart\romannumeral0%
+ \BIC@Shl#2!%
+ !#1!#2!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivStart}
+% |#1|: $8y$\\
+% |#2|: $6y$\\
+% |#3|: $4y$\\
+% |#4|: $2y$\\
+% |#5|: $y$\\
+% |#6|: $x$, |=|
+% \begin{macrocode}
+\def\BIC@DivStart#1!#2!#3!#4!#5!#6!{%
+ \BIC@ProcessDiv#6!!#5!#4!#3!#2!#1!=%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ProcessDiv}
+% |#1#2#3|: $x$, |=|\\
+% |#4|: result\\
+% |#5|: $y$\\
+% |#6|: $2y$\\
+% |#7|: $4y$\\
+% |#8|: $6y$\\
+% |#9|: $8y$
+% \begin{macrocode}
+\def\BIC@ProcessDiv#1#2#3!#4!#5!{%
+ \ifcase\BIC@PosCmp#5!#1!% y = #1
+ \ifx#2=%
+ \BIC@AfterFiFi{\BIC@DivCleanup{#41}}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@ProcessDiv#2#3!#41!#5!%
+ }%
+ \fi
+ \or % y > #1
+ \ifx#2=%
+ \BIC@AfterFiFi{\BIC@DivCleanup{#40}}%
+ \else
+ \ifx\\#4\\%
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessDiv{#1#2}#3!!#5!%
+ }%
+ \else
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessDiv{#1#2}#3!#40!#5!%
+ }%
+ \fi
+ \fi
+ \else % y < #1
+ \BIC@AfterFi{%
+ \BIC@@ProcessDiv{#1}#2#3!#4!#5!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivCleanup}
+% |#1|: result\\
+% |#2|: garbage
+% \begin{macrocode}
+\def\BIC@DivCleanup#1#2={ #1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@@ProcessDiv}
+% \begin{macrocode}
+\def\BIC@@ProcessDiv#1#2#3!#4!#5!#6!#7!{%
+ \ifcase\BIC@PosCmp#7!#1!% 4y = #1
+ \ifx#2=%
+ \BIC@AfterFiFi{\BIC@DivCleanup{#44}}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@ProcessDiv#2#3!#44!#5!#6!#7!%
+ }%
+ \fi
+ \or % 4y > #1
+ \ifcase\BIC@PosCmp#6!#1!% 2y = #1
+ \ifx#2=%
+ \BIC@AfterFiFiFi{\BIC@DivCleanup{#42}}%
+ \else
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessDiv#2#3!#42!#5!#6!#7!%
+ }%
+ \fi
+ \or % 2y > #1
+ \ifx#2=%
+ \BIC@AfterFiFiFi{\BIC@DivCleanup{#41}}%
+ \else
+ \BIC@AfterFiFiFi{%
+ \BIC@DivSub#1!#5!#2#3!#41!#5!#6!#7!%
+ }%
+ \fi
+ \else % 2y < #1
+ \BIC@AfterFiFi{%
+ \expandafter\BIC@ProcessDivII\romannumeral0%
+ \BIC@SubXY#1!#6!!!%
+ !#2#3!#4!#5!23%
+ #6!#7!%
+ }%
+ \fi
+ \else % 4y < #1
+ \BIC@AfterFi{%
+ \BIC@@@ProcessDiv{#1}#2#3!#4!#5!#6!#7!%
+ }%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@DivSub}
+% Next token group: |#1|-|#2| and next digit |#3|.
+% \begin{macrocode}
+\def\BIC@DivSub#1!#2!#3{%
+ \expandafter\BIC@ProcessDiv\expandafter{%
+ \romannumeral0%
+ \BIC@SubXY#1!#2!!!%
+ #3%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ProcessDivII}
+% |#1|: $x'-2y$\\
+% |#2#3|: remaining $x$, |=|\\
+% |#4|: result\\
+% |#5|: $y$\\
+% |#6|: first possible result digit\\
+% |#7|: second possible result digit
+% \begin{macrocode}
+\def\BIC@ProcessDivII#1!#2#3!#4!#5!#6#7{%
+ \ifcase\BIC@PosCmp#5!#1!% y = #1
+ \ifx#2=%
+ \BIC@AfterFiFi{\BIC@DivCleanup{#4#7}}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@ProcessDiv#2#3!#4#7!#5!%
+ }%
+ \fi
+ \or % y > #1
+ \ifx#2=%
+ \BIC@AfterFiFi{\BIC@DivCleanup{#4#6}}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@ProcessDiv{#1#2}#3!#4#6!#5!%
+ }%
+ \fi
+ \else % y < #1
+ \ifx#2=%
+ \BIC@AfterFiFi{\BIC@DivCleanup{#4#7}}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@DivSub#1!#5!#2#3!#4#7!#5!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ProcessDivIV}
+% |#1#2#3|: $x$, |=|, $x>4y$\\
+% |#4|: result\\
+% |#5|: $y$\\
+% |#6|: $2y$\\
+% |#7|: $4y$\\
+% |#8|: $6y$\\
+% |#9|: $8y$
+% \begin{macrocode}
+\def\BIC@@@ProcessDiv#1#2#3!#4!#5!#6!#7!#8!#9!{%
+ \ifcase\BIC@PosCmp#8!#1!% 6y = #1
+ \ifx#2=%
+ \BIC@AfterFiFi{\BIC@DivCleanup{#46}}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@ProcessDiv#2#3!#46!#5!#6!#7!#8!#9!%
+ }%
+ \fi
+ \or % 6y > #1
+ \BIC@AfterFi{%
+ \expandafter\BIC@ProcessDivII\romannumeral0%
+ \BIC@SubXY#1!#7!!!%
+ !#2#3!#4!#5!45%
+ #6!#7!#8!#9!%
+ }%
+ \else % 6y < #1
+ \ifcase\BIC@PosCmp#9!#1!% 8y = #1
+ \ifx#2=%
+ \BIC@AfterFiFiFi{\BIC@DivCleanup{#48}}%
+ \else
+ \BIC@AfterFiFiFi{%
+ \BIC@ProcessDiv#2#3!#48!#5!#6!#7!#8!#9!%
+ }%
+ \fi
+ \or % 8y > #1
+ \BIC@AfterFiFi{%
+ \expandafter\BIC@ProcessDivII\romannumeral0%
+ \BIC@SubXY#1!#8!!!%
+ !#2#3!#4!#5!67%
+ #6!#7!#8!#9!%
+ }%
+ \else % 8y < #1
+ \BIC@AfterFiFi{%
+ \expandafter\BIC@ProcessDivII\romannumeral0%
+ \BIC@SubXY#1!#9!!!%
+ !#2#3!#4!#5!89%
+ #6!#7!#8!#9!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\op{Mod}}
+%
+% \begin{macro}{\bigintcalcMod}
+% |#1|: $x$\\
+% |#2|: $y$
+% \begin{macrocode}
+\def\bigintcalcMod#1{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BIC@Mod
+ \bigintcalcNum{#1}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@Mod}
+% |#1|: $x$\\
+% |#2|: $y$
+% \begin{macrocode}
+\def\BIC@Mod#1!#2{%
+ \expandafter\expandafter\expandafter\BIC@ModSwitchSign
+ \bigintcalcNum{#2}!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BigIntCalcMod}
+% \begin{macrocode}
+\def\BigIntCalcMod#1!#2!{%
+ \romannumeral0%
+ \BIC@ModSwitchSign#2!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ModSwitchSign}
+% Decision table for \cs{BIC@ModSwitchSign}.
+% \begin{quote}
+% \begin{tabular}{@{}|l|l|l|@{}}
+% \hline
+% $y=0$ & \multicolumn{1}{l}{} & DivisionByZero\\
+% \hline
+% $y>0$ & $x=0$ & $0$\\
+% \cline{2-3}
+% & else & ModSwitch$(+,x,y)$\\
+% \hline
+% $y<0$ & \multicolumn{1}{l}{} & ModSwitch$(-,-x,-y)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% |#1#2|: $y$\\
+% |#3#4|: $x$
+% \begin{macrocode}
+\def\BIC@ModSwitchSign#1#2!#3#4!{%
+ \ifcase\ifx\\#2\\%
+ \ifx#100 % y = 0
+ \else1 % y > 0
+ \fi
+ \else
+ \ifx#1-2 % y < 0
+ \else1 % y > 0
+ \fi
+ \fi
+ \BIC@AfterFi{ 0\BigIntCalcError:DivisionByZero}%
+ \or % y > 0
+ \ifcase\ifx\\#4\\\ifx#300 \else1 \fi\else1 \fi % x = 0
+ \BIC@AfterFiFi{ 0}%
+ \else
+ \BIC@AfterFiFi{%
+ \BIC@ModSwitch{}#3#4!#1#2!%
+ }%
+ \fi
+ \else % y < 0
+ \ifcase\ifx\\#4\\%
+ \ifx#300 % x = 0
+ \else1 % x > 0
+ \fi
+ \else
+ \ifx#3-2 % x < 0
+ \else1 % x > 0
+ \fi
+ \fi
+ \BIC@AfterFiFi{ 0}%
+ \or % x > 0
+ \BIC@AfterFiFi{%
+ \BIC@ModSwitch--#3#4!#2!%
+ }%
+ \else % x < 0
+ \BIC@AfterFiFi{%
+ \BIC@ModSwitch-#4!#2!%
+ }%
+ \fi
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ModSwitch}
+% Decision table for \cs{BIC@ModSwitch}.
+% \begin{quote}
+% \begin{tabular}{@{}|l|l|l|@{}}
+% \hline
+% $y=1$ & \multicolumn{1}{l}{} & $0$\\
+% \hline
+% $y=2$ & ifodd$(x)$ & sign $1$\\
+% \cline{2-3}
+% & else & $0$\\
+% \hline
+% $y>2$ & $x<0$ &
+% $z\leftarrow x-(x/y)*y;\quad (z<0)\mathbin{?}z+y\mathbin{:}z$\\
+% \cline{2-3}
+% & $x>0$ & $x - (x/y) * y$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% |#1|: sign\\
+% |#2#3|: $x$\\
+% |#4#5|: $y$
+% \begin{macrocode}
+\def\BIC@ModSwitch#1#2#3!#4#5!{%
+ \ifcase\ifx\\#5\\%
+ \ifx#410 % y = 1
+ \else\ifx#421 % y = 2
+ \else2 % y > 2
+ \fi\fi
+ \else2 % y > 2
+ \fi
+ \BIC@AfterFi{ 0}% y = 1
+ \or % y = 2
+ \ifcase\BIC@ModTwo#2#3! % even(x)
+ \BIC@AfterFiFi{ 0}%
+ \or % odd(x)
+ \BIC@AfterFiFi{ #11}%
+? \else\BigIntCalcError:ThisCannotHappen%
+ \fi
+ \or % y > 2
+ \ifx\\#1\\%
+ \else
+ \expandafter\BIC@Space\romannumeral0%
+ \expandafter\BIC@ModMinus\romannumeral0%
+ \fi
+ \ifx#2-% x < 0
+ \BIC@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BIC@ModX
+ \bigintcalcSub{#2#3}{%
+ \bigintcalcMul{#4#5}{\bigintcalcDiv{#2#3}{#4#5}}%
+ }!#4#5!%
+ }%
+ \else % x > 0
+ \BIC@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BIC@Space
+ \bigintcalcSub{#2#3}{%
+ \bigintcalcMul{#4#5}{\bigintcalcDiv{#2#3}{#4#5}}%
+ }%
+ }%
+ \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ModMinus}
+% \begin{macrocode}
+\def\BIC@ModMinus#1{%
+ \ifx#10%
+ \BIC@AfterFi{ 0}%
+ \else
+ \BIC@AfterFi{ -#1}%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BIC@ModX}
+% |#1#2|: $z$\\
+% |#3|: $x$
+% \begin{macrocode}
+\def\BIC@ModX#1#2!#3!{%
+ \ifx#1-% z < 0
+ \BIC@AfterFi{%
+ \expandafter\BIC@Space\romannumeral0%
+ \BIC@SubXY#3!#2!!!%
+ }%
+ \else % z >= 0
+ \BIC@AfterFi{ #1#2}%
+ \BIC@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\BIC@AtEnd%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \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 bigintcalc.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \subsubsection{Preamble with test macro definitions}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{article}
+%<noetex>\let\SavedNumexpr\numexpr
+%<noetex>\let\numexpr\UNDEFINED
+\makeatletter
+\chardef\BIC@TestMode=1 %
+\makeatother
+\usepackage{bigintcalc}[2016/05/16]
+%<noetex>\let\numexpr\SavedNumexpr
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\newcommand*{\TestSpaceAtEnd}[1]{%
+%<noetex> \let\SavedNumexpr\numexpr
+%<noetex> \let\numexpr\UNDEFINED
+ \edef\resultA{#1}%
+ \edef\resultB{#1 }%
+%<noetex> \let\numexpr\SavedNumexpr
+ \Expect*{\resultA\space}*{\resultB}%
+}
+\newcommand*{\TestResult}[2]{%
+%<noetex> \let\SavedNumexpr\numexpr
+%<noetex> \let\numexpr\UNDEFINED
+ \edef\result{#1}%
+%<noetex> \let\numexpr\SavedNumexpr
+ \Expect*{\result}{#2}%
+}
+\newcommand*{\TestResultTwoExpansions}[2]{%
+%<*noetex>
+ \begingroup
+ \let\numexpr\UNDEFINED
+ \expandafter\expandafter\expandafter
+ \endgroup
+%</noetex>
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{#1}{#2}%
+}
+\newcount\TestCount
+%<etex>\newcommand*{\TestArg}[1]{\numexpr#1\relax}
+%<noetex>\newcommand*{\TestArg}[1]{#1}
+\newcommand*{\TestTeXDivide}[2]{%
+ \TestCount=\TestArg{#1}\relax
+ \divide\TestCount by \TestArg{#2}\relax
+ \Expect*{\bigintcalcDiv{#1}{#2}}*{\the\TestCount}%
+}
+\newcommand*{\Test}[2]{%
+ \TestResult{#1}{#2}%
+ \TestResultTwoExpansions{#1}{#2}%
+ \TestSpaceAtEnd{#1}%
+}
+\newcommand*{\TestExch}[2]{\Test{#2}{#1}}
+\newcommand*{\TestInv}[2]{%
+ \Test{\bigintcalcInv{#1}}{#2}%
+}
+\newcommand*{\TestAbs}[2]{%
+ \Test{\bigintcalcAbs{#1}}{#2}%
+}
+\newcommand*{\TestSgn}[2]{%
+ \Test{\bigintcalcSgn{#1}}{#2}%
+}
+\newcommand*{\TestMin}[3]{%
+ \Test{\bigintcalcMin{#1}{#2}}{#3}%
+}
+\newcommand*{\TestMax}[3]{%
+ \Test{\bigintcalcMax{#1}{#2}}{#3}%
+}
+\newcommand*{\TestCmp}[3]{%
+ \Test{\bigintcalcCmp{#1}{#2}}{#3}%
+}
+\newcommand*{\TestOdd}[2]{%
+ \Test{\bigintcalcOdd{#1}}{#2}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcOdd
+ \bigintcalcAbs{#1}!%
+ }{#2}%
+ }%
+ \x
+}
+\newcommand*{\TestInc}[2]{%
+ \Test{\bigintcalcInc{#1}}{#2}%
+ \ifnum\bigintcalcSgn{#1}>-1 %
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcInc\bigintcalcNum{#1}!%
+ }{#2}%
+ }%
+ \x
+ \fi
+}
+\newcommand*{\TestDec}[2]{%
+ \Test{\bigintcalcDec{#1}}{#2}%
+ \ifnum\bigintcalcSgn{#1}>0 %
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcDec\bigintcalcNum{#1}!%
+ }{#2}%
+ }%
+ \x
+ \fi
+}
+\newcommand*{\TestAdd}[3]{%
+ \Test{\bigintcalcAdd{#1}{#2}}{#3}%
+ \ifnum\bigintcalcSgn{#1}>0 %
+ \ifnum\bigintcalcSgn{#2}> 0 %
+ \ifnum\bigintcalcCmp{#1}{#2}>0 %
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcAdd
+ \bigintcalcNum{#1}!\bigintcalcNum{#2}!%
+ }{#3}%
+ }%
+ \x
+ \else
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcAdd
+ \bigintcalcNum{#2}!\bigintcalcNum{#1}!%
+ }{#3}%
+ }%
+ \x
+ \fi
+ \fi
+ \fi
+}
+\newcommand*{\TestSub}[3]{%
+ \Test{\bigintcalcSub{#1}{#2}}{#3}%
+ \ifnum\bigintcalcSgn{#1}>0 %
+ \ifnum\bigintcalcSgn{#2}> 0 %
+ \ifnum\bigintcalcCmp{#1}{#2}>0 %
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcSub
+ \bigintcalcNum{#1}!\bigintcalcNum{#2}!%
+ }{#3}%
+ }%
+ \x
+ \fi
+ \fi
+ \fi
+}
+\newcommand*{\TestShl}[2]{%
+ \Test{\bigintcalcShl{#1}}{#2}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcShl\bigintcalcAbs{#1}!%
+ }{\bigintcalcAbs{#2}}%
+ }%
+ \x
+}
+\newcommand*{\TestShr}[2]{%
+ \Test{\bigintcalcShr{#1}}{#2}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcShr\bigintcalcAbs{#1}!%
+ }{\bigintcalcAbs{#2}}%
+ }%
+ \x
+}
+\newcommand*{\TestMul}[3]{%
+ \Test{\bigintcalcMul{#1}{#2}}{#3}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcMul
+ \bigintcalcAbs{#1}!\bigintcalcAbs{#2}!%
+ }{\bigintcalcAbs{#3}}%
+ }%
+ \x
+}
+\newcommand*{\TestSqr}[2]{%
+ \Test{\bigintcalcSqr{#1}}{#2}%
+}
+\newcommand*{\TestFac}[2]{%
+ \expandafter\TestExch\expandafter{%
+ \the\numexpr#2%
+ }{\bigintcalcFac{#1}}%
+}
+\newcommand*{\TestFacBig}[2]{%
+ \Test{\bigintcalcFac{#1}}{#2}%
+}
+\newcommand*{\TestPow}[3]{%
+ \Test{\bigintcalcPow{#1}{#2}}{#3}%
+}
+\newcommand*{\TestDiv}[3]{%
+ \Test{\bigintcalcDiv{#1}{#2}}{#3}%
+ \TestTeXDivide{#1}{#2}%
+}
+\newcommand*{\TestDivBig}[3]{%
+ \Test{\bigintcalcDiv{#1}{#2}}{#3}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcDiv\bigintcalcAbs{#1}!\bigintcalcAbs{#2}!%
+ }{\bigintcalcAbs{#3}}%
+ }%
+}
+\newcommand*{\TestMod}[3]{%
+ \Test{\bigintcalcMod{#1}{#2}}{#3}%
+ \ifcase\ifcase\bigintcalcSgn{#1} 0%
+ \or
+ \ifcase\bigintcalcSgn{#2} 1%
+ \or 0%
+ \else 1%
+ \fi
+ \else
+ \ifcase\bigintcalcSgn{#2} 1%
+ \or 1%
+ \else 0%
+ \fi
+ \fi\relax
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\BigIntCalcMod
+ \bigintcalcAbs{#1}!\bigintcalcAbs{#2}!%
+ }{\bigintcalcAbs{#3}}%
+ }%
+ \x
+ \fi
+}
+% \end{macrocode}
+%
+% \subsubsection{Time}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfresettimer\endcsname\relax
+\else
+ \makeatletter
+ \newcount\SummaryTime
+ \newcount\TestTime
+ \SummaryTime=\z@
+ \newcommand*{\PrintTime}[2]{%
+ \typeout{%
+ [Time #1: \strip@pt\dimexpr\number#2sp\relax\space s]%
+ }%
+ }%
+ \newcommand*{\StartTime}[1]{%
+ \renewcommand*{\TimeDescription}{#1}%
+ \pdfresettimer
+ }%
+ \newcommand*{\TimeDescription}{}%
+ \newcommand*{\StopTime}{%
+ \TestTime=\pdfelapsedtime
+ \global\advance\SummaryTime\TestTime
+ \PrintTime\TimeDescription\TestTime
+ }%
+ \let\saved@qstest\qstest
+ \let\saved@endqstest\endqstest
+ \def\qstest#1#2{%
+ \saved@qstest{#1}{#2}%
+ \StartTime{#1}%
+ }%
+ \def\endqstest{%
+ \StopTime
+ \saved@endqstest
+ }%
+ \AtEndDocument{%
+ \PrintTime{summary}\SummaryTime
+ }%
+ \makeatother
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Test sets}
+%
+% \begin{macrocode}
+\makeatletter
+
+\begin{qstest}{inv}{inv}%
+ \TestInv{0}{0}%
+ \TestInv{1}{-1}%
+ \TestInv{-1}{1}%
+ \TestInv{10}{-10}%
+ \TestInv{-10}{10}%
+ \TestInv{2147483647}{-2147483647}%
+ \TestInv{-2147483647}{2147483647}%
+ \TestInv{12345678901234567890}{-12345678901234567890}%
+ \TestInv{-12345678901234567890}{12345678901234567890}%
+ \TestInv{ 0 }{0}%
+ \TestInv{ 1 }{-1}%
+ \TestInv{--1}{-1}%
+ \TestInv{\number\z@}{0}%
+ \TestInv{\ifx\relax\relax1\fi}{-1}%
+ \TestInv{\ifx\relax\relax-\fi\ifx234\else1\fi}{1}%
+\end{qstest}
+
+\begin{qstest}{abs}{abs}%
+ \TestAbs{0}{0}%
+ \TestAbs{1}{1}%
+ \TestAbs{-1}{1}%
+ \TestAbs{10}{10}%
+ \TestAbs{-10}{10}%
+ \TestAbs{2147483647}{2147483647}%
+ \TestAbs{-2147483647}{2147483647}%
+ \TestAbs{12345678901234567890}{12345678901234567890}%
+ \TestAbs{-12345678901234567890}{12345678901234567890}%
+ \TestAbs{ 0 }{0}%
+ \TestAbs{ 1 }{1}%
+ \TestAbs{--1}{1}%
+ \TestAbs{-+-+1}{1}%
+ \TestAbs{00000000000}{0}%
+ \TestAbs{00000001000}{1000}%
+ \TestAbs{\ifx\relax\relax 0\else 1\fi}{0}%
+\end{qstest}
+
+\begin{qstest}{sign}{sign}%
+ \TestSgn{0}{0}%
+ \TestSgn{1}{1}%
+ \TestSgn{-1}{-1}%
+ \TestSgn{10}{1}%
+ \TestSgn{-10}{-1}%
+ \TestSgn{2147483647}{1}%
+ \TestSgn{-2147483647}{-1}%
+ \TestSgn{12345678901234567890}{1}%
+ \TestSgn{-12345678901234567890}{-1}%
+ \TestSgn{ 0 }{0}%
+ \TestSgn{ 2 }{1}%
+ \TestSgn{ -2 }{-1}%
+ \TestSgn{--2}{1}%
+ \TestSgn{\number\z@}{0}%
+ \TestSgn{\number\@ne}{1}%
+ \TestSgn{\number\m@ne}{-1}%
+ \TestSgn{%
+ -+-+\number\z@\number\z@
+ \iftrue1\fi\iftrue2\fi\iftrue3\fi
+ }{1}%
+\end{qstest}
+
+\begin{qstest}{min}{min}%
+ \TestMin{0}{1}{0}%
+ \TestMin{1}{0}{0}%
+ \TestMin{-10}{-20}{-20}%
+ \TestMin{ 1 }{ 2 }{1}%
+ \TestMin{ 2 }{ 1 }{1}%
+ \TestMin{1}{1}{1}%
+ \TestMin{\number\z@}{\number\@ne}{0}%
+ \TestMin{\number\@ne}{\number\m@ne}{-1}%
+\end{qstest}
+
+\begin{qstest}{max}{max}%
+ \TestMax{0}{1}{1}%
+ \TestMax{1}{0}{1}%
+ \TestMax{-10}{-20}{-10}%
+ \TestMax{ 1 }{ 2 }{2}%
+ \TestMax{ 2 }{ 1 }{2}%
+ \TestMax{1}{1}{1}%
+ \TestMax{\number\z@}{\number\@ne}{1}%
+ \TestMax{\number\@ne}{\number\m@ne}{1}%
+\end{qstest}
+
+\begin{qstest}{cmp}{cmp}%
+ \TestCmp{0}{0}{0}%
+ \TestCmp{-21}{17}{-1}%
+ \TestCmp{3}{4}{-1}%
+ \TestCmp{-10}{-10}{0}%
+ \TestCmp{-10}{-11}{1}%
+ \TestCmp{100}{5}{1}%
+ \TestCmp{9}{10}{-1}%
+ \TestCmp{10}{9}{1}%
+ \TestCmp{ 3 }{ 3 }{0}%
+ \TestCmp{-9}{-10}{1}%
+ \TestCmp{-10}{-9}{-1}%
+ \TestCmp{-3}{-3}{0}%
+ \TestCmp{0}{-2}{1}%
+ \TestCmp{0}{2}{-1}%
+ \TestCmp{2}{0}{1}%
+ \TestCmp{-2}{0}{-1}%
+ \TestCmp{12}{11}{1}%
+ \TestCmp{11}{12}{-1}%
+ \TestCmp{2147483647}{-2147483647}{1}%
+ \TestCmp{-2147483647}{2147483647}{-1}%
+ \TestCmp{2147483647}{2147483647}{0}%
+ \TestCmp{\number\z@}{\number\@ne}{-1}%
+ \TestCmp{\number\@ne}{\number\m@ne}{1}%
+ \TestCmp{ 4 }{ 5 }{-1}%
+ \TestCmp{ -3 }{ -7 }{1}%
+\end{qstest}
+
+\begin{qstest}{odd}{odd}
+\tracingmacros=1
+ \TestOdd{0}{0}%
+ \TestOdd{1}{1}%
+ \TestOdd{2}{0}%
+ \TestOdd{3}{1}%
+ \TestOdd{14}{0}%
+ \TestOdd{15}{1}%
+ \TestOdd{12345678901234567896}{0}%
+ \TestOdd{12345678901234567897}{1}%
+\end{qstest}
+
+\begin{qstest}{inc}{inc}%
+ \TestInc{0}{1}%
+ \TestInc{1}{2}%
+ \TestInc{-1}{0}%
+ \TestInc{10}{11}%
+ \TestInc{-10}{-9}%
+ \TestInc{ 3 }{4}%
+ \TestInc{999}{1000}%
+ \TestInc{-1000}{-999}%
+ \TestInc{129}{130}%
+ \TestInc{2147483646}{2147483647}%
+ \TestInc{-2147483647}{-2147483646}%
+ \TestInc{12345678901234567890}{12345678901234567891}%
+ \TestInc{99999999999999999999}{100000000000000000000}%
+ \TestInc{-12345678901234567891}{-12345678901234567890}%
+ \TestInc{-100000000000000000000}{-99999999999999999999}%
+\end{qstest}
+
+\begin{qstest}{dec}{dec}%
+ \TestDec{0}{-1}%
+ \TestDec{1}{0}%
+ \TestDec{-1}{-2}%
+ \TestDec{10}{9}%
+ \TestDec{-10}{-11}%
+ \TestDec{1000}{999}%
+ \TestDec{-999}{-1000}%
+ \TestDec{130}{129}%
+ \TestDec{2147483647}{2147483646}%
+ \TestDec{-2147483646}{-2147483647}%
+ \TestDec{12345678901234567891}{12345678901234567890}%
+ \TestDec{100000000000000000000}{99999999999999999999}%
+ \TestDec{-12345678901234567890}{-12345678901234567891}%
+ \TestDec{-99999999999999999999}{-100000000000000000000}%
+\end{qstest}
+
+\begin{qstest}{add}{add}%
+ \TestAdd{0}{0}{0}%
+ \TestAdd{1}{0}{1}%
+ \TestAdd{0}{1}{1}%
+ \TestAdd{1}{2}{3}%
+ \TestAdd{-1}{-1}{-2}%
+ \TestAdd{2147483646}{1}{2147483647}%
+ \TestAdd{-2147483647}{2147483647}{0}%
+ \TestAdd{20}{-5}{15}%
+ \TestAdd{-4}{-1}{-5}%
+ \TestAdd{-1}{-4}{-5}%
+ \TestAdd{-4}{1}{-3}%
+ \TestAdd{-1}{4}{3}%
+ \TestAdd{4}{-1}{3}%
+ \TestAdd{1}{-4}{-3}%
+ \TestAdd{-4}{-1}{-5}%
+ \TestAdd{-1}{-4}{-5}%
+ \TestAdd{ -4 }{ -1 }{-5}%
+ \TestAdd{ -1 }{ -4 }{-5}%
+ \TestAdd{ -4 }{ 1 }{-3}%
+ \TestAdd{ -1 }{ 4 }{3}%
+ \TestAdd{ 4 }{ -1 }{3}%
+ \TestAdd{ 1 }{ -4 }{-3}%
+ \TestAdd{ -4 }{ -1 }{-5}%
+ \TestAdd{ -1 }{ -4 }{-5}%
+ \TestAdd{876543210}{111111111}{987654321}%
+ \TestAdd{999999999}{2}{1000000001}%
+\end{qstest}
+
+\begin{qstest}{sub}{sub}
+ \TestSub{0}{0}{0}%
+ \TestSub{1}{0}{1}%
+ \TestSub{1}{2}{-1}%
+ \TestSub{-1}{-1}{0}%
+ \TestSub{2147483646}{-1}{2147483647}%
+ \TestSub{-2147483647}{-2147483647}{0}%
+ \TestSub{-4}{-1}{-3}%
+ \TestSub{-1}{-4}{3}%
+ \TestSub{-4}{1}{-5}%
+ \TestSub{-1}{4}{-5}%
+ \TestSub{4}{-1}{5}%
+ \TestSub{1}{-4}{5}%
+ \TestSub{-4}{-1}{-3}%
+ \TestSub{-1}{-4}{3}%
+ \TestSub{ -4 }{ -1 }{-3}%
+ \TestSub{ -1 }{ -4 }{3}%
+ \TestSub{ -4 }{ 1 }{-5}%
+ \TestSub{ -1 }{ 4 }{-5}%
+ \TestSub{ 4 }{ -1 }{5}%
+ \TestSub{ 1 }{ -4 }{5}%
+ \TestSub{ -4 }{ -1 }{-3}%
+ \TestSub{ -1 }{ -4 }{3}%
+ \TestSub{1000000000}{2}{999999998}%
+ \TestSub{987654321}{111111111}{876543210}%
+\end{qstest}
+
+\begin{qstest}{shl}{shl}
+ \TestShl{0}{0}%
+ \TestShl{1}{2}%
+ \TestShl{2}{4}%
+ \TestShl{5621}{11242}%
+ \TestShl{1073741823}{2147483646}%
+\end{qstest}
+
+\begin{qstest}{shr}{shr}
+ \TestShr{0}{0}%
+ \TestShr{1}{0}%
+ \TestShr{2}{1}%
+ \TestShr{3}{1}%
+ \TestShr{4}{2}%
+ \TestShr{5}{2}%
+ \TestShr{6}{3}%
+ \TestShr{7}{3}%
+ \TestShr{8}{4}%
+ \TestShr{9}{4}%
+ \TestShr{10}{5}%
+ \TestShr{11}{5}%
+ \TestShr{12}{6}%
+ \TestShr{13}{6}%
+ \TestShr{14}{7}%
+ \TestShr{15}{7}%
+ \TestShr{16}{8}%
+ \TestShr{17}{8}%
+ \TestShr{18}{9}%
+ \TestShr{19}{9}%
+ \TestShr{20}{10}%
+ \TestShr{21}{10}%
+ \TestShr{22}{11}%
+ \TestShr{11241}{5620}%
+ \TestShr{73054202}{36527101}%
+ \TestShr{2147483646}{1073741823}%
+\end{qstest}
+
+\begin{qstest}{mul}{mul}
+ \TestMul{0}{0}{0}%
+ \TestMul{1}{0}{0}%
+ \TestMul{0}{1}{0}%
+ \TestMul{1}{1}{1}%
+ \TestMul{3}{1}{3}%
+ \TestMul{1}{-3}{-3}%
+ \TestMul{-4}{-5}{20}%
+ \TestMul{3}{7}{21}%
+ \TestMul{7}{3}{21}%
+ \TestMul{3}{-7}{-21}%
+ \TestMul{7}{-3}{-21}%
+ \TestMul{-3}{7}{-21}%
+ \TestMul{-7}{3}{-21}%
+ \TestMul{-3}{-7}{21}%
+ \TestMul{-7}{-3}{21}%
+ \TestMul{12}{11}{132}%
+ \TestMul{999}{333}{332667}%
+ \TestMul{1000}{4321}{4321000}%
+ \TestMul{12345}{173955}{2147474475}%
+ \TestMul{1073741823}{2}{2147483646}%
+ \TestMul{2}{1073741823}{2147483646}%
+ \TestMul{-1073741823}{2}{-2147483646}%
+ \TestMul{2}{-1073741823}{-2147483646}%
+ \TestMul{6706022400}{13}{87178291200}%
+\end{qstest}
+
+\begin{qstest}{sqr}{sqr}
+ \TestSqr{0}{0}%
+ \TestSqr{1}{1}%
+ \TestSqr{2}{4}%
+ \TestSqr{3}{9}%
+ \TestSqr{4}{16}%
+ \TestSqr{9}{81}%
+ \TestSqr{10}{100}%
+ \TestSqr{46340}{2147395600}%
+ \TestSqr{-1}{1}%
+ \TestSqr{-2}{4}%
+ \TestSqr{-46340}{2147395600}%
+\end{qstest}
+
+\begin{qstest}{fac}{fac}
+ \TestFac{0}{1}%
+ \TestFac{1}{1}%
+ \TestFac{2}{2}%
+ \TestFac{3}{2*3}%
+ \TestFac{4}{2*3*4}%
+ \TestFac{5}{2*3*4*5}%
+ \TestFac{6}{2*3*4*5*6}%
+ \TestFac{7}{2*3*4*5*6*7}%
+ \TestFac{8}{2*3*4*5*6*7*8}%
+ \TestFac{9}{2*3*4*5*6*7*8*9}%
+ \TestFac{10}{2*3*4*5*6*7*8*9*10}%
+ \TestFac{11}{2*3*4*5*6*7*8*9*10*11}%
+ \TestFac{12}{2*3*4*5*6*7*8*9*10*11*12}%
+ \TestFacBig{13}{6227020800}%
+ \TestFacBig{14}{87178291200}%
+ \TestFacBig{15}{1307674368000}%
+ \TestFacBig{16}{20922789888000}%
+ \TestFacBig{17}{355687428096000}%
+ \TestFacBig{18}{6402373705728000}%
+ \TestFacBig{19}{121645100408832000}%
+ \TestFacBig{20}{2432902008176640000}%
+ \TestFacBig{21}{51090942171709440000}%
+ \TestFacBig{22}{1124000727777607680000}%
+\end{qstest}
+
+\begin{qstest}{pow}{pow}
+ \TestPow{-2}{0}{1}%
+ \TestPow{-1}{0}{1}%
+ \TestPow{0}{0}{1}%
+ \TestPow{1}{0}{1}%
+ \TestPow{2}{0}{1}%
+ \TestPow{3}{0}{1}%
+ \TestPow{-2}{1}{-2}%
+ \TestPow{-1}{1}{-1}%
+ \TestPow{1}{1}{1}%
+ \TestPow{2}{1}{2}%
+ \TestPow{3}{1}{3}%
+ \TestPow{-2}{2}{4}%
+ \TestPow{-1}{2}{1}%
+ \TestPow{0}{2}{0}%
+ \TestPow{1}{2}{1}%
+ \TestPow{2}{2}{4}%
+ \TestPow{3}{2}{9}%
+ \TestPow{0}{1}{0}%
+ \TestPow{1}{-2}{1}%
+ \TestPow{1}{-1}{1}%
+ \TestPow{-1}{-2}{1}%
+ \TestPow{-1}{-1}{-1}%
+ \TestPow{-1}{3}{-1}%
+ \TestPow{-1}{4}{1}%
+ \TestPow{-2}{-1}{0}%
+ \TestPow{-2}{-2}{0}%
+ \TestPow{2}{3}{8}%
+ \TestPow{2}{4}{16}%
+ \TestPow{2}{5}{32}%
+ \TestPow{2}{6}{64}%
+ \TestPow{2}{7}{128}%
+ \TestPow{2}{8}{256}%
+ \TestPow{2}{9}{512}%
+ \TestPow{2}{10}{1024}%
+ \TestPow{-2}{3}{-8}%
+ \TestPow{-2}{4}{16}%
+ \TestPow{-2}{5}{-32}%
+ \TestPow{-2}{6}{64}%
+ \TestPow{-2}{7}{-128}%
+ \TestPow{-2}{8}{256}%
+ \TestPow{-2}{9}{-512}%
+ \TestPow{-2}{10}{1024}%
+ \TestPow{3}{3}{27}%
+ \TestPow{3}{4}{81}%
+ \TestPow{3}{5}{243}%
+ \TestPow{-3}{3}{-27}%
+ \TestPow{-3}{4}{81}%
+ \TestPow{-3}{5}{-243}%
+ \TestPow{2}{30}{1073741824}%
+ \TestPow{-3}{19}{-1162261467}%
+ \TestPow{5}{13}{1220703125}%
+ \TestPow{-7}{11}{-1977326743}%
+\end{qstest}
+
+\begin{qstest}{div}{div}
+ \TestDiv{1}{1}{1}%
+ \TestDiv{2}{1}{2}%
+ \TestDiv{-2}{1}{-2}%
+ \TestDiv{2}{-1}{-2}%
+ \TestDiv{-2}{-1}{2}%
+ \TestDiv{15}{2}{7}%
+ \TestDiv{-16}{2}{-8}%
+ \TestDiv{1}{2}{0}%
+ \TestDiv{1}{3}{0}%
+ \TestDiv{2}{3}{0}%
+ \TestDiv{-2}{3}{0}%
+ \TestDiv{2}{-3}{0}%
+ \TestDiv{-2}{-3}{0}%
+ \TestDiv{13}{3}{4}%
+ \TestDiv{-13}{-3}{4}%
+ \TestDiv{-13}{3}{-4}%
+ \TestDiv{-6}{5}{-1}%
+ \TestDiv{-5}{5}{-1}%
+ \TestDiv{-4}{5}{0}%
+ \TestDiv{-3}{5}{0}%
+ \TestDiv{-2}{5}{0}%
+ \TestDiv{-1}{5}{0}%
+ \TestDiv{0}{5}{0}%
+ \TestDiv{1}{5}{0}%
+ \TestDiv{2}{5}{0}%
+ \TestDiv{3}{5}{0}%
+ \TestDiv{4}{5}{0}%
+ \TestDiv{5}{5}{1}%
+ \TestDiv{6}{5}{1}%
+ \TestDiv{-5}{4}{-1}%
+ \TestDiv{-4}{4}{-1}%
+ \TestDiv{-3}{4}{0}%
+ \TestDiv{-2}{4}{0}%
+ \TestDiv{-1}{4}{0}%
+ \TestDiv{0}{4}{0}%
+ \TestDiv{1}{4}{0}%
+ \TestDiv{2}{4}{0}%
+ \TestDiv{3}{4}{0}%
+ \TestDiv{4}{4}{1}%
+ \TestDiv{5}{4}{1}%
+ \TestDiv{12345}{678}{18}%
+ \TestDiv{32372}{5952}{5}%
+ \TestDiv{284271294}{18162}{15651}%
+ \TestDiv{217652429}{12561}{17327}%
+ \TestDiv{462028434}{5439}{84947}%
+ \TestDiv{2147483647}{1000}{2147483}%
+ \TestDiv{2147483647}{-1000}{-2147483}%
+ \TestDiv{-2147483647}{1000}{-2147483}%
+ \TestDiv{-2147483647}{-1000}{2147483}%
+ \TestDiv{0}{3}{0}%
+ \TestDiv{1}{3}{0}%
+ \TestDiv{2}{3}{0}%
+ \TestDiv{3}{3}{1}%
+ \TestDiv{4}{3}{1}%
+ \TestDiv{5}{3}{1}%
+ \TestDiv{6}{3}{2}%
+ \TestDiv{7}{3}{2}%
+ \TestDiv{8}{3}{2}%
+ \TestDiv{9}{3}{3}%
+ \TestDiv{10}{3}{3}%
+ \TestDiv{11}{3}{3}%
+ \TestDiv{12}{3}{4}%
+ \TestDiv{13}{3}{4}%
+ \TestDiv{14}{3}{4}%
+ \TestDiv{15}{3}{5}%
+ \TestDiv{16}{3}{5}%
+ \TestDiv{17}{3}{5}%
+ \TestDiv{18}{3}{6}%
+ \TestDiv{19}{3}{6}%
+ \TestDiv{20}{3}{6}%
+ \TestDiv{21}{3}{7}%
+ \TestDiv{22}{3}{7}%
+ \TestDiv{23}{3}{7}%
+ \TestDiv{24}{3}{8}%
+ \TestDiv{25}{3}{8}%
+ \TestDiv{26}{3}{8}%
+ \TestDiv{27}{3}{9}%
+ \TestDiv{28}{3}{9}%
+ \TestDiv{29}{3}{9}%
+ \TestDiv{30}{3}{10}%
+ \TestDiv{31}{3}{10}%
+ \TestDivBig{17363436332507}{24702}{702916214}%
+\end{qstest}
+
+\begin{qstest}{mod}{mod}
+ \TestMod{-6}{5}{4}%
+ \TestMod{-5}{5}{0}%
+ \TestMod{-4}{5}{1}%
+ \TestMod{-3}{5}{2}%
+ \TestMod{-2}{5}{3}%
+ \TestMod{-1}{5}{4}%
+ \TestMod{0}{5}{0}%
+ \TestMod{1}{5}{1}%
+ \TestMod{2}{5}{2}%
+ \TestMod{3}{5}{3}%
+ \TestMod{4}{5}{4}%
+ \TestMod{5}{5}{0}%
+ \TestMod{6}{5}{1}%
+ \TestMod{-5}{4}{3}%
+ \TestMod{-4}{4}{0}%
+ \TestMod{-3}{4}{1}%
+ \TestMod{-2}{4}{2}%
+ \TestMod{-1}{4}{3}%
+ \TestMod{0}{4}{0}%
+ \TestMod{1}{4}{1}%
+ \TestMod{2}{4}{2}%
+ \TestMod{3}{4}{3}%
+ \TestMod{4}{4}{0}%
+ \TestMod{5}{4}{1}%
+ \TestMod{-6}{-5}{-1}%
+ \TestMod{-5}{-5}{0}%
+ \TestMod{-4}{-5}{-4}%
+ \TestMod{-3}{-5}{-3}%
+ \TestMod{-2}{-5}{-2}%
+ \TestMod{-1}{-5}{-1}%
+ \TestMod{0}{-5}{0}%
+ \TestMod{1}{-5}{-4}%
+ \TestMod{2}{-5}{-3}%
+ \TestMod{3}{-5}{-2}%
+ \TestMod{4}{-5}{-1}%
+ \TestMod{5}{-5}{0}%
+ \TestMod{6}{-5}{-4}%
+ \TestMod{-5}{-4}{-1}%
+ \TestMod{-4}{-4}{0}%
+ \TestMod{-3}{-4}{-3}%
+ \TestMod{-2}{-4}{-2}%
+ \TestMod{-1}{-4}{-1}%
+ \TestMod{0}{-4}{0}%
+ \TestMod{1}{-4}{-3}%
+ \TestMod{2}{-4}{-2}%
+ \TestMod{3}{-4}{-1}%
+ \TestMod{4}{-4}{0}%
+ \TestMod{5}{-4}{-3}%
+ \TestMod{2147483647}{1000}{647}%
+ \TestMod{2147483647}{-1000}{-353}%
+ \TestMod{-2147483647}{1000}{353}%
+ \TestMod{-2147483647}{-1000}{-647}%
+ \TestMod{ 0 }{ 4 }{0}%
+ \TestMod{ 1 }{ 4 }{1}%
+ \TestMod{ -1 }{ 4 }{3}%
+ \TestMod{ 0 }{ -4 }{0}%
+ \TestMod{ 1 }{ -4 }{-3}%
+ \TestMod{ -1 }{ -4 }{-1}%
+ \TestMod{18362}{25}{12}%
+\end{qstest}
+
+\newcommand*{\TestError}[2]{%
+ \begingroup
+ \expandafter\def\csname BigIntCalcError:#1\endcsname{}%
+ \Expect*{#2}{0}%
+ \expandafter\def\csname BigIntCalcError:#1\endcsname{ERROR}%
+ \Expect*{#2}{0ERROR}%
+ \endgroup
+}
+\begin{qstest}{error}{error}
+ \TestError{FacNegative}{\bigintcalcFac{-1}}%
+ \TestError{FacNegative}{\bigintcalcFac{-2147483647}}%
+ \TestError{DivisionByZero}{\bigintcalcPow{0}{-1}}%
+ \TestError{DivisionByZero}{\bigintcalcDiv{1}{0}}%
+ \TestError{DivisionByZero}{\bigintcalcMod{1}{0}}%
+\end{qstest}
+
+\begin{document}
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/bigintcalc}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/bigintcalc.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/bigintcalc.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[\CTAN{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 bigintcalc.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@{}}
+% bigintcalc.sty & tex/generic/oberdiek/bigintcalc.sty\\
+% bigintcalc.pdf & doc/latex/oberdiek/bigintcalc.pdf\\
+% test/bigintcalc-test1.tex & doc/latex/oberdiek/test/bigintcalc-test1.tex\\
+% test/bigintcalc-test2.tex & doc/latex/oberdiek/test/bigintcalc-test2.tex\\
+% test/bigintcalc-test3.tex & doc/latex/oberdiek/test/bigintcalc-test3.tex\\
+% bigintcalc.dtx & source/latex/oberdiek/bigintcalc.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk bigintcalc.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{bigintcalc.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 bigintcalc.dtx
+%makeindex -s gind.ist bigintcalc.idx
+%pdflatex bigintcalc.dtx
+%makeindex -s gind.ist bigintcalc.idx
+%pdflatex bigintcalc.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{bigintcalc.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='bigintcalc'>
+ <name>bigintcalc</name>
+ <caption>Integer calculations on very large numbers.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2011,2012'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ This package provides expandable arithmetic operations
+ with big integers that can exceed TeX's number limits.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/bigintcalc.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/bigintcalc.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/09/27 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.1}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.2}
+% \item
+% Already loaded package files are not input in \hologo{plainTeX}.
+% \end{Version}
+% \begin{Version}{2012/04/08 v1.3}
+% \item
+% Fix: \xpackage{pdftexcmds} wasn't loaded in case of \hologo{LaTeX}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/bigintcalc.pdf b/macros/latex/contrib/oberdiek/bigintcalc.pdf
new file mode 100644
index 0000000000..a8ac42cd9a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/bigintcalc.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/bitset.dtx b/macros/latex/contrib/oberdiek/bitset.dtx
new file mode 100644
index 0000000000..94da1534e7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/bitset.dtx
@@ -0,0 +1,4250 @@
+% \iffalse meta-comment
+%
+% File: bitset.dtx
+% Version: 2016/05/16 v1.2
+% Info: Handle bit-vector datatype
+%
+% Copyright (C) 2007, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 bitset.dtx
+% and the derived files
+% bitset.sty, bitset.pdf, bitset.ins, bitset.drv, bitset-test1.tex,
+% bitset-test2.tex, bitset-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/bitset.dtx
+% CTAN:macros/latex/contrib/oberdiek/bitset.pdf
+%
+% Unpacking:
+% (a) If bitset.ins is present:
+% tex bitset.ins
+% (b) Without bitset.ins:
+% tex bitset.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{bitset.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If bitset.drv is present:
+% latex bitset.drv
+% (b) Without bitset.drv:
+% latex bitset.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 bitset.dtx
+% makeindex -s gind.ist bitset.idx
+% pdflatex bitset.dtx
+% makeindex -s gind.ist bitset.idx
+% pdflatex bitset.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/bitset.sty
+% TDS:doc/latex/oberdiek/bitset.pdf
+% TDS:doc/latex/oberdiek/test/bitset-test1.tex
+% TDS:doc/latex/oberdiek/test/bitset-test2.tex
+% TDS:doc/latex/oberdiek/test/bitset-test3.tex
+% TDS:source/latex/oberdiek/bitset.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: bitset 2016/05/16 v1.2 Handle bit-vector datatype (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: bitset
+Version: 2016/05/16 v1.2
+
+Copyright (C) 2007, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 bitset.dtx
+and the derived files
+ bitset.sty, bitset.pdf, bitset.ins, bitset.drv, bitset-test1.tex,
+ bitset-test2.tex, bitset-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{bitset.ins}{\from{bitset.dtx}{install}}%
+ \file{bitset.drv}{\from{bitset.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{bitset.sty}{\from{bitset.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{bitset-test1.tex}{\from{bitset.dtx}{test1}}%
+% \file{bitset-test2.tex}{\from{bitset.dtx}{test2,etex}}%
+% \file{bitset-test3.tex}{\from{bitset.dtx}{test2,noetex}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{bitset.xml}{\from{bitset.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{* bitset.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `bitset.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bitset.drv}%
+ [2016/05/16 v1.2 Handle bit-vector datatype (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{amstext}
+\usepackage{ifluatex}
+\ifluatex
+\else
+ \usepackage[T1]{fontenc}%
+ \usepackage{lmodern}%
+\fi
+\begin{document}
+ \DocInput{bitset.dtx}%
+\end{document}
+%</driver>
+% \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{bitset.drv}
+%
+% \title{The \xpackage{bitset} package}
+% \date{2016/05/16 v1.2}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package defines and implements the data type bit set,
+% a vector of bits. The size of the vector may grow dynamically.
+% Individual bits can be manipulated.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \clearpage
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% Annotations in the PDF format know entries whose values are
+% integers. This numbers are interpreted as set of flags
+% specifying properties. For example, annotation dictionaries
+% can have a key |/F|. The bits of its integer value
+% are interpreted the following way:
+% \begin{quote}
+% \begin{tabular}{@{}l|l@{}}
+% Bit position & Property name\\
+% \hline
+% 1 & Invisible\\
+% 2 & Hidden\\
+% 3 & Print\\
+% 4 & NoZoom\\
+% 5 & NoRotate\\
+% 6 & NoView\\
+% 7 & ReadOnly\\
+% \dots & \dots
+% \end{tabular}
+% \end{quote}
+% Now, let's see how these values are set in package \xpackage{hyperref}
+% before it uses this package (before v6.77a):
+%\begin{quote}
+%\begin{verbatim}
+%\ifFld@hidden /F 6\else /F 4\fi
+%\end{verbatim}
+%\end{quote}
+% Where are the other flags? The following example for key |/Ff|
+% in a widget annotation
+% supports at least three properties:
+%\begin{quote}
+%\begin{verbatim}
+%\ifFld@multiline
+% \ifFld@readonly /Ff 4097\else /Ff 4096\fi
+%\else
+% \ifFld@password
+% \ifFld@readonly /Ff 8193\else /Ff 8192\fi
+% \else
+% \ifFld@readonly /Ff 1\fi
+% \fi
+%\fi
+%\end{verbatim}
+%\end{quote}
+% But you see the point. It would be a nightmare to continue
+% this way in supporting the missing flag settings. This kind
+% of integers may have up to 32 bits.
+%
+% Therefore I wanted a data structure for setting and
+% clearing individual bits. Also it should provide
+% an export as decimal number. The snipsets above are
+% executed in expansion contexts without \TeX's stomach
+% commands. It would be convenient to have an expandable
+% conversion from the data structure to the integer that
+% gets written to the PDF file.
+%
+% This package \xpackage{bitset} implements such a data
+% structure. The interface is quite close to Java's
+% class |BitSet| in order not to learn to many interfaces
+% for the same kind of data structure.
+%
+% \subsection{Glossary}
+%
+% \begin{description}
+% \item[Bit set:]
+% A bit set is a vector of bits or flags.
+% The vector size is unlimited and
+% grows dynamically. An undefined bit set is treated as bit
+% set where all bits are cleared.
+%
+% Bit sets are addressed by name. A name should consists of
+% letters or digits. Technically it must survive \cs{csname},
+% see \LaTeX's environment names for other names with such
+% a constraint. Package \xpackage{babel}'s shorthands are
+% not supported due to technical reasons. Shorthand support
+% would break expandable operations.
+% \item[Size:]
+% A size of a bit set is the number of bits in use.
+% It's the number of the highest index, incremented by one.
+% Sizes are in the range |0| up to |2147483647|, the highest
+% number supported by \TeX.
+% \item[Index:]
+% Bit positions in a bit set are addressed by an index number.
+% The bit vector is zero based. The first and least significant
+% bit is addressed by index |0| and the highest possible bit
+% by |2147483646|.
+% \item[Bit:]
+% A bit is enoded as |0| for cleared/disabled or |1| for set/enabled.
+% \end{description}
+%
+% \subsection{Design principles}
+%
+% \begin{description}
+% \item[Name conventions:]
+% To avoid conflicts with existing macro names, the operations
+% are prefixed by the package name.
+% \item[Zero based indexes:] The first bit is addressed by zero.
+% (Convention of array indexing in C, Java, \dots)
+% \item[Unlimited size:]
+% There is no restriction on the size of a bit set other than
+% usual memory limitations. \cs{bitsetSetDec} and \cs{bitsetGetDec}
+% transparently switch to package \xpackage{bigintcalc} if the numbers
+% get too large for \TeX's number limit.
+% \item[Expandibility:]
+% Any operation that does not change the bit set is expandable.
+% And all operations that extract or calculate some result
+% do this in exact two expansion steps. For example,
+% a macro \cs{Macro} wants a bit set as decimal number.
+% But the argument must be a plain number without macros.
+% Thus you could prefix \cs{bitsetGetDec} with \cs{number}.
+% However this won't work for bit sets with 31 or more bits
+% because of \TeX's number limit of $2^{31}-1$.
+% then just hit the operator with two \cs{expandafter}:
+% \begin{quote}
+% |\expandafter\expandafter\expandafter|\\
+% |\Macro\bitsetGetDec{foo}|
+% \end{quote}
+% |\bitsetGetDec| is hit first by the third \cs{expandafter}
+% and then by the second one.
+% \item[Format independence:] This package is written as \LaTeX\ package,
+% but it does not depend on \LaTeX. It will also work for other formats
+% such as \plainTeX.
+% \item[Independence from \TeX\ engines:]
+% Vanilla \TeX\ is all you need. Calculations are delegated to
+% packages \xpackage{intcalc} and \xpackage{bigintcalc}.
+% They don't need any special features, but they will switch
+% to a little more efficient implementation if features such
+% as \cs{numexpr} are available.
+% \item[Numeric arguments:] Anything that is accepted by
+% \cs{number}. If \eTeX\ is detected, also expressions
+% for \cs{numexpr} are supported. The only exception so far
+% is the number for \cs{bitsetSetDec}. The number might be too
+% large for \cs{number} or \cs{numexpr}.
+% \item[Error messages:]
+% In expandable contexts, only a limited set of \TeX\ primitive
+% commands work as expected. So called stomach commands behave
+% like \cs{relax} and don't get expanded or executed.
+% Unhappily also the error commands belong to this category.
+% The expandable operations will throw an unknown control
+% sequence instead to get \TeX's and user's attention.
+% The name of these control sequences starts with
+% \cs{BitSetError:} with the type of error after the colon.
+% \end{description}
+%
+% \subsection{Operator overview}
+%
+% \begin{minipage}{\linewidth}
+% \begin{description}
+% \def\It#1#2{^^A
+% \item[^^A
+% {#1} ^^A
+% \textmd{(\hyperref[{sec:#2}]{section \ref*{sec:#2}})}^^A
+% ]^^A
+% \mbox{}\\^^A
+% }
+% \def\op#1{^^A
+% \cs{bitset}\texttt{\bfseries#1}^^A
+% }
+% \def\M#1{\meta{#1}}
+% \def\Q{\hspace*{\fill}}
+% \It{Miscellaneous}{misc}
+% \op{Reset}\Q \M{BitSet}\\
+% \op{Let}\Q \M{BitSet A} \M{BitSet B}
+% \It{Import}{import}
+% \op{SetBin}, \op{SetOct}, \op{SetHex}\Q \M{BitSet} \M{Value}\\
+% \op{SetDec}\Q \M{BitSet} \M{Value}
+% \It{Export\textsuperscript{a}}{export}
+% \op{GetBin}, \op{GetOct}, \op{GetHex}\Q \M{BitSet} \M{MinSize}\\
+% \op{GetDec}\Q \M{BitSet}
+% \It{Logical operators}{log}
+% \op{And}, \op{AndNot}\Q \M{BitSet A} \M{BitSet B}\\
+% \op{Or}, \op{Xor}\Q \M{BitSet A} \M{BitSet B}
+% \It{Shifting}{shift}
+% \op{ShiftLeft}, \op{ShiftRight}\Q \M{BitSet} \M{ShiftAmount}\\
+% \It{Bit manipulation}{bitman}
+% \op{Clear}, \op{Set}, \op{Flip}\Q \M{BitSet} \M{Index}\\
+% \op{SetValue}\Q \M{BitSet} \M{Index} \M{Value}\\
+% \op{ClearRange}, \op{SetRange}, \op{FlipRange}\\
+% \Q \M{BitSet} \M{IndexFrom} \M{IndexTo}\\
+% \op{SetValueRange}\Q \M{BitSet} \M{IndexFrom} \M{IndexTo}
+% \It{Bit retrieval\textsuperscript{a}}{bitret}
+% \op{Get}\Q \M{BitSet} \M{Index}\\
+% \op{NextClearBit}, \op{NextSetBit}\Q \M{BitSet} \M{Index}\\
+% \op{GetSetBitList}\Q \M{BitSet}
+% \It{Bit set properties}{prop}
+% \op{Size}, \op{Cardinality}\Q \M{BitSet}
+% \It{Queries\textsuperscript{b}}{query}
+% \op{IsDefined}, \op{IsEmpty}\Q \M{BitSet} \M{Then} \M{Else}\\
+% \op{Equals}, \op{Intersects}\Q \M{BitSet A} \M{BitSet B} \M{Then} \M{Else}\\
+% \op{Query}\Q \M{BitSet} \M{Index} \M{Then} \M{Else}
+% \end{description}
+% \footnotetext[1]{Macros are expandable, full expansion by two steps.}
+% \footnotetext[2]{Macros are expandable.}
+% \end{minipage}
+%
+% \subsection{Package loading}
+%
+% The package can be used as normal \LaTeX\ package:
+%\begin{quote}
+%|\usepackage{bitset}|
+%\end{quote}
+% Also \plainTeX\ is supported:
+%\begin{quote}
+%|\input bitset.sty\relax|
+%\end{quote}
+%
+% \subsection{Operators}
+%
+% The following macros work on and with bit sets.
+% A bit set \meta{BitSet} is represented by a name.
+% The should consist of letters and digits. Technically
+% it must survive \cs{csname}. It is the same constraint
+% that must be satisfied by label or environment names
+% in \LaTeX.
+%
+% However active characters that are shorthands
+% of package \xpackage{babel} are not supported.
+% Support for shorthands works by an assignment.
+% But many operators
+% such as \cs{bitsetGetDec} must be usable in expandable
+% contexts. There assignments will not be executed in the
+% best case or they will cause errors.
+%
+% The bits in a bit set are addressed by non-negative
+% integers starting from zero. Thus negative index
+% numbers cause an error message. Because index numbers
+% are \TeX\ numbers. The largest index is 2147483647.
+% But in practice memory limits and patience limits
+% will be very likely reached much before.
+%
+% \subsubsection{Miscellaneous}\label{sec:misc}
+%
+% There isn't a separate operation for bit set creation.
+% For simplicity an undefined bit set is treated as bit set
+% with all bits cleared.
+%
+% \begin{declcs}{bitsetReset} \M{BitSet}
+% \end{declcs}
+% Macro \cs{bitsetReset} clears all bits. The result is an
+% empty bit set. It may also be used as replacement for
+% an operation ``new'', because an undefined bit set is defined
+% afterwards.
+%
+% \begin{declcs}{bitsetLet} \M{BitSet A} \M{BitSet B}
+% \end{declcs}
+% Macro \cs{bitsetLet} performs a simple assignment similar
+% to \TeX's \cs{let}. After the operation \meta{BitSet A} has
+% the same value as \meta{BitSet B}. If \meta{BitSet B} is
+% undefined, then \meta{BitSet A} will be the empty bit set.
+%
+% Note: If \meta{BitSet A} exists, it will be overwritten.
+%
+% \subsubsection{Import}\label{sec:import}
+%
+% \begin{declcs}{bitsetSetBin} \M{BitSet} \M{BinaryNumber}\\
+% \cs{bitsetSetOct} \M{BitSet} \M{OctalNumber}\\
+% \cs{bitsetSetHex} \M{BitSet} \M{HexadecimalNumber}
+% \end{declcs}
+% The numbers are interpreted as bit vectors and the flags in
+% the bit \meta{BitSet} set are set accordingly.
+% These numeric arguments are the only arguments where
+% spaces are allowed. Then the numbers are easier to read.
+%
+% \begin{declcs}{bitsetSetDec} \M{BitSet} \M{DecimalNumber}
+% \end{declcs}
+% Macro \cs{bitsetSetDec} uses \meta{DecimalNumber} to
+% set the bit set \meta{BitSet}.
+% The numeric argument must expand
+% to a plain number consisting of decimal digits without
+% command tokens or spaces. Internally this argument is
+% expanded only. It cannot be passed to \cs{number} or
+% \cs{numexpr}, because the number may be too large for them.
+% However \cs{number} or |\the\numexpr| may be used
+% explicitely. This also helps for unexpandable number
+% command tokens or registers (\cs{z@}, \cs{@ne}, \cs{count@}, \dots).
+% Also \LaTeX'\ \cs{value} needs prefixing:
+% \begin{quote}
+% |\bitsetSetDec{foo}{\number\value{bar}}|
+% \end{quote}
+%
+% \subsubsection{Export}\label{sec:export}
+%
+% \begin{declcs}{bitsetGetBin} \M{BitSet} \M{MinSize}\\
+% \cs{bitsetGetOct} \M{BitSet} \M{MinSize}\\
+% \cs{bitsetGetHex} \M{BitSet} \M{MinSize}
+% \end{declcs}
+% These macros returns the bit set as binary, octal or hexadecimal
+% number. If the bit size is smaller than \meta{MinSize} the gap is
+% filled with leading zeros.
+% Example:
+% \begin{quote}
+% |\bitsetReset{abc}|\\
+% |\bitsetSet{abc}{2}|\\
+% |\bitsetGetBin{abc}{8}| $\rightarrow$ |00000100|\\
+% |\bitsetSet{abc}{5}\bitsetSet{abc}{7}|\\
+% |\bitsetGetHex{abc}{16}| $\rightarrow$ |00A2|
+% \end{quote}
+% Macro \cs{bitsetGetHex} uses the uppercase letters |A| to |F|.
+% The catcode of the letters is one of 11 (letter) or 12 (other).
+%
+% \begin{declcs}{bitsetGetDec} \M{BitSet}
+% \end{declcs}
+% Macro \cs{bitsetGetDec} returns the bit set \meta{BitSet} as
+% decimal number. The returned number can be larger than
+% \TeX's number limit of $2^{31}-1$.
+%
+% \subsubsection{Logical operators}\label{sec:log}
+%
+% \begin{declcs}{bitsetAnd} \M{BitSet A} \M{BitSet B}
+% \end{declcs}
+% $A_{\text{new}} \mathrel{\mathop{:}}= A_{\text{old}}
+% \mathbin{\text{and}} B \qquad (\forall\, \text{bits})$
+%
+% \begin{declcs}{bitsetAndNot} \M{BitSet A} \M{BitSet B}
+% \end{declcs}
+% $A_{\text{new}} \mathrel{\mathop{:}}= A_{\text{old}}
+% \mathbin{\text{and}} (\text{not}\,B) \qquad (\forall\, \text{bits})$
+%
+% \begin{declcs}{bitsetOr} \M{BitSet A} \M{BitSet B}
+% \end{declcs}
+% $A_{\text{new}} \mathrel{\mathop{:}}= A_{\text{old}}
+% \mathbin{\text{or}} B \qquad (\forall\, \text{bits})$
+%
+% \begin{declcs}{bitsetXor} \M{BitSet A} \M{BitSet B}
+% \end{declcs}
+% $A_{\text{new}} \mathrel{\mathop{:}}= A_{\text{old}}
+% \mathbin{\text{xor}} B \qquad (\forall\, \text{bits})$
+%
+% \subsubsection{Shifting}\label{sec:shift}
+%
+% \begin{declcs}{bitsetShiftLeft} \M{BitSet} \M{ShiftAmount}\\
+% \cs{bitsetShiftRight} \M{BitSet} \M{ShiftAmount}
+% \end{declcs}
+% A left shift by one is a multiplication by two, thus left shifting
+% moves the flags to higher positions. The new created low positions
+% are filled by zeros.
+%
+% A right shift is the opposite, dividing by two, movint the bits
+% to lower positions. The number will become smaller, the lowest
+% bits are lost.
+%
+% If the \meta{ShiftAmount} is negative, it reverts the meaning of
+% the shift operation. A left shift becomes a right shift.
+% A \meta{ShiftAmount} of zero is ignored.
+%
+% \subsubsection{Bit manipulation}\label{sec:bitman}
+%
+% \begin{declcs}{bitsetClear} \M{BitSet} \M{Index}\\
+% \cs{bitsetSet} \M{BitSet} \M{Index}\\
+% \cs{bitsetFlip} \M{BitSet} \M{Index}
+% \end{declcs}
+% This macros manipulate a single bit in \meta{BitSet} addressed
+% by \cs{Index}. Macro \cs{bitsetClear} disables the bit,
+% \cs{bitsetSet} enables it and \cs{bitsetFlip} reverts the current
+% setting of the bit.
+%
+% \begin{declcs}{bitsetSetValue} \M{BitSet} \M{Index} \M{Bit}
+% \end{declcs}
+% Macro \cs{bitsetSetValue} puts bit \meta{Bit} at position \meta{Index}
+% in bit set \meta{BitSet}. \meta{Bit} must be a valid \TeX\ number
+% equals to zero (disabled/cleared) or one (enabled/set).
+%
+% \subsubsection{Bit retrieval}\label{sec:bitret}
+%
+% \begin{declcs}{bitsetGet} \M{BitSet} \M{Index}
+% \end{declcs}
+% Macro \cs{bitsetGet} extracts the status of the bit at
+% position \meta{Index} in bit set \meta{BitSet}.
+% Digit |1| is returned if the bit is set/enabled. If the
+% bit is cleared/disabled and in cases of an undefined bitset or
+% an index number out of range the return value is |0|.
+%
+% \begin{declcs}{bitsetNextClearBit} \M{BitSet} \M{Index}
+% \end{declcs}
+% Starting at position \meta{Index} (inclusive) the bits
+% are inspected. The first position without a set bit is returned.
+% Possible results are decimal numbers: \meta{Index}, \meta{Index} + 1,
+% \dots, ($\infty$)
+%
+% \begin{declcs}{bitsetNextSetBit} \M{BitSet} \M{Index}
+% \end{declcs}
+% Starting at position \meta{Index} (inclusive) the bits are
+% inspected and the index position of the first found set bit
+% is returned. If there isn't such a bit, then the result is
+% |-1|. In summary possible results are decimal numbers:
+% |-1|, \meta{Index}, \meta{Index} + 1, \dots, ($\infty$)
+%
+% \begin{declcs}{bitsetGetSetBitList} \M{BitSet}
+% \end{declcs}
+% Macro \cs{bitsetGetSetBitList} is an application for
+% \cs{bitsetNextSetBit}. The set bits are iterated and
+% returned as comma separated list of index positions
+% in increasing order. The list is empty in case of
+% an empty bit set.
+%
+% \subsubsection{Bit set properties}\label{sec:prop}
+%
+% \begin{declcs}{bitsetSize} \M{BitSet}
+% \end{declcs}
+% Macro \cs{bitsetSize} returns number of bits in use.
+% It is the same as the index number of the highest set/enabled bit
+% incremented by one.
+%
+% \begin{declcs}{bitsetCardinality} \M{BitSet}
+% \end{declcs}
+% Macro \cs{bitsetCardinality} counts the number of set/enabled bits.
+%
+% \subsubsection{Queries}\label{sec:query}
+%
+% Also the query procedures are expandable. They ask for a piece
+% of information about a bit set and execute code depending
+% on the answer.
+%
+% \begin{declcs}{bitsetIsDefined} \M{BitSet} \M{Then} \M{Else}
+% \end{declcs}
+% If the bit set with the name \meta{BitSet} exists the code
+% given in \meta{Then} is executed, otherwise \meta{Else} is used.
+%
+% \begin{declcs}{bitsetIsEmpty} \M{BitSet} \M{Then} \M{Else}
+% \end{declcs}
+% If the bit set \meta{BitSet} exists and at least one bit
+% is set/enabled, the code in \meta{Then} is executed,
+% \meta{Else} otherwise.
+%
+% \begin{declcs}{bitsetEquals} \M{BitSet A} \M{BitSet B} \M{Then} \M{Else}
+% \end{declcs}
+% Both bit sets are equal if and only if either both are undefined
+% or both are defined and represents the same bit values at the
+% same positions. Thus this definition is reflexive, symmeric,
+% and transitive, enough for an equivalent relation.
+%
+% \begin{declcs}{bitsetIntersects} \M{BitSet A} \M{BitSet B} \M{Then} \M{Else}
+% \end{declcs}
+% If and only if \meta{BitSet A} and \meta{BitSet B} have
+% at least one bit at the same position that is set, then
+% code part \meta{Then} is executed.
+%
+% \begin{declcs}{bitsetQuery} \M{BitSet} \M{Index} \M{Then} \M{Else}
+% \end{declcs}
+% It's just a wrapper for \cs{bitsetGet}. If the bit at position
+% \meta{Index} is enabled, code \meta{Then} is called.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% The internal format of a bit set is quite simple, a sequence
+% of digits |0| and |1|. The least significant bit is left.
+% A bit set without any flag set is encoded by |0|. Also
+% undefined bit sets are treated that way. After the
+% highest bit that is set there are no further zeroes.
+% A regular expression of valid bit sets values:
+% \begin{quote}
+% |0|\string||[01]*1|
+% \end{quote}
+%
+% \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@bitset.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{bitset}{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@bitset.sty\endcsname
+\ProvidesPackage{bitset}%
+ [2016/05/16 v1.2 Handle bit-vector datatype (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 BitSet@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\BitSet@AtEnd{%
+ \BitSet@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+\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}{11}% : (letter!)
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{63}{14}% ? (comment!)
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\BitSet@AtEnd{\BitSet@AtEnd\noexpand\endinput}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname BitSet@TestMode\endcsname\relax
+\else
+ \catcode63=9 % ? (ignore)
+\fi
+? \let\BitSet@@TestMode\BitSet@TestMode
+% \end{macrocode}
+%
+% \subsection{Package loading}
+%
+% \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{intcalc}[2007/09/27]%
+ \TMP@RequirePackage{bigintcalc}[2007/09/27]%
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{intcalc}[2007/09/27]%
+ \RequirePackage{bigintcalc}[2007/09/27]%
+\fi
+% \end{macrocode}
+%
+% \subsection{Help macros}
+%
+% \subsubsection{Number constant}
+%
+% \begin{macro}{\BitSet@MaxSize}
+% \begin{macrocode}
+\def\BitSet@MaxSize{2147483647}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{General basic macros}
+%
+% \begin{macro}{\BitSet@Empty}
+% \begin{macrocode}
+\def\BitSet@Empty{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@FirstOfOne}
+% \begin{macrocode}
+\def\BitSet@FirstOfOne#1{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Gobble}
+% \begin{macrocode}
+\def\BitSet@Gobble#1{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@FirstOfTwo}
+% \begin{macrocode}
+\def\BitSet@FirstOfTwo#1#2{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@SecondOfTwo}
+% \begin{macrocode}
+\def\BitSet@SecondOfTwo#1#2{#2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BitSet@Space}
+% \begin{macrocode}
+\def\BitSet@Space{ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@ZapSpace}
+% \begin{macrocode}
+\def\BitSet@ZapSpace#1 #2{%
+ #1%
+ \ifx\BitSet@Empty#2%
+ \else
+ \expandafter\BitSet@ZapSpace
+ \fi
+ #2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Tail recursion}
+%
+% \begin{macro}{\BitSet@Fi}
+% \begin{macrocode}
+\let\BitSet@Fi\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@AfterFi}
+% \begin{macrocode}
+\def\BitSet@AfterFi#1#2\BitSet@Fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@AfterFiFi}
+% \begin{macrocode}
+\def\BitSet@AfterFiFi#1#2\BitSet@Fi{\fi\fi#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@AfterFiFiFi}
+% \begin{macrocode}
+\def\BitSet@AfterFiFiFi#1#2\BitSet@Fi{\fi\fi\fi#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Check macros}
+%
+% \begin{macro}{\BitSet@IfUndefined}
+% \begin{macrocode}
+\def\BitSet@IfUndefined#1{%
+ \expandafter\ifx\csname BS@#1\endcsname\relax
+ \expandafter\BitSet@FirstOfTwo
+ \else
+ \expandafter\BitSet@SecondOfTwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BitSet@CheckIndex}
+% |#1|: continuation code\\
+% |#2|: BitSet\\
+% |#3|: Index
+% \begin{macrocode}
+\def\BitSet@CheckIndex#1#2#3{%
+ \BitSet@IfUndefined{#2}{\bitsetReset{#2}}{}%
+ \expandafter\expandafter\expandafter\BitSet@@CheckIndex
+ \intcalcNum{#3}!%
+ {#2}{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@CheckIndex}
+% |#1|: plain Index\\
+% |#2|: BitSet\\
+% |#3|: continuation code
+% \begin{macrocode}
+\def\BitSet@@CheckIndex#1!#2#3{%
+ \ifnum#1<0 %
+ \BitSet@AfterFi{%
+ \@PackageError{bitset}{%
+ Invalid negative index (#1)%
+ }\@ehc
+ }%
+ \else
+ \BitSet@AfterFi{%
+ #3{#2}{#1}%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Miscellaneous}\label{src:misc}
+%
+% \begin{macro}{\bitsetReset}
+% \begin{macrocode}
+\def\bitsetReset#1{%
+ \expandafter\def\csname BS@#1\endcsname{0}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bitsetLet}
+% \begin{macrocode}
+\def\bitsetLet#1#2{%
+ \BitSet@IfUndefined{#2}{%
+ \bitsetReset{#1}%
+ }{%
+ \expandafter\let\csname BS@#1\expandafter\endcsname
+ \csname BS@#2\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Import}\label{src:import}
+%
+% \subsubsection{From binary number}
+%
+% \begin{macro}{\bitsetSetBin}
+% \begin{macrocode}
+\def\bitsetSetBin#1#2{%
+ \edef\BitSet@Temp{#2}%
+ \edef\BitSet@Temp{%
+ \expandafter\expandafter\expandafter\BitSet@ZapSpace
+ \expandafter\BitSet@Temp\BitSet@Space\BitSet@Empty
+ }%
+ \edef\BitSet@Temp{%
+ \expandafter\BitSet@KillZeros\BitSet@Temp\BitSet@Empty
+ }%
+ \ifx\BitSet@Temp\BitSet@Empty
+ \expandafter\let\csname BS@#1\endcsname\BitSet@Zero
+ \else
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \expandafter\BitSet@Reverse\BitSet@Temp!%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@KillZeros}
+% \begin{macrocode}
+\def\BitSet@KillZeros#1{%
+ \ifx#10%
+ \expandafter\BitSet@KillZeros
+ \else
+ #1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Reverse}
+% \begin{macrocode}
+\def\BitSet@Reverse#1#2!{%
+ \ifx\\#2\\%
+ #1%
+ \else
+ \BitSet@AfterFi{%
+ \BitSet@Reverse#2!#1%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{From octal/hex number}
+%
+% \begin{macro}{\bitsetSetOct}
+% \begin{macrocode}
+\def\bitsetSetOct{%
+ \BitSet@SetOctHex\BitSet@FromFirstOct
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetSetHex}
+% \begin{macrocode}
+\def\bitsetSetHex{%
+ \BitSet@SetOctHex\BitSet@FromFirstHex
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@SetOctHex}
+% \begin{macrocode}
+\def\BitSet@SetOctHex#1#2#3{%
+ \edef\BitSet@Temp{#3}%
+ \edef\BitSet@Temp{%
+ \expandafter\expandafter\expandafter\BitSet@ZapSpace
+ \expandafter\BitSet@Temp\BitSet@Space\BitSet@Empty
+ }%
+ \edef\BitSet@Temp{%
+ \expandafter\BitSet@KillZeros\BitSet@Temp\BitSet@Empty
+ }%
+ \ifx\BitSet@Temp\BitSet@Empty
+ \expandafter\let\csname BS@#2\endcsname\BitSet@Zero
+ \else
+ \edef\BitSet@Temp{%
+ \expandafter#1\BitSet@Temp!%
+ }%
+ \ifx\BitSet@Temp\BitSet@Empty
+ \expandafter\let\csname BS@#2\endcsname\BitSet@Zero
+ \else
+ \expandafter\edef\csname BS@#2\endcsname{%
+ \expandafter\BitSet@Reverse\BitSet@Temp!%
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@FromFirstOct}
+% \begin{macrocode}
+\def\BitSet@FromFirstOct#1{%
+ \ifx#1!%
+ \else
+ \ifcase#1 \BitSet@AfterFiFi\BitSet@FromFirstOct
+ \or 1%
+ \or 10%
+ \or 11%
+ \or 100%
+ \or 101%
+ \or 110%
+ \or 111%
+ \else \BitSetError:WrongOctalDigit%
+ \fi
+ \expandafter\BitSet@FromOct
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@FromOct}
+% \begin{macrocode}
+\def\BitSet@FromOct#1{%
+ \ifx#1!%
+ \else
+ \ifcase#1 000%
+ \or 001%
+ \or 010%
+ \or 011%
+ \or 100%
+ \or 101%
+ \or 110%
+ \or 111%
+ \else \BitSetError:WrongOctalDigit%
+ \fi
+ \expandafter\BitSet@FromOct
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BitSet@FromFirstHex}
+% \begin{macrocode}
+\def\BitSet@FromFirstHex#1{%
+ \ifx#1!%
+ \else
+ \ifx#10%
+ \BitSet@AfterFiFi\BitSet@FromFirstHex
+ \fi
+ \expandafter\ifx\csname BitSet@Hex#1\endcsname\relax
+ \BitSetError:InvalidHexDigit%
+ \else
+ \expandafter\expandafter\expandafter\BitSet@KillZeros
+ \csname BitSet@Hex#1\endcsname
+ \fi
+ \expandafter\BitSet@FromHex
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@FromHex}
+% \begin{macrocode}
+\def\BitSet@FromHex#1{%
+ \ifx#1!%
+ \else
+ \expandafter\ifx\csname BitSet@Hex#1\endcsname\relax
+ \BitSetError:InvalidHexDigit%
+ \else
+ \csname BitSet@Hex#1\endcsname
+ \fi
+ \expandafter\BitSet@FromHex
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Hex[0..F]}
+% \begin{macrocode}
+\def\BitSet@Temp#1{%
+ \expandafter\def\csname BitSet@Hex#1\endcsname
+}
+\BitSet@Temp 0{0000}%
+\BitSet@Temp 1{0001}%
+\BitSet@Temp 2{0010}%
+\BitSet@Temp 3{0011}%
+\BitSet@Temp 4{0100}%
+\BitSet@Temp 5{0101}%
+\BitSet@Temp 6{0110}%
+\BitSet@Temp 7{0111}%
+\BitSet@Temp 8{1000}%
+\BitSet@Temp 9{1001}%
+\BitSet@Temp A{1010}%
+\BitSet@Temp B{1011}%
+\BitSet@Temp C{1100}%
+\BitSet@Temp D{1101}%
+\BitSet@Temp E{1110}%
+\BitSet@Temp F{1111}%
+\BitSet@Temp a{1010}%
+\BitSet@Temp b{1011}%
+\BitSet@Temp c{1100}%
+\BitSet@Temp d{1101}%
+\BitSet@Temp e{1110}%
+\BitSet@Temp f{1111}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{From decimal number}
+%
+% \begin{macro}{\bitsetSetDec}
+% \begin{macrocode}
+\def\bitsetSetDec#1#2{%
+ \edef\BitSet@Temp{#2}%
+ \edef\BitSet@Temp{%
+ \expandafter\expandafter\expandafter\BitSet@ZapSpace
+ \expandafter\BitSet@Temp\BitSet@Space\BitSet@Empty
+ }%
+ \edef\BitSet@Temp{%
+ \expandafter\BitSet@KillZeros\BitSet@Temp\BitSet@Empty
+ }%
+ \ifx\BitSet@Temp\BitSet@Empty
+ \expandafter\let\csname BS@#1\endcsname\BitSet@Zero
+ \else
+ \ifcase\bigintcalcSgn{\BitSet@Temp} %
+ \expandafter\let\csname BS@#1\endcsname\BitSet@Zero
+ \or
+ \ifnum\bigintcalcCmp\BitSet@Temp\BitSet@MaxSize>0 %
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \expandafter\BitSet@SetDecBig\BitSet@Temp!%
+ }%
+ \else
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \expandafter\BitSet@SetDec\BitSet@Temp!%
+ }%
+ \fi
+ \else
+ \@PackageError{bitset}{%
+ Bit sets cannot be negative%
+ }\@ehc
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@SetDecBig}
+% \begin{macrocode}
+\def\BitSet@SetDecBig#1#2#3#4#5#6#7#8#9!{%
+ \ifx\\#9\\%
+ \BitSet@SetDec#1#2#3#4#5#6#7#8!%
+ \else
+ \ifcase\BigIntCalcOdd#1#2#4#5#6#7#8#9! %
+ 0%
+ \or
+ 1%
+? \else\BitSetError:ThisCannotHappen%
+ \fi
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@SetDecBig
+ \BigIntCalcShr#1#2#3#4#5#6#7#8#9!!%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@SetDec}
+% \begin{macrocode}
+\def\BitSet@SetDec#1!{%
+ \ifcase#1 %
+ \or 1%
+ \else
+ \ifodd#1 %
+ 1%
+ \else
+ 0%
+ \fi
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@SetDec
+ \IntCalcShr#1!!%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Export}\label{src:export}
+%
+% \subsubsection{To binary number}
+%
+% \begin{macro}{\bitsetGetBin}
+% \begin{macrocode}
+\def\bitsetGetBin#1#2{%
+ \romannumeral0%
+ \expandafter\expandafter\expandafter\BitSet@@GetBin
+ \intcalcNum{#2}!{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@GetBin}
+% \begin{macrocode}
+\def\BitSet@@GetBin#1!#2{%
+ \BitSet@IfUndefined{#2}{%
+ \ifnum#1>1 %
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@Fill
+ \IntCalcDec#1!!0%
+ }%
+ \else
+ \BitSet@AfterFi{ 0}%
+ \BitSet@Fi
+ }{%
+ \expandafter\expandafter\expandafter\BitSet@NumBinRev
+ \expandafter\expandafter\expandafter1%
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#2\endcsname!!#1!%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Fill}
+% |#1|: number of leading digits |0|\\
+% |#2|: result
+% \begin{macrocode}
+\def\BitSet@Fill#1!{%
+ \ifnum#1>0 %
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@Fill
+ \IntCalcDec#1!!0%
+ }%
+ \else
+ \BitSet@AfterFi{ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BitSet@NumBinRev}
+% |#1|: bit counter (including |#2|)\\
+% |#2#3|: reverted number\\
+% |#4|: result\\
+% |#5|: min size
+% \begin{macrocode}
+\def\BitSet@NumBinRev#1!#2#3!{%
+ \ifx\\#3\\%
+ \BitSet@AfterFi{%
+ \BitSet@NumBinFill#1!#2%
+ }%
+ \else
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@NumBinRev
+ \IntCalcInc#1!!#3!#2%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@NumBinFill}
+% \begin{macrocode}
+\def\BitSet@NumBinFill#1!#2!#3!{%
+ \ifnum#3>#1 %
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@Fill
+ \IntCalcSub#3!#1!!#2%
+ }%
+ \else
+ \BitSet@AfterFi{ #2}%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{To octal/hexadecimal number}
+%
+% \begin{macro}{\bitsetGetOct}
+% \begin{macrocode}
+\def\bitsetGetOct#1#2{%
+ \romannumeral0%
+ \bitsetIsEmpty{#1}{%
+ \expandafter\expandafter\expandafter\BitSet@@GetOctHex
+ \intcalcNum{#2}!3!230%
+ }{%
+ \expandafter\expandafter\expandafter\BitSet@@GetOct
+ \expandafter\expandafter\expandafter1%
+ \expandafter\expandafter\expandafter!%
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#1\endcsname00%
+ \BitSet@Empty\BitSet@Empty\BitSet@Empty!{#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetGetHex}
+% \begin{macrocode}
+\def\bitsetGetHex#1#2{%
+ \romannumeral0%
+ \bitsetIsEmpty{#1}{%
+ \expandafter\expandafter\expandafter\BitSet@@GetOctHex
+ \intcalcNum{#2}!4!340%
+ }{%
+ \expandafter\expandafter\expandafter\BitSet@@GetHex
+ \expandafter\expandafter\expandafter1%
+ \expandafter\expandafter\expandafter!%
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#1\endcsname000%
+ \BitSet@Empty\BitSet@Empty\BitSet@Empty\BitSet@Empty!{#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@GetOct}
+% |#1|: number of digits\\
+% |#2|: result\\
+% |#3#4#5|: bits
+% \begin{macrocode}
+\def\BitSet@@GetOct#1!#2!#3#4#5{%
+ \ifx#5\BitSet@Empty
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@GetOctHex
+ \IntCalcDec#1!!#2!23%
+ }%
+ \else
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@@GetOct
+ \number\IntCalcInc#1!\expandafter\expandafter\expandafter!%
+ \csname BitSet@Oct#5#4#3\endcsname#2!%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Oct[000..111]}
+% \begin{macrocode}
+\def\BitSet@Temp#1#2#3#4{%
+ \expandafter\def\csname BitSet@Oct#1#2#3\endcsname{#4}%
+}
+\BitSet@Temp0000%
+\BitSet@Temp0011%
+\BitSet@Temp0102%
+\BitSet@Temp0113%
+\BitSet@Temp1004%
+\BitSet@Temp1015%
+\BitSet@Temp1106%
+\BitSet@Temp1117%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@GetHex}
+% |#1|: number of digits\\
+% |#2|: result\\
+% |#3#4#5#6|: bits
+% \begin{macrocode}
+\def\BitSet@@GetHex#1!#2!#3#4#5#6{%
+ \ifx#6\BitSet@Empty
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@GetOctHex
+ \IntCalcDec#1!!#2!34%
+ }%
+ \else
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@@GetHex
+ \number\IntCalcInc#1!\expandafter\expandafter\expandafter!%
+ \csname BitSet@Hex#6#5#4#3\endcsname#2!%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Hex[0000..1111]}
+% \begin{macrocode}
+\def\BitSet@Temp#1#2#3#4#5{%
+ \expandafter\def\csname BitSet@Hex#1#2#3#4\endcsname{#5}%
+}
+\BitSet@Temp00000%
+\BitSet@Temp00011%
+\BitSet@Temp00102%
+\BitSet@Temp00113%
+\BitSet@Temp01004%
+\BitSet@Temp01015%
+\BitSet@Temp01106%
+\BitSet@Temp01117%
+\BitSet@Temp10008%
+\BitSet@Temp10019%
+\BitSet@Temp1010A%
+\BitSet@Temp1011B%
+\BitSet@Temp1100C%
+\BitSet@Temp1101D%
+\BitSet@Temp1110E%
+\BitSet@Temp1111F%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@GetOctHex}
+% Leading zeros $ (|#4| - |#1| * 3 + 2)/3 $ if $ |#4| > |#1| * 3$\\
+% |#1|: digit size\\
+% |#2|: result\\
+% |#3|: bits per digit - 1\\
+% |#4|: bits per digit
+% |#5|: garbage\\
+% |#6|: min size
+% \begin{macrocode}
+\def\BitSet@GetOctHex#1!#2!#3#4#5!#6{%
+ \expandafter\BitSet@@GetOctHex
+ \number\intcalcNum{#6}\expandafter\expandafter\expandafter!%
+ \IntCalcMul#1!#4!!#3#4#2%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@GetOctHex}
+% |#1|: plain min size\\
+% |#2|: digits * (bits per digit)\\
+% |#3|: bits per digit - 1\\
+% |#4|: bits per digit
+% \begin{macrocode}
+\def\BitSet@@GetOctHex#1!#2!#3#4{%
+ \ifnum#1>#2 %
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\BitSet@Fill
+ \expandafter\IntCalcDiv\number
+ \expandafter\expandafter\expandafter\IntCalcAdd
+ \IntCalcSub#1!#2!!#3!!#4!!%
+ }%
+ \else
+ \BitSet@AfterFi{ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{To decimal number}
+%
+% \begin{macro}{\bitsetGetDec}
+% \begin{macrocode}
+\def\bitsetGetDec#1{%
+ \romannumeral0%
+ \BitSet@IfUndefined{#1}{ 0}{%
+ \expandafter\expandafter\expandafter\BitSet@GetDec
+ \csname BS@#1\endcsname!%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@GetDec}
+% \begin{macrocode}
+\def\BitSet@GetDec#1#2!{%
+ \ifx\\#2\\%
+ \BitSet@AfterFi{ #1}%
+ \else
+ \BitSet@AfterFi{%
+ \BitSet@@GetDec2!#1!#2!%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@GetDec}
+% |#1|: power of two\\
+% |#2|: result\\
+% |#3#4|: number
+% \begin{macrocode}
+\def\BitSet@@GetDec#1!#2!#3#4!{%
+ \ifx\\#4\\%
+ \ifx#31%
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@Space
+ \IntCalcAdd#1!#2!%
+ }%
+ \else
+ \BitSet@AfterFiFi{ #2}%
+ \fi
+ \else
+ \ifx#31%
+ \BitSet@AfterFiFi{%
+ \csname BitSet@N#1%
+ \expandafter\expandafter\expandafter\endcsname
+ \IntCalcAdd#1!#2!!#4!%
+ }%
+ \else
+ \BitSet@AfterFiFi{%
+ \csname BitSet@N#1\endcsname#2!#4!%
+ }%
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@N[1,2,4,...]}
+% \begin{macrocode}
+\def\BitSet@Temp#1#2{%
+ \expandafter\def\csname BitSet@N#1\endcsname{%
+ \BitSet@@GetDec#2!%
+ }%
+}
+\BitSet@Temp{1}{2}
+\BitSet@Temp{2}{4}
+\BitSet@Temp{4}{8}
+\BitSet@Temp{8}{16}
+\BitSet@Temp{16}{32}
+\BitSet@Temp{32}{64}
+\BitSet@Temp{64}{128}
+\BitSet@Temp{128}{256}
+\BitSet@Temp{256}{512}
+\BitSet@Temp{512}{1024}
+\BitSet@Temp{1024}{2048}
+\BitSet@Temp{2048}{4096}
+\BitSet@Temp{4096}{8192}
+\BitSet@Temp{8192}{16384}
+\BitSet@Temp{16384}{32768}
+\BitSet@Temp{32768}{65536}
+\BitSet@Temp{65536}{131072}
+\BitSet@Temp{131072}{262144}
+\BitSet@Temp{262144}{524288}
+\BitSet@Temp{524288}{1048576}
+\BitSet@Temp{1048576}{2097152}
+\BitSet@Temp{2097152}{4194304}
+\BitSet@Temp{4194304}{8388608}
+\BitSet@Temp{8388608}{16777216}
+\BitSet@Temp{16777216}{33554432}
+\BitSet@Temp{33554432}{67108864}
+\BitSet@Temp{67108864}{134217728}
+\BitSet@Temp{134217728}{268435456}
+\BitSet@Temp{268435456}{536870912}
+\BitSet@Temp{536870912}{1073741824}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@N1073741824}
+% \begin{macrocode}
+\expandafter\def\csname BitSet@N1073741824\endcsname{%
+ \BitSet@GetDecBig2147483648!%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BitSet@GetDecBig}
+% |#1|: current power of two\\
+% |#2|: result\\
+% |#3#4|: number
+% \begin{macrocode}
+\def\BitSet@GetDecBig#1!#2!#3#4!{%
+ \ifx\\#4\\%
+ \ifx#31%
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@Space
+ \BigIntCalcAdd#1!#2!%
+ }%
+ \else
+ \BitSet@AfterFiFi{ #2}%
+ \fi
+ \else
+ \ifx#31%
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@@GetDecBig
+ \BigIntCalcAdd#1!#2!!#1!#4!%
+ }%
+ \else
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@GetDecBig
+ \BigIntCalcShl#1!!#2!#4!%
+ }%
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@GetDecBig}
+% |#1|: result\\
+% |#2|: power of two\\
+% |#3#4|: number
+% \begin{macrocode}
+\def\BitSet@@GetDecBig#1!#2!{%
+ \expandafter\expandafter\expandafter\BitSet@GetDecBig
+ \BigIntCalcShl#2!!#1!%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Logical operators}\label{src:log}
+%
+% \subsubsection{\cs{bitsetAnd}}
+%
+% \begin{macro}{\bitsetAnd}
+% Decision table for \cs{bitsetAnd}:
+% \begin{quote}
+% \begin{tabular}{l|l|l|l|}
+% & undef(B) & empty(B) & cardinality(B)$>$0\\
+% \hline
+% undef(A) & A := empty & A := empty & A := empty\\
+% \hline
+% empty(A) & & &\\
+% \hline
+% cardinality(A)$>$0 & A := empty & A := empty & A \&= B\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\bitsetAnd#1#2{%
+ \bitsetIsEmpty{#1}{%
+ \bitsetReset{#1}%
+ }{%
+ \bitsetIsEmpty{#2}{%
+ \bitsetReset{#1}%
+ }{%
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \expandafter\expandafter\expandafter\BitSet@And
+ \csname BS@#1\expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#2\endcsname!!%
+ }%
+ \expandafter\ifx\csname BS@#1\endcsname\BitSet@Empty
+ \bitsetReset{#1}%
+ \fi
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@And}
+% \begin{macrocode}
+\def\BitSet@And#1#2!#3#4!#5!{%
+ \ifx\\#2\\%
+ \ifnum#1#3=11 #51\fi
+ \else
+ \ifx\\#4\\%
+ \ifnum#1#3=11 #51\fi
+ \else
+ \ifnum#1#3=11 %
+ #51%
+ \BitSet@AfterFiFiFi{%
+ \BitSet@And#2!#4!!%
+ }%
+ \else
+ \BitSet@AfterFiFiFi{%
+ \BitSet@And#2!#4!#50!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{bitsetAndNot}}
+%
+% \begin{macro}{\bitsetAndNot}
+% Decision table for \cs{bitsetAndNot}:
+% \begin{quote}
+% \begin{tabular}{l|l|l|l|}
+% & undef(B) & empty(B) & cardinality(B)$>$0\\
+% \hline
+% undef(A) & A := empty & A := empty & A := empty\\
+% \hline
+% empty(A) & & &\\
+% \hline
+% cardinality(A)$>$0 & & & A \&= !B\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\bitsetAndNot#1#2{%
+ \bitsetIsEmpty{#1}{%
+ \bitsetReset{#1}%
+ }{%
+ \bitsetIsEmpty{#2}{%
+ }{%
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \expandafter\expandafter\expandafter\BitSet@AndNot
+ \csname BS@#1\expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#2\endcsname!!%
+ }%
+ \expandafter\ifx\csname BS@#1\endcsname\BitSet@Empty
+ \bitsetReset{#1}%
+ \fi
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@AndNot}
+% \begin{macrocode}
+\def\BitSet@AndNot#1#2!#3#4!#5!{%
+ \ifx\\#2\\%
+ \ifnum#1#3=10 #51\fi
+ \else
+ \ifx\\#4\\%
+ #5%
+ \ifnum#1#3=10 1\else 0\fi
+ #2%
+ \else
+ \ifnum#1#3=10 %
+ #51%
+ \BitSet@AfterFiFiFi{%
+ \BitSet@AndNot#2!#4!!%
+ }%
+ \else
+ \BitSet@AfterFiFiFi{%
+ \BitSet@AndNot#2!#4!#50!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{bitsetOr}}
+%
+% \begin{macro}{\bitsetOr}
+% Decision table for \cs{bitsetOr}:
+% \begin{quote}
+% \begin{tabular}{l|l|l|l|}
+% & undef(B) & empty(B) & cardinality(B)$>$0\\
+% \hline
+% undef(A) & A := empty & A := empty & A := B\\
+% \hline
+% empty(A) & & & A := B\\
+% \hline
+% cardinality(A)$>$0 & & & A \string|= B\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\bitsetOr#1#2{%
+ \bitsetIsEmpty{#2}{%
+ \BitSet@IfUndefined{#1}{\bitsetReset{#1}}{}%
+ }{%
+ \bitsetIsEmpty{#1}{%
+ \expandafter\let\csname BS@#1\expandafter\endcsname
+ \csname BS@#2\endcsname
+ }{%
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \expandafter\expandafter\expandafter\BitSet@Or
+ \csname BS@#1\expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#2\endcsname!%
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Or}
+% \begin{macrocode}
+\def\BitSet@Or#1#2!#3#4!{%
+ \ifnum#1#3>0 1\else 0\fi
+ \ifx\\#2\\%
+ #4%
+ \else
+ \ifx\\#4\\%
+ #2%
+ \else
+ \BitSet@AfterFiFi{%
+ \BitSet@Or#2!#4!%
+ }%
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{bitsetXor}}
+%
+% \begin{macro}{\bitsetXor}
+% Decision table for \cs{bitsetXor}:
+% \begin{quote}
+% \begin{tabular}{l|l|l|l|}
+% & undef(B) & empty(B) & cardinality(B)$>$0\\
+% \hline
+% undef(A) & A := empty & A := empty & A := B\\
+% \hline
+% empty(A) & & & A := B\\
+% \hline
+% cardinality(A)$>$0 & & & A \string^= B\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\bitsetXor#1#2{%
+ \bitsetIsEmpty{#2}{%
+ \BitSet@IfUndefined{#1}{\bitsetReset{#1}}{}%
+ }{%
+ \bitsetIsEmpty{#1}{%
+ \expandafter\let\csname BS@#1\expandafter\endcsname
+ \csname BS@#2\endcsname
+ }{%
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \expandafter\expandafter\expandafter\BitSet@Xor
+ \csname BS@#1\expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#2\endcsname!!%
+ }%
+ \expandafter\ifx\csname BS@#1\endcsname\BitSet@Empty
+ \bitsetReset{#1}%
+ \fi
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Xor}
+% \begin{macrocode}
+\def\BitSet@Xor#1#2!#3#4!#5!{%
+ \ifx\\#2\\%
+ \ifx#1#3%
+ \ifx\\#4\\%
+ \else
+ #50#4%
+ \fi
+ \else
+ #51#4%
+ \fi
+ \else
+ \ifx\\#4\\%
+ #5%
+ \ifx#1#30\else 1\fi
+ #2%
+ \else
+ \ifx#1#3%
+ \BitSet@AfterFiFiFi{%
+ \BitSet@Xor#2!#4!#50!%
+ }%
+ \else
+ #51%
+ \BitSet@AfterFiFiFi{%
+ \BitSet@Xor#2!#4!!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Shifting}\label{src:shift}
+%
+% \subsubsection{\cs{bitsetShiftLeft}}
+%
+% \begin{macro}{\bitsetShiftLeft}
+% \begin{macrocode}
+\def\bitsetShiftLeft#1#2{%
+ \BitSet@IfUndefined{#1}{%
+ \bitsetReset{#1}%
+ }{%
+ \bitsetIsEmpty{#1}{%
+ }{%
+ \expandafter\expandafter\expandafter\BitSet@ShiftLeft
+ \intcalcNum{#2}!{#1}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@ShiftLeft}
+% \begin{macrocode}
+\def\BitSet@ShiftLeft#1!#2{%
+ \ifcase\intcalcSgn{#1} %
+ \or
+ \begingroup
+ \uccode`m=`0 %
+ \uppercase\expandafter{\expandafter\endgroup
+ \expandafter\edef\csname BS@#2\expandafter\endcsname
+ \expandafter{%
+ \romannumeral#1000\expandafter\BitSet@Space
+ \csname BS@#2\endcsname
+ }%
+ }%
+ \else
+ \expandafter\BitSet@ShiftRight\BitSet@Gobble#1!{#2}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{bitsetShiftRight}}
+%
+% \begin{macro}{\bitsetShiftRight}
+% \begin{macrocode}
+\def\bitsetShiftRight#1#2{%
+ \BitSet@IfUndefined{#1}{%
+ \bitsetReset{#1}%
+ }{%
+ \bitsetIsEmpty{#1}{%
+ }{%
+ \expandafter\expandafter\expandafter\BitSet@ShiftRight
+ \intcalcNum{#2}!{#1}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@ShiftRight}
+% \begin{macrocode}
+\def\BitSet@ShiftRight#1!#2{%
+ \ifcase\intcalcSgn{#1} %
+ \or
+ \expandafter\edef\csname BS@#2\endcsname{%
+ \expandafter\expandafter\expandafter\BitSet@Kill
+ \csname BS@#2\expandafter\endcsname\expandafter\BitSet@Empty
+ \expandafter=%
+ \expandafter{\expandafter}\expandafter{\expandafter}%
+ \romannumeral#1000!%
+ }%
+ \else
+ \expandafter\BitSet@ShiftLeft\BitSet@Gobble#1!{#2}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Kill}
+% \begin{macrocode}
+\def\BitSet@Kill#1#2=#3#4#5{%
+ #3#4%
+ \ifx#5!%
+ \ifx#1\BitSet@Empty
+ 0%
+ \else
+ #1#2%
+ \fi
+ \else
+ \ifx#1\BitSet@Empty
+ 0%
+ \BitSet@AfterFiFi\BitSet@Cleanup
+ \else
+ \BitSet@Kill#2=%
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Bit manipulation}\label{src:bitman}
+%
+% \begin{macro}{\bitsetClear}
+% \begin{macrocode}
+\def\bitsetClear{%
+ \BitSet@CheckIndex\BitSet@Clear
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetSet}
+% \begin{macrocode}
+\def\bitsetSet{%
+ \BitSet@CheckIndex\BitSet@Set
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetFlip}
+% \begin{macrocode}
+\def\bitsetFlip{%
+ \BitSet@CheckIndex\BitSet@Flip
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetSetValue}
+% \begin{macrocode}
+\def\bitsetSetValue#1#2#3{%
+ \expandafter\expandafter\expandafter\BitSet@SetValue
+ \intcalcNum{#3}!{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@SetValue}
+% |#1|: plain value\\
+% |#2|: BitSet\\
+% |#3|: Index
+% \begin{macrocode}
+\def\BitSet@SetValue#1!{%
+ \BitSet@CheckIndex{%
+ \ifcase#1 %
+ \expandafter\BitSet@Clear
+ \or
+ \expandafter\BitSet@Set
+ \else
+ \BitSet@ErrorInvalidBitValue{#1}%
+ \expandafter\expandafter\expandafter\BitSet@Gobble
+ \expandafter\BitSet@Gobble
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@ErrorInvalidBitValue}
+% |#1|: Wrong bit value
+% \begin{macrocode}
+\def\BitSet@ErrorInvalidBitValue#1{%
+ \@PackageError{bitset}{%
+ Invalid bit value (#1) not in range 0..1%
+ }\@ehc
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Clear operation}
+%
+% \begin{macro}{\BitSet@Clear}
+% |#1|: BitSet\\
+% |#2|: plain and checked index
+% \begin{macrocode}
+\def\BitSet@Clear#1#2{%
+ \edef\BitSet@Temp{%
+ \expandafter\expandafter\expandafter\BitSet@@Clear
+ \csname BS@#1\expandafter\endcsname
+ \expandafter\BitSet@Empty\expandafter=\expandafter!%
+ \romannumeral#2000!%
+ }%
+ \expandafter\let\csname BS@#1\expandafter\endcsname
+ \ifx\BitSet@Temp\BitSet@Empty
+ \BitSet@Zero
+ \else
+ \BitSet@Temp
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@Clear}
+% \begin{macrocode}
+\def\BitSet@@Clear#1#2=#3!#4{%
+ \ifx#4!%
+ \ifx#1\BitSet@Empty
+ \else
+ \ifx\BitSet@Empty#2%
+ \else
+ #30#2%
+ \fi
+ \fi
+ \else
+ \ifx#1\BitSet@Empty
+ \BitSet@AfterFiFi\BitSet@Cleanup
+ \else
+ \ifx#10%
+ \BitSet@AfterFiFiFi{%
+ \BitSet@@Clear#2=#30!%
+ }%
+ \else
+ #31%
+ \BitSet@AfterFiFiFi{%
+ \BitSet@@Clear#2=!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Set operation}
+%
+% \begin{macro}{\BitSet@Set}
+% |#1|: BitSet\\
+% |#2|: plain and checked Index
+% \begin{macrocode}
+\def\BitSet@Set#1#2{%
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \expandafter\expandafter\expandafter\BitSet@@Set
+ \csname BS@#1\expandafter\endcsname
+ \expandafter\BitSet@Empty\expandafter=%
+ \expandafter{\expandafter}\expandafter{\expandafter}%
+ \romannumeral#2000!%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@Set}
+% \begin{macrocode}
+\def\BitSet@@Set#1#2=#3#4#5{%
+ #3#4%
+ \ifx#5!%
+ 1#2%
+ \else
+ \ifx#1\BitSet@Empty
+ 0%
+ \BitSet@AfterFiFi\BitSet@@@Set
+ \else
+ #1%
+ \BitSet@@Set#2=%
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@@Set}
+% \begin{macrocode}
+\def\BitSet@@@Set#1{%
+ \ifx#1!%
+ 1%
+ \else
+ 0%
+ \expandafter\BitSet@@@Set
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Flip operation}
+%
+% \begin{macro}{\BitSet@Flip}
+% |#1|: BitSet\\
+% |#2|: plain and checked Index
+% \begin{macrocode}
+\def\BitSet@Flip#1#2{%
+ \edef\BitSet@Temp{%
+ \expandafter\expandafter\expandafter\BitSet@@Flip
+ \csname BS@#1\expandafter\endcsname
+ \expandafter\BitSet@Empty\expandafter=\expandafter!%
+ \romannumeral#2000!%
+ }%
+ \expandafter\let\csname BS@#1\expandafter\endcsname
+ \ifx\BitSet@Temp\BitSet@Empty
+ \BitSet@Zero
+ \else
+ \BitSet@Temp
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@Flip}
+% \begin{macrocode}
+\def\BitSet@@Flip#1#2=#3!#4{%
+ \ifx#4!%
+ \ifx#11%
+ \ifx\BitSet@Empty#2%
+ \else
+ #30#2%
+ \fi
+ \else
+ #31#2%
+ \fi
+ \else
+ \ifx#1\BitSet@Empty
+ #30%
+ \BitSet@AfterFiFi\BitSet@@@Set
+ \else
+ \ifx#10%
+ \BitSet@AfterFiFiFi{%
+ \BitSet@@Flip#2=#30!%
+ }%
+ \else
+ #31%
+ \BitSet@AfterFiFiFi{%
+ \BitSet@@Flip#2=!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Range operators}
+%
+% \begin{macro}{\bitsetClearRange}
+% \begin{macrocode}
+\def\bitsetClearRange{%
+ \BitSet@Range\BitSet@Clear
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetSetRange}
+% \begin{macrocode}
+\def\bitsetSetRange{%
+ \BitSet@Range\BitSet@Set
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetFlipRange}
+% \begin{macrocode}
+\def\bitsetFlipRange{%
+ \BitSet@Range\BitSet@Flip
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetSetValueRange}
+% \begin{macrocode}
+\def\bitsetSetValueRange#1#2#3#4{%
+ \expandafter\expandafter\expandafter\BitSet@SetValueRange
+ \intcalcNum{#4}!{#1}{#2}{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@SetValueRange}
+% \begin{macrocode}
+\def\BitSet@SetValueRange#1!#2#3#4{%
+ \ifcase#1 %
+ \BitSet@Range\BitSet@Clear{#2}{#3}{#4}%
+ \or
+ \BitSet@Range\BitSet@Set{#2}{#3}{#4}%
+ \else
+ \BitSet@ErrorInvalidBitValue{#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BitSet@Range}
+% |#1|: clear/set/flip macro\\
+% |#2|: BitSet\\
+% |#3|: Index from\\
+% |#4|: Index to
+% \begin{macrocode}
+\def\BitSet@Range#1#2#3#4{%
+ \edef\BitSet@Temp{%
+ \noexpand\BitSet@@Range\noexpand#1{#2}%
+ \intcalcNum{#3}!\intcalcNum{#4}!%
+ }%
+ \BitSet@Temp
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@Range}
+% |#1|: clear/set/flip macro\\
+% |#2|: BitSet\\
+% |#3|: Index from\\
+% |#4|: Index to
+% \begin{macrocode}
+\def\BitSet@@Range#1#2#3!#4!{%
+ \ifnum#3<0 %
+ \BitSet@NegativeIndex#1{#2}#3!#4!0!#4!%
+ \else
+ \ifnum#4<0 %
+ \BitSet@NegativeIndex#1{#2}#3!#4!#3!0!%
+ \else
+ \ifcase\intcalcCmp{#3}{#4} %
+ \or
+ \@PackageError{bitset}{%
+ Wrong index numbers in range [#3..#4]\MessageBreak% hash-ok
+ for clear/set/flip on bit set `#2'.\MessageBreak
+ The lower index exceeds the upper index.\MessageBreak
+ Canceling the operation as error recovery%
+ }\@ehc
+ \else
+ \BitSet@@@Range#3!#4!#1{#2}%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@NegativeIndex}
+% \begin{macrocode}
+\def\BitSet@NegativeIndex#1#2#3!#4!#5!#6!{%
+ \@PackageError{bitset}{%
+ Negative index in range [#3..#4]\MessageBreak % hash-ok
+ for \string\bitset
+ \ifx#1\BitSet@Clear
+ Clear%
+ \else
+ \ifx#1\BitSet@Set
+ Set%
+ \else
+ Flip%
+ \fi
+ \fi
+ Range on bit set `#2'.\MessageBreak
+ Using [#5..#6] as error recovery% hash-ok
+ }\@ehc
+ \BitSet@@Range#1{#2}#5!#6!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@Range}
+% \begin{macrocode}
+\def\BitSet@@@Range#1!#2!#3#4{%
+ \ifnum#1<#2 %
+ #3{#4}{#1}%
+ \BitSet@AfterFi{%
+ \expandafter\expandafter\expandafter\BitSet@@@Range
+ \IntCalcInc#1!!#2!#3{#4}%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Bit retrieval}\label{src:bitret}
+%
+% \subsubsection{\cs{bitsetGet}}
+%
+% \begin{macro}{\bitsetGet}
+% \begin{macrocode}
+\def\bitsetGet#1#2{%
+ \number
+ \expandafter\expandafter\expandafter\BitSet@Get
+ \intcalcNum{#2}!{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Get}
+% |#1|: plain index\\
+% |#2|: BitSet
+% \begin{macrocode}
+\def\BitSet@Get#1!#2{%
+ \ifnum#1<0 %
+ \BitSet@AfterFi{%
+ 0 \BitSetError:NegativeIndex%
+ }%
+ \else
+ \BitSet@IfUndefined{#2}{0}{%
+ \expandafter\expandafter\expandafter\BitSet@@Get
+ \csname BS@#2\expandafter\endcsname
+ \expandafter!\expandafter=%
+ \expandafter{\expandafter}\expandafter{\expandafter}%
+ \romannumeral\intcalcNum{#1}000!%
+ }%
+ \expandafter\BitSet@Space
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@Get}
+% \begin{macrocode}
+\def\BitSet@@Get#1#2=#3#4#5{%
+ #3#4%
+ \ifx#5!%
+ \ifx#1!%
+ 0%
+ \else
+ #1%
+ \fi
+ \else
+ \ifx#1!%
+ 0%
+ \BitSet@AfterFiFi\BitSet@Cleanup
+ \else
+ \BitSet@@Get#2=%
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{bitsetNextClearBit}, \cs{bitsetNextSetBit}}
+%
+% \begin{macro}{\bitsetNextClearBit}
+% \begin{macrocode}
+\def\bitsetNextClearBit#1#2{%
+ \number
+ \expandafter\expandafter\expandafter\BitSet@NextClearBit
+ \intcalcNum{#2}!{#1} %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@NextClearBit}
+% |#1|: Index\\
+% |#2|: BitSet
+% \begin{macrocode}
+\def\BitSet@NextClearBit#1!#2{%
+ \ifnum#1<0 %
+ \BitSet@NextClearBit0!{#2}%
+ \BitSet@AfterFi{%
+ \expandafter\BitSet@Space
+ \expandafter\BitSetError:NegativeIndex\romannumeral0%
+ }%
+ \else
+ \bitsetIsEmpty{#2}{#1}{%
+ \expandafter\BitSet@Skip
+ \number#1\expandafter\expandafter\expandafter!%
+ \csname BS@#2\endcsname!!!!!!!!!=%
+ {\BitSet@@NextClearBit#1!}%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@NextClearBit}
+% |#1|: index for next bit in |#2|\\
+% |#2|: next bit
+% \begin{macrocode}
+\def\BitSet@@NextClearBit#1!#2{%
+ \ifx#2!%
+ #1%
+ \else
+ \ifx#20%
+ #1%
+ \BitSet@AfterFiFi\BitSet@Cleanup
+ \else
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@@NextClearBit
+ \IntCalcInc#1!!%
+ }%
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bitsetNextSetBit}
+% \begin{macrocode}
+\def\bitsetNextSetBit#1#2{%
+ \number
+ \expandafter\expandafter\expandafter\BitSet@NextSetBit
+ \intcalcNum{#2}!{#1} %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@NextSetBit}
+% |#1|: Index\\
+% |#2|: BitSet
+% \begin{macrocode}
+\def\BitSet@NextSetBit#1!#2{%
+ \ifnum#1<0 %
+ \BitSet@NextSetBit0!{#2}%
+ \BitSet@AfterFi{%
+ \expandafter\BitSet@Space
+ \expandafter\BitSetError:NegativeIndex\romannumeral0%
+ }%
+ \else
+ \bitsetIsEmpty{#2}{-1}{%
+ \expandafter\BitSet@Skip
+ \number#1\expandafter\expandafter\expandafter!%
+ \csname BS@#2\endcsname!!!!!!!!!=%
+ {\BitSet@@NextSetBit#1!}%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@@NextSetBit}
+% |#1|: index for next bit in |#2|\\
+% |#2|: next bit
+% \begin{macrocode}
+\def\BitSet@@NextSetBit#1!#2{%
+ \ifx#2!%
+ -1%
+ \else
+ \ifx#21%
+ #1%
+ \BitSet@AfterFiFi\BitSet@Cleanup
+ \else
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@@NextSetBit
+ \IntCalcInc#1!!%
+ }%
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Cleanup}
+% \begin{macrocode}
+\def\BitSet@Cleanup#1!{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BitSet@Skip}
+% |#1|: number of bits to skip\\
+% |#2|: bits\\
+% |#3|: continuation code
+% \begin{macrocode}
+\def\BitSet@Skip#1!#2{%
+ \ifx#2!%
+ \BitSet@AfterFi{%
+ \BitSet@SkipContinue%
+ }%
+ \else
+ \ifcase#1 %
+ \BitSet@AfterFiFi{%
+ \BitSet@SkipContinue#2%
+ }%
+ \or
+ \BitSet@AfterFiFi\BitSet@SkipContinue
+ \or
+ \BitSet@AfterFiFi{%
+ \expandafter\BitSet@SkipContinue\BitSet@Gobble
+ }%
+ \else
+ \ifnum#1>8 %
+ \BitSet@AfterFiFiFi{%
+ \expandafter\BitSet@Skip
+ \number\IntCalcSub#1!8!\expandafter!%
+ \BitSet@GobbleSeven
+ }%
+ \else
+ \BitSet@AfterFiFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@Skip
+ \IntCalcDec#1!!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@SkipContinue}
+% |#1|: remaining bits\\
+% |#2|: continuation code
+% \begin{macrocode}
+\def\BitSet@SkipContinue#1!#2=#3{%
+ #3#1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@GobbleSeven}
+% \begin{macrocode}
+\def\BitSet@GobbleSeven#1#2#3#4#5#6#7{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{bitsetGetSetBitList}}
+%
+% \begin{macro}{\bitsetGetSetBitList}
+% It's just a wrapper for \cs{bitsetNextSetBit}.
+% \begin{macrocode}
+\def\bitsetGetSetBitList#1{%
+ \romannumeral0%
+ \bitsetIsEmpty{#1}{ }{%
+ \expandafter\BitSet@GetSetBitList
+ \number\BitSet@NextSetBit0!{#1}!{#1}{}!%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@GetSetBitList}
+% |#1|: found index\\
+% |#2|: BitSet\\
+% |#3|: comma
+% |#4|: result
+% \begin{macrocode}
+\def\BitSet@GetSetBitList#1!#2#3#4!{%
+ \ifnum#1<0 %
+ \BitSet@AfterFi{ #4}%
+ \else
+ \BitSet@AfterFi{%
+ \expandafter\BitSet@GetSetBitList\number
+ \expandafter\expandafter\expandafter\BitSet@NextSetBit
+ \IntCalcInc#1!!{#2}!{#2},#4#3#1!%
+ }%
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Bit set properties}\label{src:prop}
+%
+% \begin{macro}{\bitsetSize}
+% \begin{macrocode}
+\def\bitsetSize#1{%
+ \number
+ \BitSet@IfUndefined{#1}{0 }{%
+ \expandafter\expandafter\expandafter\BitSet@Size
+ \expandafter\expandafter\expandafter1%
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#1\endcsname!0!%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Size}
+% |#1|: counter\\
+% |#2#3|: bits\\
+% |#4|: result
+% \begin{macrocode}
+\def\BitSet@Size#1!#2#3!#4!{%
+ \ifx#21%
+ \ifx\\#3\\%
+ \BitSet@AfterFiFi{#1 }%
+ \else
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@Size
+ \IntCalcInc#1!!#3!#1!%
+ }%
+ \fi
+ \else
+ \ifx\\#3\\%
+ \BitSet@AfterFiFi{#4 }%
+ \else
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@Size
+ \IntCalcInc#1!!#3!#4!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bitsetCardinality}
+% \begin{macrocode}
+\def\bitsetCardinality#1{%
+ \number
+ \BitSet@IfUndefined{#1}{0 }{%
+ \expandafter\expandafter\expandafter\BitSet@Cardinality
+ \expandafter\expandafter\expandafter0%
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#1\endcsname!%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Cardinality}
+% |#1|: result\\
+% |#2#3|: bits
+% \begin{macrocode}
+\def\BitSet@Cardinality#1!#2#3!{%
+ \ifx#21%
+ \ifx\\#3\\%
+ \BitSet@AfterFiFi{\IntCalcInc#1! }%
+ \else
+ \BitSet@AfterFiFi{%
+ \expandafter\expandafter\expandafter\BitSet@Cardinality
+ \IntCalcInc#1!!#3!%
+ }%
+ \fi
+ \else
+ \ifx\\#3\\%
+ \BitSet@AfterFiFi{#1 }%
+ \else
+ \BitSet@AfterFiFi{%
+ \BitSet@Cardinality#1!#3!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Queries}\label{src:query}
+%
+% \begin{macro}{\bitsetIsDefined}
+% \begin{macrocode}
+\def\bitsetIsDefined#1{%
+ \BitSet@IfUndefined{#1}%
+ \BitSet@SecondOfTwo
+ \BitSet@FirstOfTwo
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bitsetIsEmpty}
+% \begin{macrocode}
+\def\bitsetIsEmpty#1{%
+ \BitSet@IfUndefined{#1}\BitSet@FirstOfTwo{%
+ \expandafter\ifx\csname BS@#1\endcsname\BitSet@Zero
+ \expandafter\BitSet@FirstOfTwo
+ \else
+ \expandafter\BitSet@SecondOfTwo
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Zero}
+% \begin{macrocode}
+\def\BitSet@Zero{0}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bitsetQuery}
+% \begin{macrocode}
+\def\bitsetQuery#1#2{%
+ \ifnum\bitsetGet{#1}{#2}=1 %
+ \expandafter\BitSet@FirstOfTwo
+ \else
+ \expandafter\BitSet@SecondOfTwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bitsetEquals}
+% \begin{macrocode}
+\def\bitsetEquals#1#2{%
+ \BitSet@IfUndefined{#1}{%
+ \BitSet@IfUndefined{#2}\BitSet@FirstOfTwo\BitSet@SecondOfTwo
+ }{%
+ \BitSet@IfUndefined{#2}\BitSet@SecondOfTwo{%
+ \expandafter\ifx\csname BS@#1\expandafter\endcsname
+ \csname BS@#2\endcsname
+ \expandafter\BitSet@FirstOfTwo
+ \else
+ \expandafter\BitSet@SecondOfTwo
+ \fi
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bitsetIntersects}
+% \begin{macrocode}
+\def\bitsetIntersects#1#2{%
+ \bitsetIsEmpty{#1}\BitSet@SecondOfTwo{%
+ \bitsetIsEmpty{#2}\BitSet@SecondOfTwo{%
+ \expandafter\expandafter\expandafter\BitSet@Intersects
+ \csname BS@#1\expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter!%
+ \csname BS@#2\endcsname!%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BitSet@Intersects}
+% \begin{macrocode}
+\def\BitSet@Intersects#1#2!#3#4!{%
+ \ifnum#1#3=11 %
+ \BitSet@AfterFi\BitSet@FirstOfTwo
+ \else
+ \ifx\\#2\\%
+ \BitSet@AfterFiFi\BitSet@SecondOfTwo
+ \else
+ \ifx\\#4\\%
+ \BitSet@AfterFiFiFi\BitSet@SecondOfTwo
+ \else
+ \BitSet@AfterFiFiFi{%
+ \BitSet@Intersects#2!#4!%
+ }%
+ \fi
+ \fi
+ \BitSet@Fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\BitSet@AtEnd%
+%</package>
+% \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 bitset.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \subsubsection{Preamble}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{article}
+\makeatletter
+%<*noetex>
+\let\SavedNumexpr\numexpr
+\let\SavedIfcsname\ifcsname
+\let\SavedCurrentgrouplevel\currentgrouplevel
+\def\ETeXDisable{%
+ \let\ifcsname\@undefined
+ \let\numexpr\@undefined
+ \let\currentgrouplevel\@undefined
+}
+\ETeXDisable
+%</noetex>
+\makeatletter
+\chardef\BitSet@TestMode=1 %
+\makeatother
+\usepackage{bitset}[2016/05/16]
+%<*noetex>
+\def\ETeXEnable{%
+ \let\numexpr\SavedNumexpr
+ \let\ifcsname\SavedIfcsname
+ \let\currentgrouplevel\SavedCurrentgrouplevel
+}
+\ETeXEnable
+%</noetex>
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\makeatletter
+% \end{macrocode}
+%
+% \subsubsection{Time}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfresettimer\endcsname\relax
+\else
+ \newcount\SummaryTime
+ \newcount\TestTime
+ \SummaryTime=\z@
+ \newcommand*{\PrintTime}[2]{%
+ \typeout{%
+ [Time #1: \strip@pt\dimexpr\number#2sp\relax\space s]%
+ }%
+ }%
+ \newcommand*{\StartTime}[1]{%
+ \renewcommand*{\TimeDescription}{#1}%
+ \pdfresettimer
+ }%
+ \newcommand*{\TimeDescription}{}%
+ \newcommand*{\StopTime}{%
+ \TestTime=\pdfelapsedtime
+ \global\advance\SummaryTime\TestTime
+ \PrintTime\TimeDescription\TestTime
+ }%
+ \let\saved@qstest\qstest
+ \let\saved@endqstest\endqstest
+ \def\qstest#1#2{%
+ \saved@qstest{#1}{#2}%
+ \StartTime{#1}%
+ }%
+ \def\endqstest{%
+ \StopTime
+ \saved@endqstest
+ }%
+ \AtEndDocument{%
+ \PrintTime{summary}\SummaryTime
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Detection of unwanted space}
+%
+% \begin{macrocode}
+\let\orig@qstest\qstest
+\let\orig@endqstest\endqstest
+\def\qstest#1#2{%
+ \orig@qstest{#1}{#2}%
+ \setbox0\hbox\bgroup\begingroup\ignorespaces
+}
+\def\endqstest{%
+ \endgroup\egroup
+ \Expect*{\the\wd0}{0.0pt}%
+ \orig@endqstest
+}
+% \end{macrocode}
+%
+% \subsubsection{Test macros}
+%
+% \begin{macrocode}
+\newcounter{Test}
+
+\def\TestError#1#2{%
+ \begingroup
+ \setcounter{Test}{0}%
+ \sbox0{%
+ \def\@PackageError##1##2##3{%
+ \stepcounter{Test}%
+ \begingroup
+ \let\MessageBreak\relax
+%<*noetex>
+ \ETeXEnable
+%</noetex>
+ \Expect{##1}{bitset}%
+ \Expect*{##2}*{#1}%
+ \endgroup
+ }%
+%<*noetex>
+ \ETeXDisable
+%</noetex>
+ #2%
+ }%
+ \Expect*{\theTest}{1}%
+ \Expect*{\the\wd0}{0.0pt}%
+ \endgroup
+}
+
+\def\TestErrorNegativeIndex#1#2{%
+ \TestError{Invalid negative index (#1)}{#2}%
+}
+
+\def\TestGetterUndefined#1{%
+ \CheckUndef{dummy}%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{#1{dummy}}{0}%
+}
+
+\def\ExpectBitSet#1#2{%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter
+ {\csname BS@#1\endcsname}*{#2}%
+}
+\def\Check#1#2{%
+ \ExpectBitSet{#1}{#2}%
+}
+\def\CheckUndef#1{%
+ \begingroup
+ \Expect*{%
+ \expandafter
+ \ifx\csname BS@#1\endcsname\relax true\else false\fi
+ }{true}%
+ \endgroup
+}
+\def\RevCheck#1#2{%
+ \ExpectBitSet{#1}{\Reverse#2!!}%
+}
+\def\Set#1#2{%
+ \expandafter\def\csname BS@#1\endcsname{#2}%
+}
+\def\RevSet#1#2{%
+ \expandafter\edef\csname BS@#1\endcsname{%
+ \Reverse#2!!%
+ }%
+}
+\def\Reverse#1#2!#3!{%
+ \ifx\\#2\\%
+ #1#3%
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {\Reverse#2!#1#3!}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Test sets}
+%
+% \begin{macrocode}
+\begin{qstest}{Let}{Let}
+ \CheckUndef{abc}%
+ \CheckUndef{xyz}%
+ \bitsetLet{xyz}{abc}%
+ \CheckUndef{abc}%
+ \Check{xyz}{0}%
+ \Set{abc}{1}%
+ \Check{abc}{1}%
+ \Check{xyz}{0}%
+ \bitsetLet{xyz}{abc}%
+ \Check{abc}{1}%
+ \Check{xyz}{1}%
+ \Set{xyz}{11}%
+ \Check{abc}{1}%
+ \Check{xyz}{11}%
+\end{qstest}
+
+\begin{qstest}{Reset}{Reset}
+ \bitsetReset{xyz}%
+ \Check{xyz}{0}%
+ \bitsetReset{abc}%
+ \Check{abc}{0}%
+ \Set{abc}{10101}%
+ \bitsetReset{abc}%
+ \Check{abc}{0}%
+\end{qstest}
+
+\begin{qstest}{Get/Query}{Get/Query}
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetGet{dummy}{0}%
+ }{0}%
+ \begingroup
+ \expandafter\def\csname BitSetError:NegativeIndex\endcsname{}%
+ \Set{abc}{1}%
+ \Expect*{\bitsetQuery{abc}{-1}{true}{false}}{false}%
+ \endgroup
+ \def\Test#1#2#3{%
+ \Set{abc}{#1}%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{\bitsetGet{abc}{#2}}{#3}%
+ \Expect*{\bitsetQuery{abc}{#2}{true}{false}}%
+ *{\ifcase#3 false\or true\else error\fi}%
+ }%
+ \Test{1}{100}{0}%
+ \Test{0}{0}{0}%
+ \Test{1}{0}{1}%
+ \Test{11}{1}{1}%
+ \Test{111}{1}{1}%
+ \Test{101}{1}{0}%
+ \Test{101}{2}{1}%
+ \Test{10100110011}{10}{1}%
+\end{qstest}
+
+\begin{qstest}{Size}{Size}
+ \TestGetterUndefined\bitsetSize
+ \def\Test#1#2{%
+ \Set{abc}{#1}%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{\bitsetSize{abc}}{#2}%
+ }%
+ \Test{0}{0}%
+ \Test{1}{1}%
+ \Test{00}{0}%
+ \Test{0000000}{0}%
+ \Test{10}{1}%
+ \Test{01}{2}%
+ \Test{11}{2}%
+ \Test{010}{2}%
+ \Test{011}{3}%
+ \Test{100110011}{9}%
+ \Test{0000011111000001111100000}{20}%
+ \Test{000000000000000000000000011111111111111111111}{45}%
+\end{qstest}
+
+\begin{qstest}{Cardinality}{Cardinality}
+ \TestGetterUndefined\bitsetCardinality
+ \def\Test#1#2{%
+ \Set{abc}{#1}%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetCardinality{abc}%
+ }{#2}%
+ }%
+ \Test{0}{0}%
+ \Test{1}{1}%
+ \Test{00}{0}%
+ \Test{0000000}{0}%
+ \Test{10}{1}%
+ \Test{01}{1}%
+ \Test{11}{2}%
+ \Test{010}{1}%
+ \Test{011}{2}%
+ \Test{100110011}{5}%
+ \Test{0000011111000001111100000}{10}%
+ \Test{000000000000000000000000011111111111111111111}{20}%
+\end{qstest}
+
+\begin{qstest}{NextClearBit/NextSetBit}{NextClearBit/NextSetBit}
+ \def\Test#1#2{%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \TestOp{abc}{#1}%
+ }{#2}%
+ }%
+ \def\Clear{\let\TestOp\bitsetNextClearBit}%
+ \def\Set{\let\TestOp\bitsetNextSetBit}%
+ \begingroup
+ \catcode`\:=11 %
+ \bitsetSetBin{abc}{1}%
+ \Clear
+ \Test{-1}{1\BitSetError:NegativeIndex}%
+ \Set
+ \Test{-1}{0\BitSetError:NegativeIndex}%
+ \endgroup
+ \let\BS@abc\@undefined
+ \Clear
+ \Test{0}{0}%
+ \Test{1}{1}%
+ \Test{2}{2}%
+ \Test{100}{100}%
+ \Set
+ \Test{0}{-1}%
+ \Test{1}{-1}%
+ \Test{100}{-1}%
+ \bitsetReset{abc}%
+ \Clear
+ \Test{0}{0}%
+ \Test{1}{1}%
+ \Test{2}{2}%
+ \Test{100}{100}%
+ \Set
+ \Test{0}{-1}%
+ \Test{1}{-1}%
+ \Test{100}{-1}%
+ \bitsetSetBin{abc}{1}%
+ \Clear
+ \Test{0}{1}%
+ \Test{1}{1}%
+ \Test{2}{2}%
+ \Test{100}{100}%
+ \Set
+ \Test{0}{0}%
+ \Test{1}{-1}%
+ \Test{100}{-1}%
+ \bitsetSetBin{abc}{111000111000111000111}%
+ \Clear
+ \Test{0}{3}%
+ \Test{1}{3}%
+ \Test{2}{3}%
+ \Test{3}{3}%
+ \Test{4}{4}%
+ \Test{5}{5}%
+ \Test{6}{9}%
+ \Test{7}{9}%
+ \Test{8}{9}%
+ \Test{9}{9}%
+ \Test{10}{10}%
+ \Test{11}{11}%
+ \Test{12}{15}%
+ \Test{13}{15}%
+ \Test{14}{15}%
+ \Test{15}{15}%
+ \Test{16}{16}%
+ \Test{17}{17}%
+ \Test{18}{21}%
+ \Test{19}{21}%
+ \Test{20}{21}%
+ \Test{21}{21}%
+ \Test{22}{22}%
+ \Test{100}{100}%
+ \Set
+ \Test{0}{0}%
+ \Test{1}{1}%
+ \Test{2}{2}%
+ \Test{3}{6}%
+ \Test{4}{6}%
+ \Test{5}{6}%
+ \Test{6}{6}%
+ \Test{7}{7}%
+ \Test{8}{8}%
+ \Test{9}{12}%
+ \Test{10}{12}%
+ \Test{11}{12}%
+ \Test{12}{12}%
+ \Test{13}{13}%
+ \Test{14}{14}%
+ \Test{15}{18}%
+ \Test{16}{18}%
+ \Test{17}{18}%
+ \Test{18}{18}%
+ \Test{19}{19}%
+ \Test{20}{20}%
+ \Test{21}{-1}%
+ \Test{22}{-1}%
+ \Test{100}{-1}%
+ \bitsetSetBin{abc}{1111111}%
+ \Clear
+ \Test{6}{7}%
+ \Test{7}{7}%
+ \Test{8}{8}%
+ \Test{100}{100}%
+ \Set
+ \Test{6}{6}%
+ \Test{7}{-1}%
+ \Test{8}{-1}%
+ \Test{100}{-1}%
+ \bitsetSetBin{abc}{11111111}%
+ \Clear
+ \Test{7}{8}%
+ \Test{8}{8}%
+ \Test{9}{9}%
+ \Test{100}{100}%
+ \Set
+ \Test{7}{7}%
+ \Test{8}{-1}%
+ \Test{9}{-1}%
+ \Test{100}{-1}%
+ \bitsetSetBin{abc}{111111111}%
+ \Clear
+ \Test{8}{9}%
+ \Test{9}{9}%
+ \Test{10}{10}%
+ \Test{100}{100}%
+ \Set
+ \Test{8}{8}%
+ \Test{9}{-1}%
+ \Test{10}{-1}%
+ \Test{100}{-1}%
+ \bitsetSetBin{abc}{1111111111}%
+ \Clear
+ \Test{9}{10}%
+ \Test{10}{10}%
+ \Test{11}{11}%
+ \Test{100}{100}%
+ \Set
+ \Test{9}{9}%
+ \Test{10}{-1}%
+ \Test{11}{-1}%
+ \Test{100}{-1}%
+\end{qstest}
+
+\begin{qstest}{GetSetBitList}{GetSetBitList}
+ \let\BS@abc\@undefined
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetGetSetBitList{abc}%
+ }{}%
+ \def\Test#1#2{%
+ \bitsetSetBin{abc}{#1}%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetGetSetBitList{abc}%
+ }{#2}%
+ }%
+ \Test{0}{}%
+ \Test{1}{0}%
+ \Test{10}{1}%
+ \Test{11}{0,1}%
+ \Test{10110100}{2,4,5,7}%
+ \Test{101101001010011}{0,1,4,6,9,11,12,14}%
+\end{qstest}
+
+\begin{qstest}{GetDec}{GetDec}
+ \TestGetterUndefined\bitsetGetDec
+ \def\Test#1#2{%
+ \RevSet{abc}{#1}%
+%<*noetex>
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+%</noetex>
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetGetDec{abc}%
+ }{#2}%
+ }%
+ \Test{0}{0}%
+ \Test{1}{1}%
+ \Test{10}{2}%
+ \Test{11}{3}%
+ \Test{100}{4}%
+ \Test{101}{5}%
+ \Test{110}{6}%
+ \Test{111}{7}%
+ \Test{1000}{8}%
+ \Test{000111}{7}%
+ \Test{1111111111111111%
+ 111111111111111}{2147483647}%
+ \Test{0001111111111111111%
+ 111111111111111}{2147483647}%
+ \Test{1000000000000000%
+ 0000000000000000}{2147483648}%
+ \Test{1000000000000000%
+ 00000000000000000}{4294967296}%
+ \Test{0001000000000000000%
+ 00000000000000000}{4294967296}%
+ \Test{1100000000000000%
+ 00000000000000011}{6442450947}%
+\end{qstest}
+
+\begin{qstest}{Clear}{Clear}
+ \def\Test#1#2#3{%
+ \RevSet{abc}{#1}%
+ \bitsetClear{abc}{#2}%
+ \Expect*{\BS@abc}*{\Reverse#3!!}%
+ }%
+ \bitsetClear{abc}{2}%
+ \RevCheck{abc}{0}%
+ \TestErrorNegativeIndex{-1}{\bitsetClear{abc}{-1}}%
+ \RevCheck{abc}{0}%
+ \Test{0}{0}{0}%
+ \Test{1}{0}{0}%
+ \Test{111}{1}{101}%
+ \Test{111}{30}{111}%
+ \Test{0000111}{5}{0000111}% 111 would also be ok
+ \Test{10000111}{5}{10000111}%
+ \Test{1001001}{3}{1000001}%
+\end{qstest}
+
+\begin{qstest}{Set}{Set}
+ \def\Test#1#2#3{%
+ \RevSet{abc}{#1}%
+ \bitsetSet{abc}{#2}%
+ \Expect*{\BS@abc}*{\Reverse#3!!}%
+ }%
+ \bitsetSet{abc}{2}%
+ \RevCheck{abc}{100}%
+ \TestErrorNegativeIndex{-1}{\bitsetSet{abc}{-1}}%
+ \RevCheck{abc}{100}%
+ \Test{0}{0}{1}%
+ \Test{1}{0}{1}%
+ \Test{100}{1}{110}%
+ \Test{111}{1}{111}%
+ \Test{11}{1}{11}%
+ \Test{11}{2}{111}%
+ \Test{11}{3}{1011}%
+ \Test{111}{10}{10000000111}%
+ \Test{0000111}{5}{0100111}% 100111 would also be ok
+ \Test{10000111}{5}{10100111}%
+ \Test{1000001}{3}{1001001}%
+ \Test{1001001}{3}{1001001}%
+\end{qstest}
+
+\begin{qstest}{Flip}{Flip}
+ \def\Test#1#2#3{%
+ \RevSet{abc}{#1}%
+ \bitsetFlip{abc}{#2}%
+ \Expect*{\BS@abc}*{\Reverse#3!!}%
+ }%
+ \bitsetFlip{abc}{2}%
+ \RevCheck{abc}{100}%
+ \TestErrorNegativeIndex{-1}{\bitsetFlip{abc}{-1}}%
+ \RevCheck{abc}{100}%
+ \Test{0}{0}{1}%
+ \Test{1}{0}{0}%
+ \Test{0}{2}{100}%
+ \Test{100}{1}{110}%
+ \Test{111}{1}{101}%
+ \Test{11}{1}{1}%
+ \Test{11}{2}{111}%
+ \Test{11}{3}{1011}%
+ \Test{111}{10}{10000000111}%
+ \Test{0000111}{5}{0100111}% 100111 would also be ok
+ \Test{10000111}{5}{10100111}%
+ \Test{1000001}{3}{1001001}%
+ \Test{1001001}{3}{1000001}%
+ \Test{11111}{2}{11011}%
+\end{qstest}
+
+\begin{qstest}{SetValue}{SetValue}
+ \def\Test#1#2{%
+ \TestError{Invalid bit value (#2) not in range 0..1}{%
+ \bitsetSetValue{abc}{#1}{#2}%
+ }%
+ }%
+ \Test{0}{-1}%
+ \Test{0}{2}%
+ \Test{0}{10}%
+ \def\Test#1#2#3{%
+ \let\BS@abc\@undefined
+ \bitsetSetValue{abc}{#1}{#2}%
+ \bitsetSetBin{result}{#3}%
+ \Expect*{\BS@abc}*{\BS@result}%
+ }%
+ \Test{0}{0}{0}%
+ \Test{0}{1}{1}%
+ \Test{1}{0}{0}%
+ \Test{1}{1}{10}%
+ \def\Test#1#2#3#4{%
+ \bitsetSetBin{abc}{#1}%
+ \bitsetSetBin{result}{#4}%
+ \bitsetSetValue{abc}{#2}{#3}%
+ \Expect*{\BS@abc}*{\BS@result}%
+ }%
+ \Test{0}{0}{0}{0}%
+ \Test{0}{0}{0}{0}%
+ \Test{0}{0}{1}{1}%
+ \Test{0}{1}{0}{0}%
+ \Test{0}{1}{1}{10}%
+ \Test{1010}{2}{1}{1110}%
+ \Test{1010}{4}{1}{11010}%
+ \Test{1010}{6}{1}{1001010}%
+ \Test{1010}{1}{0}{1000}%
+ \Test{1010}{2}{0}{1010}%
+ \Test{1010}{3}{0}{10}%
+ \Test{1010}{4}{0}{1010}%
+ \Test{1010}{6}{0}{1010}%
+ \Test{1010}{2}{\csname iffalse\endcsname 0\else 1\fi}{1110}%
+ \Test{1010}{1}{\csname iffalse\endcsname 1\else 0\fi}{1000}%
+\end{qstest}
+
+\begin{qstest}{IsDefined}{IsDefined}
+ \let\BS@abc\@undefined
+ \Expect*{\bitsetIsDefined{abc}{true}{false}}{false}%
+ \bitsetReset{abc}%
+ \Expect*{\bitsetIsDefined{abc}{true}{false}}{true}%
+\end{qstest}
+
+\begin{qstest}{IsEmpty}{IsEmpty}
+ \let\BS@abc\@undefined
+ \Expect*{\bitsetIsEmpty{abc}{true}{false}}{true}%
+ \bitsetReset{abc}%
+ \Expect*{\bitsetIsEmpty{abc}{true}{false}}{true}%
+ \bitsetSet{abc}{1}%
+ \Expect*{\bitsetIsEmpty{abc}{true}{false}}{false}%
+\end{qstest}
+
+\begin{qstest}{Equals}{Equals}
+ \def\Test#1#2#3{%
+ \Expect*{\bitsetEquals{#1}{#2}{true}{false}}{#3}%
+ }%
+ \let\BS@abc\@undefined
+ \Test{abc}{abc}{true}%
+ \Test{abc}{foo}{true}%
+ \Test{foo}{abc}{true}%
+ \bitsetReset{abc}%
+ \Test{abc}{abc}{true}%
+ \Test{abc}{foo}{false}%
+ \Test{foo}{abc}{false}%
+ \bitsetReset{foo}%
+ \Test{abc}{foo}{true}%
+ \Test{foo}{abc}{true}%
+ \bitsetSet{abc}{4}%
+ \Test{abc}{foo}{false}%
+ \Test{foo}{abc}{false}%
+ \bitsetFlip{foo}{4}%
+ \Test{abc}{foo}{true}%
+ \Test{foo}{abc}{true}%
+\end{qstest}
+
+\begin{qstest}{Intersects}{Intersects}
+ \def\Test#1{%
+ \Expect*{\bitsetIntersects{abc}{foo}{true}{false}}{#1}%
+ }%
+ \let\BS@abc\@undefined
+ \let\BS@foo\@undefined
+ \Test{false}%
+ \Set{abc}{0}%
+ \Test{false}%
+ \Set{foo}{0}%
+ \Test{false}%
+ \let\BS@abc\@undefined
+ \Test{false}%
+ \Set{foo}{1}%
+ \Test{false}%
+ \Set{abc}{0}%
+ \Test{false}%
+ \Set{abc}{1}%
+ \Test{true}%
+ \let\BS@foo\@undefined
+ \Test{false}%
+ \Set{foo}{0}%
+ \Test{false}%
+ \def\Test#1#2#3{%
+ \bitsetSetBin{abc}{#1}%
+ \bitsetSetBin{foo}{#2}%
+ \Expect*{\bitsetIntersects{abc}{foo}{true}{false}}{#3}%
+ }%
+ \Test{1010}{0101}{false}%
+ \Test{0}{10}{false}%
+ \Test{1}{11}{true}%
+ \Test{11}{1}{true}%
+ \Test{10}{1}{false}%
+\end{qstest}
+
+\begin{qstest}{And/AndNot/Or/Xor}{And/AndNot/Or/Xor}
+ \def\@Test#1#2#3#4#5{%
+ \begingroup
+ #5%
+ \begingroup
+ \let\BS@foo\@undefined
+ \csname bitset#1\endcsname{abc}{foo}%
+ \CheckUndef{foo}%
+ \Check{abc}{#2}%
+ \endgroup
+ \begingroup
+ \bitsetReset{foo}%
+ \csname bitset#1\endcsname{abc}{foo}%
+ \Check{foo}{0}%
+ \Check{abc}{#3}%
+ \endgroup
+ \begingroup
+ \def\BS@foo{0101}%
+ \csname bitset#1\endcsname{abc}{foo}%
+ \Check{foo}{0101}%
+ \Check{abc}{#4}%
+ \endgroup
+ \endgroup
+ }%
+ \def\Test#1{%
+ \def\Op{#1}%
+ \Test@
+ }%
+ \def\Test@#1#2#3#4#5#6#7#8#9{%
+ \@Test\Op{#1}{#2}{#3}{%
+ \let\BS@abc\@undefined
+ }%
+ \@Test\Op{#4}{#5}{#6}{%
+ \bitsetReset{abc}%
+ }%
+ \@Test\Op{#7}{#8}{#9}{%
+ \def\BS@abc{1001}%
+ }%
+ }%
+ \Test{And}%
+ {0}{0}{0}%
+ {0}{0}{0}%
+ {0}{0}{0001}%
+ \Test{AndNot}%
+ {0}{0}{0}%
+ {0}{0}{0}%
+ {1001}{1001}{1}%
+ \Test{Or}%
+ {0}{0}{0101}%
+ {0}{0}{0101}%
+ {1001}{1001}{1101}%
+ \Test{Xor}%
+ {0}{0}{0101}%
+ {0}{0}{0101}%
+ {1001}{1001}{11}%
+ \def\Test#1#2#3{%
+ \bitsetSetBin{abc}{#1}%
+ \bitsetSetBin{foo}{#2}%
+ \csname bitset\Op\endcsname{abc}{foo}%
+ \RevCheck{foo}{#2}%
+ \RevCheck{abc}{#3}%
+ }%
+ \def\Op{And}%
+ \Test{1}{111}{1}%
+ \Test{111}{1}{1}%
+ \Test{10}{111}{10}%
+ \Test{111}{10}{10}%
+ \Test{111}{1000}{0}%
+ \Test{1000}{111}{0}%
+ \def\Op{AndNot}%
+ \Test{1010}{11}{1000}%
+ \Test{100}{100}{0}%
+ \Test{111}{1111}{0}%
+ \Test{100}{111}{0}%
+ \def\Op{Or}%
+ \Test{0}{0}{0}%
+ \Test{1}{0}{1}%
+ \Test{0}{1}{1}%
+ \Test{1}{1}{1}%
+ \Test{1000}{10}{1010}%
+ \Test{10}{1000}{1010}%
+ \def\Op{Xor}%
+ \Test{0}{0}{0}%
+ \Test{1}{0}{1}%
+ \Test{0}{1}{1}%
+ \Test{1}{1}{0}%
+ \Test{1000}{10}{1010}%
+ \Test{10}{1000}{1010}%
+ \Test {110011001100}%
+ {111000111000111}%
+ {111110100001011}%
+ \Test{111000111000111}%
+ {110011001100}%
+ {111110100001011}%
+\end{qstest}
+
+\begin{qstest}{GetUndef}{GetUndef, GetBin, GetOct, GetHex}
+ \def\TestUndef#1#2{%
+ \let\BS@abc\@undefined
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \x{abc}{#1}%
+ }{#2}%
+ }%
+ \let\x\bitsetGetBin
+ \TestUndef{-1}{0}%
+ \TestUndef{0}{0}%
+ \TestUndef{1}{0}%
+ \TestUndef{2}{00}%
+ \TestUndef{8}{00000000}%
+ \let\x\bitsetGetOct
+ \TestUndef{-1}{0}%
+ \TestUndef{0}{0}%
+ \TestUndef{1}{0}%
+ \TestUndef{2}{0}%
+ \TestUndef{3}{0}%
+ \TestUndef{4}{00}%
+ \TestUndef{5}{00}%
+ \TestUndef{6}{00}%
+ \TestUndef{7}{000}%
+ \TestUndef{8}{000}%
+ \TestUndef{9}{000}%
+ \TestUndef{10}{0000}%
+ \let\x\bitsetGetHex
+ \TestUndef{-1}{0}%
+ \TestUndef{0}{0}%
+ \TestUndef{1}{0}%
+ \TestUndef{2}{0}%
+ \TestUndef{3}{0}%
+ \TestUndef{4}{0}%
+ \TestUndef{5}{00}%
+ \TestUndef{6}{00}%
+ \TestUndef{7}{00}%
+ \TestUndef{8}{00}%
+ \TestUndef{9}{000}%
+ \TestUndef{10}{000}%
+ \TestUndef{12}{000}%
+ \TestUndef{13}{0000}%
+ \TestUndef{16}{0000}%
+ \TestUndef{17}{00000}%
+\end{qstest}
+
+\begin{qstest}{SetBin}{SetBin}
+ \def\Test#1#2{%
+ \let\BS@abc\@undefined
+ \bitsetSetBin{abc}{#1}%
+ \expandafter\Expect\expandafter{\BS@abc}{#2}%
+ }%
+ \Test{}{0}%
+ \Test{0}{0}%
+ \Test{1}{1}%
+ \Test{10}{01}%
+ \Test{11}{11}%
+ \Test{010}{01}%
+ \Test{011}{11}%
+ \Test{0010}{01}%
+ \Test{1010}{0101}%
+\end{qstest}
+
+\begin{qstest}{SetOct}{SetOct}
+ \def\Test#1#2{%
+ \bitsetSetOct{abc}{#1}%
+ \expandafter\Expect\expandafter{\BS@abc}{#2}%
+ }%
+ \Test{}{0}%
+ \Test{0}{0}%
+ \Test{000}{0}%
+ \Test{1}{1}%
+ \Test{001}{1}%
+ \Test{010}{0001}%
+ \Test{020}{00001}%
+ \Test{42}{010001}%
+ \Test{377}{11111111}%
+ \Test{0377}{11111111}%
+ \Test{76543210}{000100010110001101011111}%
+ \Test{ 0 7 0 7 1 }{100111000111}%
+\end{qstest}
+
+\begin{qstest}{SetHex}{SetHex}
+ \def\Test#1#2{%
+ \bitsetSetHex{abc}{#1}%
+ \expandafter\Expect\expandafter{\BS@abc}{#2}%
+ }%
+ \Test{}{0}%
+ \Test{0}{0}%
+ \Test{000}{0}%
+ \Test{1}{1}%
+ \Test{001}{1}%
+ \Test{010}{00001}%
+ \Test{020}{000001}%
+ \Test{42}{0100001}%
+ \Test{3F}{111111}%
+ \Test{03F}{111111}%
+ \Test{43210}{0000100001001100001}%
+ \Test{98765}{10100110111000011001}%
+ \Test{FEDCBA}{010111010011101101111111}%
+ \Test{ 0 F 0 F 1 }{1000111100001111}%
+\end{qstest}
+
+\begin{qstest}{SetDec}{SetDec}
+ \def\Test#1#2{%
+ \bitsetSetDec{abc}{#1}%
+ \expandafter\Expect\expandafter{\BS@abc}{#2}%
+ }%
+ \Test{}{0}%
+ \Test{0}{0}%
+ \Test{000}{0}%
+ \Test{1}{1}%
+ \Test{7}{111}%
+ \Test{8}{0001}%
+ \Test{001}{1}%
+ \Test{010}{0101}%
+ \Test{020}{00101}%
+ \Test{53}{101011}%
+ \Test{255}{11111111}%
+ \Test{256}{000000001}%
+ \Test{999999999}{111111111001001101011001110111}%
+ \Test{1000000000}{000000000101001101011001110111}%
+ \Test{4210987654}{01100001010010010111111101011111}%
+ \Test{2147483647}{1111111111111111111111111111111}%
+ \Test{2147483648}{00000000000000000000000000000001}%
+\end{qstest}
+
+\begin{qstest}{GetBin}{GetBin}
+ \def\TestUndef#1#2{%
+ \let\BS@abc\@undefined
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetGetBin{abc}{#1}%
+ }{#2}%
+ }%
+ \TestUndef{-1}{0}%
+ \TestUndef{0}{0}%
+ \TestUndef{1}{0}%
+ \TestUndef{2}{00}%
+ \TestUndef{8}{00000000}%
+ \def\Test#1#2{%
+ \bitsetSetBin{abc}{#2}%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetGetBin{abc}{#1}%
+ }{#2}%
+ }%
+ \Test{-1}{0}%
+ \Test{0}{0}%
+ \Test{1}{0}%
+ \Test{1}{1}%
+ \Test{2}{01}%
+ \Test{2}{10}%
+ \Test{3}{010}%
+ \Test{2}{00}%
+ \Test{2}{01}%
+ \Test{8}{00101100}%
+ \Test{2}{10101}%
+ \Test{-100}{11011}%
+\end{qstest}
+
+\begin{qstest}{GetOct}{GetOct}
+ \def\Test#1#2#3{%
+ \edef\x{\zap@space#1 \@empty}%
+ \edef\x{\noexpand\bitsetSetBin{abc}{\x}}%
+ \x
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetGetOct{abc}{#2}%
+ }{#3}%
+ }%
+ \Test{111 110 101 100 011 010 001 000}{0}{76543210}%
+ \Test{000 111}{0}{7}%
+ \Test{101 000}{-1}{50}%
+ \Test{111}{-1}{7}%
+ \Test{111}{0}{7}%
+ \Test{111}{1}{7}%
+ \Test{111}{3}{7}%
+ \Test{111}{4}{07}%
+ \Test{111}{6}{07}%
+ \Test{111}{7}{007}%
+ \Test{111 010}{6}{72}%
+ \Test{111 010}{7}{072}%
+ \Test{011 111}{0}{37}%
+ \Test{011 111}{6}{37}%
+ \Test{011 111}{7}{037}%
+ \Test{001 111}{0}{17}%
+ \Test{001 111}{6}{17}%
+ \Test{001 111}{7}{017}%
+\end{qstest}
+
+\begin{qstest}{GetHex}{GetHex}
+ \def\Test#1#2#3{%
+ \bitsetSetBin{abc}{#1}%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{%
+ \bitsetGetHex{abc}{#2}%
+ }{#3}%
+ }%
+ \Test{1111 1110 1101 1100 1011 1010 1001 1000}{0}{FEDCBA98}%
+ \Test{0111 0110 0101 0100 0011 0010 0001 0000}{0}{76543210}%
+ \Test{0000 1111}{0}{F}%
+ \Test{0101 0000}{-1}{50}%
+ \Test{1111}{-1}{F}%
+ \Test{1111}{0}{F}%
+ \Test{1111}{1}{F}%
+ \Test{1111}{4}{F}%
+ \Test{1111}{5}{0F}%
+ \Test{1111}{8}{0F}%
+ \Test{1111}{9}{00F}%
+ \Test{1111 0010}{8}{F2}%
+ \Test{1111 0010}{9}{0F2}%
+ \Test{0111 1111}{0}{7F}%
+ \Test{0111 1111}{8}{7F}%
+ \Test{0111 1111}{9}{07F}%
+ \Test{0011 1111}{0}{3F}%
+ \Test{0011 1111}{8}{3F}%
+ \Test{0011 1111}{9}{03F}%
+ \Test{0001 1111}{0}{1F}%
+ \Test{0001 1111}{8}{1F}%
+ \Test{0001 1111}{9}{01F}%
+\end{qstest}
+
+\begin{qstest}{Range}{Range}
+ \TestError{%
+ Wrong index numbers in range [9..8]\MessageBreak% hash-ok
+ for clear/set/flip on bit set `abc'.\MessageBreak
+ The lower index exceeds the upper index.\MessageBreak
+ Canceling the operation as error recovery%
+ }{%
+ \bitsetSetRange{abc}{9}{8}%
+ }%
+ \def\TestErrorNegInd#1#2#3#4#5#6{%
+ \TestError{%
+ Negative index in range [#2..#3]\MessageBreak % hash-ok
+ for \string\bitset #1Range on bit set `abc'.\MessageBreak
+ Using [#4..#5] as error recovery% hash-ok
+ }{%
+ \csname bitset#1Range\endcsname{abc}{#2}{#3}%
+ \global\let\BS@global\BS@abc
+ }%
+ \Check{global}{#6}%
+ }%
+ \Set{abc}{111}%
+ \TestErrorNegInd{Clear}{-1}{0}{0}{0}{111}%
+ \TestErrorNegInd{Clear}{0}{-1}{0}{0}{111}%
+ \TestErrorNegInd{Clear}{-2}{2}{0}{2}{001}%
+ \bitsetReset{abc}%
+ \TestErrorNegInd{Set}{-1}{0}{0}{0}{0}%
+ \TestErrorNegInd{Set}{0}{-1}{0}{0}{0}%
+ \TestErrorNegInd{Set}{-2}{2}{0}{2}{11}%
+ \Set{abc}{101}%
+ \TestErrorNegInd{Flip}{-1}{0}{0}{0}{101}%
+ \TestErrorNegInd{Flip}{0}{-1}{0}{0}{101}%
+ \TestErrorNegInd{Flip}{-2}{2}{0}{2}{011}%
+ \def\Test#1#2#3#4{%
+ \bitsetSetBin{abc}{#1}%
+ \csname bitset\TestOp Range\endcsname{abc}{#2}{#3}%
+ \Expect*{\bitsetGetBin{abc}{0}}{#4}%
+ }%
+ \def\TestOp{Clear}%
+ \Test{0}{0}{1}{0}%
+ \Test{1111}{1}{2}{1101}%
+ \Test{1111}{1}{3}{1001}%
+ \Test{1111111100000000}{12}{14}{1100111100000000}%
+ \def\TestOp{Set}%
+ \Test{0}{0}{1}{1}%
+ \Test{1000}{1}{2}{1010}%
+ \Test{0}{1}{2}{10}%
+ \Test{1}{12}{15}{111000000000001}%
+ \Test{1111}{1}{3}{1111}%
+ \Test{1000000000000000}{12}{14}{1011000000000000}%
+ \def\TestOp{Flip}%
+ \Test{0}{0}{1}{1}%
+ \Test{1}{0}{1}{0}%
+ \Test{10101010}{1}{5}{10110100}%
+ \def\Test#1#2#3#4#5{%
+ \bitsetSetBin{abc}{#1}%
+ \bitsetSetValueRange{abc}{#2}{#3}{#4}%
+ \Expect*{\bitsetGetBin{abc}{0}}{#5}%
+ }%
+ \Test{0}{0}{1}{0}{0}%
+ \Test{0}{0}{1}{1}{1}%
+ \Test{1010}{1}{3}{0}{1000}%
+ \Test{1010}{1}{3}{1}{1110}%
+\end{qstest}
+
+\begin{qstest}{ShiftLeft/ShiftRight}{ShiftLeft/ShiftRight}
+ \def\@Test#1#2{%
+ \let\BS@abc\@undefined
+ \csname bitsetShift#1\endcsname{abc}{#2}%
+ \Expect*{\BS@abc}{0}%
+ }%
+ \def\Test#1{%
+ \@Test{Left}{#1}%
+ \@Test{Right}{#1}%
+ }%
+ \Test{-16}%
+ \Test{-1}%
+ \Test{0}%
+ \Test{1}%
+ \Test{16}%
+ \def\Test#1#2#3{%
+ \bitsetSetBin{abc}{#1}%
+ \bitsetSetBin{result}{#3}%
+ \csname bitsetShift\Op\endcsname{abc}{#2}%
+ \Expect*{\bitsetGetBin{abc}{0}}*{\bitsetGetBin{result}{0}}%
+ }%
+ \def\Op{Left}%
+ \Test{0}{0}{0}%
+ \Test{0}{1}{0}%
+ \Test{0}{-1}{0}%
+ \Test{1}{0}{1}%
+ \Test{1}{1}{10}%
+ \Test{1}{-1}{0}%
+ \Test{10}{1}{100}%
+ \Test{10}{-1}{1}%
+ \Test{1}{32}{100000000000000000000000000000000}%
+ \Test{1}{-100}{0}%
+ \def\Op{Right}%
+ \Test{0}{0}{0}%
+ \Test{0}{1}{0}%
+ \Test{0}{-1}{0}%
+ \Test{1}{0}{1}%
+ \Test{1}{1}{0}%
+ \Test{1}{-1}{10}%
+ \Test{10}{1}{1}%
+ \Test{10}{-1}{100}%
+ \Test{1}{-32}{100000000000000000000000000000000}%
+ \Test{1}{100}{0}%
+ \Test{110110110110110}{10}{11011}%
+ \Test{110110110110110}{100}{0}%
+ \Test{1}{100000}{0}%
+\end{qstest}
+
+\begin{qstest}{Profile: Set}{Profile: Set}
+ \bitsetSet{abc}{4095}%
+ \global\let\BS@global\BS@abc
+\end{qstest}
+
+\begin{qstest}{Profile: Get}{Profile: Get}
+ \edef\x{\bitsetGet{global}{4095}}%
+\end{qstest}
+
+\begin{document}
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/bitset}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/bitset.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/bitset.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[\CTAN{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 bitset.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@{}}
+% bitset.sty & tex/generic/oberdiek/bitset.sty\\
+% bitset.pdf & doc/latex/oberdiek/bitset.pdf\\
+% test/bitset-test1.tex & doc/latex/oberdiek/test/bitset-test1.tex\\
+% test/bitset-test2.tex & doc/latex/oberdiek/test/bitset-test2.tex\\
+% test/bitset-test3.tex & doc/latex/oberdiek/test/bitset-test3.tex\\
+% bitset.dtx & source/latex/oberdiek/bitset.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk bitset.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{bitset.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 bitset.dtx
+%makeindex -s gind.ist bitset.idx
+%pdflatex bitset.dtx
+%makeindex -s gind.ist bitset.idx
+%pdflatex bitset.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{bitset.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='bitset'>
+ <name>bitset</name>
+ <caption>Handle bit-vector datatype.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.2'/>
+ <description>
+ This package defines and implements the data type bit set,
+ a vector of bits. The size of the vector may grow dynamically.
+ Individual bits can be manipulated.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/bitset.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/bitset.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/09/28 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.1}
+% \item
+% Already loaded package files are not input in \hologo{plainTeX}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.2}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/bitset.pdf b/macros/latex/contrib/oberdiek/bitset.pdf
new file mode 100644
index 0000000000..012ce76213
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/bitset.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/bmpsize.dtx b/macros/latex/contrib/oberdiek/bmpsize.dtx
new file mode 100644
index 0000000000..ec2013277c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/bmpsize.dtx
@@ -0,0 +1,4097 @@
+% \iffalse meta-comment
+%
+% File: bmpsize.dtx
+% Version: 2016/05/16 v1.7
+% Info: Extract size/resolution from bitmap files
+%
+% Copyright (C) 2006-2009 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file bmpsize.dtx
+% and the derived files
+% bmpsize.sty, bmpsize.pdf, bmpsize.ins, bmpsize.drv,
+% bmpsize-base.sty, bmpsize-test.tex, bmpsize-dvips.def,
+% bmpsize-dvipdfm.def, bmpsize-dvipdfmx.def.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/bmpsize.dtx
+% CTAN:macros/latex/contrib/oberdiek/bmpsize.pdf
+%
+% Unpacking:
+% (a) If bmpsize.ins is present:
+% tex bmpsize.ins
+% (b) Without bmpsize.ins:
+% tex bmpsize.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{bmpsize.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If bmpsize.drv is present:
+% latex bmpsize.drv
+% (b) Without bmpsize.drv:
+% latex bmpsize.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 bmpsize.dtx
+% makeindex -s gind.ist bmpsize.idx
+% pdflatex bmpsize.dtx
+% makeindex -s gind.ist bmpsize.idx
+% pdflatex bmpsize.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/bmpsize.sty
+% TDS:tex/latex/oberdiek/bmpsize-base.sty
+% TDS:tex/latex/oberdiek/bmpsize-test.tex
+% TDS:tex/latex/oberdiek/bmpsize-dvips.def
+% TDS:tex/latex/oberdiek/bmpsize-dvipdfm.def
+% TDS:tex/latex/oberdiek/bmpsize-dvipdfmx.def
+% TDS:doc/latex/oberdiek/bmpsize.pdf
+% TDS:source/latex/oberdiek/bmpsize.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: bmpsize 2016/05/16 v1.7 Extract size/resolution from bitmap files (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: bmpsize
+Version: 2016/05/16 v1.7
+
+Copyright (C) 2006-2009 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file bmpsize.dtx
+and the derived files
+ bmpsize.sty, bmpsize.pdf, bmpsize.ins, bmpsize.drv,
+ bmpsize-base.sty, bmpsize-test.tex, bmpsize-dvips.def,
+ bmpsize-dvipdfm.def, bmpsize-dvipdfmx.def.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{bmpsize.ins}{\from{bmpsize.dtx}{install}}%
+ \file{bmpsize.drv}{\from{bmpsize.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{bmpsize.sty}{\from{bmpsize.dtx}{package}}%
+ \file{bmpsize-base.sty}{\from{bmpsize.dtx}{base}}%
+ \file{bmpsize-test.tex}{\from{bmpsize.dtx}{test}}%
+ \file{bmpsize-dvips.def}{\from{bmpsize.dtx}{dvips}}%
+ \file{bmpsize-dvipdfm.def}{\from{bmpsize.dtx}{dvipdfm}}%
+ \file{bmpsize-dvipdfmx.def}{\from{bmpsize.dtx}{dvipdfmx}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{bmpsize.xml}{\from{bmpsize.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{* bmpsize.sty, bmpsize-base.sty, bmpsize-test.tex,}
+\Msg{* bmpsize-dvips.def, bmpsize-dvipdfm.def,}
+\Msg{* bmpsize-dvipdfmx.def}
+\Msg{*}
+\Msg{* To produce the documentation run the file `bmpsize.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bmpsize.drv}%
+ [2016/05/16 v1.7 Extract size/resolution from bitmap files (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{bmpsize.dtx}%
+\end{document}
+%</driver>
+% \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{bmpsize.drv}
+%
+% \title{The \xpackage{bmpsize} package}
+% \date{2016/05/16 v1.7}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{bmpsize} analyzes bitmap images to extract
+% size and resolution data. It adds this feature to the graphics package
+% that now do not need separate bounding box files for bitmap images.
+% Additionally the implementation for the inclusion of bitmap images
+% in some drivers of package \xpackage{graphicx} are rewritten to support
+% options \xoption{viewport}, \xoption{trim} and \xoption{clip}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% The support of bitmap images in the \TeX\ world is quite poor.
+% \TeX\ can read text files and thus parse the bounding box
+% of EPS files, but it cannot read binary files. If \TeX\ reads
+% a line, it removes spaces before the line end and normalizes
+% the line end itself to get independent from the convention of
+% the operating system.
+%
+% The situation changed with \pdfTeX. It is a \TeX\ compiler,
+% where the output driver is already integrated.
+% Images of type JPEG and PNG are supported directly and
+% the size of the images are reported back to the \TeX\ language.
+% Thus it is easy for package \xpackage{graphics} to get the
+% size of the images.
+%
+% The problem remains for other drivers than \pdfTeX\ in PDF mode.
+% The size information must either be given manually by the
+% bounding box options or an additional file is used for each
+% image, where the size information is stored as EPS bounding box.
+% Program \xpackage{dvips} comes with the program \xpackage{ebb}
+% that create these \xfile{.bb} files. However it ignores the
+% natural size of the image and uses a fixed resolution of 100\,DPI.
+%
+% Since \pdfTeX\ 1.30.0 there are some new primites. Especially
+% \cs{pdffiledump} is very helpful. It reads a file in binary mode
+% and reports the selected area as hex dump. It works in both
+% DVI and PDF mode of \pdfTeX. Thus it is now possible to read
+% and parse bitmap files to get their size.
+% This project uses this feature to implement parsers for many
+% bitmap file types.
+%
+% \subsection{Bitmap image parsers}
+%
+% This project supports the following image types:
+% \begin{quote}
+% BMP, GIF, JPEG, MSP, PAM, PCX, PNG, PNM, SGI, TGA, TIFF, WMF, XPM
+% \end{quote}
+% Consult the documentation of your \TeX\ distribution and driver
+% which types are supported by your driver. Sometimes automatically triggered
+% conversions can be configured to extend the range of supported
+% image types.
+%
+% \subsubsection{User interface}
+%
+% Package \xpackage{bmpsize} hooks into package \xpackage{graphics}.
+% If an image is included and its size is not given, then
+% \xpackage{bmpsize} investigates the image. If it could be
+% parsed as known bitmap file type, the size is reported back
+% to package \xpackage{graphics}.
+%
+% The following options are added to the options of package \xpackage{graphicx}:
+% \begin{description}
+% \item[\xoption{resolutionunit}:] Specifies the unit of the
+% options for setting the resolution. Default is \verb|1in| that means
+% the numbers are interpreted as dots per inch (DPI).
+% \item[\xoption{defaultresolution}:] Bitmap files do not always provide
+% information about their resolution (density). If this information
+% is not given, the values of this option are used to calculate the
+% image size. Default: \verb|72 !|
+% \item[\xoption{resolution}:] This option override the resolution given
+% in the bitmap file.
+% \item[\xoption{bmpsizefast}:] Values are \verb|true| and \verb|false|.
+% The option is enabled by default. Then mainly \eTeX's arithmetic is
+% used to calculate the width and height. However the dimen dimensions
+% are limited. Therefore overflow errors can happen.
+% Disable then this option to use the arithmetic of package \xpackage{fp}.
+% It allows a larger range of numbers at the cost of speed.
+% \end{description}
+% Options \xoption{defaultresolution} and \xoption{resolution} expect
+% two numbers, separated by a space. The first is taken as density
+% for the horizontal x axis, the second for the vertical y axis.
+% One of the numbers may be replaced by an exclamation mark. In this
+% an aspect ratio is respected and the correct density for this axis
+% automatically calculated. If one number is given, this number is
+% used for both axes.
+% Examples:
+% \begin{quote}
+% \def\comment#1{%
+% \unskip\qquad\textit{\%\space#1}\\%
+% \ignorespaces
+% }%
+% |defaultresolution=72 !| \comment{Default}
+% |resolution=100| \comment{Simulates behaviour of program \xpackage{ebb}}
+% \end{quote}
+%
+% The options can be set in \cs{includegraphics} or using \cs{bmpsizesetup}.
+% \verb|\setkeys{Gin}| is equivalent to the latter case.
+% \begin{quote}
+%\begin{verbatim}
+%\bmpsizesetup{resolutionunit=1in, resolution=100}
+%\includegraphics[
+% defaultresolution=72 !,
+% bmpsizefast=false
+%]{image}
+%\end{verbatim}
+% \end{quote}
+%
+% \subsubsection{Hints}
+%
+% \begin{itemize}
+% \item My version of \xfile{dvips.def} 1999/02/16 v3.0i defines
+% rules for the supported bitmap extensions, but does not
+% include them in the list of extensions that are tried
+% if the file name is not given with an extension.
+% In such a case, the list of extensions can be set
+% by \cs{DeclareGraphicsExtensions}, see \xpackage{grfguide}.
+% The following code just extends the list:
+% \begin{quote}
+%\begin{verbatim}
+%\makeatletter
+%\g@addto@macro\Gin@extensions{,.bmp,.pcx,.msp}
+%\makeatother
+%\end{verbatim}
+% \end{quote}
+% \item My version of \xfile{dvipdfm.def} 1998/11/24 vx.x misses
+% the graphics rule for PNG files. It can be added by:
+% \begin{quote}
+%\begin{verbatim}
+%\DeclareGraphicsRule{.png}{bmp}{.bb}{#1}
+%\end{verbatim}
+% \end{quote}
+% See the previous issue to add the extension \xfile{.png} to the list
+% of extensions for package \xpackage{graphics}.
+% \end{itemize}
+%
+% \subsubsection{Test program}
+%
+% There is a test program \xfile{bmpsize-test.tex}. Run it through
+% \verb|latex|, \verb|pdflatex|, or \verb|pdftex|. Then given
+% image files are inspected and the result is printed.
+%
+% \subsubsection{Interface for programmers}
+%
+% The macro names of the parsers are \verb|\bmpsize@read@|\meta{type}.
+% Example: \cs{bmpsize@read@jpg} in case of JPEG.
+%
+% A parser sets the switch \cs{ifbmpsize@ok} to true, if it
+% could successfully parse the image file.
+% The width and height are returnd in \cs{bmpsize@width} and
+% \cs{bmpsize@height}. If information about density is available,
+% it is used to calculate width and height of the image, otherwise
+% the values given by option \xoption{defaultresolution} is used.
+% \xoption{resolution} overwrites the values in the image file.
+%
+% \subsection{Improved bitmap inclusion}
+%
+% Some drivers for package \xpackage{graphics} define the graphics
+% type \xoption{bmp} for bitmap images. The code in the standard
+% drivers for \xoption{dvips}, \xoption{dvipdfm}, and \xoption{dvipdfmx}
+% is very basic and misses essential features of the
+% package \xpackage{graphicx}. Therefore the code for bitmap
+% inclusion is automatically rewritten by this package to add
+% the following features:
+% \begin{itemize}
+% \item Support for \xoption{viewport} and \xoption{trim}.
+% \item Support for \xoption{clip}.
+% \item In case of \xoption{dvipdfm} and \xoption{dvipdfmx} the
+% bitmap images are reused and not included again if they
+% are used more than once.
+% \end{itemize}
+% However, there is a difference between \xoption{dvipdfm} and
+% \xoption{dvipdfmx}, especially if images are reused. In the
+% former case the reused box has width and height of 1bp, in the
+% latter case its natural width. Thus the correct driver option must be given.
+% \xoption{dvipdfm} and \xoption{dvipdfmx} are not equivalent.
+%
+% Older versions of \xoption{dvipdfmx} uses a size of 1in. However I do
+% want to distinguish between versions of the same program. Therefore the
+% support of these older versions has stopped with version 1.6 of this package.
+% Use version dvipdfmx-20090708 or newer (some few versions before will
+% probably also work, but I don't want to investigate this further).
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Basic package \xpackage{bmpsize-base}}
+%
+% Identification.
+% \begin{macrocode}
+%<*base>
+\ProvidesPackage{bmpsize-base}%
+ [2016/05/16 v1.7 Basic part of bmpsize (HO)]%
+% \end{macrocode}
+% Modules of package \xpackage{fp} are used for calculations.
+% \begin{macrocode}
+\RequirePackage{fp-basic}
+\RequirePackage{fp-snap}
+% \end{macrocode}
+% Package \xpackage{fp} uses nested \cs{loop} structures.
+% That breaks with the plain-\TeX\ version of \cs{loop}.
+% Therefore we use the \LaTeX\ variant.
+% \begin{macro}{\@bmpsize@plain@loop}
+% \begin{macrocode}
+\long\def\@bmpsize@plain@loop#1\repeat{%
+ \def\iterate{%
+ #1\relax
+ \expandafter\iterate\fi
+ }%
+ \iterate
+ \let\iterate\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\RequirePackage{pdftexcmds}[2007/11/11]
+% \end{macrocode}
+% \begin{macrocode}
+\newif\ifbmpsize@ok
+\let\@bmpsize@ok\bmpsize@oktrue
+
+\newif\if@bmpsize@bigendian
+\newif\if@bmpsize@absnum
+\newif\if@bmpsize@user@resolution
+\newif\if@bmpsize@fast
+\@bmpsize@fasttrue
+
+\def\@bmpsize@init{%
+ \let\@bmpsize@org@plain@loop\loop
+ \let\loop\@bmpsize@plain@loop
+ \bmpsize@okfalse
+ \@bmpsize@bigendiantrue
+ \@bmpsize@absnumfalse
+ \let\bmpsize@pixelwidth\relax
+ \let\bmpsize@pixelheight\relax
+ \let\bmpsize@pixelx\relax
+ \let\bmpsize@pixely\relax
+ \let\bmpsize@unit\relax
+ \let\bmpsize@pixelxdenom\relax
+ \let\bmpsize@pixelydenom\relax
+ \let\bmpsize@orientation\relax
+}
+
+\def\@bmpsize@stop#1\@nil{}
+
+\def\@bmpsize@loop#1{%
+ #1%
+ \@bmpsize@loop{#1}%
+}
+\def\@bmpsize@break#1\@bmpsize@loop#2{}
+
+\def\@bmpsize@size#1#2#3{%
+ \edef#3{\pdf@filesize{#1}}%
+ \ifx#3\@empty
+ \expandafter\@bmpsize@stop
+ \fi
+ \ifnum#3<#2\relax
+ \expandafter\@bmpsize@stop
+ \fi
+}
+
+\def\@bmpsize@read#1#2#3{%
+ \edef\@bmpsize@buf{\pdf@filedump{#3}{#2}{#1}}%
+ \edef\@bmpsize@temp{%
+ \noexpand\@bmpsize@check@byte{#2}\@bmpsize@buf{}{}\noexpand\\%
+ }%
+ \@bmpsize@temp
+}
+\def\@bmpsize@fillbuf#1{%
+ \ifx\@bmpsize@buf\@empty
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \edef\@bmpsize@buf{%
+ \pdf@filedump{\bmpsize@offset}{\bmpsize@fillbuflength}{#1}%
+ }%
+ \ifx\@bmpsize@buf\@empty
+ \expandafter\@bmpsize@stop
+ \fi
+ \edef\bmpsize@offset{\the\numexpr\bmpsize@offset+\bmpsize@fillbuflength}%
+ }%
+}
+\def\bmpsize@fillbuflength{10}
+
+\def\@bmpsize@append#1#2#3{%
+ \edef#1{#2#3}%
+}
+\def\@bmpsize@pushback#1{%
+ \edef\@bmpsize@buf{#1\@bmpsize@buf}%
+}
+
+\def\@bmpsize@iswhite#1{%
+ \ifnum\pdf@strcmp{#1}{09}=\z@
+ \else
+ \ifnum\pdf@strcmp{#1}{0A}=\z@
+ \else
+ \ifnum\pdf@strcmp{#1}{0D}=\z@
+ \else
+ \ifnum\pdf@strcmp{#1}{20}=\z@
+ \else
+ 1%
+ \fi
+ \fi
+ \fi
+ \fi
+ \space
+}
+\def\@bmpsize@isdigit#1{%
+ \ifnum\pdf@strcmp{#1}{30}<\z@
+ 1%
+ \else
+ \ifnum\pdf@strcmp{#1}{39}>\z@
+ 1%
+ \fi
+ \fi
+ \space
+}
+
+\def\@bmpsize@check@byte#1#2#3{%
+ \ifnum#1<\@ne
+ \csname fi\endcsname
+ \@bmpsize@cleanup@end
+ \else
+ \csname fi\endcsname
+ \ifx!#2#3!%
+ \csname fi\endcsname
+ \@bmpsize@stop
+ \else
+ \csname fi\endcsname
+ \expandafter\@bmpsize@check@byte\expandafter{\the\numexpr#1-1}%
+}
+\def\@bmpsize@cleanup@end#1\\{}
+
+\def\@bmpsize@swap@maybe#1{%
+ \if@bmpsize@bigendian
+ \else
+ \edef#1{\expandafter\@bmpsize@@swap#1\@empty\@empty\@empty\@empty}%
+ \fi
+}
+\def\@bmpsize@@swap#1#2#3#4#5#6#7#8{%
+ #7#8#5#6#3#4#1#2%
+}
+
+\def\@bmpsize@skip@one{%
+ \edef\@bmpsize@buf{\expandafter\@gobbletwo\@bmpsize@buf}%
+}
+\def\@bmpsize@skip@two{%
+ \edef\@bmpsize@buf{\expandafter\@gobblefour\@bmpsize@buf}%
+}
+\def\@bmpsize@skip@four{%
+ \edef\@bmpsize@buf{%
+ \expandafter\expandafter\expandafter\@gobblefour\expandafter
+ \@gobblefour\@bmpsize@buf
+ }%
+}
+
+\def\@bmpsize@grab#1#2{%
+ \edef#1{\noexpand\@bmpsize@grab@byte#2=\@bmpsize@buf\noexpand\\}%
+ \edef#1{#1}%
+}
+\def\@bmpsize@grab@byte#1=#2#3{%
+ #2#3%
+ \ifnum#1>\@ne
+ \expandafter\@bmpsize@grab@byte\the\numexpr#1-1\expandafter=%
+ \else
+ \expandafter\@bmpsize@cleanup@end
+ \fi
+}
+
+\def\@bmpsize@abs@maybe#1{%
+ \let\@bmpsize@temp\relax
+ \if@bmpsize@absnum
+ \ifnum"\expandafter\@car#1\@nil>7 %
+ \edef#1{\expandafter\@bmpsize@abs@byte#1\relax}%
+ \ifnum\pdf@strcmp{#1}{7FFFFFFF}=\z@
+ \let\@bmpsize@temp\@bmpsize@stop
+ \else
+ \def\@bmpsize@temp{\edef#1{\the\numexpr#1+1}}%
+ \fi
+ \fi
+ \fi
+}
+\def\@bmpsize@abs@byte#1{%
+ \ifx#1\relax
+ \else
+ \ifcase"0#1 %
+ F\or E\or D\or C\or B\or A\or 9\or 8\or
+ 7\or 6\or 5\or 4\or 3\or 2\or 1\or 0%
+ \fi
+ \expandafter\@bmpsize@abs@byte
+ \fi
+}
+
+\def\@bmpsize@num@one#1{%
+ \@bmpsize@grab#11%
+ \@bmpsize@abs@maybe#1%
+ \edef#1{\number"#1}%
+ \@bmpsize@temp
+ \@bmpsize@skip@one
+}
+\def\@bmpsize@num@two#1{%
+ \@bmpsize@grab#12%
+ \@bmpsize@swap@maybe#1%
+ \@bmpsize@abs@maybe#1%
+ \edef#1{\number"#1}%
+ \@bmpsize@temp
+ \@bmpsize@skip@two
+}
+\def\@bmpsize@num@four#1{%
+ \@bmpsize@grab#14%
+ \@bmpsize@swap@maybe#1%
+ \@bmpsize@abs@maybe#1%
+ \ifnum\pdf@strcmp{#1}{7FFFFFFF}>\z@
+ \expandafter\@bmpsize@stop
+ \fi
+ \edef#1{\number"#1}%
+ \@bmpsize@temp
+ \@bmpsize@skip@four
+}
+
+\def\@bmpsize@div#1#2#3{% #1 := #2/#3
+ \FPdiv#1{#2}{#3}%
+ \@bmpsize@beautify#1%
+}
+\def\@bmpsize@beautify#1{%
+ \FPifint#1%
+ \edef#1{\expandafter\@bmpsize@trunc#1.\@nil}%
+ \else
+ \edef#1{\expandafter\@bmpsize@cleanup@frac#1.\@nil}%
+ \fi
+}
+\def\@bmpsize@trunc#1.#2\@nil{#1}
+% #1 isn't an integer, thus we should have at least one
+% necessary digit after the dot
+\def\@bmpsize@cleanup@frac#1.#2#3.#4\@nil{%
+ #1.#2%
+ \ifx\\#3\\%
+ \else
+ \@bmpsize@cleanup@fracdigits#3000000000\@nil
+ \fi
+}
+\def\@bmpsize@cleanup@fracdigits#1#2#3#4#5#6#7#8#9{%
+ \ifcase#9 %
+ \ifcase#8 %
+ \ifcase#7 %
+ \ifcase#6 %
+ \ifcase#5 %
+ \ifcase #4 %
+ \ifcase #3 %
+ \ifcase #2 %
+ \ifcase #1 %
+ \else
+ #1%
+ \fi
+ \else
+ #1#2%
+ \fi
+ \else
+ #1#2#3%
+ \fi
+ \else
+ #1#2#3#4%
+ \fi
+ \else
+ #1#2#3#4#5%
+ \fi
+ \else
+ #1#2#3#4#5#6%
+ \fi
+ \else
+ #1#2#3#4#5#6#7%
+ \fi
+ \else
+ #1#2#3#4#5#6#7#8%
+ \fi
+ \else
+ #1#2#3#4#5#6#7#8#9%
+ \fi
+ \@bmpsize@trunc.%
+}
+
+\def\@bmpsize@end{%
+ \ifbmpsize@ok
+ \ifx\bmpsize@pixelwidth\relax
+ \bmpsize@okfalse
+ \fi
+ \ifx\bmpsize@pixelheight\relax
+ \bmpsize@okfalse
+ \fi
+ \fi
+ \ifbmpsize@ok
+ \ifnum\bmpsize@pixelwidth>\z@
+ \else
+ \bmpsize@okfalse
+ \fi
+ \ifnum\bmpsize@pixelheight>\z@
+ \else
+ \bmpsize@okfalse
+ \fi
+ \fi
+ \ifbmpsize@ok
+ \ifcase 0%
+ \ifx\bmpsize@pixelx\relax 1 \fi
+ \ifx\bmpsize@pixely\relax 1 \fi
+ \ifnum\bmpsize@pixelx>\z@\else 1 \fi
+ \ifnum\bmpsize@pixely>\z@\else 1 \fi
+ \ifx\bmpsize@pixelxdenom\relax
+ \ifx\bmpsize@pixelydenom\relax\else 1 \fi
+ \else
+ \ifnum\bmpsize@pixelxdenom>\z@\else 1 \fi
+ \fi
+ \ifx\bmpsize@pixelydenom\relax
+ \else
+ \ifnum\bmpsize@pixelydenom>\z@\else 1 \fi
+ \fi
+ \else
+ \let\bmpsize@pixelx\relax
+ \let\bmpsize@pixely\relax
+ \let\bmpsize@unit\relax
+ \let\bmpsize@pixelxdenom\relax
+ \let\bmpsize@pixelydenom\relax
+ \fi
+ \ifx\bmpsize@pixelxdenom\relax
+ \else
+ \@bmpsize@div\bmpsize@pixelx\bmpsize@pixelx\bmpsize@pixelxdenom
+ \@bmpsize@div\bmpsize@pixely\bmpsize@pixely\bmpsize@pixelydenom
+ \let\bmpsize@pixelxdenom\relax
+ \let\bmpsize@pixelydenom\relax
+ \fi
+ \ifcase 0\ifx\bmpsize@unit\relax 1\fi
+ \if@bmpsize@user@resolution 1\fi
+ \relax
+ \let\bmpsize@calc@unit\bmpsize@unit
+ \let\bmpsize@calc@pixelx\bmpsize@pixelx
+ \let\bmpsize@calc@pixely\bmpsize@pixely
+ \else
+ \let\bmpsize@calc@unit\bmpsize@unit@default
+ \let\bmpsize@calc@pixelx\bmpsize@pixelx@default
+ \let\bmpsize@calc@pixely\bmpsize@pixely@default
+ \ifx\bmpsize@calc@pixely\Gin@exclamation
+ \ifx\bmpsize@pixelx\relax
+ \let\bmpsize@calc@pixely\bmpsize@calc@pixelx
+ \else
+ \FPdiv\bmpsize@calc@pixely\bmpsize@calc@pixelx\bmpsize@pixelx
+ \FPmul\bmpsize@calc@pixely\bmpsize@calc@pixely\bmpsize@pixely
+ \fi
+ \else
+ \ifx\bmpsize@calc@pixelx\Gin@exclamation
+ \ifx\bmpsize@pixelx\relax
+ \let\bmpsize@calc@pixelx\bmpsize@calc@pixely
+ \else
+ \FPdiv\bmpsize@calc@pixelx\bmpsize@calc@pixely\bmpsize@pixely
+ \FPmul\bmpsize@calc@pixelx\bmpsize@calc@pixelx\bmpsize@pixelx
+ \fi
+ \fi
+ \fi
+ \fi
+ \FPdiv\bmpsize@width\bmpsize@pixelwidth\bmpsize@calc@pixelx
+ \FPdiv\bmpsize@height\bmpsize@pixelheight\bmpsize@calc@pixely
+ % calculation of width and height in bp for package graphics
+ % 1in = 72bp = 72.27pt, 72/72.27 = 8/8.03, 1pt = 65536sp
+ \if@bmpsize@fast
+ \edef\bmpsize@width{%
+ \strip@pt\dimexpr.99626\dimexpr
+ \bmpsize@width\dimexpr\bmpsize@calc@unit
+ }%
+ \edef\bmpsize@height{%
+ \strip@pt\dimexpr.99626\dimexpr
+ \bmpsize@height\dimexpr\bmpsize@calc@unit
+ }%
+ \else
+ \edef\@bmpsize@temp{\number\dimexpr\bmpsize@calc@unit}%
+ \ifnum\@bmpsize@temp>100000 %
+ \FPmul\@bmpsize@temp\@bmpsize@temp{0.00001}%
+ \def\@bmpsize@corr{100000}%
+ \else
+ \let\@bmpsize@corr\relax
+ \fi
+ \FPmul\bmpsize@width\bmpsize@width\@bmpsize@temp
+ \FPmul\bmpsize@height\bmpsize@height\@bmpsize@temp
+ \FPmul\bmpsize@width\bmpsize@width{8}%
+ \FPmul\bmpsize@height\bmpsize@height{8}%
+ \FPdiv\bmpsize@width\bmpsize@width{8.03}%
+ \FPdiv\bmpsize@height\bmpsize@height{8.03}%
+ \FPdiv\bmpsize@width\bmpsize@width{65536}%
+ \FPdiv\bmpsize@height\bmpsize@height{65536}%
+ \ifx\@bmpsize@corr\relax
+ \else
+ \FPmul\bmpsize@width\bmpsize@width\@bmpsize@corr
+ \FPmul\bmpsize@height\bmpsize@height\@bmpsize@corr
+ \fi
+ \FPround\bmpsize@width\bmpsize@width{5}%
+ \FPround\bmpsize@height\bmpsize@height{5}%
+ \@bmpsize@beautify\bmpsize@width
+ \@bmpsize@beautify\bmpsize@height
+ \fi
+ \fi
+ \let\loop\@bmpsize@org@plain@loop
+}
+\def\bmpsize@unit@default{72.27pt}% more accurate than 1in
+\def\bmpsize@pixelx@default{72}
+\let\bmpsize@pixely@default\Gin@exclamation
+
+\def\bmpsize@types{png,jpg,bmp,gif,tiff,pnm,pam,xpm,tga,pcx,msp,sgi}
+%</base>
+% \end{macrocode}
+%
+% \subsection{Bitmap formats}
+%
+% \subsubsection{png}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin png
+%big-endian
+%
+%read 24 0
+%grab 8 -> $temp
+%check streq $temp [0x89 "PNG" 0x0D 0x0A 0x1A 0x0A]
+%num 4 -> $length
+%grab 4 -> $temp
+%check streq $temp ["IHDR"]
+%num 4 -> $pixelwidth
+%num 4 -> $pixelheight
+%ok
+%assign numexpr(20 + $length) -> $offset
+%loop
+% read 8 $offset
+% num 4 -> $length
+% grab 4 -> $temp
+% if streq $temp ["IDAT"]
+% stop
+% fi
+% if streq $temp ["pHYs"]
+% read 9 numexpr($offset + 8)
+% num 4 -> $pixelx
+% num 4 -> $pixely
+% grab 1 -> $temp
+% if numeq $temp 1
+% assign {100cm} -> $unit
+% fi
+% stop
+% fi
+% assign numexpr($offset + 12 + $length) -> $offset
+%repeat
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@png}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@png#1{%
+ \@bmpsize@init
+ \@bmpsize@bigendiantrue
+ \@bmpsize@read{#1}{24}{0}%
+ \@bmpsize@grab\bmpsize@temp{8}%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@four
+ \ifnum\pdf@strcmp{\bmpsize@temp}{89504E470D0A1A0A}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@num@four\bmpsize@length
+ \@bmpsize@grab\bmpsize@temp{4}%
+ \@bmpsize@skip@four
+ \ifnum\pdf@strcmp{\bmpsize@temp}{49484452}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@num@four\bmpsize@pixelwidth
+ \@bmpsize@num@four\bmpsize@pixelheight
+ \@bmpsize@ok
+ \edef\bmpsize@offset{\the\numexpr20+\bmpsize@length}%
+ \@bmpsize@loop{%
+ \@bmpsize@read{#1}{8}{\bmpsize@offset}%
+ \@bmpsize@num@four\bmpsize@length
+ \@bmpsize@grab\bmpsize@temp{4}%
+ \@bmpsize@skip@four
+ \ifnum\pdf@strcmp{\bmpsize@temp}{49444154}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@stop
+ }%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{70485973}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@read{#1}{9}{\numexpr\bmpsize@offset+8\relax}%
+ \@bmpsize@num@four\bmpsize@pixelx
+ \@bmpsize@num@four\bmpsize@pixely
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\bmpsize@temp=1\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \def\bmpsize@unit{100cm}%
+ }%
+ \@bmpsize@stop
+ }%
+ \edef\bmpsize@offset{\the\numexpr\bmpsize@offset+12+\bmpsize@length}%
+ }%
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{jpg}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin jpg
+%
+%read 3 0
+%grab 3 -> $temp % SOI and 0xFF
+%check streq $temp [0xFF 0xD8 0xFF]
+%assign {2} -> $offset
+%assign {0} -> $exifdensity
+%loop
+% read 4 $offset
+% grab 1 -> $temp
+% check streq $temp [0xFF]
+% num 1 -> $temp
+% if numeq $temp 0xDA % SOS
+% stop
+% fi
+% % look for JFIF APP0 segment
+% if numeq $temp 0xE0 % APP0
+% num 2 -> $length
+% if numeq $exifdensity 0
+% if numge $length 16 % a JFIF segment has 16 bytes at least
+% read 12 numexpr($offset + 4)
+% grab 5 -> $temp % identifier
+% if streq $temp ["JFIF" 0x0]
+% check numge $length 16
+% skip 2 % version
+% num 1 -> $temp % units
+% if numeq $temp 1
+% assign {72.27pt} -> $unit
+% else
+% if numeq $temp 2
+% assign {1cm} -> $unit
+% fi
+% fi
+% num 2 -> $pixelx
+% num 2 -> $pixely
+% fi
+% fi
+% fi
+% else
+% if numeq $temp 0xE1 % APP1
+% % look for Exif APP1 segment
+% num 2 -> $length
+% if numge $length 20 % identifier (6) + Tiff header (8) + first IFD (>=6)
+% read 20 numexpr($offset + 4)
+% grab 6 -> $temp
+% if streq $temp ["Exif" 0x0 0x0]
+% assign numexpr($offset + 10) -> $exifoffset
+% % read TIFF header
+% grab 2 -> $temp
+% if streq $temp ["II"]
+% little-endian
+% else
+% check streq $temp ["MM"]
+% % big-endian
+% fi
+% num 2 -> $temp
+% check numeq $temp 42
+% num 4 -> $temp % offset of first IFD
+% check numgt $temp 0
+% % read first IFD
+% assign numexpr($temp + $exifoffset) -> $off
+% read 2 $off
+% num 2 -> $entries
+% assign numexpr($off + 2) -> $off
+% loop
+% if numeq $entries 0
+% break
+% fi
+% assign numexpr($entries - 1) -> $entries
+% % entry format:
+% % 2 tag
+% % 2 field type
+% % 4 count
+% % 4 value/offset
+% read 12 $off
+% assign numexpr($off + 12) -> $off
+% num 2 -> $tag
+% if numeq $tag 296 % ResolutionUnit
+% skip 6 % type: 3 (short), count: 1
+% num 2 -> $temp
+% ifcase $temp
+% or % 1
+% clear $unit
+% or % 2
+% assign {72.27pt} -> $unit
+% or % 3
+% assign {1cm} -> $unit
+% else
+% clear $unit % unknown
+% fi
+% ifcase $temp
+% or % 1
+% or % 2
+% assign {1} -> $exifdensity
+% or % 3
+% assign {1} -> $exifdensity
+% else
+% assign $exifdensity -> $exifdensity
+% fi
+% fi
+% % 256 ImageWidth (use width of JPG part)
+% % 257 ImageHeight (use height of JPG part)
+% if numeq $tag 274 % Orientation
+% skip 6 % type: 3 (short), count: 1
+% num 2 -> $temp
+% if numge $temp 0
+% if numle $temp 8
+% assign $temp -> $orientation
+% fi
+% fi
+% fi
+% if numeq $tag 282 % XResolution
+% skip 6
+% num 4 -> $temp
+% read 8 numexpr($temp + $exifoffset)
+% num 4 -> $pixelx
+% num 4 -> $temp
+% if numeq $temp 1
+% else
+% assign numexpr($temp) -> $pixelxdenom
+% % div $pixelx $temp -> $pixelx
+% fi
+% fi
+% if numeq $tag 283 % YResolution
+% skip 6
+% num 4 -> $temp
+% read 8 numexpr($temp + $exifoffset)
+% num 4 -> $pixely
+% num 4 -> $temp
+% if numeq $temp 1
+% else
+% assign numexpr($temp) -> $pixelydenom
+% % div $pixely $temp -> $pixely
+% fi
+% fi
+% repeat
+% big-endian
+% fi
+% fi
+% else
+% assign numexpr($temp - 0xC0) -> $temp
+% ifcase $temp % SOF_0
+% or % SOF_1
+% or % SOF_2
+% or % SOF_3
+% or % DHT
+% assign {-1} -> $temp
+% or % SOF_5
+% or % SOF_6
+% or % SOF_7
+% or % JPG
+% assign {-1} -> $temp
+% or % SOF_9
+% or % SOF_10
+% or % SOF_11
+% or % DAC
+% assign {-1} -> $temp
+% or % SOF_13
+% or % SOF_14
+% or % SOF_15
+% else
+% assign {-1} -> $temp
+% fi
+% if numeq $temp -1
+% else
+% read 4 numexpr($offset + 5)
+% num 2 -> $pixelheight
+% num 2 -> $pixelwidth
+% if numeq $pixelheight 0
+% clear $pixelheight
+% stop
+% fi
+% ok
+% stop
+% fi
+% num 2 -> $length
+% fi
+% fi
+% assign numexpr($offset + $length + 2) -> $offset
+%repeat
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@jpg}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@jpg#1{%
+ \@bmpsize@init
+ \@bmpsize@read{#1}{3}{0}%
+ \@bmpsize@grab\bmpsize@temp{3}%
+ \@bmpsize@skip@two
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{FFD8FF}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \def\bmpsize@offset{2}%
+ \def\bmpsize@exifdensity{0}%
+ \@bmpsize@loop{%
+ \@bmpsize@read{#1}{4}{\bmpsize@offset}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{FF}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@num@one\bmpsize@temp
+ \ifnum\bmpsize@temp=218\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@stop
+ }%
+ \ifnum\bmpsize@temp=224\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@num@two\bmpsize@length
+ \ifnum\bmpsize@exifdensity=0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \unless\ifnum\bmpsize@length<16\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@read{#1}{12}{\numexpr\bmpsize@offset+4\relax}%
+ \@bmpsize@grab\bmpsize@temp{5}%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{4A46494600}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \ifnum\bmpsize@length<16\relax
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@skip@two
+ \@bmpsize@num@one\bmpsize@temp
+ \ifnum\bmpsize@temp=1\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \def\bmpsize@unit{72.27pt}%
+ }{%
+ \ifnum\bmpsize@temp=2\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \def\bmpsize@unit{1cm}%
+ }%
+ }%
+ \@bmpsize@num@two\bmpsize@pixelx
+ \@bmpsize@num@two\bmpsize@pixely
+ }%
+ }%
+ }%
+ }{%
+ \ifnum\bmpsize@temp=225\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@num@two\bmpsize@length
+ \unless\ifnum\bmpsize@length<20\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@read{#1}{20}{\numexpr\bmpsize@offset+4\relax}%
+ \@bmpsize@grab\bmpsize@temp{6}%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \ifnum\pdf@strcmp{\bmpsize@temp}{457869660000}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \edef\bmpsize@exifoffset{\the\numexpr\bmpsize@offset+10}%
+ \@bmpsize@grab\bmpsize@temp{2}%
+ \@bmpsize@skip@two
+ \ifnum\pdf@strcmp{\bmpsize@temp}{4949}=\z@
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@bigendianfalse
+ }{%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{4D4D}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ }%
+ \@bmpsize@num@two\bmpsize@temp
+ \ifnum\bmpsize@temp=42\relax
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@num@four\bmpsize@temp
+ \ifnum\bmpsize@temp>0\relax
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \edef\bmpsize@off{\the\numexpr\bmpsize@temp+\bmpsize@exifoffset}%
+ \@bmpsize@read{#1}{2}{\bmpsize@off}%
+ \@bmpsize@num@two\bmpsize@entries
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+2}%
+ \@bmpsize@loop{%
+ \ifnum\bmpsize@entries=0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ \edef\bmpsize@entries{\the\numexpr\bmpsize@entries-1}%
+ \@bmpsize@read{#1}{12}{\bmpsize@off}%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+12}%
+ \@bmpsize@num@two\bmpsize@tag
+ \ifnum\bmpsize@tag=296\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@two\bmpsize@temp
+ \ifcase\bmpsize@temp\relax
+ \or
+ \let\bmpsize@unit\relax
+ \or
+ \def\bmpsize@unit{72.27pt}%
+ \or
+ \def\bmpsize@unit{1cm}%
+ \else
+ \let\bmpsize@unit\relax
+ \fi
+ \ifcase\bmpsize@temp\relax
+ \or
+ \or
+ \def\bmpsize@exifdensity{1}%
+ \or
+ \def\bmpsize@exifdensity{1}%
+ \else
+ \let\bmpsize@exifdensity\bmpsize@exifdensity
+ \fi
+ }%
+ \ifnum\bmpsize@tag=274\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@two\bmpsize@temp
+ \unless\ifnum\bmpsize@temp<0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \unless\ifnum\bmpsize@temp>8\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \let\bmpsize@orientation\bmpsize@temp
+ }%
+ }%
+ }%
+ \ifnum\bmpsize@tag=282\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@four\bmpsize@temp
+ \@bmpsize@read{#1}{8}{\numexpr\bmpsize@temp+\bmpsize@exifoffset\relax}%
+ \@bmpsize@num@four\bmpsize@pixelx
+ \@bmpsize@num@four\bmpsize@temp
+ \ifnum\bmpsize@temp=1\relax
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \edef\bmpsize@pixelxdenom{\the\numexpr\bmpsize@temp}%
+ }%
+ }%
+ \ifnum\bmpsize@tag=283\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@four\bmpsize@temp
+ \@bmpsize@read{#1}{8}{\numexpr\bmpsize@temp+\bmpsize@exifoffset\relax}%
+ \@bmpsize@num@four\bmpsize@pixely
+ \@bmpsize@num@four\bmpsize@temp
+ \ifnum\bmpsize@temp=1\relax
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \edef\bmpsize@pixelydenom{\the\numexpr\bmpsize@temp}%
+ }%
+ }%
+ }%
+ \@bmpsize@bigendiantrue
+ }%
+ }%
+ }{%
+ \edef\bmpsize@temp{\the\numexpr\bmpsize@temp-192}%
+ \ifcase\bmpsize@temp\relax
+ \or
+ \or
+ \or
+ \or
+ \def\bmpsize@temp{-1}%
+ \or
+ \or
+ \or
+ \or
+ \def\bmpsize@temp{-1}%
+ \or
+ \or
+ \or
+ \or
+ \def\bmpsize@temp{-1}%
+ \or
+ \or
+ \or
+ \else
+ \def\bmpsize@temp{-1}%
+ \fi
+ \ifnum\bmpsize@temp=-1\relax
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \@bmpsize@read{#1}{4}{\numexpr\bmpsize@offset+5\relax}%
+ \@bmpsize@num@two\bmpsize@pixelheight
+ \@bmpsize@num@two\bmpsize@pixelwidth
+ \ifnum\bmpsize@pixelheight=0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \let\bmpsize@pixelheight\relax
+ \@bmpsize@stop
+ }%
+ \@bmpsize@ok
+ \@bmpsize@stop
+ }%
+ \@bmpsize@num@two\bmpsize@length
+ }%
+ }%
+ \edef\bmpsize@offset{\the\numexpr\bmpsize@offset+\bmpsize@length+2}%
+ }%
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{bmp}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin bmp
+%little-endian
+%
+%read 26 0
+%grab 2 -> $temp
+%check streq $temp ["BM"]
+%skip 12
+%% header size is 4 bytes in V3+, unknown for V1, V2,
+%% known header sizes fit in 2 bytes
+%num 2 -> $temp
+%if numeq $temp 12 % V1
+% skip 2
+% num 2 -> $pixelwidth
+% num 2 -> $pixelheight
+% % no resolution entries
+% ok
+% stop
+%fi
+%if numeq $temp 64 % V2
+% skip 2
+% num 2 -> $pixelwidth
+% num 2 -> $pixelheight
+% % missing specification for resolution
+% ok
+% stop
+%fi
+%% V3, V4, V5
+%skip 2
+%num 4 -> $pixelwidth
+%absnum 4 -> $pixelheight
+%ok
+%read 8 38
+%num 4 -> $pixelx
+%num 4 -> $pixely
+%assign {100cm} -> $unit
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@bmp}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@bmp#1{%
+ \@bmpsize@init
+ \@bmpsize@bigendianfalse
+ \@bmpsize@read{#1}{26}{0}%
+ \@bmpsize@grab\bmpsize@temp{2}%
+ \@bmpsize@skip@two
+ \ifnum\pdf@strcmp{\bmpsize@temp}{424D}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@skip@four
+ \@bmpsize@skip@four
+ \@bmpsize@skip@four
+ \@bmpsize@num@two\bmpsize@temp
+ \ifnum\bmpsize@temp=12\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@two
+ \@bmpsize@num@two\bmpsize@pixelwidth
+ \@bmpsize@num@two\bmpsize@pixelheight
+ \@bmpsize@ok
+ \@bmpsize@stop
+ }%
+ \ifnum\bmpsize@temp=64\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@two
+ \@bmpsize@num@two\bmpsize@pixelwidth
+ \@bmpsize@num@two\bmpsize@pixelheight
+ \@bmpsize@ok
+ \@bmpsize@stop
+ }%
+ \@bmpsize@skip@two
+ \@bmpsize@num@four\bmpsize@pixelwidth
+ \@bmpsize@absnumtrue
+ \@bmpsize@num@four\bmpsize@pixelheight
+ \@bmpsize@absnumfalse
+ \@bmpsize@ok
+ \@bmpsize@read{#1}{8}{38}%
+ \@bmpsize@num@four\bmpsize@pixelx
+ \@bmpsize@num@four\bmpsize@pixely
+ \def\bmpsize@unit{100cm}%
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{gif}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin gif
+%little-endian
+%
+%% Header
+%read 13 0
+%grab 3 -> $temp
+%check streq $temp ["GIF"]
+%skip 3 % version
+%
+%% Logical Screen Descriptor
+%num 2 -> $pixelwidth
+%num 2 -> $pixelheight
+%skip 2
+%num 1 -> $temp % Pixel Aspect Ratio
+%if numeq $temp 0
+%else
+% assign numexpr($temp + 15) -> $pixelx
+% assign {64} -> $pixely
+%fi
+%ok
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@gif}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@gif#1{%
+ \@bmpsize@init
+ \@bmpsize@bigendianfalse
+ \@bmpsize@read{#1}{13}{0}%
+ \@bmpsize@grab\bmpsize@temp{3}%
+ \@bmpsize@skip@two
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{474946}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@skip@two
+ \@bmpsize@skip@one
+ \@bmpsize@num@two\bmpsize@pixelwidth
+ \@bmpsize@num@two\bmpsize@pixelheight
+ \@bmpsize@skip@two
+ \@bmpsize@num@one\bmpsize@temp
+ \ifnum\bmpsize@temp=0\relax
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \edef\bmpsize@pixelx{\the\numexpr\bmpsize@temp+15}%
+ \def\bmpsize@pixely{64}%
+ }%
+ \@bmpsize@ok
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{tiff}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin tiff
+%% defaults
+%assign {72.27pt} -> $unit
+%
+%% Image File Header
+%read 8 0
+%grab 2 -> $temp
+%if streq $temp ["II"]
+% little-endian
+%else
+% check streq $temp ["MM"]
+% big-endian
+%fi
+%num 2 -> $temp
+%check numeq $temp 42
+%num 4 -> $offset % first IFD (Image File Directory)
+%
+%% First IFD
+%read 2 $offset
+%assign numexpr($offset + 2) -> $offset
+%num 2 -> $entries
+%ok % must rely on checks at the end
+%loop
+% if numeq $entries 0
+% stop
+% fi
+% assign numexpr($entries - 1) -> $entries
+% % entry format:
+% % 2 tag
+% % 2 field type
+% % 4 count
+% % 4 value/offset
+% read 12 $offset
+% assign numexpr($offset + 12) -> $offset
+% num 2 -> $tag % tag
+% if numeq $temp 296 % ResolutionUnit
+% skip 6 % type: 3 (short), count: 1
+% num 2 -> $temp
+% ifcase $temp
+% or % 1
+% clear $unit
+% or % 2
+% assign {72.27pt} -> $unit
+% or % 3
+% assign {1cm} -> $unit
+% else
+% clear $unit
+% fi
+% fi
+% if numeq $tag 256 % ImageWidth
+% skip 6
+% num 4 -> $pixelwidth
+% fi
+% if numeq $tag 257 % ImageLength
+% skip 6
+% num 4 -> $pixelheight
+% fi
+% if numeq $tag 282 % XResolution
+% skip 6
+% num 4 -> $temp
+% read 8 $temp
+% num 4 -> $pixelx
+% num 4 -> $temp
+% if numeq $temp 1
+% else
+% assign numexpr($temp) -> $pixelxdenom
+% % div $pixelx $temp -> $pixelx
+% fi
+% fi
+% if numeq $tag 283 % YResolution
+% skip 6
+% num 4 -> $temp
+% read 8 $temp
+% num 4 -> $pixely
+% num 4 -> $temp
+% if numeq $temp 1
+% else
+% assign numexpr($temp) -> $pixelydenom
+% % div $pixely $temp -> $pixely
+% fi
+% fi
+%repeat
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@tiff}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@tiff#1{%
+ \@bmpsize@init
+ \def\bmpsize@unit{72.27pt}%
+ \@bmpsize@read{#1}{8}{0}%
+ \@bmpsize@grab\bmpsize@temp{2}%
+ \@bmpsize@skip@two
+ \ifnum\pdf@strcmp{\bmpsize@temp}{4949}=\z@
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@bigendianfalse
+ }{%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{4D4D}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@bigendiantrue
+ }%
+ \@bmpsize@num@two\bmpsize@temp
+ \ifnum\bmpsize@temp=42\relax
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@num@four\bmpsize@offset
+ \@bmpsize@read{#1}{2}{\bmpsize@offset}%
+ \edef\bmpsize@offset{\the\numexpr\bmpsize@offset+2}%
+ \@bmpsize@num@two\bmpsize@entries
+ \@bmpsize@ok
+ \@bmpsize@loop{%
+ \ifnum\bmpsize@entries=0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@stop
+ }%
+ \edef\bmpsize@entries{\the\numexpr\bmpsize@entries-1}%
+ \@bmpsize@read{#1}{12}{\bmpsize@offset}%
+ \edef\bmpsize@offset{\the\numexpr\bmpsize@offset+12}%
+ \@bmpsize@num@two\bmpsize@tag
+ \ifnum\bmpsize@temp=296\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@two\bmpsize@temp
+ \ifcase\bmpsize@temp\relax
+ \or
+ \let\bmpsize@unit\relax
+ \or
+ \def\bmpsize@unit{72.27pt}%
+ \or
+ \def\bmpsize@unit{1cm}%
+ \else
+ \let\bmpsize@unit\relax
+ \fi
+ }%
+ \ifnum\bmpsize@tag=256\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@four\bmpsize@pixelwidth
+ }%
+ \ifnum\bmpsize@tag=257\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@four\bmpsize@pixelheight
+ }%
+ \ifnum\bmpsize@tag=282\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@four\bmpsize@temp
+ \@bmpsize@read{#1}{8}{\bmpsize@temp}%
+ \@bmpsize@num@four\bmpsize@pixelx
+ \@bmpsize@num@four\bmpsize@temp
+ \ifnum\bmpsize@temp=1\relax
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \edef\bmpsize@pixelxdenom{\the\numexpr\bmpsize@temp}%
+ }%
+ }%
+ \ifnum\bmpsize@tag=283\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@four\bmpsize@temp
+ \@bmpsize@read{#1}{8}{\bmpsize@temp}%
+ \@bmpsize@num@four\bmpsize@pixely
+ \@bmpsize@num@four\bmpsize@temp
+ \ifnum\bmpsize@temp=1\relax
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \edef\bmpsize@pixelydenom{\the\numexpr\bmpsize@temp}%
+ }%
+ }%
+ }%
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{pnm}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin pnm
+%assign {0} -> $offset
+%read 3 $offset
+%assign {3} -> $offset
+%grab 1 -> $temp
+%check streq $temp ["P"]
+%grab 1 -> $temp
+%check strge $temp ["1"]
+%check strle $temp ["6"]
+%% ensure one white space
+%grab 1 -> $temp
+%if iswhite $temp
+%else
+% stop
+%fi
+%loop
+% % skip white space
+% fillbuf
+% grab 1 -> $temp
+% if iswhite $temp
+% else
+% if streq $temp ["#"]
+% % ignore comments
+% loop
+% fillbuf
+% grab 1 -> $temp
+% if streq $temp [0x0A]
+% break
+% else
+% if streq $temp [0x0D]
+% break
+% fi
+% fi
+% repeat
+% else
+% pushback $temp
+% break
+% fi
+% fi
+%repeat
+%assign {} -> $tempnum
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if isdigit $temp
+% append $tempnum $temp -> $tempnum
+% else
+% if iswhite $temp
+% break
+% else
+% stop
+% fi
+% fi
+%repeat
+%assign unescapehex($tempnum) -> $pixelwidth
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if iswhite $temp
+% else
+% pushback $temp
+% break
+% fi
+%repeat
+%assign {} -> $tempnum
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if isdigit $temp
+% append $tempnum $temp -> $tempnum
+% else
+% if iswhite $temp
+% break
+% else
+% stop
+% fi
+% fi
+%repeat
+%assign unescapehex($tempnum) -> $pixelheight
+%ok
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@pnm}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@pnm#1{%
+ \@bmpsize@init
+ \def\bmpsize@offset{0}%
+ \@bmpsize@read{#1}{3}{\bmpsize@offset}%
+ \def\bmpsize@offset{3}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{50}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{31}<\z@
+ \expandafter\@bmpsize@stop
+ \fi
+ \ifnum\pdf@strcmp{\bmpsize@temp}{36}>\z@
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \@bmpsize@stop
+ }%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{23}=\z@
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{0A}=\z@
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@break
+ }{%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{0D}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ }%
+ }%
+ }{%
+ \@bmpsize@pushback\bmpsize@temp
+ \@bmpsize@break
+ }%
+ }%
+ }%
+ \def\bmpsize@tempnum{}%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@append\bmpsize@tempnum\bmpsize@tempnum\bmpsize@temp
+ }{%
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@break
+ }{%
+ \@bmpsize@stop
+ }%
+ }%
+ }%
+ \edef\bmpsize@pixelwidth{\pdf@unescapehex{\bmpsize@tempnum}}%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \@bmpsize@pushback\bmpsize@temp
+ \@bmpsize@break
+ }%
+ }%
+ \def\bmpsize@tempnum{}%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@append\bmpsize@tempnum\bmpsize@tempnum\bmpsize@temp
+ }{%
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@break
+ }{%
+ \@bmpsize@stop
+ }%
+ }%
+ }%
+ \edef\bmpsize@pixelheight{\pdf@unescapehex{\bmpsize@tempnum}}%
+ \@bmpsize@ok
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{pam}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin pam
+%read 3 0
+%assign {3} -> $offset
+%assign $offset -> $off
+%grab 3 -> $temp
+%check streq $temp ["P7" 0x0A]
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if iswhite $temp
+% % ignore white space
+% assign numexpr($off + 1) -> $off
+% else
+% if streq $temp ["#"]
+% % ignore comment line
+% assign numexpr($off + 1) -> $off
+% loop
+% fillbuf
+% grab 1 -> $temp
+% assign numexpr($off + 1) -> $off
+% if streq $temp [0x0A]
+% break
+% fi
+% repeat
+% else
+% read 6 $off
+% assign numexpr($off + 6) -> $offset
+% grab 5 -> $head
+% if streq $head ["WIDTH"]
+% assign numexpr($off + 5) -> $off
+% % skip white space
+% loop
+% fillbuf
+% grab 1 -> $temp
+% if iswhite $temp
+% assign numexpr($off + 1) -> $off
+% else
+% if isdigit $temp
+% assign numexpr($off + 1) -> $off
+% break
+% else
+% % error
+% stop
+% fi
+% fi
+% repeat
+% % read number
+% assign $temp -> $tempnum
+% loop
+% fillbuf
+% grab 1 -> $temp
+% if isdigit $temp
+% assign numexpr($off + 1) -> $off
+% append $tempnum $temp -> $tempnum
+% else
+% pushback $temp
+% break
+% fi
+% repeat
+% % skip to end of line
+% loop
+% fillbuf
+% grab 1 -> $temp
+% assign numexpr($off + 1) -> $off
+% if streq $temp [0x0A]
+% break
+% fi
+% repeat
+% assign unescapehex($tempnum) -> $pixelwidth
+% else
+% grab 1 -> $temp
+% append $head $temp -> $head
+% if streq $head ["ENDHDR"]
+% % last header line
+% ok
+% stop
+% else
+% if streq $head ["HEIGHT"]
+% assign numexpr($off + 6) -> $off
+% % skip white space
+% loop
+% fillbuf
+% grab 1 -> $temp
+% if iswhite $temp
+% assign numexpr($off + 1) -> $off
+% else
+% if isdigit $temp
+% assign numexpr($off + 1) -> $off
+% break
+% else
+% % error
+% stop
+% fi
+% fi
+% repeat
+% % read number
+% assign $temp -> $tempnum
+% loop
+% fillbuf
+% grab 1 -> $temp
+% if isdigit $temp
+% assign numexpr($off + 1) -> $off
+% append $tempnum $temp -> $tempnum
+% else
+% pushback $temp
+% break
+% fi
+% repeat
+% % skip to end of line
+% loop
+% fillbuf
+% grab 1 -> $temp
+% assign numexpr($off + 1) -> $off
+% if streq $temp [0x0A]
+% break
+% fi
+% repeat
+% assign unescapehex($tempnum) -> $pixelheight
+% else
+% % ignore unknown header line
+% pushback $head
+% loop
+% fillbuf
+% grab 1 -> $temp
+% assign numexpr($off + 1) -> $off
+% if streq $temp [0x0A]
+% break
+% fi
+% repeat
+% fi
+% fi
+% fi
+% fi
+% fi
+%repeat
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@pam}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@pam#1{%
+ \@bmpsize@init
+ \@bmpsize@read{#1}{3}{0}%
+ \def\bmpsize@offset{3}%
+ \let\bmpsize@off\bmpsize@offset
+ \@bmpsize@grab\bmpsize@temp{3}%
+ \@bmpsize@skip@two
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{50370A}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ }{%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{23}=\z@
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{0A}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ }%
+ }{%
+ \@bmpsize@read{#1}{6}{\bmpsize@off}%
+ \edef\bmpsize@offset{\the\numexpr\bmpsize@off+6}%
+ \@bmpsize@grab\bmpsize@head{5}%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@head}{5749445448}=\z@
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+5}%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ }{%
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \@bmpsize@break
+ }{%
+ \@bmpsize@stop
+ }%
+ }%
+ }%
+ \let\bmpsize@tempnum\bmpsize@temp
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \@bmpsize@append\bmpsize@tempnum\bmpsize@tempnum\bmpsize@temp
+ }{%
+ \@bmpsize@pushback\bmpsize@temp
+ \@bmpsize@break
+ }%
+ }%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{0A}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ }%
+ \edef\bmpsize@pixelwidth{\pdf@unescapehex{\bmpsize@tempnum}}%
+ }{%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \@bmpsize@append\bmpsize@head\bmpsize@head\bmpsize@temp
+ \ifnum\pdf@strcmp{\bmpsize@head}{454E44484452}=\z@
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@ok
+ \@bmpsize@stop
+ }{%
+ \ifnum\pdf@strcmp{\bmpsize@head}{484549474854}=\z@
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+6}%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ }{%
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \@bmpsize@break
+ }{%
+ \@bmpsize@stop
+ }%
+ }%
+ }%
+ \let\bmpsize@tempnum\bmpsize@temp
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \@bmpsize@append\bmpsize@tempnum\bmpsize@tempnum\bmpsize@temp
+ }{%
+ \@bmpsize@pushback\bmpsize@temp
+ \@bmpsize@break
+ }%
+ }%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{0A}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ }%
+ \edef\bmpsize@pixelheight{\pdf@unescapehex{\bmpsize@tempnum}}%
+ }{%
+ \@bmpsize@pushback\bmpsize@head
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \edef\bmpsize@off{\the\numexpr\bmpsize@off+1}%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{0A}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{xpm}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin xpm
+%read 9 0
+%grab 9 -> $temp
+%assign {9} -> $offset
+%check streq $temp ["/* XPM */"]
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if streq $temp [0x22] % "
+% break
+% fi
+% if streq $temp ["/"]
+% fillbuf
+% grab 1 -> $temp
+% if streq $temp ["*"]
+% % look for end of C comment
+% loop
+% fillbuf
+% grab 1 -> $temp
+% if streq $temp ["*"]
+% loop
+% fillbuf
+% grab 1 -> $temp
+% if streq $temp ["/"]
+% break
+% fi
+% if streq $temp ["*"]
+% else
+% break
+% fi
+% repeat
+% if streq $temp ["/"]
+% break
+% fi
+% fi
+% repeat
+% fi
+% fi
+%repeat
+%% width
+%assign {} -> $tempnum
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if iswhite $temp
+% else
+% if isdigit $temp
+% append $tempnum $temp -> $tempnum
+% break
+% else
+% stop
+% fi
+% fi
+%repeat
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if isdigit $temp
+% append $tempnum $temp -> $tempnum
+% else
+% if iswhite $temp
+% break
+% else
+% stop
+% fi
+% fi
+%repeat
+%assign unescapehex($tempnum) -> $pixelwidth
+%% height
+%assign {} -> $tempnum
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if iswhite $temp
+% else
+% if isdigit $temp
+% append $tempnum $temp -> $tempnum
+% break
+% else
+% stop
+% fi
+% fi
+%repeat
+%loop
+% fillbuf
+% grab 1 -> $temp
+% if isdigit $temp
+% append $tempnum $temp -> $tempnum
+% else
+% if iswhite $temp
+% break
+% else
+% stop
+% fi
+% fi
+%repeat
+%assign unescapehex($tempnum) -> $pixelheight
+%ok
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@xpm}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@xpm#1{%
+ \@bmpsize@init
+ \@bmpsize@read{#1}{9}{0}%
+ \@bmpsize@grab\bmpsize@temp{9}%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@four
+ \@bmpsize@skip@one
+ \def\bmpsize@offset{9}%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{2F2A2058504D202A2F}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{22}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{2F}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{2A}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{2A}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{2F}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{2A}=\z@
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ }%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{2F}=\z@
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@break
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \def\bmpsize@tempnum{}%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@append\bmpsize@tempnum\bmpsize@tempnum\bmpsize@temp
+ \@bmpsize@break
+ }{%
+ \@bmpsize@stop
+ }%
+ }%
+ }%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@append\bmpsize@tempnum\bmpsize@tempnum\bmpsize@temp
+ }{%
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@break
+ }{%
+ \@bmpsize@stop
+ }%
+ }%
+ }%
+ \edef\bmpsize@pixelwidth{\pdf@unescapehex{\bmpsize@tempnum}}%
+ \def\bmpsize@tempnum{}%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@append\bmpsize@tempnum\bmpsize@tempnum\bmpsize@temp
+ \@bmpsize@break
+ }{%
+ \@bmpsize@stop
+ }%
+ }%
+ }%
+ \@bmpsize@loop{%
+ \@bmpsize@fillbuf{#1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifcase 0\@bmpsize@isdigit\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@append\bmpsize@tempnum\bmpsize@tempnum\bmpsize@temp
+ }{%
+ \ifcase 0\@bmpsize@iswhite\bmpsize@temp
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \@bmpsize@break
+ }{%
+ \@bmpsize@stop
+ }%
+ }%
+ }%
+ \edef\bmpsize@pixelheight{\pdf@unescapehex{\bmpsize@tempnum}}%
+ \@bmpsize@ok
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{tga}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin tga
+%little-endian
+% % id length (1 byte)
+%read 16 1
+%grab 1 -> $temp % color map type (1 byte), values: 0, 1
+%if streq $temp [0x00]
+%else
+% if streq $temp [0x01]
+% else
+% stop
+% fi
+%fi
+%skip 10 % image type (1 byte)
+% % color map specification (5 bytes)
+% % x origin (2 bytes)
+% % y origin (2 bytes)
+%num 2 -> $pixelwidth % image width
+%num 2 -> $pixelheight % image height
+%ok
+%% TGA File Footer
+%size 26 -> $temp
+%read 26 numexpr($temp - 26)
+%num 4 -> $offset % the extension area offset
+%skip 4 % the developer directory offset
+%grab 18 -> $temp % the signature, ".", 0x00
+%if streq $temp ["TRUEVISION-XFILE." 0x00]
+%else
+% stop
+%fi
+%if numeq $offset 0
+% stop % no extension area
+%fi
+%read 4 numexpr($offset + 474) % pixel aspect ratio (4 bytes)
+%num 2 -> $pixelx % pixel ratio numerator (pixel width)
+%num 2 -> $pixely % pixel ratio denominator (pixel height)
+%if numeq $pixely 0 % no pixel aspect ratio
+% clear $pixelx
+% clear $pixely
+%fi
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@tga}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@tga#1{%
+ \@bmpsize@init
+ \@bmpsize@bigendianfalse
+ \@bmpsize@read{#1}{16}{1}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{00}=\z@
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{01}=\z@
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \@bmpsize@stop
+ }%
+ }%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \@bmpsize@num@two\bmpsize@pixelwidth
+ \@bmpsize@num@two\bmpsize@pixelheight
+ \@bmpsize@ok
+ \@bmpsize@size{#1}{26}\bmpsize@temp \@bmpsize@read{#1}{26}{\numexpr\bmpsize@temp-26\relax}%
+ \@bmpsize@num@four\bmpsize@offset
+ \@bmpsize@skip@four
+ \@bmpsize@grab\bmpsize@temp{18}%
+ \@bmpsize@skip@four
+ \@bmpsize@skip@four
+ \@bmpsize@skip@four
+ \@bmpsize@skip@four
+ \@bmpsize@skip@two
+ \ifnum\pdf@strcmp{\bmpsize@temp}{54525545564953494F4E2D5846494C452E00}=\z@
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \@bmpsize@stop
+ }%
+ \ifnum\bmpsize@offset=0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@stop
+ }%
+ \@bmpsize@read{#1}{4}{\numexpr\bmpsize@offset+474\relax}%
+ \@bmpsize@num@two\bmpsize@pixelx
+ \@bmpsize@num@two\bmpsize@pixely
+ \ifnum\bmpsize@pixely=0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \let\bmpsize@pixelx\relax
+ \let\bmpsize@pixely\relax
+ }%
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{pcx}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin pcx
+%little-endian
+%read 16 0
+%grab 1 -> $temp % manufacturer
+%check streq $temp [0x0A]
+%skip 1 % version
+%num 1 -> $temp % encoding
+%check numeq $temp 1
+%skip 1 % bits per pixel
+%num 2 -> $pixelwidth % x_min
+%num 2 -> $pixelheight % y_min
+%num 2 -> $temp % x_max
+%assign numexpr($temp - $pixelwidth + 1) -> $pixelwidth
+%num 2 -> $temp % y_max
+%assign numexpr($temp - $pixelheight + 1) -> $pixelheight
+%check numgt $pixelwidth 0
+%check numgt $pixelheight 0
+%ok
+%num 2 -> $pixelx % horizontal resolution in DPI
+%num 2 -> $pixely % vertical resolution in DPI
+%assign {72.27pt} -> $unit
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@pcx}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@pcx#1{%
+ \@bmpsize@init
+ \@bmpsize@bigendianfalse
+ \@bmpsize@read{#1}{16}{0}%
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\pdf@strcmp{\bmpsize@temp}{0A}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@skip@one
+ \@bmpsize@num@one\bmpsize@temp
+ \ifnum\bmpsize@temp=1\relax
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@skip@one
+ \@bmpsize@num@two\bmpsize@pixelwidth
+ \@bmpsize@num@two\bmpsize@pixelheight
+ \@bmpsize@num@two\bmpsize@temp
+ \edef\bmpsize@pixelwidth{\the\numexpr\bmpsize@temp-\bmpsize@pixelwidth+1}%
+ \@bmpsize@num@two\bmpsize@temp
+ \edef\bmpsize@pixelheight{\the\numexpr\bmpsize@temp-\bmpsize@pixelheight+1}%
+ \ifnum\bmpsize@pixelwidth>0\relax
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \ifnum\bmpsize@pixelheight>0\relax
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@ok
+ \@bmpsize@num@two\bmpsize@pixelx
+ \@bmpsize@num@two\bmpsize@pixely
+ \def\bmpsize@unit{72.27pt}%
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{msp}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin msp
+%little-endian
+%
+%read 16 0
+%
+%% header 4
+%grab 4 -> $temp
+%if streq $temp ["DanM"]
+%else
+% check streq $temp ["LinS"]
+%fi
+%num 2 -> $pixelwidth
+%num 2 -> $pixelheight
+%ok
+%num 2 -> $pixelx % x_asp
+%num 2 -> $pixely % y_asp
+%assign {72.27pt} -> $unit % guessing
+%if numeq $pixelx 0
+% num 2 -> $pixelx % x_asp_prn
+% num 2 -> $pixely % y_asp_prn
+%fi
+%% num 2 % width_prn
+%% num 2 % height_prn
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@msp}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@msp#1{%
+ \@bmpsize@init
+ \@bmpsize@bigendianfalse
+ \@bmpsize@read{#1}{16}{0}%
+ \@bmpsize@grab\bmpsize@temp{4}%
+ \@bmpsize@skip@four
+ \ifnum\pdf@strcmp{\bmpsize@temp}{44616E4D}=\z@
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \ifnum\pdf@strcmp{\bmpsize@temp}{4C696E53}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ }%
+ \@bmpsize@num@two\bmpsize@pixelwidth
+ \@bmpsize@num@two\bmpsize@pixelheight
+ \@bmpsize@ok
+ \@bmpsize@num@two\bmpsize@pixelx
+ \@bmpsize@num@two\bmpsize@pixely
+ \def\bmpsize@unit{72.27pt}%
+ \ifnum\bmpsize@pixelx=0\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \@bmpsize@num@two\bmpsize@pixelx
+ \@bmpsize@num@two\bmpsize@pixely
+ }%
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{sgi}
+%
+%\iffalse
+%<*ignore>
+%\fi
+%\begin{verbatim}
+%begin sgi
+%big-endian
+%read 10 0
+%grab 2 -> $temp
+%check streq $temp [0x01 0xDA] % magic: 474 decimal
+%grab 1 -> $temp % storage: 0 or 1
+%check numge $temp 0
+%check numle $temp 1
+%skip 2 % bpc, dimension
+%num 2 -> $pixelwidth
+%num 2 -> $pixelheight
+%ok
+%end
+%\end{verbatim}
+%\iffalse
+%</ignore>
+%\fi
+% \begin{macro}{\bmpsize@read@sgi}
+% \begin{macrocode}
+%<*base>
+\def\bmpsize@read@sgi#1{%
+ \@bmpsize@init
+ \@bmpsize@bigendiantrue
+ \@bmpsize@read{#1}{10}{0}%
+ \@bmpsize@grab\bmpsize@temp{2}%
+ \@bmpsize@skip@two
+ \ifnum\pdf@strcmp{\bmpsize@temp}{01DA}=\z@
+ \else
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@grab\bmpsize@temp{1}%
+ \@bmpsize@skip@one
+ \ifnum\bmpsize@temp<0\relax
+ \expandafter\@bmpsize@stop
+ \fi
+ \ifnum\bmpsize@temp>1\relax
+ \expandafter\@bmpsize@stop
+ \fi
+ \@bmpsize@skip@two
+ \@bmpsize@num@two\bmpsize@pixelwidth
+ \@bmpsize@num@two\bmpsize@pixelheight
+ \@bmpsize@ok
+ \@bmpsize@stop
+ \@nil
+ \@bmpsize@end
+}%
+%</base>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Package \xpackage{bmpsize}}
+%
+% \begin{macrocode}
+%<*package>
+\ProvidesPackage{bmpsize}%
+ [2016/05/16 v1.7 Extract size/resolution from bitmap files (HO)]%
+\RequirePackage{ifpdf}
+\ifpdf
+ \PackageInfo{bmpsize}{Superseded by pdfTeX in PDF mode}%
+ \expandafter\endinput
+\fi
+\RequirePackage{pdftexcmds}[2007/11/11]
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@filedump\endcsname\relax
+ \PackageError{bmpsize}{%
+ You need pdfTeX 1.30.0 or newer%
+ }{Package loading is aborted.}%
+ \expandafter\endinput
+\fi
+
+\RequirePackage{infwarerr}[2007/09/09]
+\RequirePackage{graphics}
+% \end{macrocode}
+% In case of \plainTeX\ options are not executed
+% and \cs{KV@err} and \cs{KV@errx} are undefined.
+% \begin{macrocode}
+\RequirePackage{keyval}\relax
+\expandafter\ifx\csname KV@errx\endcsname\relax
+ \def\KV@errx#1{%
+ \@PackageError{keyval}{#1}\@ehc
+ }%
+\fi
+\expandafter\ifx\csname KV@err\endcsname\relax
+ \let\KV@err\KV@errx
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{bmpsize-base}
+
+\InputIfFileExists{bmpsize-\Gin@driver}{}{}
+
+\define@key{Gin}{bmpsizefast}[true]{%
+ \expandafter\ifx\csname if#1\expandafter\endcsname\csname iftrue\endcsname
+ \@bmpsize@fasttrue
+ \else
+ \@bmpsize@fastfalse
+ \fi
+}
+\define@key{Gin}{resolutionunit}{%
+ \def\bmpsize@unit@default{#1}%
+}
+\begingroup
+ \def\x#1{\endgroup
+ \define@key{Gin}{resolution}{%
+ \@bmpsize@read@resolution\@bmpsize@user@resolutiontrue##1#1#1\@nil
+ }%
+ \define@key{Gin}{defaultresolution}{%
+ \@bmpsize@read@resolution\@bmpsize@user@resolutionfalse##1#1#1\@nil
+ }%
+ }%
+\x{ }
+\def\@bmpsize@read@resolution#1#2 #3 #4\@nil{%
+ \ifcase 0\ifx\\#2\\1\fi
+ \ifnum\pdf@strcmp{#2}{\Gin@exclamation}=\z@
+ \ifx\\#3\\1\fi
+ \ifnum\pdf@strcmp{#3}{\Gin@exclamation}=\z@
+ 1%
+ \fi
+ \fi
+ \ifcase\pdf@strcmp{#2}{\Gin@exclamation}\relax
+ \let\bmpsize@pixelx@default\Gin@exclamation
+ \else
+ \edef\bmpsize@pixelx@default{#2}%
+ \fi
+ \ifcase\pdf@strcmp{#3}{\Gin@exclamation}\relax
+ \let\bmpsize@pixely@default\Gin@exclamation
+ \else
+ \ifx\\#3\\%
+ \let\bmpsize@pixely@default\bmpsize@pixelx@default
+ \else
+ \edef\bmpsize@pixely@default{#3}%
+ \fi
+ \fi
+ #1%
+ \else
+ \PackageError{bmpsize}{%
+ Wrong syntax for key (default)resolution%
+ }{%
+ See package documentation for correct syntax.%
+ }%
+ \fi
+}
+\newcommand*{\bmpsizesetup}{\setkeys{Gin}}
+
+\let\@bmpsize@org@setfile\Gin@setfile
+\def\Gin@setfile#1#2#3{%
+ \ifcase\pdf@strcmp{#1}{bmp}\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobble
+ \fi
+ {%
+ \bmpsize@okfalse
+ \edef\bmpsize@ext{\ifx\Gin@ext\relax\Gin@eext\else\Gin@ext\fi}%
+ \edef\bmpsize@file{\Gin@base\bmpsize@ext}%
+ \edef\@bmpsize@temp{\bmpsize@ext}%
+ \@ifundefined{bmpsize@read@\@bmpsize@temp}{%
+ \@ifundefined{bmpsize@map@\@bmpsize@temp}{}{%
+ \expandafter\let\expandafter\@bmpsize@temp
+ \csname bmpsize@map@\@bmpsize@temp\endcsname
+ }%
+ }{}%
+ \@ifundefined{bmpsize@read@\@bmpsize@temp}{%
+ }{%
+ \csname bmpsize@read@\@bmpsize@temp\endcsname\bmpsize@file
+ }%
+ \ifbmpsize@ok
+ \else
+ \@for\@bmpsize@temp:=\bmpsize@types\do{%
+ \ifbmpsize@ok
+ \else
+ \csname bmpsize@read@\@bmpsize@temp\endcsname\bmpsize@file
+ \fi
+ }%
+ \fi
+ \ifbmpsize@ok
+ \ifGin@bbox
+ \@ifundefined{Gin@vllx}{%
+ \@PackageWarning{bmpsize}{Explicit bounding box is ignored}%
+ }{%
+ \ifx\Gin@viewport@code\relax
+ \def\Gin@ollx{0}%
+ \let\Gin@olly\Gin@ollx
+ \let\Gin@ourx\bmpsize@width
+ \let\Gin@oury\bmpsize@height
+ \let\Gin@vllx\Gin@llx
+ \let\Gin@vlly\Gin@lly
+ \let\Gin@vurx\Gin@urx
+ \let\Gin@vury\Gin@ury
+ \let\Gin@viewport@code\Gin@viewport
+ \@PackageWarning{bmpsize}{%
+ Explicit bounding box replaced by\MessageBreak
+ viewport setting%
+ }%
+ \else
+ \@PackageWarning{bmpsize}{Explicit bounding box is ignored}%
+ \fi
+ }%
+ \fi
+ \def\Gin@llx{0}%
+ \def\Gin@lly{0}%
+ \let\Gin@urx\bmpsize@width
+ \let\Gin@ury\bmpsize@height
+ \Gin@bboxtrue
+ \else
+ \PackageInfo{bmpsize}{Unknown image type of \bmpsize@file}%
+ \fi
+ }%
+ \@bmpsize@org@setfile{#1}{#2}{#3}%
+}
+\newcommand*{\bmpsize@ext@type}[1]{%
+ \@namedef{bmpsize@map@#1}%
+}
+\bmpsize@ext@type{.jpg}{jpg}
+\bmpsize@ext@type{.jpe}{jpg}
+\bmpsize@ext@type{.jfif}{jpg}
+\bmpsize@ext@type{.jpeg}{jpg}
+\bmpsize@ext@type{.tif}{tiff}
+\bmpsize@ext@type{.tiff}{tiff}
+\bmpsize@ext@type{.pcx}{pcx}
+\bmpsize@ext@type{.msp}{msp}
+\bmpsize@ext@type{.bmp}{bmp}
+\bmpsize@ext@type{.png}{png}
+\bmpsize@ext@type{.pnm}{pnm}
+\bmpsize@ext@type{.pbm}{pnm}
+\bmpsize@ext@type{.pgm}{pnm}
+\bmpsize@ext@type{.ppm}{pnm}
+\bmpsize@ext@type{.pam}{pam}
+\bmpsize@ext@type{.xpm}{xpm}
+\bmpsize@ext@type{.gif}{gif}
+\bmpsize@ext@type{.tga}{tga}
+\bmpsize@ext@type{.sgi}{sgi}
+%</package>
+% \end{macrocode}
+%
+% \subsection{Drivers}
+%
+% \subsubsection{dvips}
+%
+% Identification.
+% \begin{macrocode}
+%<*dvips>
+\ProvidesFile{bmpsize-dvips.def}%
+ [2016/05/16 v1.7 Graphics bitmap driver for dvips (HO)]%
+% \end{macrocode}
+% Ensure correct catcodes.
+% \begin{macrocode}
+\expandafter\edef\csname @bmpsize@driver@catcodes\endcsname{%
+ \catcode44 \the\catcode44 % ,
+ \catcode58 \the\catcode58 % :
+ \catcode60 \the\catcode60 % <
+ \catcode61 \the\catcode61 % =
+ \catcode62 \the\catcode62 % >
+ \catcode64 \the\catcode64 % @
+}
+\catcode64 11 %
+\@makeother\,
+\@makeother\:
+\@makeother\<
+\@makeother\=
+\@makeother\>
+% \end{macrocode}
+% \begin{macro}{\Ginclude@bmp}
+% Added features: support for viewport/trim and clip.
+% \begin{macrocode}
+\def\Ginclude@bmp#1{%
+ \message{<#1>}%
+ \raise\Gin@req@height
+ \hbox to\Gin@req@width{%
+% \end{macrocode}
+% Clipping support.
+% \begin{macrocode}
+ \ifGin@clip
+ \vbox to\z@{%
+ \special{ps:gsave currentpoint}%
+ \kern\Gin@req@height
+ \hbox to\z@{%
+ \kern\Gin@req@width
+ \special{ps:%
+ currentpoint %
+ newpath %
+ 3 index 3 index moveto %
+ 1 index 3 index lineto %
+ 2 copy lineto %
+ exch pop exch pop %
+ lineto %
+ closepath %
+ clip %
+ }%
+ \hss
+ }%
+ \vss
+ }%
+ \fi
+% \end{macrocode}
+% Support for viewport/trim. The original bounding box is
+% `0 0 width height'. If package \xpackage{bmpsize} is used
+% and the image has been recognized, then the original width
+% and height are known (\cs{bmpsize@width}, \cs{bmpsize@height}).
+% Otherwise we try the saved values \cs{Gin@ourx} and \cs{Gin@oury}.
+% This guessing will fail, if options viewport and trim are used
+% both or several times. This is a deficiency of package {graphicx}.
+% One of options viewport and trim should be used at most once.
+% \begin{macrocode}
+ \@ifundefined{Gin@ollx}{%
+ \dimen@\z@
+ }{%
+ \ifx\Gin@scalex\Gin@exclamation
+ \let\Gin@scalex\Gin@scaley
+ \fi
+ \ifx\Gin@scaley\Gin@exclamation
+ \let\Gin@scaley\Gin@scalex
+ \fi
+ \@ifundefined{bmpsize@width}{%
+ \let\bmpsize@width\Gin@ourx
+ \let\bmpsize@height\Gin@oury
+ }{}%
+ \dimen@=\Gin@llx bp\relax
+ \dimen@=\Gin@scalex\dimen@
+ \kern-\dimen@
+ \advance\Gin@req@width\dimen@
+ \dimen@=\bmpsize@width bp\relax
+ \advance\dimen@ by -\Gin@urx bp\relax
+ \dimen@=\Gin@scalex\dimen@
+ \advance\Gin@req@width\dimen@
+ \dimen@=\Gin@lly bp\relax
+ \dimen@=\Gin@scaley\dimen@
+ \advance\Gin@req@height\dimen@
+ \dimen@=\bmpsize@height bp\relax
+ \advance\dimen@ by -\Gin@ury bp\relax
+ \dimen@=\Gin@scaley\dimen@
+ \advance\Gin@req@height\dimen@
+ }%
+ \ifdim\dimen@=\z@
+ \else
+ \vbox to\z@\bgroup
+ \kern-\dimen@
+ \fi
+% \end{macrocode}
+% The special for the image.
+% \begin{macrocode}
+ \special{em:graph #1,\the\Gin@req@width,\the\Gin@req@height}%
+ \ifdim\dimen@=\z@
+ \else
+ \vss
+ \egroup
+ \fi
+ \ifGin@clip
+ \special{ps::grestore}%
+ \fi
+ \hss
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\@bmpsize@driver@catcodes
+%</dvips>
+% \end{macrocode}
+%
+% \subsubsection{dvipdfm and dvipdfmx}
+%
+% Identification.
+% \begin{macrocode}
+%<*dvipdfm>
+\ProvidesFile{bmpsize-dvipdfm.def}%
+ [2016/05/16 v1.7 Graphics bitmap driver for dvipdfm (HO)]%
+%</dvipdfm>
+%<*dvipdfmx>
+\ProvidesFile{bmpsize-dvipdfmx.def}%
+ [2016/05/16 v1.7 Graphics bitmap driver for dvipdfmx (HO)]%
+%</dvipdfmx>
+%<*dvipdfm|dvipdfmx>
+% \end{macrocode}
+% Ensure correct catcodes.
+% \begin{macrocode}
+\expandafter\edef\csname @bmpsize@driver@catcodes\endcsname{%
+ \catcode44 \the\catcode44 % ,
+ \catcode46 \the\catcode46 % .
+ \catcode58 \the\catcode58 % :
+ \catcode60 \the\catcode60 % <
+ \catcode61 \the\catcode61 % =
+ \catcode62 \the\catcode62 % >
+ \catcode64 \the\catcode64 % @
+}
+\catcode64 11 %
+\@makeother\,
+\@makeother\.
+\@makeother\:
+\@makeother\<
+\@makeother\=
+\@makeother\>
+% \end{macrocode}
+% Counter resource to generate unique names for xform objects.
+% \begin{macrocode}
+\@ifundefined{@bmpsize@count}{%
+ \csname newcount\endcsname\@bmpsize@count
+ \@bmpsize@count=\z@
+}{}
+% \end{macrocode}
+% The file name is given as PDF string in the image special.
+% If we have \pdfTeX\ with \cs{pdfescapestring} we use it.
+% \begin{macro}{\@bmpsize@pdfescapestring}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@escapestring\endcsname\relax
+ \def\@bmpsize@pdfescapestring#1{#1}%
+\else
+ \let\@bmpsize@pdfescapestring\pdf@escapestring
+\fi
+% \end{macrocode}
+% \end{macro}
+% The size of reused images of dvipdfm 0.13.2c is 1bp. It is
+% the default size of an image object in user space.
+% Thus the reused image must be scaled to the requested
+% width and height. The factor is just the conversion
+% from pt to bp (72/72.27).
+% \begin{macro}{\bmpsize@dvipdfm@factor}
+% \begin{macrocode}
+%<dvipdfm>\def\bmpsize@dvipdfm@factor{.99626}
+% \end{macrocode}
+% Unhappily dvipdfmx behaves differently. It remembers the
+% size assuming a resolution of 100 dots per inch and additionally
+% scales the reused image to this size. Thus the scaling factor
+% also depends on the pixel sizes of the image:
+% \begin{itemize}
+% \item width: (72 / 72.27) * (100 / 72) / pixelwidth =\\
+% \mbox{}\hphantom{width:} 100 / 72.27 / pixelwidth
+% \item height: 100 / 72.27 / pixelheight
+% \end{itemize}
+% Recent versions however use the natural size of the reused image.
+% Thus the factor is the difference between the requested size and
+% the natural size.
+% \end{macro}
+% \begin{macro}{\Ginclude@bmp}
+% Added features: support for viewport/trim, clip, and image reuse.
+% \begin{macrocode}
+\def\Ginclude@bmp#1{%
+ \message{<#1>}%
+% \end{macrocode}
+% Clip support is achieved by putting the image inside
+% a xform object. These xform objects are automatically clipped
+% when they are used.
+% \begin{macrocode}
+ \ifGin@clip
+ \global\advance\@bmpsize@count\@ne
+ \edef\@bmpsize@clip@name{@CLIP@\the\@bmpsize@count}%
+ \special{%
+ pdf:bxobj \@bmpsize@clip@name\space
+ width \the\Gin@req@width\space
+ height \the\Gin@req@height
+ }%
+ \fi
+% \end{macrocode}
+% Support for viewport/trim.
+% \begin{macrocode}
+ \hbox to \z@{%
+ \@ifundefined{Gin@ollx}{%
+ \dimen@\z@
+ }{%
+ \ifx\Gin@scalex\Gin@exclamation
+ \let\Gin@scalex\Gin@scaley
+ \fi
+ \ifx\Gin@scaley\Gin@exclamation
+ \let\Gin@scaley\Gin@scalex
+ \fi
+ \@ifundefined{bmpsize@width}{%
+ \let\bmpsize@width\Gin@ourx
+ \let\bmpsize@height\Gin@oury
+ }{}%
+ \dimen@=\Gin@llx bp\relax
+ \dimen@=\Gin@scalex\dimen@
+ \kern-\dimen@
+ \advance\Gin@req@width\dimen@
+ \dimen@=\bmpsize@width bp\relax
+ \advance\dimen@ by -\Gin@urx bp\relax
+ \dimen@=\Gin@scalex\dimen@
+ \advance\Gin@req@width\dimen@
+ \dimen@=\bmpsize@height bp\relax
+ \advance\dimen@ by -\Gin@ury bp\relax
+ \dimen@=\Gin@scaley\dimen@
+ \advance\Gin@req@height\dimen@
+ \dimen@=\Gin@lly bp\relax
+ \dimen@=\Gin@scaley\dimen@
+ \advance\Gin@req@height\dimen@
+ }%
+ \ifdim\dimen@=\z@
+ \else
+ \vbox to\z@\bgroup
+ \kern\dimen@
+ \fi
+% \end{macrocode}
+% Reuse support, dvipdfm just remember the image. The requested
+% sizes, clipping, \dots do not matter. In case of dvipdfmx
+% we also must remember the natural size.
+% \begin{macrocode}
+ \edef\@bmpsize@temp{@IMG@\@bmpsize@pdfescapestring{#1}}%
+ \@ifundefined{\@bmpsize@temp}{%
+ \global\advance\@bmpsize@count\@ne
+%<*dvipdfm>
+ \expandafter\xdef\csname\@bmpsize@temp\endcsname{%
+ \the\@bmpsize@count
+ }%
+%</dvipdfm>
+%<*dvipdfmx>
+ \expandafter\ifx\csname bmpsize@pixelwidth\endcsname\relax
+ \else
+ \expandafter\xdef\csname\@bmpsize@temp\endcsname{%
+ \the\@bmpsize@count:\bmpsize@width:\bmpsize@height
+ }%
+ \fi
+%</dvipdfmx>
+ \special{%
+ pdf:image @IMG\the\@bmpsize@count\space
+ width \the\Gin@req@width\space
+ height \the\Gin@req@height\space
+ depth 0pt (\@bmpsize@pdfescapestring{#1})%
+ }%
+ }{%
+%<*dvipdfm>
+ \special{%
+ pdf:bt %
+ xscale \strip@pt\dimexpr
+ \bmpsize@dvipdfm@factor\Gin@req@width\relax\space
+ yscale \strip@pt\dimexpr
+ \bmpsize@dvipdfm@factor\Gin@req@height\relax
+ }%
+ \special{pdf:uxobj @IMG\csname\@bmpsize@temp\endcsname}%
+ \special{pdf:et}%
+%</dvipdfm>
+%<*dvipdfmx>
+ \expandafter\expandafter\expandafter\@bmpsize@extract
+ \csname\@bmpsize@temp\endcsname\@nil
+ \edef\@bmpsize@xscale{\strip@pt\Gin@req@width}%
+ \edef\@bmpsize@temp{\strip@pt\dimexpr\@bmpsize@width bp}%
+ \@bmpsize@div\@bmpsize@xscale\@bmpsize@xscale\@bmpsize@temp
+ \edef\@bmpsize@yscale{\strip@pt\Gin@req@height}%
+ \edef\@bmpsize@temp{\strip@pt\dimexpr\@bmpsize@height bp}%
+ \@bmpsize@div\@bmpsize@yscale\@bmpsize@yscale\@bmpsize@temp
+ \special{%
+ pdf:bt %
+ xscale \@bmpsize@xscale\space
+ yscale \@bmpsize@yscale
+ }%
+ \special{pdf:uxobj @IMG\@bmpsize@imgnum}%
+ \special{pdf:et}%
+%</dvipdfmx>
+ }%
+ \ifdim\dimen@=\z@
+ \else
+ \vss
+ \egroup
+ \fi
+ \hss
+ }%
+ \ifGin@clip
+ \special{pdf:exobj}%
+ \special{pdf:uxobj \@bmpsize@clip@name}%
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+%<*dvipdfmx>
+\def\@bmpsize@extract#1:#2:#3\@nil{%
+ \def\@bmpsize@imgnum{#1}%
+ \def\@bmpsize@width{#2}%
+ \def\@bmpsize@height{#3}%
+}
+%</dvipdfmx>
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\@bmpsize@driver@catcodes
+%</dvipdfm|dvipdfmx>
+% \end{macrocode}
+%
+% \subsection{Test program \xpackage{bmpsize-test.tex}}
+%
+% \begin{macrocode}
+%<*test>
+\expandafter\ifx\csname NeedsTeXFormat\endcsname\relax
+ \input miniltx\relax
+\fi
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfoutput\endcsname\relax
+\else
+ \pdfoutput=0 %
+\fi
+\RequirePackage{bmpsize}
+
+\endlinechar=-1
+\catcode`\@=11
+\def\msg#{\immediate\write16}
+
+\def\init{%
+ \msg{}%
+ \msg{File name menu}%
+ \msg{==============}%
+ \msg{* Option menu: use `opt' as file name}%
+ \msg{* Quit program: <return>}%
+ \msg{}%
+ \message{Image file name = }%
+ \read-1 to \imagename
+ \ifx\imagename\@empty
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \csname @@end\endcsname
+ \end
+ }{%
+ \ifnum\pdf@strcmp{\imagename}{opt}=\z@
+ \expandafter\optionmenu
+ \else
+ \startimg
+ \expandafter\init
+ \fi
+ }%
+}
+\def\optionmenu{%
+ \msg{}%
+ \msg{Option menu}%
+ \msg{===========}%
+ \msg{Current setting:}%
+ \msg{* bmpsizefast = \if@bmpsize@fast true\else false\fi}%
+ \msg{* \if@bmpsize@user@resolution\else default\fi resolution = %
+ \bmpsize@pixelx@default
+ \space
+ \bmpsize@pixely@default
+ }%
+ \msg{* \if@bmpsize@user@resolution default\fi resolution: not set}%
+ \msg{* resolutionunit = \bmpsize@unit@default}%
+ \msg{* Quit option menu: <return>}%
+ \msg{}%
+ \message{Options = }%
+ \read-1 to \options
+ \ifx\options\empty
+ \expandafter\init
+ \else
+ \edef\@bmpsize@temp{%
+ \noexpand\setkeys{Gin}{\options}%
+ }%
+ \@bmpsize@temp
+ \expandafter\optionmenu
+ \fi
+}
+
+\def\startimg{%
+ \let\@found\@empty
+ \msg{}%
+ \msg{* File [\imagename]}%
+ \@for\@type:=\bmpsize@types\do{%
+ \ifx\@found\@empty
+ \csname bmpsize@read@\@type\endcsname\imagename
+ \ifbmpsize@ok
+ \let\@found\@type
+ \msg{\space\space Type: \@type}%
+ \msg{\space\space Pixel width: \bmpsize@pixelwidth\space px}%
+ \msg{\space\space Pixel height: \bmpsize@pixelheight\space px}%
+ \ifx\bmpsize@pixelx\relax
+ \else
+ \ifx\bmpsize@unit\relax
+ \let\@unit@spec\@empty
+ \def\@ratio@name{Ratio }%
+ \else
+ \def\@unit@spec{\space dots per \bmpsize@unit}%
+ \def\@ratio@name{Density }%
+ \fi
+ \msg{\space\space \@ratio@name x: \bmpsize@pixelx\@unit@spec}%
+ \msg{\space\space \@ratio@name y: \bmpsize@pixely\@unit@spec}%
+ \fi
+ \msg{\space\space Width: \bmpsize@width\space bp}%
+ \msg{\space\space Height: \bmpsize@height\space bp}%
+ \ifx\bmpsize@orientation\relax
+ \else
+ \msg{\space\space Orientation: \bmpsize@orientation}%
+ \fi
+ \fi
+ \fi
+ }%
+ \ifx\@found\@empty
+ \edef\@file@date{\pdf@filemoddate{\imagename}}%
+ \ifx\@file@date\@empty
+ \msg{\space\space --> File not found <--}%
+ \else
+ \msg{\space\space --> Unknown image type <--}%
+ \fi
+ \fi
+}
+
+\ifx\noinit!\else\expandafter\init\fi
+%</test>
+% \end{macrocode}
+%
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/bmpsize}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/bmpsize.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/bmpsize.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[\CTAN{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 bmpsize.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@{}}
+% bmpsize.sty & tex/latex/oberdiek/bmpsize.sty\\
+% bmpsize-base.sty & tex/latex/oberdiek/bmpsize-base.sty\\
+% bmpsize-test.tex & tex/latex/oberdiek/bmpsize-test.tex\\
+% bmpsize-dvips.def & tex/latex/oberdiek/bmpsize-dvips.def\\
+% bmpsize-dvipdfm.def & tex/latex/oberdiek/bmpsize-dvipdfm.def\\
+% bmpsize-dvipdfmx.def & tex/latex/oberdiek/bmpsize-dvipdfmx.def\\
+% bmpsize.pdf & doc/latex/oberdiek/bmpsize.pdf\\
+% bmpsize.dtx & source/latex/oberdiek/bmpsize.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk bmpsize.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{bmpsize.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 bmpsize.dtx
+%makeindex -s gind.ist bmpsize.idx
+%pdflatex bmpsize.dtx
+%makeindex -s gind.ist bmpsize.idx
+%pdflatex bmpsize.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{bmpsize.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='bmpsize'>
+ <name>bmpsize</name>
+ <caption>Extract size and resolution data from bitmap files.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006-2009'/>
+ <license type='lppl1.3'/>
+ <version number='1.7'/>
+ <description>
+ This package analyzes bitmap images to extract size and resolution
+ data. It adds this feature to the graphics package so it is no
+ longer necessary to provide a separate bounding box files for
+ bitmap images. dditionally the implementation for the inclusion
+ of bitmap images in some drivers of package
+ <xref refid='graphicx'>graphicx</xref> are rewritten to support
+ options viewport, trim and clip. The package requires
+ <xref refid='pdftex'>pdfTeX</xref> version 1.30.0 or later (the
+ relevant pdfTeX primitive operates in both DVI and PDF output
+ modes).
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/bmpsize.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/bmpsize.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{grfguide}
+% D.\,P.\,Carlisle, The \LaTeX\ Project:
+% \textit{Packages in the `graphics' bundle},
+% 2005/11/14;
+% \CTAN{macros/latex/required/graphics/grfguide.pdf}.
+%
+% \subsection{URLs for bitmap format descriptions}
+%
+% \subsubsection{JPEG}
+% \begin{itemize}
+% \item \url{http://www.w3.org/Graphics/JPEG/jfif3.pdf}
+% \item \url{http://exif.org/Exif2-2.PDF}
+% \end{itemize}
+%
+% \subsubsection{PNG}
+% \begin{itemize}
+% \item \url{http://en.wikipedia.org/wiki/PNG}
+% \item \url{http://www.w3.org/TR/PNG/}
+% \end{itemize}
+%
+% \subsubsection{GIF}
+% \begin{itemize}
+% \item \url{http://www.w3.org/Graphics/GIF/spec-gif89a.txt}
+% \end{itemize}
+%
+% \subsubsection{BMP}
+% \begin{itemize}
+% \item \url{http://en.wikipedia.org/wiki/Windows_bitmap}
+% \item \url{http://de.wikipedia.org/wiki/Windows_bitmap}
+% \item \url{http://msdn.microsoft.com/en-us/library/ms532311.aspx}
+% \item \url{http://msdn.microsoft.com/en-us/library/ms532321.aspx}
+% \end{itemize}
+%
+% \subsubsection{PCX}
+% \begin{itemize}
+% \item \url{http://en.wikipedia.org/wiki/PCX}
+% \item \url{http://de.wikipedia.org/wiki/PCX}
+% \item \url{http://www.qzx.com/pc-gpe/pcx.txt}
+% \end{itemize}
+%
+% \subsubsection{MSP}
+% \begin{itemize}
+% \item \url{http://en.wikipedia.org/wiki/Microsoft_Paint}
+% \item Sources of \xpackage{dvips}.
+% \end{itemize}
+%
+% \subsubsection{TIFF}
+% \begin{itemize}
+% \item \url{http://en.wikipedia.org/wiki/TIFF}
+% \item \url{http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf}
+% \end{itemize}
+%
+% \subsubsection{TGA}
+% \begin{itemize}
+% \item \url{http://de.wikipedia.org/wiki/Targa_Image_File}
+% \item \url{http://en.wikipedia.org/wiki/Truevision_TGA}
+% \item \url{http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf}
+% \end{itemize}
+%
+% \subsubsection{SGI}
+% \begin{itemize}
+% \item \url{http://en.wikipedia.org/wiki/Silicon_Graphics_Image}
+% \item \url{ftp://ftp.sgi.com/graphics/SGIIMAGESPEC}
+% \end{itemize}
+%
+% \subsubsection{WMF}
+% \begin{itemize}
+% \item \url{http://www.fileformat.info/format/wmf/}
+% \end{itemize}
+%
+% \subsubsection{XPM}
+% \begin{itemize}
+% \item \url{http://en.wikipedia.org/wiki/XPM_%28image_format%29}
+% \item \url{http://de.wikipedia.org/wiki/Xpm}
+% \item \url{http://koala.ilog.fr/ftp/pub/xpm/xpm-README.html}
+% \end{itemize}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/08/24 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/02/18 v1.1}
+% \item
+% 1in replaced by 72.27pt, because TeX is inaccurate if 1in is given.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.2}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/05/01 v1.3}
+% \item
+% Uses package \xpackage{infwarerr}.
+% \item
+% Image reuse algorithm fixed for dvipdfmx.
+% \item
+% Some support for Exif's orientation tag.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.4}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \item
+% Fix of bug of package \xpackage{keyval}: \cs{KV@err} and \cs{KV@errx}
+% are used, but undefined if loaded by \plainTeX.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.5}
+% \item
+% Code is not changed.
+% \item
+% Update of URLs.
+% \end{Version}
+% \begin{Version}{2009/09/04 v1.6}
+% \item
+% Fixes for reusing objects with dvipdfmx-20090708.
+% Older versions of dvipdfmx are no longer supported.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.7}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/bmpsize.pdf b/macros/latex/contrib/oberdiek/bmpsize.pdf
new file mode 100644
index 0000000000..7f421cece5
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/bmpsize.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/bookmark.dtx b/macros/latex/contrib/oberdiek/bookmark.dtx
new file mode 100644
index 0000000000..72c6b0d3eb
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/bookmark.dtx
@@ -0,0 +1,3527 @@
+% \iffalse meta-comment
+%
+% File: bookmark.dtx
+% Version: 2019/06/04 v1.27
+% Info: PDF bookmarks
+%
+% Copyright (C) 2007-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file bookmark.dtx
+% and the derived files
+% bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv,
+% bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def,
+% bkm-textures.def, bkm-pdftex.def, bkm-vtex.def,
+% bookmark-example.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/bookmark.dtx
+% CTAN:macros/latex/contrib/oberdiek/bookmark.pdf
+%
+% Unpacking:
+% (a) If bookmark.ins is present:
+% tex bookmark.ins
+% (b) Without bookmark.ins:
+% tex bookmark.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{bookmark.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If bookmark.drv is present:
+% latex bookmark.drv
+% (b) Without bookmark.drv:
+% latex bookmark.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 bookmark.dtx
+% makeindex -s gind.ist bookmark.idx
+% pdflatex bookmark.dtx
+% makeindex -s gind.ist bookmark.idx
+% pdflatex bookmark.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/bookmark.sty
+% TDS:tex/latex/oberdiek/bkm-dvipdfm.def
+% TDS:tex/latex/oberdiek/bkm-dvips.def
+% TDS:tex/latex/oberdiek/bkm-dvipsone.def
+% TDS:tex/latex/oberdiek/bkm-textures.def
+% TDS:tex/latex/oberdiek/bkm-pdftex.def
+% TDS:tex/latex/oberdiek/bkm-vtex.def
+% TDS:doc/latex/oberdiek/bookmark.pdf
+% TDS:doc/latex/oberdiek/bookmark-example.tex
+% TDS:source/latex/oberdiek/bookmark.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: bookmark 2019/06/04 v1.27 PDF bookmarks (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: bookmark
+Version: 2019/06/04 v1.27
+
+Copyright (C) 2007-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file bookmark.dtx
+and the derived files
+ bookmark.sty, bookmark.pdf, bookmark.ins, bookmark.drv,
+ bkm-dvipdfm.def, bkm-dvips.def, bkm-dvipsone.def,
+ bkm-textures.def, bkm-pdftex.def, bkm-vtex.def,
+ bookmark-example.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{bookmark.ins}{\from{bookmark.dtx}{install}}%
+ \file{bookmark.drv}{\from{bookmark.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{bookmark.sty}{\from{bookmark.dtx}{package}}%
+ \file{bkm-dvipdfm.def}{\from{bookmark.dtx}{dvipdfm}}%
+ \file{bkm-dvips.def}{\from{bookmark.dtx}{dvips,pdfmark}}%
+ \file{bkm-dvipsone.def}{\from{bookmark.dtx}{dvipsone,pdfmark}}%
+ \file{bkm-textures.def}{\from{bookmark.dtx}{textures,pdfmark}}%
+ \file{bkm-pdftex.def}{\from{bookmark.dtx}{pdftex}}%
+ \file{bkm-vtex.def}{\from{bookmark.dtx}{vtex}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{bookmark-example.tex}{\from{bookmark.dtx}{example}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{bookmark.xml}{\from{bookmark.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{* bookmark.sty, bkm-dvipdfm.def, bkm-dvips.def,}
+\Msg{* bkm-dvipsone.def, bkm-textures.def, bkm-pdftex.def,}
+\Msg{* bkm-vtex.def}
+\Msg{*}
+\Msg{* To produce the documentation run the file `bookmark.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bookmark.drv}%
+ [2019/06/04 v1.27 PDF bookmarks (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{bookmark.dtx}%
+\end{document}
+%</driver>
+% \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{bookmark.drv}
+%
+% \title{The \xpackage{bookmark} package}
+% \date{2019/06/04 v1.27}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package implements a new bookmark (outline) organization for
+% package \xpackage{hyperref}. Bookmark properties such
+% as style and color can now be set. Other action types
+% are available (URI, GoToR, Named). The bookmarks are
+% generated in the first compile run. Package \xpackage{hyperref}
+% uses two runs.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% This package \xpackage{bookmark} tries to provide a more modern
+% management for bookmarks:
+% \begin{itemize}
+% \item The bookmarks are already generated in the first \hologo{TeX} compile run.
+% \item The font style and color of the bookmarks can be changed.
+% \item More actions than simple GoTo actions are possible.
+% \end{itemize}
+%
+% In the same way as \xpackage{hyperref} \cite{hyperref}
+% the bookmarks are generated
+% in the order of the bookmark generating macros (\cs{bookmark}).
+% A level number is used to define the tree structure of the bookmarks.
+% The restrictions are less strict:
+% \begin{itemize}
+% \item The level values may jump and omit values. A \cs{subsubsection}
+% may follow a \cs{chapter}. This was an error in \xpackage{hyperref},
+% that prints a warning and tries to fix this.
+% \item Several bookmarks may point to the same destination.
+% In \xpackage{hyperref} this would mess up the bookmark tree
+% completely, because the algorithm assumes that the destination
+% names are keys (unique).
+% \end{itemize}
+%
+% Note that this package is intended as experimentation platform
+% for bookmark management. Feedback is welcome. Also the interfaces
+% may change in future versions.
+%
+% \subsection{Options}
+%
+% Options can be given at four places:
+% \begin{enumerate}
+% \item \cs{usepackage}|[|\meta{options}|]{bookmark}|\\
+% This is the only place for driver options
+% and option \xoption{atend}.
+% \item \cs{bookmarksetup}|{|\meta{options}|}|\\
+% This command is just for setting options.
+% \item \cs{bookmarksetupnext}|{|\meta{options}|}|\\
+% The options are stored and called after the
+% options of the next \cs{bookmark} command.
+% \item \cs{bookmark}|[|\meta{options}|]{|\meta{title}|}|\\
+% This command sets the bookmark. The option settings remain
+% limited to this bookmark.
+% \end{enumerate}
+% Exception: Driver options, option \xoption{atend} and
+% options \xoption{draft}\slash\xoption{final}
+% cannot be changed after the package is loaded.
+%
+% \subsubsection{Options \xoption{draft} and \xoption{final}}
+%
+% If a \LaTeX\ file is compiled several times, then a little
+% time can be saved, if option \xoption{draft} is used to
+% disable the bookmark stuff of this package. Default is
+% \xoption{final}.
+% Both options are boolean options, without
+% value the value |true| is used. |draft=true| is the same
+% as |final=false|.
+%
+% Options of package \xpackage{bookmark} are local options
+% with the exception of driver options. Therefore \xoption{draft}
+% or \xoption{final} given as class option is not seen by this
+% package. If you want to optimize first \LaTeX\ runs depending
+% on a global \xoption{draft}, then package \xpackage{ifdraft}
+% and \LaTeX's \cs{PassOptionsToPackage}
+% might help in the organization of the preamble, for example:
+%\begin{quote}
+%\begin{verbatim}
+%\documentclass[draft]{article}
+%\usepackage{ifdraft}
+%\ifdraft{%
+% \PassOptionsToPackage{draft}{bookmark}%
+%}{}
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{Driver options}
+%
+% Supported drivers are \xoption{pdftex}, \xoption{dvips},
+% \xoption{dvipsone}, \xoption{textures},
+% \xoption{dvipdfm} (\xoption{xetex}), and \xoption{vtex}.
+% The \hologo{TeX} engines \hologo{pdfTeX}, \hologo{XeTeX},
+% and \hologo{VTeX} are automatically detected.
+% The default for the DVI drivers is \xoption{dvips}. This can
+% be changed in the configuration file \xfile{bookmark.cfg} by
+% \cs{BookmarkDriverDefault}, e.g.:
+% \begin{quote}
+% |\def\BookmarkDriverDefault{dvipdfm}|
+% \end{quote}
+%
+% \paragraph{Open bookmarks with dvipdfmx.} Since 2007-04-25 the
+% cvs version of dvipmdfmx contains a patch that extends the
+% \cs{special} for bookmarks in order to specify the open status of
+% an outline entry. Option \xoption{dvipdfmx-outline-open} notifies
+% the package that the dvi driver program understands this kind
+% of \cs{special}. Alternatively \cs{SpecialDvipdfmxOutlineOpen}
+% can be defined as number one in the configuration file or before
+% the package is loaded, e.g.:
+% \begin{quote}
+% |\chardef\SpecialDvipdfmxOutlineOpen=1\relax|
+% \end{quote}
+%
+% \subsubsection{Layout options}
+%
+% \paragraph{Font options.}
+%
+% \begin{description}
+% \item[\xoption{bold}:] The bookmark is shown with a bold font
+% if the PDF viewer supports this (since PDF 1.4).
+% \item[\xoption{italic}:] An italic font is used (since PDF 1.4).
+% \end{description}
+% Both \xoption{bold} and \xoption{italic} can be used together.
+% Using value |false| disables the font option.
+%
+% \paragraph{Color option.}
+%
+% Colored bookmarks are a feature of PDF 1.4, they are not supported
+% by all PDF viewers.
+% \begin{description}
+% \item[\xoption{color}:] Here the color can be given as
+% color specification of packages \xpackage{color} or \xpackage{xcolor}.
+% An empty value means that the color property is not set.
+% Without package \xpackage{xcolor} the recognized values
+% are restricted to
+% \begin{itemize}
+% \item Empty value, no color is set,\\
+% example: |color={}|
+% \item Explicit color specification of color model rgb,\\
+% example for red: |color=[rgb]{1,0,0}|
+% \item Explicit color specification of color model gray,\\
+% example for dark gray: |color=[gray]{0.25}|
+% \end{itemize}
+% Note that this restriction also holds if package \xpackage{color}
+% is loaded. With \xpackage{xcolor}, however, the full range
+% of color specifications can be used.
+% \end{description}
+%
+% \subsubsection{Action options}
+%
+% \begin{description}
+% \item[\xoption{dest}:] Destination name.
+% \item[\xoption{page}:] Page number, first page is 1.
+% \item[\xoption{view}:] View specification, examples:\\
+% |view={FitB}|, |view={FitH 842}|, |view={XYZ 0 100 null}|
+% Some view specification parameters expect numbers as parameters
+% with unit bp. They can be given either as plain numbers or
+% as length expressions inside \cs{calc}. Expressions of
+% package \xpackage{calc} are supported if the package is loaded.
+% Otherwise \hologo{eTeX}'s \cs{dimexpr} is used. Example:\\
+% |view={FitH \calc{\paperheight-\topmargin-1in}}|\\
+% |view={XYZ 0 \calc{\paperheight} null}|\\
+% Note that \cs{calc} cannot be used for the third parameter
+% of |XYZ|. This parameter is the zoom value, not a length.
+% \item[\xoption{named}:] Named action name:\\
+% |FirstPage|, |LastPage|, |NextPage|, |PrevPage|
+% \item[\xoption{gotor}:] Name of the external PDF file.
+% \item[\xoption{uri}:] URI specification.
+% \item[\xoption{rawaction}:] Raw action specification.
+% Because these specification depends on the driver this option
+% should not be used.
+% \end{description}
+% The appropriate action for the bookmark is selected by
+% analyzing the specified options. The actions
+% are distinguished by different sets of options:
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% \textbf{Action} & \textbf{Options}\\
+% \hline
+% \textsf{GoTo}: & \xoption{dest}\\
+% \textsf{GoTo}: & \xoption{page} + \xoption{view}\\
+% \textsf{GoToR}: & \xoption{gotor} + \xoption{dest}\\
+% \textsf{GoToR}: & \xoption{gotor} + \xoption{page} + \xoption{view}\\
+% \textsf{Named}: & \xoption{named}\\
+% \textsf{URI}: & \xoption{uri}
+% \end{tabular}
+% \end{quote}
+%
+% \paragraph{Missing actions.}
+% If the action is missing package \xpackage{bookmark} throws
+% an error message. Depending on the driver (\xoption{pdftex},
+% \xoption{dvips} and friends) the package detects it quite late
+% at the end of the document. Since version 2011/04/21 v1.21
+% the package tries printing the line number and file name
+% of the corresponding occurence of \cs{bookmark}.
+% However, \hologo{TeX} does provide the line number, but
+% unhappily the file name is a secret. The package supports
+% some ways to get the file name:
+% \begin{itemize}
+% \item If \hologo{LuaTeX} (indenpendently from DVI or PDF modus)
+% is running, then its |status.filename| is used automatically.
+% \item Package \cs{currfile} \cite{currfile} redefines \hologo{LaTeX}
+% internals to keep track of the file name. If the package
+% is loaded, then its \cs{currfilepath} is detected and used
+% automatically by package \xpackage{bookmark}.
+% \item The file name can be set manually by option \xoption{scrfile}
+% in \cs{bookmarksetup} or \cs{bookmark}. But be careful,
+% manual setting disables the previous ways for file name
+% detection. And a wrong or missed file name setting might
+% get you a wrong source location in the error message.
+% \end{itemize}
+%
+% \subsubsection{Level options}
+%
+% The order of the bookmark entries are defined by the
+% appearance order of \cs{bookmark} commands. The tree structure
+% is constructed by the property \xoption{level} of the bookmark nodes.
+% The values of \xoption{level} are integers. If the level of a
+% bookmark entry has a higher value than the previous node, then
+% the entry becomes a child of the previous node. The absolute
+% value of the difference does not matter.
+%
+% Package \xpackage{bookmark} remembers the level of the previous
+% bookmark entry in a global property `current level'.
+%
+% The behaviour of the level system can be configured by following
+% options:
+% \begin{description}
+% \item[\xoption{level}:]
+% Sets the level, see the description above. If option \xoption{level}
+% is given without value, then the default behaviour is restored,
+% that the `current level' is used as level value.
+% Since version 2010/10/19 v1.16 package \xpackage{bookmark}
+% also supports names |part|, |section| and other,
+% if the macros \cs{toclevel@part}, \cs{toclevel@section}
+% are defined (done by package \xpackage{hyperref}, see
+% option \xoption{bookmarkdepth}).
+% \item[\xoption{rellevel}:]
+% Sets the level relative to the previous level.
+% A positive value means that the bookmark entry become
+% a child of the previous one.
+% \item[\xoption{keeplevel}:]
+% Use the level, set by \xoption{level} or \xoption{rellevel},
+% but do not change the global property `current level'.
+% The option can be disabled by setting to |false|.
+% \item[\xoption{startatroot}:]
+% At this time the bookmark tree starts at the top level again.
+% The next bookmark entry is not sorted as child to a previous entry.
+% Example scenario: A document uses part. However there are
+% last chapters that should not be put below the last part:
+% \begin{quote}
+%\begin{verbatim}
+%\documentclass{book}
+%[...]
+%\begin{document}
+% \part{First part}
+% \chapter{First chapter in first part}
+% [...]
+% \part{Second part}
+% \chapter{First chapter in second part}
+% [...]
+% \bookmarksetup{startatroot}
+% \chapter{Index}% does not belong to second part
+%\end{document}
+%\end{verbatim}
+% \end{quote}
+% \end{description}
+%
+% \subsubsection{Style definitions}
+%
+% A style is a group of option settings. It can be defined
+% by macro \cs{bookmarkdefinestyle} and is used by option \xoption{style}.
+% \begin{declcs}{bookmarkdefinestyle} \M{name} \M{key value list}
+% \end{declcs}
+% The \meta{key value list} of option settings is assigned the
+% style \meta{name}.
+%
+% \begin{description}
+% \item[\xoption{style}:]
+% The value of option \xoption{style} is the name of a previously
+% defined style. Its option settings are now executed.
+% The options may include option \xoption{style}.
+% Endless recursion by calling the same style recursively
+% is prevented and throws an error.
+% \end{description}
+%
+% \subsubsection{Hook support}
+%
+% A hook is called right after the processing the optional options
+% of macro \cs{bookmark}.
+% \begin{description}
+% \item[\xoption{addtohook}:]
+% Code, given as value to this option is added to the hook.
+% \end{description}
+%
+% \begin{declcs}{bookmarkget} \M{option}
+% \end{declcs}
+% Macro \cs{bookmarkget} extracts the value of the latest option
+% setting of option \meta{option}. In case of boolean options number
+% one is returned, if the boolean option is enabled, otherwise the
+% result is zero.
+% The resulting numbers can directly be used in \cs{ifnum} or \cs{ifcase}.
+% If you want to have the digits \texttt{0} and \texttt{1}, then
+% prefix \cs{bookmarkget} with \cs{number}.
+% Macro \cs{bookmarkget} is expandable.
+% In case of
+% unsupported options an empty string is returned.
+% Supported boolean options are
+% \begin{quote}
+% \xoption{bold},
+% \xoption{italic},
+% \xoption{open}
+% \end{quote}
+% Other supported options:
+% \begin{quote}
+% \xoption{depth},
+% \xoption{dest},
+% \xoption{color},
+% \xoption{gotor},
+% \xoption{level},
+% \xoption{named},
+% \xoption{openlevel},
+% \xoption{page},
+% \xoption{rawaction},
+% \xoption{uri},
+% \xoption{view},
+% \end{quote}
+% Additionally the following key is available:
+% \begin{quote}
+% \xoption{text}
+% \end{quote}
+% It returns the text of the outline entry.
+%
+% \paragraph{Option setting.}
+% Inside the hook an option can be set using \cs{bookmarksetup}.
+%
+% \subsection{Compatibility with \xpackage{hyperref}}
+%
+% Package \xpackage{bookmark} automatically disables
+% \xpackage{hyperref}'s bookmarks. However the package
+% uses some of the code of \xpackage{hyperref}. For example,
+% the package redefines the hook \cs{Hy@writebookmark} that
+% \xpackage{hyperref} inserts in \cs{addcontentsline} and
+% other commands. Therefore
+% \xpackage{hyperref}'s bookmarks should not be disabled.
+%
+% Package \xpackage{bookmark} uses \xpackage{hyperref}'s \cs{pdfstringdef}
+% and does not provide a replacement.
+%
+% Some options of \xpackage{hyperref} are also implemented
+% in package \xpackage{bookmark}:
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% \xpackage{hyperref} & \xpackage{bookmark}\\
+% \hline
+% \xoption{bookmarksdepth} & \xoption{depth}\\
+% \xoption{bookmarksopen} & \xoption{open}\\
+% \xoption{bookmarksopenlevel} & \xoption{openlevel}\\
+% \xoption{bookmarksnumbered} & \xoption{numbered}\\
+% \end{tabular}
+% \end{quote}
+%
+% The following commands are also available:
+% \begin{quote}
+% \cs{pdfbookmark}\\
+% \cs{currentpdfbookmark}\\
+% \cs{subpdfbookmark}\\
+% \cs{belowpdfbookmark}
+% \end{quote}
+%
+% \subsection{Adding bookmarks at the end}
+%
+% Package option \xoption{atend} enables the following macro:
+% \begin{declcs}{BookmarkAtEnd}
+% \M{stuff}
+% \end{declcs}
+% Macro \cs{BookmarkAtEnd} puts \meta{stuff} at the end
+% of the document. \meta{stuff} means bookmark commands.
+% Example:
+% \begin{quote}
+%\begin{verbatim}
+%\usepackage[atend]{bookmark}
+%\BookmarkAtEnd{%
+% \bookmarksetup{startatroot}%
+% \bookmark[named=LastPage, level=0]{Last page}%
+%}
+%\end{verbatim}
+% \end{quote}
+%
+% Alternatively, option \xoption{startatroot} can be given
+% in \cs{bookmark}:
+% \begin{quote}
+%\begin{verbatim}
+%\BookmarkAtEnd{%
+% \bookmark[
+% startatroot,
+% named=LastPage,
+% level=0,
+% ]{Last page}%
+%}
+%\end{verbatim}
+% \end{quote}
+%
+% \paragraph{Remarks.}
+% \begin{itemize}
+% \item
+% \cs{BookmarkAtEnd} hides the fact that the method for
+% adding bookmarks at the end of the document depends
+% on the driver.
+%
+% Some drivers
+% (\xoption{pdftex}, \xoption{dvips}, \xoption{dvipsone},
+% \xoption{textures}) use package \xpackage{atveryend}'s
+% for this purpose. \cs{AtEndDocument} is too early,
+% the last page might not been shipped out. Because the \xext{aux}
+% file is needed, these drivers use \cs{AfterLastShipout}.
+%
+% The implementation of the other drivers
+% (\xoption{dvipdfm}, \xoption{xetex}, \xoption{vtex})
+% depends on
+% \cs{special} that does not have an effect after the last
+% page. In this case \cs{AtEndDvi} of package \xpackage{atenddvi}
+% helps. It puts its argument on last page of the document.
+% Two \hologo{LaTeX} runs are necessary at least, because
+% the last page is detected by a reference.
+% \item
+% The time of expansion of the argument of \cs{BookmarkAtEnd}
+% is not specified. This can happen immediately or at the end
+% of the document.
+% \end{itemize}
+%
+% \subsection{Limitations/ToDos}
+%
+% \begin{itemize}
+% \item Support for missing actions (Launch, \dots).
+% \item Better design for \xpackage{hyperref}'s option
+% \xoption{bookmarkstype}.
+% \end{itemize}
+%
+% \section{Example}
+%
+% \begin{macrocode}
+%<*example>
+% \end{macrocode}
+% \begin{macrocode}
+\documentclass{article}
+\usepackage{xcolor}[2007/01/21]
+\usepackage{hyperref}
+\usepackage[
+ open,
+ openlevel=2,
+ atend
+]{bookmark}[2019/06/04]
+
+\bookmarksetup{color=blue}
+
+\BookmarkAtEnd{%
+ \bookmarksetup{startatroot}%
+ \bookmark[named=LastPage, level=0]{End/Last page}%
+ \bookmark[named=FirstPage, level=1]{First page}%
+}
+
+\begin{document}
+\section{First section}
+\subsection{Subsection A}
+\begin{figure}
+ \hypertarget{fig}{}%
+ A figure.
+\end{figure}
+\bookmark[
+ rellevel=1,
+ keeplevel,
+ dest=fig
+]{A figure}
+\subsection{Subsection B}
+\subsubsection{Subsubsection C}
+\subsection{Umlauts: \"A\"O\"U\"a\"o\"u\ss}
+\newpage
+\bookmarksetup{
+ bold,
+ color=[rgb]{1,0,0}
+}
+\section{Very important section}
+\bookmarksetup{
+ italic,
+ bold=false,
+ color=blue
+}
+\subsection{Italic section}
+\bookmarksetup{
+ italic=false
+}
+\part{Misc}
+\section{Diverse}
+\subsubsection{Subsubsection, omitting subsection}
+\bookmarksetup{
+ startatroot
+}
+\section{Last section outside part}
+\subsection{Subsection}
+\bookmarksetup{
+ color={}
+}
+\begingroup
+ \bookmarksetup{level=0, color=green!80!black}
+ \bookmark[named=FirstPage]{First page}
+ \bookmark[named=LastPage]{Last page}
+ \bookmark[named=PrevPage]{Previous page}
+ \bookmark[named=NextPage]{Next page}
+\endgroup
+\bookmark[
+ page=2,
+ view=FitH 800
+]{Page 2, FitH 800}
+\bookmark[
+ page=2,
+ view=FitBH \calc{\paperheight-\topmargin-1in-\headheight-\headsep}
+]{Page 2, FitBH top of text body}
+\bookmark[
+ uri={http://www.dante.de/},
+ color=magenta
+]{Dante homepage}
+\bookmark[
+ gotor={t.pdf},
+ page=1,
+ view={XYZ 0 1000 null},
+ color=cyan!75!black
+]{File t.pdf}
+\bookmark[named=FirstPage]{First page}
+\bookmark[rellevel=1, named=LastPage]{Last page (rellevel=1)}
+\bookmark[named=PrevPage]{Previous page}
+\bookmark[level=0, named=FirstPage]{First page (level=0)}
+\bookmark[
+ rellevel=1,
+ keeplevel,
+ named=LastPage
+]{Last page (rellevel=1, keeplevel)}
+\bookmark[named=PrevPage]{Previous page}
+\end{document}
+% \end{macrocode}
+% \begin{macrocode}
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Package}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bookmark}%
+ [2019/06/04 v1.27 PDF bookmarks (HO)]%
+% \end{macrocode}
+%
+% \subsubsection{Requirements}
+%
+% \paragraph{\hologo{eTeX}.}
+%
+% \begin{macro}{\BKM@CalcExpr}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+ \def\BKM@CalcExpr#1#2#3#4{%
+ \begingroup
+ \count@=#2\relax
+ \advance\count@ by#3#4\relax
+ \edef\x{\endgroup
+ \def\noexpand#1{\the\count@}%
+ }%
+ \x
+ }%
+\else
+ \def\BKM@CalcExpr#1#2#3#4{%
+ \edef#1{%
+ \the\numexpr#2#3#4\relax
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Escape features of \hologo{pdfTeX}.}
+%
+% \begin{macrocode}
+\RequirePackage{pdfescape}[2007/03/20]
+% \end{macrocode}
+% \begin{macro}{\BKM@EscapeName}
+% \begin{macrocode}
+\def\BKM@EscapeName#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeName#1#1%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@EscapeString}
+% \begin{macrocode}
+\def\BKM@EscapeString#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeString#1#1%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@EscapeHex}
+% \begin{macrocode}
+\def\BKM@EscapeHex#1{%
+ \ifx#1\@empty
+ \else
+ \EdefEscapeHex#1#1%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@UnescapeHex}
+% \begin{macrocode}
+\def\BKM@UnescapeHex#1{%
+ \EdefUnescapeHex#1#1%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Packages.}
+%
+% \begin{macrocode}
+\RequirePackage{ifpdf}[2009/04/10]
+\RequirePackage{ifxetex}
+\RequirePackage{ifvtex}[2008/11/04]
+\RequirePackage{ifluatex}[2010/03/01]
+\RequirePackage{pdftexcmds}[2010/11/04]
+\RequirePackage{hyperref}[2010/06/18]
+\RequirePackage{auxhook}[2007/04/06]
+\RequirePackage{kvsetkeys}[2010/03/01]
+\RequirePackage{kvoptions}[2009/08/13]
+\RequirePackage{hycolor}[2008/09/08]
+\RequirePackage{bitset}[2011/01/30]
+\RequirePackage{ltxcmds}[2011/04/14]
+% \end{macrocode}
+%
+% \subsubsection{Package options}
+%
+% \begin{macrocode}
+\SetupKeyvalOptions{family=BKM,prefix=BKM@}
+\DeclareLocalOptions{%
+ atend,%
+ bold,%
+ color,%
+ depth,%
+ dest,%
+ draft,%
+ final,%
+ gotor,%
+ italic,%
+ keeplevel,%
+ level,%
+ named,%
+ numbered,%
+ open,%
+ openlevel,%
+ page,%
+ rawaction,%
+ rellevel,%
+ srcfile,%
+ srcline,%
+ startatroot,%
+ uri,%
+ view,%
+}
+% \end{macrocode}
+% \begin{macro}{\bookmarksetup}
+% \begin{macrocode}
+\newcommand*{\bookmarksetup}{\kvsetkeys{BKM}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@setup}
+% \begin{macrocode}
+\def\BKM@setup#1{%
+ \bookmarksetup{#1}%
+ \ifx\BKM@HookNext\ltx@empty
+ \else
+ \expandafter\bookmarksetup\expandafter{\BKM@HookNext}%
+ \BKM@HookNextClear
+ \fi
+ \BKM@hook
+ \ifBKM@keeplevel
+ \else
+ \xdef\BKM@currentlevel{\BKM@level}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bookmarksetupnext}
+% \begin{macrocode}
+\newcommand*{\bookmarksetupnext}[1]{%
+ \ltx@GlobalAppendToMacro\BKM@HookNext{,#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@setupnext}
+% \begin{macrocode}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@HookNextClear}
+% \begin{macrocode}
+\def\BKM@HookNextClear{%
+ \global\let\BKM@HookNext\ltx@empty
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@HookNext}
+% \begin{macrocode}
+\BKM@HookNextClear
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareBoolOption{draft}
+\DeclareComplementaryOption{final}{draft}
+% \end{macrocode}
+% \begin{macro}{\BKM@DisableOptions}
+% \begin{macrocode}
+\def\BKM@DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{draft}%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{final}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareBoolOption[\ifHy@bookmarksopen true\else false\fi]{open}
+% \end{macrocode}
+% \begin{macro}{\bookmark@open}
+% \begin{macrocode}
+\def\bookmark@open{%
+ \ifBKM@open\ltx@one\else\ltx@zero\fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareStringOption[\maxdimen]{openlevel}
+% \end{macrocode}
+% \begin{macro}{\BKM@openlevel}
+% \begin{macrocode}
+\edef\BKM@openlevel{\number\@bookmarksopenlevel}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%\DeclareStringOption[\c@tocdepth]{depth}
+\ltx@IfUndefined{Hy@bookmarksdepth}{%
+ \def\BKM@depth{\c@tocdepth}%
+}{%
+ \let\BKM@depth\Hy@bookmarksdepth
+}
+\define@key{BKM}{depth}[]{%
+ \edef\BKM@param{#1}%
+ \ifx\BKM@param\@empty
+ \def\BKM@depth{\c@tocdepth}%
+ \else
+ \ltx@IfUndefined{toclevel@\BKM@param}{%
+ \@onelevel@sanitize\BKM@param
+ \edef\BKM@temp{\expandafter\@car\BKM@param\@nil}%
+ \ifcase 0\expandafter\ifx\BKM@temp-1\fi
+ \expandafter\ifnum\expandafter`\BKM@temp>47 %
+ \expandafter\ifnum\expandafter`\BKM@temp<58 %
+ 1%
+ \fi
+ \fi
+ \relax
+ \PackageWarning{bookmark}{%
+ Unknown document division name (\BKM@param)\MessageBreak
+ for option `depth'%
+ }%
+ \else
+ \BKM@SetDepthOrLevel\BKM@depth\BKM@param
+ \fi
+ }{%
+ \BKM@SetDepthOrLevel\BKM@depth{%
+ \csname toclevel@\BKM@param\endcsname
+ }%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\bookmark@depth}
+% \begin{macrocode}
+\def\bookmark@depth{\BKM@depth}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@SetDepthOrLevel}
+% \begin{macrocode}
+\def\BKM@SetDepthOrLevel#1#2{%
+ \begingroup
+ \setbox\z@=\hbox{%
+ \count@=#2\relax
+ \expandafter
+ }%
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{\the\count@}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareStringOption[\BKM@currentlevel]{level}[\BKM@currentlevel]
+\define@key{BKM}{level}{%
+ \edef\BKM@param{#1}%
+ \ifx\BKM@param\BKM@MacroCurrentLevel
+ \let\BKM@level\BKM@param
+ \else
+ \ltx@IfUndefined{toclevel@\BKM@param}{%
+ \@onelevel@sanitize\BKM@param
+ \edef\BKM@temp{\expandafter\@car\BKM@param\@nil}%
+ \ifcase 0\expandafter\ifx\BKM@temp-1\fi
+ \expandafter\ifnum\expandafter`\BKM@temp>47 %
+ \expandafter\ifnum\expandafter`\BKM@temp<58 %
+ 1%
+ \fi
+ \fi
+ \relax
+ \PackageWarning{bookmark}{%
+ Unknown document division name (\BKM@param)\MessageBreak
+ for option `level'%
+ }%
+ \else
+ \BKM@SetDepthOrLevel\BKM@level\BKM@param
+ \fi
+ }{%
+ \BKM@SetDepthOrLevel\BKM@level{%
+ \csname toclevel@\BKM@param\endcsname
+ }%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\BKM@MacroCurrentLevel}
+% \begin{macrocode}
+\def\BKM@MacroCurrentLevel{\BKM@currentlevel}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareBoolOption{keeplevel}
+\DeclareBoolOption{startatroot}
+% \end{macrocode}
+% \begin{macro}{\BKM@startatrootfalse}
+% \begin{macrocode}
+\def\BKM@startatrootfalse{%
+ \global\let\ifBKM@startatroot\iffalse
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@startatroottrue}
+% \begin{macrocode}
+\def\BKM@startatroottrue{%
+ \global\let\ifBKM@startatroot\iftrue
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\define@key{BKM}{rellevel}{%
+ \BKM@CalcExpr\BKM@level{#1}+\BKM@currentlevel
+}
+% \end{macrocode}
+% \begin{macro}{\bookmark@level}
+% \begin{macrocode}
+\def\bookmark@level{\BKM@level}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@currentlevel}
+% \begin{macrocode}
+\def\BKM@currentlevel{0}
+% \end{macrocode}
+% \end{macro}
+% Make \xpackage{bookmark}'s option \xoption{numbered} an alias
+% for \xpackage{hyperref}'s \xoption{bookmarksnumbered}.
+% \begin{macrocode}
+\DeclareBoolOption[%
+ \ifHy@bookmarksnumbered true\else false\fi
+]{numbered}
+\g@addto@macro\BKM@numberedtrue{%
+ \let\ifHy@bookmarksnumbered\iftrue
+}
+\g@addto@macro\BKM@numberedfalse{%
+ \let\ifHy@bookmarksnumbered\iffalse
+}
+\g@addto@macro\Hy@bookmarksnumberedtrue{%
+ \let\ifBKM@numbered\iftrue
+}
+\g@addto@macro\Hy@bookmarksnumberedfalse{%
+ \let\ifBKM@numbered\iffalse
+}
+% \end{macrocode}
+% \begin{macro}{\bookmark@numbered}
+% \begin{macrocode}
+\def\bookmark@numbered{%
+ \ifBKM@numbered\ltx@one\else\ltx@zero\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Redefinitions \xpackage{hyperref}'s options}
+%
+% \begin{macro}{\BKM@PatchHyperrefOption}
+% \begin{macrocode}
+\def\BKM@PatchHyperrefOption#1{%
+ \expandafter\BKM@@PatchHyperrefOption\csname KV@Hyp@#1\endcsname%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@@PatchHyperrefOption}
+% \begin{macrocode}
+\def\BKM@@PatchHyperrefOption#1{%
+ \expandafter\BKM@@@PatchHyperrefOption#1{##1}\BKM@nil#1%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@@@PatchHyperrefOption}
+% \begin{macrocode}
+\def\BKM@@@PatchHyperrefOption#1\BKM@nil#2#3{%
+ \def#2##1{%
+ #1%
+ \bookmarksetup{#3={##1}}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\BKM@PatchHyperrefOption{bookmarksopen}{open}
+\BKM@PatchHyperrefOption{bookmarksopenlevel}{openlevel}
+\BKM@PatchHyperrefOption{bookmarksdepth}{depth}
+% \end{macrocode}
+%
+% \paragraph{Font style options.}
+%
+% Caution: Package \xpackage{bitset} is zero-based, the
+% PDF specifications starts with one.
+% \begin{macrocode}
+\bitsetReset{BKM@FontStyle}%
+\define@key{BKM}{italic}[true]{%
+ \expandafter\ifx\csname if#1\endcsname\iftrue
+ \bitsetSet{BKM@FontStyle}{0}%
+ \else
+ \bitsetClear{BKM@FontStyle}{0}%
+ \fi
+}%
+\define@key{BKM}{bold}[true]{%
+ \expandafter\ifx\csname if#1\endcsname\iftrue
+ \bitsetSet{BKM@FontStyle}{1}%
+ \else
+ \bitsetClear{BKM@FontStyle}{1}%
+ \fi
+}%
+% \end{macrocode}
+% \begin{macro}{\bookmark@italic}
+% \begin{macrocode}
+\def\bookmark@italic{%
+ \ifnum\bitsetGet{BKM@FontStyle}{0}=1 \ltx@one\else\ltx@zero\fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bookmark@bold}
+% \begin{macrocode}
+\def\bookmark@bold{%
+ \ifnum\bitsetGet{BKM@FontStyle}{1}=1 \ltx@one\else\ltx@zero\fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@PrintStyle}
+% \begin{macrocode}
+\def\BKM@PrintStyle{%
+ \bitsetGetDec{BKM@FontStyle}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Options for color.}
+%
+% \begin{macrocode}
+\define@key{BKM}{color}{%
+ \HyColor@BookmarkColor{#1}\BKM@color{bookmark}{color}%
+}
+% \end{macrocode}
+% \begin{macro}{\BKM@color}
+% \begin{macrocode}
+\let\BKM@color\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bookmark@color}
+% \begin{macrocode}
+\def\bookmark@color{\BKM@color}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Action options}
+%
+% \begin{macrocode}
+\def\BKM@temp#1{%
+ \DeclareStringOption{#1}%
+ \expandafter\edef\csname bookmark@#1\endcsname{%
+ \expandafter\noexpand\csname BKM@#1\endcsname
+ }%
+}
+% \end{macrocode}
+% \begin{macro}{\bookmark@dest}
+% \begin{macrocode}
+\BKM@temp{dest}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bookmark@named}
+% \begin{macrocode}
+\BKM@temp{named}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bookmark@uri}
+% \begin{macrocode}
+\BKM@temp{uri}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bookmark@gotor}
+% \begin{macrocode}
+\BKM@temp{gotor}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bookmark@rawaction}
+% \begin{macrocode}
+\BKM@temp{rawaction}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\define@key{BKM}{page}{%
+ \def\BKM@page{#1}%
+ \ifx\BKM@page\@empty
+ \else
+ \edef\BKM@page{\number\BKM@page}%
+ \ifnum\BKM@page>\z@
+ \else
+ \PackageError{bookmark}{Page must be positive}\@ehc
+ \def\BKM@page{1}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\BKM@page}
+% \begin{macrocode}
+\let\BKM@page\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bookmark@page}
+% \begin{macrocode}
+\def\bookmark@page{\BKM@@page}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\define@key{BKM}{view}{%
+ \BKM@CheckView{#1}%
+}
+% \end{macrocode}
+% \begin{macro}{\BKM@view}
+% \begin{macrocode}
+\let\BKM@view\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bookmark@view}
+% \begin{macrocode}
+\def\bookmark@view{\BKM@view}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{BKM@CheckView}
+% \begin{macrocode}
+\def\BKM@CheckView#1{%
+ \BKM@CheckViewType#1 \@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@CheckViewType}
+% \begin{macrocode}
+\def\BKM@CheckViewType#1 #2\@nil{%
+ \def\BKM@type{#1}%
+ \@onelevel@sanitize\BKM@type
+ \BKM@TestViewType{Fit}{}%
+ \BKM@TestViewType{FitB}{}%
+ \BKM@TestViewType{FitH}{%
+ \BKM@CheckParam#2 \@nil{top}%
+ }%
+ \BKM@TestViewType{FitBH}{%
+ \BKM@CheckParam#2 \@nil{top}%
+ }%
+ \BKM@TestViewType{FitV}{%
+ \BKM@CheckParam#2 \@nil{bottom}%
+ }%
+ \BKM@TestViewType{FitBV}{%
+ \BKM@CheckParam#2 \@nil{bottom}%
+ }%
+ \BKM@TestViewType{FitR}{%
+ \BKM@CheckRect{#2}{ }%
+ }%
+ \BKM@TestViewType{XYZ}{%
+ \BKM@CheckXYZ{#2}{ }%
+ }%
+ \@car{%
+ \PackageError{bookmark}{%
+ Unknown view type `\BKM@type',\MessageBreak
+ using `FitH' instead%
+ }\@ehc
+ \def\BKM@view{FitH}%
+ }%
+ \@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@TestViewType}
+% \begin{macrocode}
+\def\BKM@TestViewType#1{%
+ \def\BKM@temp{#1}%
+ \@onelevel@sanitize\BKM@temp
+ \ifx\BKM@type\BKM@temp
+ \let\BKM@view\BKM@temp
+ \expandafter\@car
+ \else
+ \expandafter\@gobble
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{BKM@CheckParam}
+% \begin{macrocode}
+\def\BKM@CheckParam#1 #2\@nil#3{%
+ \def\BKM@param{#1}%
+ \ifx\BKM@param\@empty
+ \PackageWarning{bookmark}{%
+ Missing parameter (#3) for `\BKM@type',\MessageBreak
+ using 0%
+ }%
+ \def\BKM@param{0}%
+ \else
+ \BKM@CalcParam
+ \fi
+ \edef\BKM@view{\BKM@view\space\BKM@param}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{BKM@CheckRect}
+% \begin{macrocode}
+\def\BKM@CheckRect#1#2{%
+ \BKM@@CheckRect#1#2#2#2#2\@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@@CheckRect}
+% \begin{macrocode}
+\def\BKM@@CheckRect#1 #2 #3 #4 #5\@nil{%
+ \def\BKM@temp{0}%
+ \def\BKM@param{#1}%
+ \ifx\BKM@param\@empty
+ \def\BKM@param{0}%
+ \def\BKM@temp{1}%
+ \else
+ \BKM@CalcParam
+ \fi
+ \edef\BKM@view{\BKM@view\space\BKM@param}%
+ \def\BKM@param{#2}%
+ \ifx\BKM@param\@empty
+ \def\BKM@param{0}%
+ \def\BKM@temp{1}%
+ \else
+ \BKM@CalcParam
+ \fi
+ \edef\BKM@view{\BKM@view\space\BKM@param}%
+ \def\BKM@param{#3}%
+ \ifx\BKM@param\@empty
+ \def\BKM@param{0}%
+ \def\BKM@temp{1}%
+ \else
+ \BKM@CalcParam
+ \fi
+ \edef\BKM@view{\BKM@view\space\BKM@param}%
+ \def\BKM@param{#4}%
+ \ifx\BKM@param\@empty
+ \def\BKM@param{0}%
+ \def\BKM@temp{1}%
+ \else
+ \BKM@CalcParam
+ \fi
+ \edef\BKM@view{\BKM@view\space\BKM@param}%
+ \ifnum\BKM@temp>\z@
+ \PackageWarning{bookmark}{Missing parameters for `\BKM@type'}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@CheckXYZ}
+% \begin{macrocode}
+\def\BKM@CheckXYZ#1#2{%
+ \BKM@@CheckXYZ#1#2#2#2\@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@@CheckXYZ}
+% \begin{macrocode}
+\def\BKM@@CheckXYZ#1 #2 #3 #4\@nil{%
+ \def\BKM@param{#1}%
+ \let\BKM@temp\BKM@param
+ \@onelevel@sanitize\BKM@temp
+ \ifx\BKM@param\@empty
+ \let\BKM@param\BKM@null
+ \else
+ \ifx\BKM@temp\BKM@null
+ \else
+ \BKM@CalcParam
+ \fi
+ \fi
+ \edef\BKM@view{\BKM@view\space\BKM@param}%
+ \def\BKM@param{#2}%
+ \let\BKM@temp\BKM@param
+ \@onelevel@sanitize\BKM@temp
+ \ifx\BKM@param\@empty
+ \let\BKM@param\BKM@null
+ \else
+ \ifx\BKM@temp\BKM@null
+ \else
+ \BKM@CalcParam
+ \fi
+ \fi
+ \edef\BKM@view{\BKM@view\space\BKM@param}%
+ \def\BKM@param{#3}%
+ \ifx\BKM@param\@empty
+ \let\BKM@param\BKM@null
+ \fi
+ \edef\BKM@view{\BKM@view\space\BKM@param}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@null}
+% \begin{macrocode}
+\def\BKM@null{null}
+\@onelevel@sanitize\BKM@null
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BKM@CalcParam}
+% \begin{macrocode}
+\def\BKM@CalcParam{%
+ \begingroup
+ \let\calc\@firstofone
+ \expandafter\BKM@@CalcParam\BKM@param\@empty\@empty\@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@@CalcParam}
+% \begin{macrocode}
+\def\BKM@@CalcParam#1#2#3\@nil{%
+ \ifx\calc#1%
+ \@ifundefined{calc@assign@dimen}{%
+ \@ifundefined{dimexpr}{%
+ \setlength{\dimen@}{#2}%
+ }{%
+ \setlength{\dimen@}{\dimexpr#2\relax}%
+ }%
+ }{%
+ \setlength{\dimen@}{#2}%
+ }%
+ \dimen@.99626\dimen@
+ \edef\BKM@param{\strip@pt\dimen@}%
+ \expandafter\endgroup
+ \expandafter\def\expandafter\BKM@param\expandafter{\BKM@param}%
+ \else
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Option \xoption{atend}}
+%
+% \begin{macrocode}
+\DeclareBoolOption{atend}
+\g@addto@macro\BKM@DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{atend}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Option \xoption{style}}
+%
+% \begin{macro}{\bookmarkdefinestyle}
+% \begin{macrocode}
+\newcommand*{\bookmarkdefinestyle}[2]{%
+ \@ifundefined{BKM@style@#1}{%
+ }{%
+ \PackageInfo{bookmark}{Redefining style `#1'}%
+ }%
+ \@namedef{BKM@style@#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\define@key{BKM}{style}{%
+ \BKM@StyleCall{#1}%
+}
+\newif\ifBKM@ok
+% \end{macrocode}
+% \begin{macro}{\BKM@StyleCall}
+% \begin{macrocode}
+\def\BKM@StyleCall#1{%
+ \@ifundefined{BKM@style@#1}{%
+ \PackageWarning{bookmark}{%
+ Ignoring unknown style `#1'%
+ }%
+ }{%
+% \end{macrocode}
+% Check style stack.
+% \begin{macrocode}
+ \BKM@oktrue
+ \edef\BKM@StyleCurrent{#1}%
+ \@onelevel@sanitize\BKM@StyleCurrent
+ \let\BKM@StyleEntry\BKM@StyleEntryCheck
+ \BKM@StyleStack
+ \ifBKM@ok
+ \expandafter\@firstofone
+ \else
+ \PackageError{bookmark}{%
+ Ignoring recursive call of style `\BKM@StyleCurrent'%
+ }\@ehc
+ \expandafter\@gobble
+ \fi
+ {%
+% \end{macrocode}
+% Push current style on stack.
+% \begin{macrocode}
+ \let\BKM@StyleEntry\relax
+ \edef\BKM@StyleStack{%
+ \BKM@StyleEntry{\BKM@StyleCurrent}%
+ \BKM@StyleStack
+ }%
+% \end{macrocode}
+% Call style.
+% \begin{macrocode}
+ \expandafter\expandafter\expandafter\bookmarksetup
+ \expandafter\expandafter\expandafter{%
+ \csname BKM@style@\BKM@StyleCurrent\endcsname
+ }%
+% \end{macrocode}
+% Pop current style from stack.
+% \begin{macrocode}
+ \BKM@StyleStackPop
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@StyleStackPop}
+% \begin{macrocode}
+\def\BKM@StyleStackPop{%
+ \let\BKM@StyleEntry\relax
+ \edef\BKM@StyleStack{%
+ \expandafter\@gobbletwo\BKM@StyleStack
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@StyleEntryCheck}
+% \begin{macrocode}
+\def\BKM@StyleEntryCheck#1{%
+ \def\BKM@temp{#1}%
+ \ifx\BKM@temp\BKM@StyleCurrent
+ \BKM@okfalse
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@StyleStack}
+% \begin{macrocode}
+\def\BKM@StyleStack{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Options for source file location}
+%
+% \begin{macrocode}
+\DeclareStringOption{srcline}
+\DeclareStringOption{srcfile}
+% \end{macrocode}
+%
+% \subsubsection{Hook support}
+%
+% \begin{macro}{\BKM@hook}
+% \begin{macrocode}
+\def\BKM@hook{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\define@key{BKM}{addtohook}{%
+ \ltx@LocalAppendToMacro\BKM@hook{#1}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{bookmarkget}
+% \begin{macrocode}
+\newcommand*{\bookmarkget}[1]{%
+ \romannumeral0%
+ \ltx@ifundefined{bookmark@#1}{%
+ \ltx@space
+ }{%
+ \expandafter\expandafter\expandafter\ltx@space
+ \csname bookmark@#1\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Driver setup and loading}
+%
+% \paragraph{Driver detection.}
+%
+% \begin{macro}{\BKM@DefineDriverKey}
+% \begin{macrocode}
+\def\BKM@DefineDriverKey#1{%
+ \define@key{BKM}{#1}[]{%
+ \def\BKM@driver{#1}%
+ }%
+ \g@addto@macro\BKM@DisableOptions{%
+ \DisableKeyvalOption[action=warning,package=bookmark]%
+ {BKM}{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\BKM@DefineDriverKey{pdftex}
+\BKM@DefineDriverKey{dvips}
+\BKM@DefineDriverKey{dvipsone}
+\BKM@DefineDriverKey{textures}
+\BKM@DefineDriverKey{dvipdfm}
+\BKM@DefineDriverKey{dvipdfmx}
+\BKM@DefineDriverKey{xetex}
+\BKM@DefineDriverKey{vtex}
+\define@key{BKM}{dvipdfmx-outline-open}[true]{%
+ \expandafter\ifx\csname if#1\expandafter\endcsname
+ \csname iftrue\endcsname
+ \chardef\SpecialDvipdfmxOutlineOpen\@ne
+ \else
+ \chardef\SpecialDvipdfmxOutlineOpen\z@
+ \fi
+}
+\g@addto@macro\BKM@DisableOptions{%
+ \DisableKeyvalOption{BKM}{dvipdfmx-outline-open}%
+}
+% \end{macrocode}
+% \begin{macro}{\bookmark@driver}
+% \begin{macrocode}
+\def\bookmark@driver{\BKM@driver}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\InputIfFileExists{bookmark.cfg}{}{}
+% \end{macrocode}
+% \begin{macro}{\BookmarkDriverDefault}
+% \begin{macrocode}
+\providecommand*{\BookmarkDriverDefault}{dvips}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@driver}
+% Lua\TeX\ and pdf\TeX\ share driver.
+% \begin{macrocode}
+\ifpdf
+ \def\BKM@driver{pdftex}%
+ \ifx\pdfoutline\@undefined
+ \ifx\pdfextension\@undefined\else
+ \protected\def\pdfoutline{\pdfextension outline }
+ \fi
+ \fi
+\else
+ \ifxetex
+ \def\BKM@driver{dvipdfm}%
+ \else
+ \ifvtex
+ \def\BKM@driver{vtex}%
+ \else
+ \edef\BKM@driver{\BookmarkDriverDefault}%
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Process options.}
+%
+% \begin{macrocode}
+\ProcessKeyvalOptions*
+\BKM@DisableOptions
+% \end{macrocode}
+%
+% \paragraph{Option \xoption{draft}}
+%
+% \begin{macrocode}
+\ifBKM@draft
+ \PackageWarningNoLine{bookmark}{Draft mode on}%
+ \let\bookmarksetup\ltx@gobble
+ \let\BookmarkAtEnd\ltx@gobble
+ \let\bookmarkdefinestyle\ltx@gobbletwo
+ \let\bookmarkget\ltx@gobble
+ \let\pdfbookmark\ltx@undefined
+ \newcommand*{\pdfbookmark}[3][]{}%
+ \let\currentpdfbookmark\ltx@gobbletwo
+ \let\subpdfbookmark\ltx@gobbletwo
+ \let\belowpdfbookmark\ltx@gobbletwo
+ \newcommand*{\bookmark}[2][]{}%
+ \renewcommand*{\Hy@writebookmark}[5]{}%
+ \let\ReadBookmarks\relax
+ \let\BKM@DefGotoNameAction\ltx@gobbletwo % package `hypdestopt'
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \paragraph{Driver validation and loading.}
+%
+% \begin{macrocode}
+\newif\ifBKM@DvipdfmxOutlineOpen
+\ltx@IfUndefined{SpecialDvipdfmxOutlineOpen}{%
+ \ifxetex
+ \ifdim\number\XeTeXversion\XeTeXrevision in<0.9995in %
+ \else
+ \chardef\SpecialDvipdfmxOutlineOpen\ltx@one
+ \BKM@DvipdfmxOutlineOpentrue
+ \fi
+ \fi
+}{%
+ \ifnum\SpecialDvipdfmxOutlineOpen>\z@
+ \BKM@DvipdfmxOutlineOpentrue
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\BKM@temp{dvipdfmx}%
+\ifx\BKM@temp\BKM@driver
+ \def\BKM@driver{dvipdfm}%
+\fi
+\def\BKM@temp{pdftex}%
+\ifpdf
+ \ifx\BKM@temp\BKM@driver
+ \else
+ \PackageWarningNoLine{bookmark}{%
+ Wrong driver `\BKM@driver', using `pdftex' instead%
+ }%
+ \let\BKM@driver\BKM@temp
+ \fi
+\else
+ \ifx\BKM@temp\BKM@driver
+ \PackageError{bookmark}{%
+ Wrong driver, pdfTeX is not running in PDF mode.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \expandafter\expandafter\expandafter\endinput
+ \fi
+ \def\BKM@temp{dvipdfm}%
+ \ifxetex
+ \ifx\BKM@temp\BKM@driver
+ \else
+ \PackageWarningNoLine{bookmark}{%
+ Wrong driver `\BKM@driver',\MessageBreak
+ using `dvipdfm' for XeTeX instead%
+ }%
+ \let\BKM@driver\BKM@temp
+ \fi
+ \else
+ \def\BKM@temp{vtex}%
+ \ifvtex
+ \ifx\BKM@temp\BKM@driver
+ \else
+ \PackageWarningNoLine{bookmark}{%
+ Wrong driver `\BKM@driver',\MessageBreak
+ using `vtex' for VTeX instead%
+ }%
+ \let\BKM@driver\BKM@temp
+ \fi
+ \else
+ \ifx\BKM@temp\BKM@driver
+ \PackageError{bookmark}{%
+ Wrong driver, VTeX is not running in PDF mode.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \expandafter\expandafter\expandafter\endinput
+ \fi
+ \fi
+ \fi
+\fi
+\InputIfFileExists{bkm-\BKM@driver.def}{}{%
+ \PackageError{bookmark}{%
+ Unsupported driver `\BKM@driver'.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \endinput
+}
+% \end{macrocode}
+%
+% \subsubsection{Compatibility for \xpackage{hyperref}}
+%
+% \begin{macro}{\pdfbookmark}
+% \begin{macrocode}
+\let\pdfbookmark\ltx@undefined
+\newcommand*{\pdfbookmark}[3][0]{%
+ \bookmark[level=#1,dest={#3.#1}]{#2}%
+ \hyper@anchorstart{#3.#1}\hyper@anchorend
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\currentpdfbookmark}
+% \begin{macrocode}
+\def\currentpdfbookmark{%
+ \pdfbookmark[\BKM@currentlevel]%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\subpdfbookmark}
+% \begin{macrocode}
+\def\subpdfbookmark{%
+ \BKM@CalcExpr\BKM@CalcResult\BKM@currentlevel+1%
+ \expandafter\pdfbookmark\expandafter[\BKM@CalcResult]%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\belowpdfbookmark}
+% \begin{macrocode}
+\def\belowpdfbookmark#1#2{%
+ \xdef\BKM@gtemp{\number\BKM@currentlevel}%
+ \subpdfbookmark{#1}{#2}%
+ \global\let\BKM@currentlevel\BKM@gtemp
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Section number, text, label, level, file
+% \begin{macro}{\Hy@writebookmark}
+% \begin{macrocode}
+\def\Hy@writebookmark#1#2#3#4#5{%
+ \ifnum#4>\BKM@depth\relax
+ \else
+ \def\BKM@type{#5}%
+ \ifx\BKM@type\Hy@bookmarkstype
+ \begingroup
+ \ifBKM@numbered
+ \let\numberline\Hy@numberline
+ \let\booknumberline\Hy@numberline
+ \let\partnumberline\Hy@numberline
+ \let\chapternumberline\Hy@numberline
+ \else
+ \let\numberline\@gobble
+ \let\booknumberline\@gobble
+ \let\partnumberline\@gobble
+ \let\chapternumberline\@gobble
+ \fi
+ \bookmark[level=#4,dest={#3}]{#2}%
+ \endgroup
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ReadBookmarks}
+% \begin{macrocode}
+\let\ReadBookmarks\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \subsection{Driver for dvipdfm}
+%
+% \begin{macrocode}
+%<*dvipdfm>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bkm-dvipdfm.def}%
+ [2019/06/04 v1.27 bookmark driver for dvipdfm (HO)]%
+% \end{macrocode}
+%
+% \begin{macro}{\BKM@id}
+% \begin{macrocode}
+\newcount\BKM@id
+\BKM@id=\z@
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BKM@0}
+% \begin{macrocode}
+\@namedef{BKM@0}{000}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifBKM@sw}
+% \begin{macrocode}
+\newif\ifBKM@sw
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bookmark}
+% \begin{macrocode}
+\newcommand*{\bookmark}[2][]{%
+ \if@filesw
+ \begingroup
+ \def\bookmark@text{#2}%
+ \BKM@setup{#1}%
+ \edef\BKM@prev{\the\BKM@id}%
+ \global\advance\BKM@id\@ne
+ \BKM@swtrue
+ \@whilesw\ifBKM@sw\fi{%
+ \def\BKM@abslevel{1}%
+ \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@
+ \BKM@startatrootfalse
+ \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{%
+ 0{\BKM@level}\BKM@abslevel
+ }%
+ \BKM@swfalse
+ \else
+ \expandafter\expandafter\expandafter\BKM@getx
+ \csname BKM@\BKM@prev\endcsname
+ \ifnum\BKM@level>\BKM@x@level\relax
+ \BKM@CalcExpr\BKM@abslevel\BKM@x@abslevel+1%
+ \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{%
+ {\BKM@prev}{\BKM@level}\BKM@abslevel
+ }%
+ \BKM@swfalse
+ \else
+ \let\BKM@prev\BKM@x@parent
+ \fi
+ \fi
+ }%
+ \csname HyPsd@XeTeXBigCharstrue\endcsname
+ \pdfstringdef\BKM@title{\bookmark@text}%
+ \edef\BKM@FLAGS{\BKM@PrintStyle}%
+ \let\BKM@action\@empty
+ \ifx\BKM@gotor\@empty
+ \ifx\BKM@dest\@empty
+ \ifx\BKM@named\@empty
+ \ifx\BKM@rawaction\@empty
+ \ifx\BKM@uri\@empty
+ \ifx\BKM@page\@empty
+ \PackageError{bookmark}{Missing action}\@ehc
+ \edef\BKM@action{/Dest[@page1/Fit]}%
+ \else
+ \ifx\BKM@view\@empty
+ \def\BKM@view{Fit}%
+ \fi
+ \edef\BKM@action{/Dest[@page\BKM@page/\BKM@view]}%
+ \fi
+ \else
+ \BKM@EscapeString\BKM@uri
+ \edef\BKM@action{%
+ /A<<%
+ /S/URI%
+ /URI(\BKM@uri)%
+ >>%
+ }%
+ \fi
+ \else
+ \edef\BKM@action{/A<<\BKM@rawaction>>}%
+ \fi
+ \else
+ \BKM@EscapeName\BKM@named
+ \edef\BKM@action{%
+ /A<</S/Named/N/\BKM@named>>%
+ }%
+ \fi
+ \else
+ \BKM@EscapeString\BKM@dest
+ \edef\BKM@action{%
+ /A<<%
+ /S/GoTo%
+ /D(\BKM@dest)%
+ >>%
+ }%
+ \fi
+ \else
+ \ifx\BKM@dest\@empty
+ \ifx\BKM@page\@empty
+ \def\BKM@page{0}%
+ \else
+ \BKM@CalcExpr\BKM@page\BKM@page-1%
+ \fi
+ \ifx\BKM@view\@empty
+ \def\BKM@view{Fit}%
+ \fi
+ \edef\BKM@action{/D[\BKM@page/\BKM@view]}%
+ \else
+ \BKM@EscapeString\BKM@dest
+ \edef\BKM@action{/D(\BKM@dest)}%
+ \fi
+ \BKM@EscapeString\BKM@gotor
+ \edef\BKM@action{%
+ /A<<%
+ /S/GoToR%
+ /F(\BKM@gotor)%
+ \BKM@action
+ >>%
+ }%
+ \fi
+ \special{pdf:%
+ out \ifBKM@DvipdfmxOutlineOpen
+ [%
+ \ifBKM@open
+ \ifnum\BKM@level<%
+ \expandafter\ltx@firstofone\expandafter
+ {\number\BKM@openlevel} %
+ \else
+ -%
+ \fi
+ \else
+ -%
+ \fi
+ ] %
+ \fi
+ \BKM@abslevel
+ <<%
+ /Title(\BKM@title)%
+ \ifx\BKM@color\@empty
+ \else
+ /C[\BKM@color]%
+ \fi
+ \ifnum\BKM@FLAGS>\z@
+ /F \BKM@FLAGS
+ \fi
+ \BKM@action
+ >>%
+ }%
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@getx}
+% \begin{macrocode}
+\def\BKM@getx#1#2#3{%
+ \def\BKM@x@parent{#1}%
+ \def\BKM@x@level{#2}%
+ \def\BKM@x@abslevel{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</dvipdfm>
+% \end{macrocode}
+%
+% \subsection{Driver for \hologo{VTeX}}
+%
+% \begin{macrocode}
+%<*vtex>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bkm-vtex.def}%
+ [2019/06/04 v1.27 bookmark driver for VTeX (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifvtexpdf
+\else
+ \PackageWarningNoLine{bookmark}{%
+ The VTeX driver only supports PDF mode%
+ }%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\BKM@id}
+% \begin{macrocode}
+\newcount\BKM@id
+\BKM@id=\z@
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BKM@0}
+% \begin{macrocode}
+\@namedef{BKM@0}{00}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifBKM@sw}
+% \begin{macrocode}
+\newif\ifBKM@sw
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bookmark}
+% \begin{macrocode}
+\newcommand*{\bookmark}[2][]{%
+ \if@filesw
+ \begingroup
+ \def\bookmark@text{#2}%
+ \BKM@setup{#1}%
+ \edef\BKM@prev{\the\BKM@id}%
+ \global\advance\BKM@id\@ne
+ \BKM@swtrue
+ \@whilesw\ifBKM@sw\fi{%
+ \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@
+ \BKM@startatrootfalse
+ \def\BKM@parent{0}%
+ \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{%
+ 0{\BKM@level}%
+ }%
+ \BKM@swfalse
+ \else
+ \expandafter\expandafter\expandafter\BKM@getx
+ \csname BKM@\BKM@prev\endcsname
+ \ifnum\BKM@level>\BKM@x@level\relax
+ \let\BKM@parent\BKM@prev
+ \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{%
+ {\BKM@prev}{\BKM@level}%
+ }%
+ \BKM@swfalse
+ \else
+ \let\BKM@prev\BKM@x@parent
+ \fi
+ \fi
+ }%
+ \pdfstringdef\BKM@title{\bookmark@text}%
+ \BKM@vtex@title
+ \edef\BKM@FLAGS{\BKM@PrintStyle}%
+ \let\BKM@action\@empty
+ \ifx\BKM@gotor\@empty
+ \ifx\BKM@dest\@empty
+ \ifx\BKM@named\@empty
+ \ifx\BKM@rawaction\@empty
+ \ifx\BKM@uri\@empty
+ \ifx\BKM@page\@empty
+ \PackageError{bookmark}{Missing action}\@ehc
+ \def\BKM@action{!1}%
+ \else
+ \edef\BKM@action{!\BKM@page}%
+ \fi
+ \else
+ \BKM@EscapeString\BKM@uri
+ \edef\BKM@action{%
+ <u=%
+ /S/URI%
+ /URI(\BKM@uri)%
+ >%
+ }%
+ \fi
+ \else
+ \edef\BKM@action{<u=\BKM@rawaction>}%
+ \fi
+ \else
+ \BKM@EscapeName\BKM@named
+ \edef\BKM@action{%
+ <u=%
+ /S/Named%
+ /N/\BKM@named
+ >%
+ }%
+ \fi
+ \else
+ \BKM@EscapeString\BKM@dest
+ \edef\BKM@action{\BKM@dest}%
+ \fi
+ \else
+ \ifx\BKM@dest\@empty
+ \ifx\BKM@page\@empty
+ \def\BKM@page{1}%
+ \fi
+ \ifx\BKM@view\@empty
+ \def\BKM@view{Fit}%
+ \fi
+ \edef\BKM@action{/D[\BKM@page/\BKM@view]}%
+ \else
+ \BKM@EscapeString\BKM@dest
+ \edef\BKM@action{/D(\BKM@dest)}%
+ \fi
+ \BKM@EscapeString\BKM@gotor
+ \edef\BKM@action{%
+ <u=%
+ /S/GoToR%
+ /F(\BKM@gotor)%
+ \BKM@action
+ >>%
+ }%
+ \fi
+ \ifx\BKM@color\@empty
+ \let\BKM@RGBcolor\@empty
+ \else
+ \expandafter\BKM@toRGB\BKM@color\@nil
+ \fi
+ \special{%
+ !outline \BKM@action;%
+ p=\BKM@parent,%
+ i=\number\BKM@id,%
+ s=%
+ \ifBKM@open
+ \ifnum\BKM@level<\BKM@openlevel
+ o%
+ \else
+ c%
+ \fi
+ \else
+ c%
+ \fi,%
+ \ifx\BKM@RGBcolor\@empty
+ \else
+ c=\BKM@RGBcolor,%
+ \fi
+ \ifnum\BKM@FLAGS>\z@
+ f=\BKM@FLAGS,%
+ \fi
+ t=\BKM@title
+ }%
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@getx}
+% \begin{macrocode}
+\def\BKM@getx#1#2{%
+ \def\BKM@x@parent{#1}%
+ \def\BKM@x@level{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@toRGB}
+% \begin{macrocode}
+\def\BKM@toRGB#1 #2 #3\@nil{%
+ \let\BKM@RGBcolor\@empty
+ \BKM@toRGBComponent{#1}%
+ \BKM@toRGBComponent{#2}%
+ \BKM@toRGBComponent{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@toRGBComponent}
+% \begin{macrocode}
+\def\BKM@toRGBComponent#1{%
+ \dimen@=#1pt\relax
+ \ifdim\dimen@>\z@
+ \ifdim\dimen@<\p@
+ \dimen@=255\dimen@
+ \advance\dimen@ by 32768sp\relax
+ \divide\dimen@ by 65536\relax
+ \dimen@ii=\dimen@
+ \divide\dimen@ii by 16\relax
+ \edef\BKM@RGBcolor{%
+ \BKM@RGBcolor
+ \BKM@toHexDigit\dimen@ii
+ }%
+ \dimen@ii=16\dimen@ii
+ \advance\dimen@-\dimen@ii
+ \edef\BKM@RGBcolor{%
+ \BKM@RGBcolor
+ \BKM@toHexDigit\dimen@
+ }%
+ \else
+ \edef\BKM@RGBcolor{\BKM@RGBcolor FF}%
+ \fi
+ \else
+ \edef\BKM@RGBcolor{\BKM@RGBcolor00}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@toHexDigit}
+% \begin{macrocode}
+\def\BKM@toHexDigit#1{%
+ \ifcase\expandafter\@firstofone\expandafter{\number#1} %
+ 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
+ 8\or 9\or A\or B\or C\or D\or E\or F%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\begingroup
+ \catcode`\|=0 %
+ \catcode`\\=12 %
+% \end{macrocode}
+% \begin{macro}{\BKM@vtex@title}
+% \begin{macrocode}
+ |gdef|BKM@vtex@title{%
+ |@onelevel@sanitize|BKM@title
+ |edef|BKM@title{|expandafter|BKM@vtex@leftparen|BKM@title\(|@nil}%
+ |edef|BKM@title{|expandafter|BKM@vtex@rightparen|BKM@title\)|@nil}%
+ |edef|BKM@title{|expandafter|BKM@vtex@zero|BKM@title\0|@nil}%
+ |edef|BKM@title{|expandafter|BKM@vtex@one|BKM@title\1|@nil}%
+ |edef|BKM@title{|expandafter|BKM@vtex@two|BKM@title\2|@nil}%
+ |edef|BKM@title{|expandafter|BKM@vtex@three|BKM@title\3|@nil}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@vtex@leftparen}
+% \begin{macrocode}
+ |gdef|BKM@vtex@leftparen#1\(#2|@nil{%
+ #1%
+ |ifx||#2||%
+ |else
+ (%
+ |ltx@ReturnAfterFi{%
+ |BKM@vtex@leftparen#2|@nil
+ }%
+ |fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@vtex@rightparen}
+% \begin{macrocode}
+ |gdef|BKM@vtex@rightparen#1\)#2|@nil{%
+ #1%
+ |ifx||#2||%
+ |else
+ )%
+ |ltx@ReturnAfterFi{%
+ |BKM@vtex@rightparen#2|@nil
+ }%
+ |fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@vtex@zero}
+% \begin{macrocode}
+ |gdef|BKM@vtex@zero#1\0#2|@nil{%
+ #1%
+ |ifx||#2||%
+ |else
+ |noexpand|hv@pdf@char0%
+ |ltx@ReturnAfterFi{%
+ |BKM@vtex@zero#2|@nil
+ }%
+ |fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@vtex@one}
+% \begin{macrocode}
+ |gdef|BKM@vtex@one#1\1#2|@nil{%
+ #1%
+ |ifx||#2||%
+ |else
+ |noexpand|hv@pdf@char1%
+ |ltx@ReturnAfterFi{%
+ |BKM@vtex@one#2|@nil
+ }%
+ |fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@vtex@two}
+% \begin{macrocode}
+ |gdef|BKM@vtex@two#1\2#2|@nil{%
+ #1%
+ |ifx||#2||%
+ |else
+ |noexpand|hv@pdf@char2%
+ |ltx@ReturnAfterFi{%
+ |BKM@vtex@two#2|@nil
+ }%
+ |fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@vtex@three}
+% \begin{macrocode}
+ |gdef|BKM@vtex@three#1\3#2|@nil{%
+ #1%
+ |ifx||#2||%
+ |else
+ |noexpand|hv@pdf@char3%
+ |ltx@ReturnAfterFi{%
+ |BKM@vtex@three#2|@nil
+ }%
+ |fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+|endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</vtex>
+% \end{macrocode}
+%
+% \subsection{Driver for \hologo{pdfTeX}}
+%
+% \begin{macrocode}
+%<*pdftex>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bkm-pdftex.def}%
+ [2019/06/04 v1.27 bookmark driver for pdfTeX (HO)]%
+% \end{macrocode}
+%
+% \begin{macro}{\BKM@DO@entry}
+% \begin{macrocode}
+\def\BKM@DO@entry#1#2{%
+ \begingroup
+ \kvsetkeys{BKM@DO}{#1}%
+ \def\BKM@DO@title{#2}%
+ \ifx\BKM@DO@srcfile\@empty
+ \else
+ \BKM@UnescapeHex\BKM@DO@srcfile
+ \fi
+ \BKM@UnescapeHex\BKM@DO@title
+ \expandafter\expandafter\expandafter\BKM@getx
+ \csname BKM@\BKM@DO@id\endcsname\@empty\@empty
+ \let\BKM@attr\@empty
+ \ifx\BKM@DO@flags\@empty
+ \else
+ \edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}%
+ \fi
+ \ifx\BKM@DO@color\@empty
+ \else
+ \edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}%
+ \fi
+ \ifx\BKM@attr\@empty
+ \else
+ \edef\BKM@attr{attr{\BKM@attr}}%
+ \fi
+ \let\BKM@action\@empty
+ \ifx\BKM@DO@gotor\@empty
+ \ifx\BKM@DO@dest\@empty
+ \ifx\BKM@DO@named\@empty
+ \ifx\BKM@DO@rawaction\@empty
+ \ifx\BKM@DO@uri\@empty
+ \ifx\BKM@DO@page\@empty
+ \PackageError{bookmark}{%
+ Missing action\BKM@SourceLocation
+ }\@ehc
+ \edef\BKM@action{goto page1{/Fit}}%
+ \else
+ \ifx\BKM@DO@view\@empty
+ \def\BKM@DO@view{Fit}%
+ \fi
+ \edef\BKM@action{goto page\BKM@DO@page{/\BKM@DO@view}}%
+ \fi
+ \else
+ \BKM@UnescapeHex\BKM@DO@uri
+ \BKM@EscapeString\BKM@DO@uri
+ \edef\BKM@action{user{<</S/URI/URI(\BKM@DO@uri)>>}}%
+ \fi
+ \else
+ \BKM@UnescapeHex\BKM@DO@rawaction
+ \edef\BKM@action{%
+ user{%
+ <<%
+ \BKM@DO@rawaction
+ >>%
+ }%
+ }%
+ \fi
+ \else
+ \BKM@EscapeName\BKM@DO@named
+ \edef\BKM@action{%
+ user{<</S/Named/N/\BKM@DO@named>>}%
+ }%
+ \fi
+ \else
+ \BKM@UnescapeHex\BKM@DO@dest
+ \BKM@DefGotoNameAction\BKM@action\BKM@DO@dest
+ \fi
+ \else
+ \ifx\BKM@DO@dest\@empty
+ \ifx\BKM@DO@page\@empty
+ \def\BKM@DO@page{0}%
+ \else
+ \BKM@CalcExpr\BKM@DO@page\BKM@DO@page-1%
+ \fi
+ \ifx\BKM@DO@view\@empty
+ \def\BKM@DO@view{Fit}%
+ \fi
+ \edef\BKM@action{/D[\BKM@DO@page/\BKM@DO@view]}%
+ \else
+ \BKM@UnescapeHex\BKM@DO@dest
+ \BKM@EscapeString\BKM@DO@dest
+ \edef\BKM@action{/D(\BKM@DO@dest)}%
+ \fi
+ \BKM@UnescapeHex\BKM@DO@gotor
+ \BKM@EscapeString\BKM@DO@gotor
+ \edef\BKM@action{%
+ user{%
+ <<%
+ /S/GoToR%
+ /F(\BKM@DO@gotor)%
+ \BKM@action
+ >>%
+ }%
+ }%
+ \fi
+ \pdfoutline\BKM@attr\BKM@action
+ count\ifBKM@DO@open\else-\fi\BKM@x@childs
+ {\BKM@DO@title}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@DefGotoNameAction}
+% Macro \cs{BKM@DefGotoNameAction} is a hook for
+% package \xpackage{hypdestopt}.
+% \begin{macrocode}
+\def\BKM@DefGotoNameAction#1#2{%
+ \BKM@EscapeString\BKM@DO@dest
+ \edef#1{goto name{#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</pdftex>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*pdftex|pdfmark>
+% \end{macrocode}
+% \begin{macro}{\BKM@SourceLocation}
+% \begin{macrocode}
+\def\BKM@SourceLocation{%
+ \ifx\BKM@DO@srcfile\@empty
+ \ifx\BKM@DO@srcline\@empty
+ \else
+ .\MessageBreak
+ Source: line \BKM@DO@srcline
+ \fi
+ \else
+ \ifx\BKM@DO@srcline\@empty
+ .\MessageBreak
+ Source: file `\BKM@DO@srcfile'%
+ \else
+ .\MessageBreak
+ Source: file `\BKM@DO@srcfile', line \BKM@DO@srcline
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</pdftex|pdfmark>
+% \end{macrocode}
+%
+% \subsection{Drivers with pdfmark specials}
+%
+% \subsubsection{Driver dvips}
+%
+% \begin{macrocode}
+%<*dvips>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bkm-dvips.def}%
+ [2019/06/04 v1.27 bookmark driver for dvips (HO)]%
+% \end{macrocode}
+% \begin{macro}{\BKM@PSHeaderFile}
+% \begin{macrocode}
+\def\BKM@PSHeaderFile#1{%
+ \special{header=#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</dvips>
+% \end{macrocode}
+%
+% \subsubsection{Driver dvipsone}
+%
+% \begin{macrocode}
+%<*dvipsone>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bkm-dvipsone.def}%
+ [2019/06/04 v1.27 bookmark driver for dvipsone (HO)]%
+% \end{macrocode}
+% \begin{macro}{\BKM@PSHeaderFile}
+% \begin{macrocode}
+\def\BKM@PSHeaderFile#1{%
+ \special{header=#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</dvipsone>
+% \end{macrocode}
+%
+% \subsubsection{Driver textures}
+%
+% \begin{macrocode}
+%<*textures>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bkm-textures.def}%
+ [2019/06/04 v1.27 bookmark driver for textures (HO)]%
+% \end{macrocode}
+% \begin{macro}{\BKM@PSHeaderFile}
+% \begin{macrocode}
+\def\BKM@PSHeaderFile#1{%
+ \special{prePostScriptfile #1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</textures>
+% \end{macrocode}
+%
+% \subsubsection{Common part}
+%
+% \begin{macrocode}
+%<*pdfmark>
+% \end{macrocode}
+% \begin{macro}{\BKM@filename}
+% \begin{macrocode}
+\def\BKM@filename{\jobname.out.ps}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\BKM@PSHeaderFile\BKM@filename
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{atveryend}[2009/12/07]
+\AfterLastShipout{\BKM@pdfmark@out}
+% \end{macrocode}
+%
+% \begin{macro}{\BKM@pdfmark@out}
+% Do not use package \xpackage{rerunfilecheck} here, because
+% the file \cs{BKM@filename} is not read during the \hologo{TeX} run.
+% \begin{macrocode}
+\def\BKM@pdfmark@out{%
+ \if@filesw
+ \newwrite\BKM@file
+ \immediate\openout\BKM@file=\BKM@filename\relax
+ \BKM@write{\@percentchar!}%
+ \BKM@write{/pdfmark where{pop}}%
+ \BKM@write{%
+ {%
+ /globaldict where{pop globaldict}{userdict}ifelse%
+ /pdfmark/cleartomark load put%
+ }%
+ }%
+ \BKM@write{ifelse}%
+ \else
+ \let\BKM@write\@gobble
+ \let\BKM@DO@entry\@gobbletwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@write}
+% \begin{macrocode}
+\def\BKM@write#{%
+ \immediate\write\BKM@file
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BKM@DO@entry}
+% The specification for pdfmark says that |/Color| is the
+% name of the key for color, however ghostscript only passes
+% the key into the PDF file, thus the key name must be |/C|.
+% \begin{macrocode}
+\def\BKM@DO@entry#1#2{%
+ \begingroup
+ \kvsetkeys{BKM@DO}{#1}%
+ \ifx\BKM@DO@srcfile\@empty
+ \else
+ \BKM@UnescapeHex\BKM@DO@srcfile
+ \fi
+ \def\BKM@DO@title{#2}%
+ \BKM@UnescapeHex\BKM@DO@title
+ \expandafter\expandafter\expandafter\BKM@getx
+ \csname BKM@\BKM@DO@id\endcsname\@empty\@empty
+ \let\BKM@attr\@empty
+ \ifx\BKM@DO@flags\@empty
+ \else
+ \edef\BKM@attr{\BKM@attr/F \BKM@DO@flags}%
+ \fi
+ \ifx\BKM@DO@color\@empty
+ \else
+ \edef\BKM@attr{\BKM@attr/C[\BKM@DO@color]}%
+ \fi
+ \let\BKM@action\@empty
+ \ifx\BKM@DO@gotor\@empty
+ \ifx\BKM@DO@dest\@empty
+ \ifx\BKM@DO@named\@empty
+ \ifx\BKM@DO@rawaction\@empty
+ \ifx\BKM@DO@uri\@empty
+ \ifx\BKM@DO@page\@empty
+ \PackageError{bookmark}{%
+ Missing action\BKM@SourceLocation
+ }\@ehc
+ \edef\BKM@action{%
+ /Action/GoTo%
+ /Page 1%
+ /View[/Fit]%
+ }%
+ \else
+ \ifx\BKM@DO@view\@empty
+ \def\BKM@DO@view{Fit}%
+ \fi
+ \edef\BKM@action{%
+ /Action/GoTo%
+ /Page \BKM@DO@page
+ /View[/\BKM@DO@view]%
+ }%
+ \fi
+ \else
+ \BKM@UnescapeHex\BKM@DO@uri
+ \BKM@EscapeString\BKM@DO@uri
+ \edef\BKM@action{%
+ /Action<<%
+ /Subtype/URI%
+ /URI(\BKM@DO@uri)%
+ >>%
+ }%
+ \fi
+ \else
+ \BKM@UnescapeHex\BKM@DO@rawaction
+ \edef\BKM@action{%
+ /Action<<%
+ \BKM@DO@rawaction
+ >>%
+ }%
+ \fi
+ \else
+ \BKM@EscapeName\BKM@DO@named
+ \edef\BKM@action{%
+ /Action<<%
+ /Subtype/Named%
+ /N/\BKM@DO@named
+ >>%
+ }%
+ \fi
+ \else
+ \BKM@UnescapeHex\BKM@DO@dest
+ \BKM@EscapeString\BKM@DO@dest
+ \edef\BKM@action{%
+ /Action/GoTo%
+ /Dest(\BKM@DO@dest)cvn%
+ }%
+ \fi
+ \else
+ \ifx\BKM@DO@dest\@empty
+ \ifx\BKM@DO@page\@empty
+ \def\BKM@DO@page{1}%
+ \fi
+ \ifx\BKM@DO@view\@empty
+ \def\BKM@DO@view{Fit}%
+ \fi
+ \edef\BKM@action{%
+ /Page \BKM@DO@page
+ /View[/\BKM@DO@view]%
+ }%
+ \else
+ \BKM@UnescapeHex\BKM@DO@dest
+ \BKM@EscapeString\BKM@DO@dest
+ \edef\BKM@action{%
+ /Dest(\BKM@DO@dest)cvn%
+ }%
+ \fi
+ \BKM@UnescapeHex\BKM@DO@gotor
+ \BKM@EscapeString\BKM@DO@gotor
+ \edef\BKM@action{%
+ /Action/GoToR%
+ /File(\BKM@DO@gotor)%
+ \BKM@action
+ }%
+ \fi
+ \BKM@write{[}%
+ \BKM@write{/Title(\BKM@DO@title)}%
+ \ifnum\BKM@x@childs>\z@
+ \BKM@write{/Count \ifBKM@DO@open\else-\fi\BKM@x@childs}%
+ \fi
+ \ifx\BKM@attr\@empty
+ \else
+ \BKM@write{\BKM@attr}%
+ \fi
+ \BKM@write{\BKM@action}%
+ \BKM@write{/OUT pdfmark}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</pdfmark>
+% \end{macrocode}
+%
+% \subsection{Common part for \xoption{pdftex} and \xoption{pdfmark}}
+%
+% \begin{macrocode}
+%<*pdftex|pdfmark>
+% \end{macrocode}
+%
+% \subsubsection{Write auxiliary file}
+%
+% \begin{macrocode}
+\RequirePackage{auxhook}
+% \end{macrocode}
+% \begin{macrocode}
+\AddLineBeginMainAux{%
+ \string\providecommand\string\BKM@entry[2]{}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\BKM@id}
+% \begin{macrocode}
+\newcount\BKM@id
+\BKM@id=\z@
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BKM@0}
+% \begin{macrocode}
+\@namedef{BKM@0}{000}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifBKM@sw}
+% \begin{macrocode}
+\newif\ifBKM@sw
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bookmark}
+% \begin{macrocode}
+\newcommand*{\bookmark}[2][]{%
+ \if@filesw
+ \begingroup
+ \BKM@InitSourceLocation
+ \def\bookmark@text{#2}%
+ \BKM@setup{#1}%
+ \ifx\BKM@srcfile\@empty
+ \else
+ \BKM@EscapeHex\BKM@srcfile
+ \fi
+ \edef\BKM@prev{\the\BKM@id}%
+ \global\advance\BKM@id\@ne
+ \BKM@swtrue
+ \@whilesw\ifBKM@sw\fi{%
+ \ifnum\ifBKM@startatroot\z@\else\BKM@prev\fi=\z@
+ \BKM@startatrootfalse
+ \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{%
+ 0{\BKM@level}0%
+ }%
+ \BKM@swfalse
+ \else
+ \expandafter\expandafter\expandafter\BKM@getx
+ \csname BKM@\BKM@prev\endcsname
+ \ifnum\BKM@level>\BKM@x@level\relax
+ \expandafter\xdef\csname BKM@\the\BKM@id\endcsname{%
+ {\BKM@prev}{\BKM@level}0%
+ }%
+ \ifnum\BKM@prev>\z@
+ \BKM@CalcExpr\BKM@CalcResult\BKM@x@childs+1%
+ \expandafter\xdef\csname BKM@\BKM@prev\endcsname{%
+ {\BKM@x@parent}{\BKM@x@level}{\BKM@CalcResult}%
+ }%
+ \fi
+ \BKM@swfalse
+ \else
+ \let\BKM@prev\BKM@x@parent
+ \fi
+ \fi
+ }%
+ \pdfstringdef\BKM@title{\bookmark@text}%
+ \edef\BKM@FLAGS{\BKM@PrintStyle}%
+ \csname BKM@HypDestOptHook\endcsname
+ \BKM@EscapeHex\BKM@dest
+ \BKM@EscapeHex\BKM@uri
+ \BKM@EscapeHex\BKM@gotor
+ \BKM@EscapeHex\BKM@rawaction
+ \BKM@EscapeHex\BKM@title
+ \immediate\write\@mainaux{%
+ \string\BKM@entry{%
+ id=\number\BKM@id
+ \ifBKM@open
+ \ifnum\BKM@level<\BKM@openlevel
+ ,open%
+ \fi
+ \fi
+ \BKM@auxentry{dest}%
+ \BKM@auxentry{named}%
+ \BKM@auxentry{uri}%
+ \BKM@auxentry{gotor}%
+ \BKM@auxentry{page}%
+ \BKM@auxentry{view}%
+ \BKM@auxentry{rawaction}%
+ \BKM@auxentry{color}%
+ \ifnum\BKM@FLAGS>\z@
+ ,flags=\BKM@FLAGS
+ \fi
+ \BKM@auxentry{srcline}%
+ \BKM@auxentry{srcfile}%
+ }{\BKM@title}%
+ }%
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@getx}
+% \begin{macrocode}
+\def\BKM@getx#1#2#3{%
+ \def\BKM@x@parent{#1}%
+ \def\BKM@x@level{#2}%
+ \def\BKM@x@childs{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@auxentry}
+% \begin{macrocode}
+\def\BKM@auxentry#1{%
+ \expandafter\ifx\csname BKM@#1\endcsname\@empty
+ \else
+ ,#1={\csname BKM@#1\endcsname}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BKM@InitSourceLocation}
+% \begin{macrocode}
+\def\BKM@InitSourceLocation{%
+ \edef\BKM@srcline{\the\inputlineno}%
+ \BKM@LuaTeX@InitFile
+ \ifx\BKM@srcfile\@empty
+ \ltx@IfUndefined{currfilepath}{}{%
+ \edef\BKM@srcfile{\currfilepath}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BKM@LuaTeX@InitFile}
+% \begin{macrocode}
+\ifluatex
+ \ifnum\luatexversion>36 %
+ \def\BKM@LuaTeX@InitFile{%
+ \begingroup
+ \ltx@LocToksA={}%
+ \edef\x{\endgroup
+ \def\noexpand\BKM@srcfile{%
+ \the\expandafter\ltx@LocToksA
+ \directlua{%
+ if status and status.filename then %
+ tex.settoks('ltx@LocToksA', status.filename)%
+ end%
+ }%
+ }%
+ }\x
+ }%
+ \else
+ \let\BKM@LuaTeX@InitFile\relax
+ \fi
+\else
+ \let\BKM@LuaTeX@InitFile\relax
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Read auxiliary data}
+%
+% \begin{macrocode}
+\SetupKeyvalOptions{family=BKM@DO,prefix=BKM@DO@}
+\DeclareStringOption[0]{id}
+\DeclareBoolOption{open}
+\DeclareStringOption{flags}
+\DeclareStringOption{color}
+\DeclareStringOption{dest}
+\DeclareStringOption{named}
+\DeclareStringOption{uri}
+\DeclareStringOption{gotor}
+\DeclareStringOption{page}
+\DeclareStringOption{view}
+\DeclareStringOption{rawaction}
+\DeclareStringOption{srcline}
+\DeclareStringOption{srcfile}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \let\BKM@entry\BKM@DO@entry
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pdftex|pdfmark>
+% \end{macrocode}
+%
+% \subsection{Option \xoption{atend}}
+%
+% \subsubsection{Hook}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% \begin{macrocode}
+\ifBKM@atend
+\else
+% \end{macrocode}
+% \begin{macro}{\BookmarkAtEnd}
+% This is a dummy definition that generates a warning
+% if option \xoption{atend} has not been given.
+% \begin{macrocode}
+ \newcommand{\BookmarkAtEnd}[1]{%
+ \PackageWarning{bookmark}{%
+ Ignored, because option `atend' is missing%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% \begin{macro}{\BookmarkAtEnd}
+% \begin{macrocode}
+\newcommand*{\BookmarkAtEnd}{%
+ \g@addto@macro\BKM@EndHook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\let\BKM@EndHook\@empty
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \subsubsection{Drivers using hooks at end of document}
+%
+% The following drivers use package \xpackage{atveryend}'s
+% \cs{AfterLastShipout}, because they still need the
+% \xext{aux} file.
+% \begin{itemize}
+% \item
+% Driver \xoption{pdftex} uses \cs{pdfoutline} that can
+% be used after the last page.
+% \item
+% PostScript drivers such as
+% \xoption{dvips} use an external PostScript header file
+% for the bookmarks. File writing can be done after
+% the last shipout page, but before the \xext{aux} file is closed.
+% \end{itemize}
+% \begin{macrocode}
+%<*pdftex|pdfmark>
+\ifBKM@atend
+ \AfterLastShipout{%
+ \BKM@EndHook
+ }%
+\fi
+%</pdftex|pdfmark>
+% \end{macrocode}
+%
+% \subsubsection{Drivers using \cs{AtEndDvi}}
+%
+% The other drivers implement \cs{bookmark} using \cs{special}
+% commands. Thus the last bookmarks must be put on the last page,
+% not afterwards.
+% \cs{AtEndDocument} cannot be used, because it is too late, the
+% last page can already be output. Therefore we use package
+% \xpackage{atenddvi} that uses the help of packages \xpackage{atbegshi}
+% and \xpackage{zref}. The argument of \cs{AtEndDvi} is put
+% at the end of the last page. At least two \hologo{LaTeX} runs are necessary.
+% \begin{macrocode}
+%<*dvipdfm|vtex>
+\ifBKM@atend
+ \RequirePackage{atenddvi}%
+ \AtEndDvi{\BKM@EndHook}%
+\fi
+%</dvipdfm|vtex>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/bookmark}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/bookmark.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/bookmark.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[\CTAN{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 bookmark.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@{}}
+% bookmark.sty & tex/latex/oberdiek/bookmark.sty\\
+% bkm-dvipdfm.def & tex/latex/oberdiek/bkm-dvipdfm.def\\
+% bkm-dvips.def & tex/latex/oberdiek/bkm-dvips.def\\
+% bkm-dvipsone.def & tex/latex/oberdiek/bkm-dvipsone.def\\
+% bkm-textures.def & tex/latex/oberdiek/bkm-textures.def\\
+% bkm-pdftex.def & tex/latex/oberdiek/bkm-pdftex.def\\
+% bkm-vtex.def & tex/latex/oberdiek/bkm-vtex.def\\
+% bookmark.pdf & doc/latex/oberdiek/bookmark.pdf\\
+% bookmark-example.tex & doc/latex/oberdiek/bookmark-example.tex\\
+% bookmark.dtx & source/latex/oberdiek/bookmark.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk bookmark.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{bookmark.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 bookmark.dtx
+%makeindex -s gind.ist bookmark.idx
+%pdflatex bookmark.dtx
+%makeindex -s gind.ist bookmark.idx
+%pdflatex bookmark.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{bookmark.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='bookmark'>
+ <name>bookmark</name>
+ <caption>A new bookmark (outline) organization for hyperref.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.26'/>
+ <description>
+ This package implements a new bookmark (outline) organization for
+ package <xref refid='hyperref'>hyperref</xref>. Bookmark properties such
+ as style and color can now be set. Other action types
+ are available (URI, GoToR, Named). The bookmarks are
+ generated in the first compile run. Package
+ <xref refid='hyperref'>hyperref</xref> uses two runs.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/bookmark.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/bookmark.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz, Heiko Oberdiek:
+% \textit{The \xpackage{hyperref} package};
+% 2011/04/17 v6.82g;
+% \CTAN{macros/latex/contrib/hyperref/}
+%
+% \bibitem{currfile}
+% Martin Scharrer:
+% \textit{The \xpackage{currfile} package};
+% 2011/01/09 v0.4.
+% \CTAN{macros/latex/contrib/currfile/}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/02/19 v0.1}
+% \item
+% First experimental version.
+% \end{Version}
+% \begin{Version}{2007/02/20 v0.2}
+% \item
+% Option \xoption{startatroot} added.
+% \item
+% Dummies for \cs{pdf(un)escape...} commands added to get
+% the package basically work for non-\hologo{pdfTeX} users.
+% \end{Version}
+% \begin{Version}{2007/02/21 v0.3}
+% \item
+% Dependency from \hologo{pdfTeX} 1.30 removed by using package
+% \xpackage{pdfescape}.
+% \end{Version}
+% \begin{Version}{2007/02/22 v0.4}
+% \item
+% \xpackage{hyperref}'s \xoption{bookmarkstype} respected.
+% \end{Version}
+% \begin{Version}{2007/03/02 v0.5}
+% \item
+% Driver options \xoption{vtex} (PDF mode), \xoption{dvipsone},
+% and \xoption{textures} added.
+% \item
+% Implementation of option \xoption{depth} completed. Division names
+% are supported, see \xpackage{hyperref}'s
+% option \xoption{bookmarksdepth}.
+% \item
+% \xpackage{hyperref}'s options \xoption{bookmarksopen},
+% \xoption{bookmarksopenlevel}, and \xoption{bookmarksdepth} respected.
+% \end{Version}
+% \begin{Version}{2007/03/03 v0.6}
+% \item
+% Option \xoption{numbered} as alias for \xpackage{hyperref}'s
+% \xoption{bookmarksnumbered}.
+% \end{Version}
+% \begin{Version}{2007/03/07 v0.7}
+% \item
+% Dependency from \hologo{eTeX} removed.
+% \end{Version}
+% \begin{Version}{2007/04/09 v0.8}
+% \item
+% Option \xoption{atend} added.
+% \item
+% Option \xoption{rgbcolor} removed.
+% \verb|rgbcolor=<r> <g> <b>| can be replaced by
+% \verb|color=[rgb]{<r>,<g>,<b>}|.
+% \item
+% Support of recent cvs version (2007-03-29) of dvipdfmx
+% that extends the \cs{special} for bookmarks to specify
+% open outline entries. Option \xoption{dvipdfmx-outline-open}
+% or \cs{SpecialDvipdfmxOutlineOpen} notify the package.
+% \end{Version}
+% \begin{Version}{2007/04/25 v0.9}
+% \item
+% The syntax of \cs{special} of dvipdfmx, if feature
+% \xoption{dvipdfmx-outline-open} is enabled, has changed.
+% Now cvs version 2007-04-25 is needed.
+% \end{Version}
+% \begin{Version}{2007/05/29 v1.0}
+% \item
+% Bug fix in code for second parameter of XYZ.
+% \end{Version}
+% \begin{Version}{2007/07/13 v1.1}
+% \item
+% Fix for pdfmark with GoToR action.
+% \end{Version}
+% \begin{Version}{2007/09/25 v1.2}
+% \item
+% pdfmark driver respects \cs{nofiles}.
+% \end{Version}
+% \begin{Version}{2008/08/08 v1.3}
+% \item
+% Package \xpackage{flags} replaced by package \xpackage{bitset}.
+% Now flags are also supported without \hologo{eTeX}.
+% \item
+% Hook for package \xpackage{hypdestopt} added.
+% \end{Version}
+% \begin{Version}{2008/09/13 v1.4}
+% \item
+% Fix for bug introduced in v1.3, package \xpackage{flags} is one-based,
+% but package \xpackage{bitset} is zero-based. Thus options \xoption{bold}
+% and \xoption{italic} are wrong in v1.3. (Daniel M\"ullner)
+% \end{Version}
+% \begin{Version}{2009/08/13 v1.5}
+% \item
+% Except for driver options the other options are now local options.
+% This resolves a problem with KOMA-Script v3.00 and its option \xoption{open}.
+% \end{Version}
+% \begin{Version}{2009/12/06 v1.6}
+% \item
+% Use of package \xpackage{atveryend} for drivers \xoption{pdftex}
+% and \xoption{pdfmark}.
+% \end{Version}
+% \begin{Version}{2009/12/07 v1.7}
+% \item
+% Use of package \xpackage{atveryend} fixed.
+% \end{Version}
+% \begin{Version}{2009/12/17 v1.8}
+% \item
+% Support of \xpackage{hyperref} 2009/12/17 v6.79v for \hologo{XeTeX}.
+% \end{Version}
+% \begin{Version}{2010/03/30 v1.9}
+% \item
+% Package name in an error message fixed.
+% \end{Version}
+% \begin{Version}{2010/04/03 v1.10}
+% \item
+% Option \xoption{style} and macro \cs{bookmarkdefinestyle} added.
+% \item
+% Hook support with option \xoption{addtohook} added.
+% \item
+% \cs{bookmarkget} added.
+% \end{Version}
+% \begin{Version}{2010/04/04 v1.11}
+% \item
+% Bug fix (introduced in v1.10).
+% \end{Version}
+% \begin{Version}{2010/04/08 v1.12}
+% \item
+% Requires \xpackage{ltxcmds} 2010/04/08.
+% \end{Version}
+% \begin{Version}{2010/07/23 v1.13}
+% \item
+% Support for \xclass{memoir}'s \cs{booknumberline} added.
+% \end{Version}
+% \begin{Version}{2010/09/02 v1.14}
+% \item
+% (Local) options \xoption{draft} and \xoption{final} added.
+% \end{Version}
+% \begin{Version}{2010/09/25 v1.15}
+% \item
+% Fix for option \xoption{dvipdfmx-outline-open}.
+% \item
+% Option \xoption{dvipdfmx-outline-open} is set automatically,
+% if XeTeX $\geq$ 0.9995 is detected.
+% \end{Version}
+% \begin{Version}{2010/10/19 v1.16}
+% \item
+% Option `startatroot' now acts globally.
+% \item
+% Option `level' also accepts names the same way as option `depth'.
+% \end{Version}
+% \begin{Version}{2010/10/25 v1.17}
+% \item
+% \cs{bookmarksetupnext} added.
+% \item
+% Using \cs{kvsetkeys} of package \xpackage{kvsetkeys}, because
+% \cs{setkeys} of package \xpackage{keyval} is not reentrant.
+% This can cause problems (unknown keys) with older versions of
+% hyperref that also uses \cs{setkeys} (found by GL).
+% \end{Version}
+% \begin{Version}{2010/11/05 v1.18}
+% \item
+% Use of \cs{pdf@ifdraftmode} of package \xpackage{pdftexcmds} for
+% the default of option \xoption{draft}.
+% \end{Version}
+% \begin{Version}{2011/03/20 v1.19}
+% \item
+% Use of \cs{dimexpr} fixed, if \hologo{eTeX} is not used.
+% (Bug found by Martin M\"unch.)
+% \item
+% Fix in documentation. Also layout options work without \hologo{eTeX}.
+% \end{Version}
+% \begin{Version}{2011/04/13 v1.20}
+% \item
+% Bug fix: \cs{BKM@SetDepth} renamed to \cs{BKM@SetDepthOrLevel}.
+% \end{Version}
+% \begin{Version}{2011/04/21 v1.21}
+% \item
+% Some support for file name and line number in error messages
+% at end of document (pdfTeX and pdfmark based drivers).
+% \end{Version}
+% \begin{Version}{2011/05/13 v1.22}
+% \item
+% Change of version 2010/11/05 v1.18 reverted, because otherwise
+% draftmode disables some \xext{aux} file entries.
+% \end{Version}
+% \begin{Version}{2011/09/19 v1.23}
+% \item
+% Some \cs{renewcommand}s changed to \cs{def} to avoid trouble
+% if the commands are not defined, because hyperref stopped early.
+% \end{Version}
+% \begin{Version}{2011/12/02 v1.24}
+% \item
+% Small optimization in \cs{BKM@toHexDigit}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.25}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/05/17 v1.26}
+% \item
+% define \cs{pdfbookmark} to allow pdftex driver to be used with Lua\TeX.
+% \end{Version}
+% \begin{Version}{2019/06/04 v1.27}
+% \item
+% unknown style options are ignored (issue 67)
+% \end{Version}
+
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/bookmark.pdf b/macros/latex/contrib/oberdiek/bookmark.pdf
new file mode 100644
index 0000000000..96582a6439
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/bookmark.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/catchfile.dtx b/macros/latex/contrib/oberdiek/catchfile.dtx
new file mode 100644
index 0000000000..5ab4124acb
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/catchfile.dtx
@@ -0,0 +1,1155 @@
+% \iffalse meta-comment
+%
+% File: catchfile.dtx
+% Version: 2016/05/16 v1.7
+% Info: Catch the contents of a file
+%
+% Copyright (C) 2007, 2010, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 catchfile.dtx
+% and the derived files
+% catchfile.sty, catchfile.pdf, catchfile.ins, catchfile.drv,
+% catchfile-test1.tex, catchfile-test2.tex,
+% catchfile-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/catchfile.dtx
+% CTAN:macros/latex/contrib/oberdiek/catchfile.pdf
+%
+% Unpacking:
+% (a) If catchfile.ins is present:
+% tex catchfile.ins
+% (b) Without catchfile.ins:
+% tex catchfile.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{catchfile.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If catchfile.drv is present:
+% latex catchfile.drv
+% (b) Without catchfile.drv:
+% latex catchfile.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 catchfile.dtx
+% makeindex -s gind.ist catchfile.idx
+% pdflatex catchfile.dtx
+% makeindex -s gind.ist catchfile.idx
+% pdflatex catchfile.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/catchfile.sty
+% TDS:doc/latex/oberdiek/catchfile.pdf
+% TDS:doc/latex/oberdiek/test/catchfile-test1.tex
+% TDS:doc/latex/oberdiek/test/catchfile-test2.tex
+% TDS:doc/latex/oberdiek/test/catchfile-test3.tex
+% TDS:source/latex/oberdiek/catchfile.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: catchfile 2016/05/16 v1.7 Catch the contents of a file (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: catchfile
+Version: 2016/05/16 v1.7
+
+Copyright (C) 2007, 2010, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 catchfile.dtx
+and the derived files
+ catchfile.sty, catchfile.pdf, catchfile.ins, catchfile.drv,
+ catchfile-test1.tex, catchfile-test2.tex,
+ catchfile-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{catchfile.ins}{\from{catchfile.dtx}{install}}%
+ \file{catchfile.drv}{\from{catchfile.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{catchfile.sty}{\from{catchfile.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{catchfile-test1.tex}{\from{catchfile.dtx}{test1}}%
+% \file{catchfile-test2.tex}{\from{catchfile.dtx}{test2}}%
+% \file{catchfile-test3.tex}{\from{catchfile.dtx}{test3}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{catchfile.xml}{\from{catchfile.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{* catchfile.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `catchfile.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{catchfile.drv}%
+ [2016/05/16 v1.7 Catch the contents of a file (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{catchfile.dtx}%
+\end{document}
+%</driver>
+% \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{catchfile.drv}
+%
+% \title{The \xpackage{catchfile} package}
+% \date{2016/05/16 v1.7}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package catches the contents of a file and puts it in a macro.
+% It requires \eTeX. Both \LaTeX\ and \plainTeX\ are supported.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% The package relies on \eTeX's \cs{everyeof}. Otherwise it
+% aborts with an error message.
+%
+% \begin{declcs}{CatchFileDef} \M{cmd} \M{file name} \M{setup}\\
+% \cs{CatchFileEdef} \M{cmd} \M{file name} \M{setup}
+% \end{declcs}
+% Macro \meta{cmd} is defined with the contents
+% of file \meta{file name}.
+% \cs{CatchFileDef} uses \cs{def}, \cs{CatchFileEdef} \cs{edef}
+% for the definition.
+% Additional setup code for setting
+% catcodes or treatment of line ends can be given in code
+% \meta{setup}. See the test files for an example.
+%
+% \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@catchfile.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{catchfile}{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@catchfile.sty\endcsname
+\ProvidesPackage{catchfile}%
+ [2016/05/16 v1.7 Catch the contents of a file (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 CatchFile@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\CatchFile@AtEnd{%
+ \CatchFile@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\CatchFile@AtEnd{\CatchFile@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Preparations}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+ \input ltxcmds.sty\relax
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{ltxcmds}[2010/03/09]%
+\fi
+% \end{macrocode}
+%
+% Check for \eTeX's \cs{everyeof}.
+% \begin{macrocode}
+\begingroup
+ \escapechar=92\relax
+ \edef\TestString{\string\everyeof}%
+ \edef\TestMeaning{\meaning\everyeof}%
+ \ifx\TestString\TestMeaning
+ \else
+ \@PackageError{catchfile}{%
+ Cannot find e-TeX's \string\everyeof,\MessageBreak
+ package loading is aborted%
+ }\@ehd
+ \endgroup
+ \expandafter\CatchFile@AtEnd
+ \fi%
+\endgroup
+% \end{macrocode}
+%
+% \subsection{Looking for primitive \cs{input}}
+%
+% \begin{macro}{\CatchFile@Input}
+% The package needs the expandable primitive \cs{input}.
+% However there are formats that redefine it. For example,
+% \LaTeX's \cs{input} is not expandable, but it stores
+% the primitive in \cs{@@input}. The third possibility
+% is \cs{pdfprimitive}, introduced in \pdfTeX\ 1.40.0.
+%
+% Thus we try to find the primitive and store it in
+% \cs{CatchFile@Input}. If it is used, it must be expanded
+% twice (because of the solution with \cs{pdfprimitive}).
+% \begin{macrocode}
+\begingroup
+ \def\Check#1#2#3#4\endgroup{%
+ \edef\TestString{\string#1}%
+ \edef\TestMeaning{\meaning#2}%
+ \ifx\TestString\TestMeaning
+ \endgroup
+ \let\CatchFile@Primitive#2%
+ \def\CatchFile@Input{\CatchFile@Primitive#3}%
+ \else
+ #4\endgroup
+ \fi
+ }%
+ \Check\input\input{}%
+ \Check\input\@@input{}%
+ \Check\pdfprimitive\pdfprimitive\input
+ \@PackageError{%
+ Cannot find primitive \string\input,\MessageBreak
+ package loading is aborted%
+ }\@ehd
+ \csname endgroup\endcsname
+ \CatchFile@AtEnd%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Input file check}
+%
+% \begin{macro}{\CatchFile@CheckFileExists}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname IfFileExists\endcsname\relax
+ \input pdftexcmds.sty\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdf@filesize\endcsname\relax
+ \def\CatchFile@CheckFileExists#1{%
+ \expandafter\ifx\csname @inputcheck\endcsname\relax
+ \csname newread\endcsname\@inputcheck
+ \fi
+ \openin\@inputcheck#1\relax
+ \expandafter\closein\expandafter\@inputcheck
+ \ifeof\@inputcheck
+ \let\CatchFile@File\relax
+ \else
+ \def\CatchFile@File{#1}%
+ \fi
+ }%
+ \else
+ \def\CatchFile@CheckFileExists#1{%
+ \expandafter\expandafter\expandafter\ifx
+ \expandafter\expandafter\expandafter\relax\pdf@filesize{#1}\relax
+ \let\CatchFile@File\relax
+ \else
+ \def\CatchFile@File{#1}%
+ \fi
+ }%
+ \fi
+\else
+ \def\CatchFile@CheckFileExists#1{%
+ \IfFileExists{#1}{%
+ \expandafter\CatchFile@DefFile\@filef@und\@nil
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname @addtofilelist\endcsname\relax
+ \else
+ \@addtofilelist\CatchFile@File
+ \fi
+ }{%
+ \let\CatchFile@File\relax
+ }%
+ }%
+ \def\CatchFile@DefFile#1 \@nil{%
+ \def\CatchFile@File{#1}%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CatchFile@NotFound}
+% \begin{macrocode}
+\def\CatchFile@NotFound#1#2{%
+ \def#1{}%
+ \@PackageError{catchfile}{%
+ File `#2' not found%
+ }\@ehc
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Catch file contents}
+%
+% \begin{macrocode}
+\ltx@IfUndefined{RequirePackage}{%
+ \input etexcmds.sty\relax
+}{%
+ \RequirePackage{etexcmds}[2010/01/28]%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\CatchFileEdef}
+% \begin{macrocode}
+\long\def\CatchFileEdef#1#2#3{%
+ \CatchFile@CheckFileExists{#2}%
+ \ifx\CatchFile@File\relax
+ \CatchFile@NotFound{#1}{#2}%
+ \else
+ \begingroup
+ \everyeof{\noexpand}%
+ #3%
+ \xdef\CatchFile@Contents{\CatchFile@Input\CatchFile@File\space}%
+ \endgroup
+ \let#1\CatchFile@Contents
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CatchFileDef}
+% \begin{macrocode}
+\long\def\CatchFileDef#1#2#3{%
+ \CatchFile@CheckFileExists{#2}%
+ \ifx\CatchFile@File\relax
+ \CatchFile@NotFound{#1}{#2}%
+ \else
+ \begingroup
+ \everyeof\expandafter{%
+ \CatchFile@EOF
+ \expandafter\CatchFile@Finish
+ \noexpand
+ }%
+ \ltx@ifundefined{etex@unexpanded}{%
+ \expandafter\long\expandafter\def\expandafter\CatchFile@Do
+ \expandafter##\expandafter1\CatchFile@EOF{%
+ \toks\ltx@zero{##1}%
+ \xdef\CatchFile@gtemp{\the\toks\ltx@zero}%
+ \def\CatchFile@Finish{%
+ \endgroup
+ \let#1\CatchFile@gtemp
+ \global\let\CatchFile@gtemp\ltx@undefined
+ }%
+ }%
+ }{%
+ \expandafter\long\expandafter\def\expandafter\CatchFile@Do
+ \expandafter##\expandafter1\CatchFile@EOF{%
+ \edef\CatchFile@Finish{%
+ \endgroup
+ \etex@unexpanded{%
+ \edef#1{\etex@unexpanded{##1}}%
+ }%
+ }%
+ }%
+ }%
+ #3\relax
+ \expandafter\expandafter\expandafter\CatchFile@Do
+ \CatchFile@Input\CatchFile@File\relax
+ \fi
+}
+% \end{macrocode}
+% \cs{relax} after |#3| was added to make it more robust in
+% case the user uses something like
+%\begin{verbatim}
+%\CatchFileDef{\content}{\jobname.tt}{\endlinechar=-1}
+%\end{verbatim}
+% that expands the following \cs{expandafter} after |#3| prematurely
+% (contribution of Martin Scharrer).
+% \end{macro}
+% \begin{macro}{\CatchFile@EOF}
+% If the file is read the catcode mappings are fixed.
+% This means that the same character cannot occur
+% inside the file with different catcodes.
+% Thus we use as end of file marker the at sign
+% twice with different catcodes.
+% \begin{macrocode}
+\begingroup
+ \lccode65=64 % lowercase('A') = '@'
+ \lccode66=64 % lowercase('B') = '@'
+ \catcode65=8 % catcode('A') = subscript
+ \catcode66=3 % catcode('B') = math shift
+\lowercase{\endgroup
+ \def\CatchFile@EOF{AB}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\CatchFile@AtEnd%
+%</package>
+% \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 catchfile.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{\LaTeX}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\listfiles
+\tracingnesting=2 %
+\documentclass{minimal}
+\usepackage{catchfile}[2016/05/16]
+\makeatletter
+\def\mysetup{%
+ \let\do\@makeother
+ \dospecials
+}
+\def\CheckContents{%
+ \begingroup
+ \expandafter\ifx\csname contents\endcsname\relax
+ \PackageError{TEST}{\string\contents\space is not defined}\@ehc
+ \fi
+ \endgroup
+}
+\def\StartDisableUnexpanded{%
+ \begingroup
+ \let\etex@unexpanded\@undefined
+}
+\def\StopDisableUnexpanded{%
+ \endgroup
+}
+\def\CheckCleanup{%
+ \begingroup
+ \edef\x{\the\toks0}%
+ \def\y{ABC}%
+ \ifx\x\y
+ \else
+ \PackageError{TEST}{\string\toks0 has changed}\@ehc
+ \fi
+ \ifx\CatchFile@gtemp\@undefined
+ \else
+ \PackageError{TEST}{Left over \string\CatchFile@gtemp}\@ehc
+ \fi
+ \endgroup
+}
+\def\Check{%
+ \CheckContents
+ \CheckCleanup
+}
+\makeatother
+\begin{document}
+\toks0{ABC}
+
+\CatchFileDef\contents{catchfile.sty}\mysetup
+\typeout{\meaning\contents}
+\Check
+\typeout{***********************************************************}%
+\CatchFileDef\contents{catchfile.sty}{}
+\typeout{\meaning\contents}
+\Check
+\typeout{***********************************************************}%
+
+\StartDisableUnexpanded
+\CatchFileDef\contents{catchfile.sty}\mysetup
+\typeout{\meaning\contents}
+\Check
+\typeout{***********************************************************}%
+\CatchFileDef\contents{catchfile.sty}{}
+\typeout{\meaning\contents}
+\Check
+\typeout{***********************************************************}%
+\StopDisableUnexpanded
+
+\CatchFileEdef\contents{catchfile.sty}{%
+ \mysetup
+ \def\par{^^J}%
+ \obeylines
+}
+\typeout{\contents}
+\Check
+\typeout{***********************************************************}%
+\CatchFileEdef\contents{catchfile.sty}{%
+ \catcode`\\=12 %
+ \catcode`\#=12 %
+ \def\par{^^J}%
+ \obeylines
+}
+\typeout{\contents}
+\Check
+\typeout{***********************************************************}%
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \subsection{\plainTeX}
+%
+% \begin{macrocode}
+%<*test3>
+\def\msg#{\immediate\write16}
+\newlinechar=10 %
+\tracingnesting=2 %
+\input catchfile.sty\relax
+
+\def\mysetup{%
+ \def\do##1{%
+ \catcode`##1=12\relax
+ }%
+ \dospecials
+}
+\def\CheckContents{%
+ \begingroup
+ \expandafter\ifx\csname contents\endcsname\relax
+ \def\space{ }%
+ \errmessage{\string\contents\space is not defined.}%
+ \fi
+ \endgroup
+}
+\catcode`\@=11 %
+\def\CheckCleanup{%
+ \begingroup
+ \edef\x{\the\toks0}%
+ \def\y{ABC}%
+ \ifx\x\y
+ \else
+ \errmessage{\string\toks0 has changed}%
+ \fi
+ \ifx\CatchFile@gtemp\@undefined
+ \else
+ \errmessage{Left over \string\CatchFile@gtemp}%
+ \fi
+ \endgroup
+}
+\def\Check{%
+ \CheckContents
+ \CheckCleanup
+}
+\def\StartDisableUnexpanded{%
+ \begingroup
+ \let\etex@unexpanded\@undefined
+}
+\def\StopDisableUnexpanded{%
+ \endgroup
+}
+\catcode`\@=12 %
+
+\toks0{ABC}
+
+\CatchFileDef\contents{catchfile.sty}\mysetup
+\msg{\meaning\contents}
+\Check
+\msg{***********************************************************}%
+\CatchFileDef\contents{catchfile.sty}{}
+\msg{\meaning\contents}
+\Check
+\msg{***********************************************************}%
+
+\StartDisableUnexpanded
+\CatchFileDef\contents{catchfile.sty}\mysetup
+\msg{\meaning\contents}
+\Check
+\msg{***********************************************************}%
+\CatchFileDef\contents{catchfile.sty}{}
+\msg{\meaning\contents}
+\Check
+\msg{***********************************************************}%
+\StopDisableUnexpanded
+
+\CatchFileEdef\contents{catchfile.sty}{%
+ \mysetup
+ \def\par{^^J}%
+ \obeylines
+}
+\msg{\contents}
+\Check
+\msg{***********************************************************}%
+\CatchFileEdef\contents{catchfile.sty}{%
+ \catcode`\\=12 %
+ \catcode`\#=12 %
+ \def\par{^^J}%
+ \obeylines
+}
+\msg{\contents}
+\Check
+\msg{***********************************************************}%
+
+\csname @@end\endcsname
+\end
+%</test3>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/catchfile}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/catchfile.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/catchfile.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[\CTAN{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 catchfile.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@{}}
+% catchfile.sty & tex/generic/oberdiek/catchfile.sty\\
+% catchfile.pdf & doc/latex/oberdiek/catchfile.pdf\\
+% test/catchfile-test1.tex & doc/latex/oberdiek/test/catchfile-test1.tex\\
+% test/catchfile-test2.tex & doc/latex/oberdiek/test/catchfile-test2.tex\\
+% test/catchfile-test3.tex & doc/latex/oberdiek/test/catchfile-test3.tex\\
+% catchfile.dtx & source/latex/oberdiek/catchfile.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk catchfile.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{catchfile.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 catchfile.dtx
+%makeindex -s gind.ist catchfile.idx
+%pdflatex catchfile.dtx
+%makeindex -s gind.ist catchfile.idx
+%pdflatex catchfile.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{catchfile.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='catchfile'>
+ <name>catchfile</name>
+ <caption>Catch an external file into a macro.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2010,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.7'/>
+ <description>
+ This package catches the contents of a file and puts it in a macro.
+ It requires <xref refid='etex'>e-TeX</xref>. Both
+ <xref refid='latex'>LaTeX</xref> and
+ <xref refid='plain'>plain TeX</xref> are supported.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/catchfile.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/catchfile.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/05/30 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.1}
+% \item
+% Catcode section rewritten.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.2}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.3}
+% \item
+% Fix for unknown \cs{@PackageErrorNoLine}.
+% \end{Version}
+% \begin{Version}{2010/04/08 v1.4}
+% \item
+% \cs{closein} also added if \cs{ifeof} is true.
+% \end{Version}
+% \begin{Version}{2010/04/28 v1.5}
+% \item
+% \cs{CatchFileDef}: Getting rid of warning `end of semi simple group
+% entered at line \dots\ of
+% a different file (Florent Chervet).
+% \item
+% \cs{CatchFileDef}: Fix for error `Illegal parameter number in
+% definition of \dots' (HO) including improvement that uses
+% \cs{unexpanded} if available (Florent Chervet).
+% \end{Version}
+% \begin{Version}{2011/03/01 v1.6}
+% \item
+% \cs{relax} added after the setup argument of
+% \cs{CatchFileDef} to prevent premature file reading
+% (Martin Scharrer).
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.7}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/catchfile.pdf b/macros/latex/contrib/oberdiek/catchfile.pdf
new file mode 100644
index 0000000000..0c3aa86546
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/catchfile.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/centernot.dtx b/macros/latex/contrib/oberdiek/centernot.dtx
new file mode 100644
index 0000000000..833ec9e034
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/centernot.dtx
@@ -0,0 +1,571 @@
+% \iffalse meta-comment
+%
+% File: centernot.dtx
+% Version: 2016/05/16 v1.4
+% Info: Centers the not symbol horizontally
+%
+% Copyright (C) 2006, 2007, 2010, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file centernot.dtx
+% and the derived files
+% centernot.sty, centernot.pdf, centernot.ins, centernot.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/centernot.dtx
+% CTAN:macros/latex/contrib/oberdiek/centernot.pdf
+%
+% Unpacking:
+% (a) If centernot.ins is present:
+% tex centernot.ins
+% (b) Without centernot.ins:
+% tex centernot.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{centernot.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If centernot.drv is present:
+% latex centernot.drv
+% (b) Without centernot.drv:
+% latex centernot.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 centernot.dtx
+% makeindex -s gind.ist centernot.idx
+% pdflatex centernot.dtx
+% makeindex -s gind.ist centernot.idx
+% pdflatex centernot.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/centernot.sty
+% TDS:doc/latex/oberdiek/centernot.pdf
+% TDS:source/latex/oberdiek/centernot.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: centernot 2016/05/16 v1.4 Centers the not symbol horizontally (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: centernot
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2006, 2007, 2010, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file centernot.dtx
+and the derived files
+ centernot.sty, centernot.pdf, centernot.ins, centernot.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{centernot.ins}{\from{centernot.dtx}{install}}%
+ \file{centernot.drv}{\from{centernot.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{centernot.sty}{\from{centernot.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{centernot.xml}{\from{centernot.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{* centernot.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `centernot.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{centernot.drv}%
+ [2016/05/16 v1.4 Centers the not symbol horizontally (HO)]%
+\documentclass{ltxdoc}
+\makeatletter
+%\@namedef{ver@fontspec.sty}{}
+\@namedef{ver@unicode-math.sty}{}
+\def\setmathfont#1{}
+\makeatother
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{centernot}[2016/05/16]
+\usepackage{amssymb}
+\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
+\DeclareFontShape{U}{matha}{m}{n}{%
+ <5> <6> <7> <8> <9> <10> gen * matha %
+ <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12 %
+}{}
+\DeclareSymbolFont{matha}{U}{matha}{m}{n}
+\DeclareMathSymbol{\notdivides}{3}{matha}{"1F}
+\DeclareMathSymbol{\notrightarrow}{3}{matha}{"DB}
+\begin{document}
+ \DocInput{centernot.dtx}%
+\end{document}
+%</driver>
+% \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{centernot.drv}
+%
+% \title{The \xpackage{centernot} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides \cs{centernot} that prints the symbol
+% \cs{not} on the following argument. Unlike \cs{not} the symbol
+% is horizontally centered.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% If a negated relational symbol is not available, \cs{not}
+% can be used to create the negated variant of the relational
+% symbol. The disadvantage of \cs{not} is that it is put at
+% a fixed location regardless of the width of the relational
+% symbol. Therefore \cs{centernot} takes an argument and
+% measures its width to achieve a better placement of the
+% symbol \cs{not}.
+% Examples:
+% \begin{quote}
+% \begin{tabular}{@{}cccl@{}}
+% symbol & \cs{not} & \cs{centernot} &\\
+% \hline
+% |=| & $\not=$ & $\centernot=$ & \textit{(definition)}\\
+% \cs{parallel} & $\not\parallel$ & $\centernot\parallel$\\
+% \cs{longrightarrow} &
+% $\not\longrightarrow$ & $\centernot\longrightarrow$
+% \end{tabular}
+% \end{quote}
+% But do not forget that most negated symbols are already
+% available, e.g.:
+% \begin{quote}
+% \begin{tabular}{@{}lllc@{}}
+% case & package & code & result\\
+% \hline
+% \cs{parallel}:
+% &\xpackage{centernot} & |$A \centernot\parallel B$|
+% & $A \centernot\parallel B$\\
+% &\xpackage{amssymb} & |$A \nparallel B$|
+% & $A\nparallel B$\\
+% \hline
+% \cs{mid}:
+% &\xpackage{centernot} & |$A \centernot\mid B$|
+% & $A \centernot\mid B$\\
+% &\xpackage{amssymb} & |$A \nmid B$|
+% & $A \nmid B$\\
+% &\xpackage{mathabx} & |$A \notdivides B$|
+% & $A \notdivides B$\\
+% \hline
+% \cs{rightarrow}:
+% &\xpackage{centernot} & |$A \centernot\rightarrow B$|
+% & $A \centernot\rightarrow B$\\
+% &\xpackage{amssymb} & |$A \nrightarrow B$|
+% & $A \nrightarrow B$\\
+% &\xpackage{mathabx} & |$A \nrightarrow B$|
+% & $A \notrightarrow B$\\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{centernot}
+ [2016/05/16 v1.4 Centers the not symbol horizontally (HO)]%
+% \end{macrocode}
+%
+% \noindent
+% \cs{not} is a \cs{mathrel} atom with zero width. It prints itself
+% outside its character box, similar to \cs{rlap}. The next
+% \cs{mathrel} symbol is then print on top of it. \TeX\ does not
+% add space between two \cs{mathrel} atoms. The following implementation
+% assumes that the math font is designed in such a way that the
+% position of \cs{not} fits well on the equal symbol.
+%
+% The blue boxes marks the character bounding boxes seen by \TeX:
+% \begin{quote}
+% \setlength{\fboxrule}{.8pt}
+% \setlength{\fboxsep}{.8pt}
+% \def\xbox#1{^^A
+% \begingroup
+% \large
+% \color{blue}%
+% \fbox{\color{black}\boldmath$#1$}^^A
+% \kern-2\fboxsep
+% \kern-2\fboxrule
+% \endgroup
+% }
+% \begin{tabular}{@{}c@{\qquad}c@{\qquad}c@{}}
+% |\not| & |=| & |\not=|\\
+% \xbox{\not} & \xbox{=} & \xbox{\not}\xbox{=}
+% \end{tabular}
+% \end{quote}
+% \begin{macro}{\centernot}
+% \cs{centernot} is not a symbol but a macro that takes
+% one argument. It measures the width of the argument
+% and places \cs{not} horizontally centered on that argument.
+% The result is a \cs{mathrel} atom.
+% \begin{macrocode}
+\newcommand*{\centernot}{%
+ \mathpalette\@centernot
+}
+\def\@centernot#1#2{%
+ \mathrel{%
+ \rlap{%
+ \settowidth\dimen@{$\m@th#1{#2}$}%
+ \kern.5\dimen@
+ \settowidth\dimen@{$\m@th#1=$}%
+ \kern-.5\dimen@
+ $\m@th#1\not$%
+ }%
+ {#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/centernot}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/centernot.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/centernot.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[\CTAN{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 centernot.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@{}}
+% centernot.sty & tex/latex/oberdiek/centernot.sty\\
+% centernot.pdf & doc/latex/oberdiek/centernot.pdf\\
+% centernot.dtx & source/latex/oberdiek/centernot.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk centernot.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{centernot.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 centernot.dtx
+%makeindex -s gind.ist centernot.idx
+%pdflatex centernot.dtx
+%makeindex -s gind.ist centernot.idx
+%pdflatex centernot.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{centernot.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='centernot'>
+ <name>centernot</name>
+ <caption>Centred \not command.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006,2007,2010,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ The package provides <tt>\centernot</tt> that prints the symbol
+ <tt>\not</tt> on the following argument. Unlike the default
+ <tt>\not</tt> command, the symbol is horizontally centered.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/centernot.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/centernot.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2006/12/02 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/05/31 v1.1}
+% \item
+% Real symbols added in documentation part.
+% \end{Version}
+% \begin{Version}{2010/03/29 v1.2}
+% \item
+% Documentation fix: `negotiated' to `negated' (Hartmut Henkel).
+% \end{Version}
+% \begin{Version}{2011/07/11 v1.3}
+% \item
+% Superfluous \cs{makeatother} removed (Martin M\"unch).
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/centernot.pdf b/macros/latex/contrib/oberdiek/centernot.pdf
new file mode 100644
index 0000000000..41893f970b
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/centernot.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/chemarr.dtx b/macros/latex/contrib/oberdiek/chemarr.dtx
new file mode 100644
index 0000000000..e6528a10a4
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/chemarr.dtx
@@ -0,0 +1,569 @@
+% \iffalse meta-comment
+%
+% File: chemarr.dtx
+% Version: 2016/05/16 v1.3
+% Info: Arrows for chemical reactions
+%
+% Copyright (C) 2001, 2006 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file chemarr.dtx
+% and the derived files
+% chemarr.sty, chemarr.pdf, chemarr.ins, chemarr.drv,
+% chemarr-example.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/chemarr.dtx
+% CTAN:macros/latex/contrib/oberdiek/chemarr.pdf
+%
+% Unpacking:
+% (a) If chemarr.ins is present:
+% tex chemarr.ins
+% (b) Without chemarr.ins:
+% tex chemarr.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{chemarr.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If chemarr.drv is present:
+% latex chemarr.drv
+% (b) Without chemarr.drv:
+% latex chemarr.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 chemarr.dtx
+% makeindex -s gind.ist chemarr.idx
+% pdflatex chemarr.dtx
+% makeindex -s gind.ist chemarr.idx
+% pdflatex chemarr.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/chemarr.sty
+% TDS:doc/latex/oberdiek/chemarr.pdf
+% TDS:doc/latex/oberdiek/chemarr-example.tex
+% TDS:source/latex/oberdiek/chemarr.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: chemarr 2016/05/16 v1.3 Arrows for chemical reactions (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: chemarr
+Version: 2016/05/16 v1.3
+
+Copyright (C) 2001, 2006 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file chemarr.dtx
+and the derived files
+ chemarr.sty, chemarr.pdf, chemarr.ins, chemarr.drv,
+ chemarr-example.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{chemarr.ins}{\from{chemarr.dtx}{install}}%
+ \file{chemarr.drv}{\from{chemarr.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{chemarr.sty}{\from{chemarr.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{chemarr-example.tex}{\from{chemarr.dtx}{example}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{chemarr.xml}{\from{chemarr.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{* chemarr.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `chemarr.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{chemarr.drv}%
+ [2016/05/16 v1.3 Arrows for chemical reactions (HO)]%
+\documentclass{ltxdoc}
+\usepackage{chemarr}[2016/05/16]
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{chemarr.dtx}%
+\end{document}
+%</driver>
+% \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{chemarr.drv}
+%
+% \title{The \xpackage{chemarr} package}
+% \date{2016/05/16 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Very often chemists need a longer version
+% of reaction arrows (\cs{rightleftharpoons}) with
+% the possibility to put text above and below.
+% Analogous to \xpackage{amsmath}'s \cs{xrightarrow} and
+% \cs{xleftarrow} this package provides the macro
+% \cs{xrightleftharpoons}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \DescribeMacro{\xrightleftharpoons}
+% This \LaTeX\ package defines \cs{xrightleftharpoons}. It prints
+% extensible arrows (harpoons), usually used in chemical reactions.
+% It allows to put some text above and below the harpoons and can
+% be used inside and outside of math mode.
+%
+% The package is based on \xpackage{amsmath}, thus it loads it,
+% if necessary.
+%
+% \subsection{Example}
+%
+% \begin{macrocode}
+%<*example>
+\documentclass{article}
+\usepackage{chemarr}
+\begin{document}
+\begin{center}
+ left
+ \xrightleftharpoons[\text{below}]{\text{above}}
+ right
+\end{center}
+\[
+ A
+ \xrightleftharpoons[T \geq 400\,\mathrm{K}]{p > 10\,\mathrm{hPa}}
+ B
+\]
+\end{document}
+%</example>
+% \end{macrocode}
+% The result:
+% \begin{center}
+% left
+% \xrightleftharpoons[\text{below}]{\text{above}}
+% right
+% \end{center}
+% \[
+% A
+% \xrightleftharpoons[T \geq 400\,\mathrm{K}]{p > 10\,\mathrm{hPa}}
+% B
+% \]
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{chemarr}%
+ [2016/05/16 v1.3 Arrows for chemical reactions (HO)]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{amsmath}
+% \end{macrocode}
+% The package \xpackage{amsmath} is needed for the following commands:
+% \begin{quote}
+% \cs{ext@arrow}, \cs{@ifnotempty}, \cs{arrowfill@}\\
+% \cs{relbar}, \cs{std@minus}\\
+% \cs{@ifempty}, \cs{@xifempty}, \cs{@xp}
+% \end{quote}
+%
+% \begin{macro}{\xrightleftharpoons}
+% In \xfile{fontmath.ltx} \cs{rightleftharpoons} is defined with
+% a vertical space of 2pt.
+% \begin{macrocode}
+\newcommand{\xrightleftharpoons}[2][]{%
+ \ensuremath{%
+ \mathrel{%
+ \settoheight{\dimen@}{\raise 2pt\hbox{$\rightharpoonup$}}%
+ \setlength{\dimen@}{-\dimen@}%
+ \edef\CA@temp{\the\dimen@}%
+ \settoheight\dimen@{$\rightleftharpoons$}%
+ \addtolength{\dimen@}{\CA@temp}%
+ \raisebox{\dimen@}{%
+ \rlap{%
+ \raisebox{2pt}{%
+ $%
+ \ext@arrow 0359\rightharpoonupfill@{\hphantom{#1}}{#2}%
+ $%
+ }%
+ }%
+ \hbox{%
+ $%
+ \ext@arrow 3095\leftharpoondownfill@{#1}{\hphantom{#2}}%
+ $%
+ }%
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\leftharpoondownfill@}
+% \begin{macrocode}
+\newcommand*{\leftharpoondownfill@}{%
+ \arrowfill@\leftharpoondown\relbar\relbar
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rightharpoonupfill@}
+% \begin{macrocode}
+\newcommand*{\rightharpoonupfill@}{%
+ \arrowfill@\relbar\relbar\rightharpoonup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/chemarr}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/chemarr.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/chemarr.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[\CTAN{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 chemarr.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@{}}
+% chemarr.sty & tex/latex/oberdiek/chemarr.sty\\
+% chemarr.pdf & doc/latex/oberdiek/chemarr.pdf\\
+% chemarr-example.tex & doc/latex/oberdiek/chemarr-example.tex\\
+% chemarr.dtx & source/latex/oberdiek/chemarr.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk chemarr.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{chemarr.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 chemarr.dtx
+%makeindex -s gind.ist chemarr.idx
+%pdflatex chemarr.dtx
+%makeindex -s gind.ist chemarr.idx
+%pdflatex chemarr.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{chemarr.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='chemarr'>
+ <name>chemarr</name>
+ <caption>Arrows for chemists.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2001,2006'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ Very often chemists need a longer version of reaction arrows
+ (<tt>\rightleftharpoons</tt>) with the possibility to put text
+ above and below. Analogous to <xref refid='amsmath'>amsmath</xref>'s
+ <tt>\xrightarrow</tt> and <tt>\xleftarrow</tt> this package
+ provides the macro <tt>\xrightleftharpoons</tt>. The package
+ requires amsmath. To use it, <tt>\usepackage{chemarr}</tt>,
+ then <tt>\xrightleftharpoons[below]{above}</tt> .
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/chemarr.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/chemarr.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2001/06/21 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2001/06/22 v1.1}
+% \item
+% Documentation fixes.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.2}
+% \item
+% DTX framework.
+% \item
+% Example added.
+% \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/chemarr.pdf b/macros/latex/contrib/oberdiek/chemarr.pdf
new file mode 100644
index 0000000000..c944655ad0
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/chemarr.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/classlist.dtx b/macros/latex/contrib/oberdiek/classlist.dtx
new file mode 100644
index 0000000000..f5e9506d3c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/classlist.dtx
@@ -0,0 +1,674 @@
+% \iffalse meta-comment
+%
+% File: classlist.dtx
+% Version: 2016/05/16 v1.5
+% Info: Record classes used in a document
+%
+% Copyright (C) 2005, 2006, 2008, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file classlist.dtx
+% and the derived files
+% classlist.sty, classlist.pdf, classlist.ins, classlist.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/classlist.dtx
+% CTAN:macros/latex/contrib/oberdiek/classlist.pdf
+%
+% Unpacking:
+% (a) If classlist.ins is present:
+% tex classlist.ins
+% (b) Without classlist.ins:
+% tex classlist.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{classlist.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If classlist.drv is present:
+% latex classlist.drv
+% (b) Without classlist.drv:
+% latex classlist.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 classlist.dtx
+% makeindex -s gind.ist classlist.idx
+% pdflatex classlist.dtx
+% makeindex -s gind.ist classlist.idx
+% pdflatex classlist.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/classlist.sty
+% TDS:doc/latex/oberdiek/classlist.pdf
+% TDS:source/latex/oberdiek/classlist.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: classlist 2016/05/16 v1.5 Record classes used in a document (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: classlist
+Version: 2016/05/16 v1.5
+
+Copyright (C) 2005, 2006, 2008, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file classlist.dtx
+and the derived files
+ classlist.sty, classlist.pdf, classlist.ins, classlist.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{classlist.ins}{\from{classlist.dtx}{install}}%
+ \file{classlist.drv}{\from{classlist.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{classlist.sty}{\from{classlist.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{classlist.xml}{\from{classlist.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{* classlist.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `classlist.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{classlist.drv}%
+ [2016/05/16 v1.5 Record classes used in a document (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{classlist.dtx}%
+\end{document}
+%</driver>
+% \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{classlist.drv}
+%
+% \title{The \xpackage{classlist} package}
+% \date{2016/05/16 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package records the loaded classes and stores
+% them in a list.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Background}
+%
+% This packages is an answer of a newsgroup question:
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% Newsgroup: & comp.text.tex\\
+% Subject: & Finding the Document Class\\
+% From: & Herber Schulz\\
+% Date: & 18 Jun 2005 13:16:49 -0500\\
+% Message-ID: &
+% \textless
+% \texttt{herbs-D55DB9.13170418062005@news.isp.giganews.com}^^A
+% \textgreater
+% \end{tabular}
+% \end{quote}
+%
+% \subsection{Usage}
+%
+% Load this package before \cs{documentclass}:
+% \begin{quote}
+% |\RequirePackage{classlist}|\\
+% |\documentclass[some,options]{whatever}|
+% \end{quote}
+% It then records the classes with options.
+%
+% If used after \cs{documentclass}, \cs{@filelist} is
+% parsed for classes. The additional data
+% specified options and requested version is no
+% longer available here.
+%
+% \begin{description}
+% \item[\cs{MainClassName}] contains the first loaded class.
+% \item[\cs{ClassList}] stores the class entries, eg.
+% \begin{quote}
+% \begin{tabular}{@{}l@{ }l@{}}
+% \cs{ClassList} $\rightarrow$&
+% |\ClassListEntry{myarticle}{a4paper}{}|\\
+% &|\ClassListEntry{article}{}{}|
+% \end{tabular}
+% \end{quote}
+% \item[\cs{ClassListEntry}] has three arguments:
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% |#1|: & class name\\
+% |#2|: & options given in \cs{documentclass}/\cs{LoadClass}\\
+% |#3|: & requested version, not the version of class
+% \end{tabular}
+% \end{quote}
+% \item[\cs{PrintClassList}] prints the list on screen it can be
+% configured by
+% \item[\cs{PrintClassListTitle}] for the title and
+% \item[\cs{PrintClassListEntry}] for formatting the entries.
+% See the implemenation how to use these.
+% \end{description}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{classlist}%
+ [2016/05/16 v1.5 Record classes used in a document (HO)]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\ClassList\@empty
+\let\MainClassName\relax
+% \end{macrocode}
+%
+% Test, whether we are called before \cs{documentclass}.
+% \begin{macrocode}
+\ifx\@classoptionslist\relax
+ \let\CL@org@fileswith@pti@ns\@fileswith@pti@ns
+ \def\@fileswith@pti@ns#1[#2]#3[#4]{%
+% \end{macrocode}
+% \begin{tabular}{@{}ll@{}}
+% |#1|: & \cs{@clsextension}\\
+% |#2|: & options of \cs{documentclass}/\cs{LoadClass}\\
+% |#3|: & class name\\
+% |#4|: & requested version
+% \end{tabular}
+% \begin{macrocode}
+ \ifx#1\@clsextension
+ \@ifl@aded#1{#3}{%
+ \PackageInfo{classlist}{%
+ Skipping class `#3', because\MessageBreak
+ this class is already loaded%
+ }%
+ }{%
+ \@ifundefined{MainClassName}{%
+ \def\MainClassName{#3}%
+ }{}%
+ \@temptokena\expandafter{%
+ \ClassList
+ \ClassListEntry{#3}{#2}{#4}%
+ }%
+ \edef\ClassList{\the\@temptokena}%
+ }%
+ \fi
+ \CL@org@fileswith@pti@ns{#1}[{#2}]{#3}[{#4}]%
+ }%
+ \let\@@fileswith@pti@ns\@fileswith@pti@ns
+\else
+% \end{macrocode}
+% Called after \cs{documentclass}.
+% \begin{macrocode}
+ \PackageInfo{classlist}{Use \string\@filelist\space method}%
+
+ \let\ClassListEntry\relax
+ \expandafter\def\expandafter\CL@test
+ \expandafter#\expandafter1\@clsextension#2\@nil{%
+ \ifx\\#2\\%
+% \end{macrocode}
+% Name does not contain \cs{@clsextension}
+% \begin{macrocode}
+ \else
+ \expandafter\CL@test@i\CL@entry\@nil
+ \fi
+ }%
+ \expandafter\def\expandafter\CL@test@i
+ \expandafter#\expandafter1\@clsextension#2\@nil{%
+ \ifx\\#2\\%
+ \@ifundefined{opt@\CL@entry}{%
+ }{%
+ \@ifundefined{MainClassName}{%
+ \let\MainClassName\CL@entry
+ }{%
+ }%
+ \edef\ClassList{%
+ \ClassList
+ \ClassListEntry{\CL@entry}{}{}%
+ }%
+ }%
+ \else
+% \end{macrocode}
+% Names with more than one \cs{@clsextension} are not supported.
+% \begin{macrocode}
+ \fi
+ }%
+ \@for\CL@entry:=\@filelist\do{%
+ \expandafter\expandafter\expandafter\CL@test\expandafter
+ \CL@entry\@clsextension\@nil
+ }%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\PrintClassListEntry}
+% \begin{macrocode}
+\providecommand*{\PrintClassListEntry}[3]{%
+ \toks@{* #1}%
+ \typeout{\the\toks@}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PrintClassListTitle}
+% \begin{macrocode}
+\providecommand*{\PrintClassListTitle}{%
+ \typeout{Class list:}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PrintClassList}
+% \begin{macrocode}
+\providecommand*{\PrintClassList}{%
+ \begingroup
+ \let\ClassListEntry\PrintClassListEntry
+ \PrintClassListTitle
+ \ClassList
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CL@InfoEntry}
+% \begin{macrocode}
+\def\CL@InfoEntry#1#2#3{%
+ \advance\count@ by \@ne
+ \def\x{#2}%
+ \@onelevel@sanitize\x
+ \edef\CL@Info{%
+ \CL@Info
+ \noexpand\MessageBreak
+ (\the\count@) %
+ #1 [\x]%
+ \ifx\\#3\\%
+ \else
+ \space[#3]% hash-ok
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \begingroup
+ \count@=\z@
+ \def\CL@Info{Class List:}%
+ \let\ClassListEntry\CL@InfoEntry
+ \ClassList
+ \let\on@line\@empty
+ \PackageInfo{classlist}{\CL@Info}%
+ \endgroup
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/classlist}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/classlist.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/classlist.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[\CTAN{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 classlist.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@{}}
+% classlist.sty & tex/latex/oberdiek/classlist.sty\\
+% classlist.pdf & doc/latex/oberdiek/classlist.pdf\\
+% classlist.dtx & source/latex/oberdiek/classlist.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk classlist.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{classlist.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 classlist.dtx
+%makeindex -s gind.ist classlist.idx
+%pdflatex classlist.dtx
+%makeindex -s gind.ist classlist.idx
+%pdflatex classlist.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{classlist.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='classlist'>
+ <name>classlist</name>
+ <caption>Record classes used in a document.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2005,2006,2008,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.5'/>
+ <description>
+ Load this package before \documentclass:
+ <p/>
+ &nbsp;&nbsp;<tt>\RequirePackage{classlist}</tt><br/>
+ &nbsp;&nbsp;<tt>\documentclass[some,options]{whatever}</tt>
+ <p/>
+ After doing this, <tt>\MainClass</tt> contains the name of the
+ first loaded class, <tt>\ClassList</tt> contains a set of triples
+ &lt;class name&gt;, &lt;options directly requested&gt;, and
+ &lt;version requested&gt;. (The package may also be loaded after
+ <tt>\documentclass</tt>, in which case some information is not
+ available.)
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/classlist.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/classlist.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2005/06/19 v1.0}
+% \item
+% First published version: CTAN and newsgroup \xnewsgroup{comp.text.tex}:
+% \URL{``\link{Re: Finding the Document Class}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/8ee9523c2dc13666}
+% \end{Version}
+% \begin{Version}{2005/06/19 v1.1}
+% \item
+% After \cs{documentclass} the package looks
+% at \cs{@filelist} instead of aborting with error.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.2}
+% \item
+% DTX framework.
+% \item
+% Fix for \cs{@@fileswith@pti@ns}.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.3}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2011/10/17 v1.4}
+% \item
+% Documentation fix: \cs{MainClass} $\rightarrow$ \cs{MainClassName}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/classlist.pdf b/macros/latex/contrib/oberdiek/classlist.pdf
new file mode 100644
index 0000000000..5c83122d6b
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/classlist.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/colonequals.dtx b/macros/latex/contrib/oberdiek/colonequals.dtx
new file mode 100644
index 0000000000..8fb8bb943b
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/colonequals.dtx
@@ -0,0 +1,681 @@
+% \iffalse meta-comment
+%
+% File: colonequals.dtx
+% Version: 2016/05/16 v1.1
+% Info: Colon equals symbols
+%
+% Copyright (C) 2006 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file colonequals.dtx
+% and the derived files
+% colonequals.sty, colonequals.pdf, colonequals.ins, colonequals.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/colonequals.dtx
+% CTAN:macros/latex/contrib/oberdiek/colonequals.pdf
+%
+% Unpacking:
+% (a) If colonequals.ins is present:
+% tex colonequals.ins
+% (b) Without colonequals.ins:
+% tex colonequals.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{colonequals.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If colonequals.drv is present:
+% latex colonequals.drv
+% (b) Without colonequals.drv:
+% latex colonequals.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 colonequals.dtx
+% makeindex -s gind.ist colonequals.idx
+% pdflatex colonequals.dtx
+% makeindex -s gind.ist colonequals.idx
+% pdflatex colonequals.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/colonequals.sty
+% TDS:doc/latex/oberdiek/colonequals.pdf
+% TDS:source/latex/oberdiek/colonequals.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: colonequals 2016/05/16 v1.1 Colon equals symbols (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: colonequals
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2006 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file colonequals.dtx
+and the derived files
+ colonequals.sty, colonequals.pdf, colonequals.ins, colonequals.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{colonequals.ins}{\from{colonequals.dtx}{install}}%
+ \file{colonequals.drv}{\from{colonequals.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{colonequals.sty}{\from{colonequals.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{colonequals.xml}{\from{colonequals.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{* colonequals.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `colonequals.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{colonequals.drv}%
+ [2016/05/16 v1.1 Colon equals symbols (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{colonequals}
+\usepackage{array}
+\usepackage{capt-of}
+\usepackage{longtable}
+\begin{document}
+ \DocInput{colonequals.dtx}%
+\end{document}
+%</driver>
+% \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{colonequals.drv}
+%
+% \title{The \xpackage{colonequals} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{colonequals} defines poor man's symbols
+% for math relation symbols such as ``colon equals''.
+% The colon is centered around the horizontal math axis.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% \subsection{Introduction}
+%
+% Math symbols consisting of the colon character can be
+% constructed with the colon text character, if the math font
+% lacks of the complete symbol. Often, however, the colon text
+% character is not centered around the math axis. Especially
+% combined with the equals symbol the composed symbol does not
+% look symmetrically. Thus this packages defines a colon
+% math symbol \cs{ratio} that is centered around the horizontal
+% math axis. Also math symbols are provided that consist of the
+% colon symbol. The package is not necessary, if the math
+% font contains the composed symbols. Examples are \textsf{txfonts}
+% (\cite{txfonts}) or \textsf{mathabx} (\cite{mathabx}).
+%
+% \subsection{Symbols}
+%
+% All symbols of this package are relation symbols.
+% The relation property can be changed by the appropriate
+% \TeX\ command \cs{mathbin}, \cs{mathord}, \dots
+%
+% \begin{center}
+% \captionof{table}{Unicode mathematical operators}
+% \kern1ex
+% \begin{tabular}{l>{\scshape}l>{$}l<{$}l}
+% U+2236 & ratio & \ratio & \cs{ratio} \\
+% U+2237 & proportion & \coloncolon & \cs{coloncolon} \\
+% U+2239 & excess & \colonminus & \cs{colonminus} \\
+% U+2254 & colon equals & \colonequals & \cs{colonequals} \\
+% U+2255 & equals colon & \equalscolon & \cs{equalscolon} \\
+% \end{tabular}
+% \end{center}
+%
+% The following grammar generates all symbols that are supported by
+% this package:
+% \begin{center}
+% \captionof{table}{Symbol grammar}
+% \kern1ex
+% \begin{tabular}{@{}l>{$}r<{$}l@{}}
+% symbols & \coloncolonequals & col \\
+% & \mid & col symbol \\
+% & \mid & symbol col \\
+% & ; & \\[1ex]
+% col & \coloncolonequals & '\texttt{:}' \\
+% & \mid & '\texttt{::}' \\
+% & ; & \\[1ex]
+% symbol & \coloncolonequals & '\texttt{=}' \\
+% & \mid & '\texttt{-}' \\
+% & \mid & '$\approx$' \\
+% & \mid & '$\sim$' \\
+% & ; &
+% \end{tabular}
+% \end{center}
+%
+% \def\entry#1{\csname #1\endcsname&\cs{#1}\\}
+% \def\entryset#1{^^A
+% \entry{colon#1}^^A
+% \entry{coloncolon#1}^^A
+% \entry{#1colon}^^A
+% \entry{#1coloncolon}^^A
+% }
+% \begin{longtable}{>{$}l<{$}l}
+% \caption{All relation symbols}\\
+% \entry{ratio}
+% \entry{coloncolon}
+% \entryset{equals}
+% \entryset{minus}
+% \entryset{approx}
+% \entryset{sim}
+% \end{longtable}
+%
+% \subsection{Fine tuning}
+%
+% The distances in composed symbols can be configured:
+%
+% \begin{declcs}{colonsep}
+% \end{declcs}
+% Macro \cs{colonsep} is executed between the colon and
+% the other symbol.
+%
+% \begin{declcs}{doublecolonsep}
+% \end{declcs}
+% Macro \cs{doublecolonsep} controls the distance between
+% two colons.
+%
+% \subsubsection{Example}
+% \begin{quote}
+% \verb|\renewcommand*{\colonsep}{\mskip-.5\thinmuskip}|
+% \end{quote}
+%
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{colonequals}%
+ [2016/05/16 v1.1 Colon equals symbols (HO)]%
+% \end{macrocode}
+%
+% \subsection{Distance control}
+%
+% \begin{macro}{\colonsep}
+% \begin{macrocode}
+\newcommand*{\colonsep}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\doublecolonsep}
+% \begin{macrocode}
+\newcommand*{\doublecolonsep}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Centered colons}
+%
+% \begin{macrocode}
+\def\@center@colon{%
+ \mathpalette\@center@math{:}%
+}
+\def\@center@math#1#2{%
+ \vcenter{%
+ \m@th
+ \hbox{$#1#2$}%
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\ratio}
+% Because the name \cs{colon} is already in use, the Unicode name
+% \cs{ratio} is used for the centered colon relation symbol.
+% (The \cs{ratio} of package \textsf{calc} is not used outside
+% calc expressions.)
+% \begin{macrocode}
+\newcommand*{\ratio}{%
+ \ensuremath{%
+ \mathrel{%
+ \@center@colon
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\coloncolon}
+% \begin{macrocode}
+\newcommand*{\coloncolon}{%
+ \ensuremath{%
+ \mathrel{%
+ \@center@colon
+ \doublecolonsep
+ \@center@colon
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Combined symbols}
+%
+% \begin{macrocode}
+\def\@make@colon@set#1#2{%
+ \begingroup
+ \let\@center@colon\relax
+ \let\newcommand\relax
+ \let\ensuremath\relax
+ \let\mathrel\relax
+ \let\colonsep\relax
+ \let\doublecolonsep\relax
+ \def\csx##1{%
+ \expandafter\noexpand\csname ##1\endcsname
+ }%
+ \edef\x{\endgroup
+ \newcommand*{\csx{colon#1}}{%
+ \ensuremath{%
+ \mathrel{%
+ \@center@colon
+ \colonsep
+ {#2}%
+ }%
+ }%
+ }%
+ \newcommand*{\csx{coloncolon#1}}{%
+ \ensuremath{%
+ \mathrel{%
+ \@center@colon
+ \doublecolonsep
+ \@center@colon
+ \colonsep
+ {#2}%
+ }%
+ }%
+ }%
+ \newcommand*{\csx{#1colon}}{%
+ \ensuremath{%
+ \mathrel{%
+ {#2}%
+ \colonsep
+ \@center@colon
+ }%
+ }%
+ }%
+ \newcommand*{\csx{#1coloncolon}}{%
+ \ensuremath{%
+ \mathrel{%
+ {#2}%
+ \colonsep
+ \@center@colon
+ \doublecolonsep
+ \@center@colon
+ }%
+ }%
+ }%
+ }%
+ \x
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@make@colon@set{equals}{=}%
+\@make@colon@set{minus}{-}%
+\@make@colon@set{approx}{\approx}
+\@make@colon@set{sim}{\sim}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/colonequals}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/colonequals.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/colonequals.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[\CTAN{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 colonequals.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@{}}
+% colonequals.sty & tex/latex/oberdiek/colonequals.sty\\
+% colonequals.pdf & doc/latex/oberdiek/colonequals.pdf\\
+% colonequals.dtx & source/latex/oberdiek/colonequals.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk colonequals.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{colonequals.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 colonequals.dtx
+%makeindex -s gind.ist colonequals.idx
+%pdflatex colonequals.dtx
+%makeindex -s gind.ist colonequals.idx
+%pdflatex colonequals.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{colonequals.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='colonequals'>
+ <name>colonequals</name>
+ <caption>Colon equals symbols.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ This package defines poor man&#x2018;s symbols for mathematical
+ relation symbols such as &#x201C;colon equals&#x201D;.
+ The colon is centered around the horizontal math axis.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/colonequals.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/colonequals.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{txfonts}
+% Young Ryu: \textit{The TX Fonts};
+% 2000/12/15;
+% \CTAN{fonts/txfonts/}.
+%
+% \bibitem{mathabx}
+% Anthony Phan: \textit{Mathabx font series};
+% 2005/05/16;
+% \CTAN{fonts/mathabx/}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/08/01 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/colonequals.pdf b/macros/latex/contrib/oberdiek/colonequals.pdf
new file mode 100644
index 0000000000..aae0491822
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/colonequals.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/dvipscol.dtx b/macros/latex/contrib/oberdiek/dvipscol.dtx
new file mode 100644
index 0000000000..100501d81e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/dvipscol.dtx
@@ -0,0 +1,569 @@
+% \iffalse meta-comment
+%
+% File: dvipscol.dtx
+% Version: 2016/05/16 v1.3
+% Info: Alter the usage of the dvips color stack
+%
+% Copyright (C) 2000, 2006, 2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file dvipscol.dtx
+% and the derived files
+% dvipscol.sty, dvipscol.pdf, dvipscol.ins, dvipscol.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/dvipscol.dtx
+% CTAN:macros/latex/contrib/oberdiek/dvipscol.pdf
+%
+% Unpacking:
+% (a) If dvipscol.ins is present:
+% tex dvipscol.ins
+% (b) Without dvipscol.ins:
+% tex dvipscol.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{dvipscol.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If dvipscol.drv is present:
+% latex dvipscol.drv
+% (b) Without dvipscol.drv:
+% latex dvipscol.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 dvipscol.dtx
+% makeindex -s gind.ist dvipscol.idx
+% pdflatex dvipscol.dtx
+% makeindex -s gind.ist dvipscol.idx
+% pdflatex dvipscol.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/dvipscol.sty
+% TDS:doc/latex/oberdiek/dvipscol.pdf
+% TDS:source/latex/oberdiek/dvipscol.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: dvipscol 2016/05/16 v1.3 Alter the usage of the dvips color stack (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: dvipscol
+Version: 2016/05/16 v1.3
+
+Copyright (C) 2000, 2006, 2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file dvipscol.dtx
+and the derived files
+ dvipscol.sty, dvipscol.pdf, dvipscol.ins, dvipscol.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{dvipscol.ins}{\from{dvipscol.dtx}{install}}%
+ \file{dvipscol.drv}{\from{dvipscol.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{dvipscol.sty}{\from{dvipscol.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{dvipscol.xml}{\from{dvipscol.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{* dvipscol.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `dvipscol.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{dvipscol.drv}%
+ [2016/05/16 v1.3 Alter the usage of the dvips color stack (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{dvipscol.dtx}%
+\end{document}
+%</driver>
+% \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{dvipscol.drv}
+%
+% \title{The \xpackage{dvipscol} package}
+% \date{2016/05/16 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Color support for dvips in \xfile{dvips.def} involves the
+% color stack of dvips. The package tries to remove unnecessary
+% uses of the stack to avoid the error ``out of coor stack space''.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% This package tries a solution, if the program
+% dvips complains:
+% \begin{quote}
+% |! out of color stack space|
+% \end{quote}
+% The driver file \xfile{dvips.def} contains the
+% low level color commands for the package \xpackage{color}.
+% Each time a color is set, the current color is
+% pushed on the color stack before and after the
+% current group the old color is popped from
+% the stack and set again (via \cs{aftergroup}).
+% But the color stack size of dvips is limited,
+% so a stack overflow can occur, if there are
+% too many color setting operations in a group.
+%
+% Only at the bottom group level (no group),
+% the color can be set directly without pushing
+% the current color on the stack before, because
+% there is no group at bottom level that can end.
+%
+% With \eTeX\ the group level can easily be
+% detected (\cs{currentgrouplevel}). Alone with
+% \TeX\ this is not possible.
+%
+% \subsection{Usage}
+%
+% \subsubsection{With \eTeX}
+%
+% With e-TeX the package fixes \cs{set@color}, therefore
+% no interaction with the user is required. Just load the package:
+% \begin{quote}
+% |\usepackage[dvips]{color}|\\
+% |\usepackage{dvipscol}|
+% \end{quote}
+%
+% \subsubsection{Without \eTeX}
+%
+% \begin{quote}
+% |\usepackage[dvips]{color}|\\
+% |\usepackage{dvipscol}|
+% \end{quote}
+% Without \eTeX\ the package does not know, which \cs{color}
+% do not need the stack. Therefore it defines \cs{nogroupcolor},
+% that the user can use manually instead of \cs{color}.
+% But caution: it should only be used outside of all
+% groups, for example the following will not work:
+% \begin{quote}
+% |\textcolor{black}{\nogroupcolor{blue}...}|
+% \end{quote}
+%
+% The use of \eTeX is strongly recommended.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{dvipscol}%
+ [2016/05/16 v1.3 Alter the usage of the dvips color stack (HO)]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@ifundefined{ver@dvips.def}{%
+ \PackageWarningNoLine{dvipscol}{%
+ Nothing to fix, because \string`dvips.def\string' not loaded%
+ }%
+ \endinput
+}
+% \end{macrocode}
+% \begin{macrocode}
+\CheckCommand*{\set@color}{%
+ \special{color push \current@color}%
+ \aftergroup\reset@color
+}
+% \end{macrocode}
+% \begin{macro}{\nogroupcolor}
+% \begin{macrocode}
+\newcommand*{\nogroupcolor}{%
+ \let\saved@org@set@color\set@color
+ \def\set@color{%
+ \let\set@color\saved@org@set@color
+ \special{color \current@color}%
+ }%
+ \color
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Patch for \eTeX\ users.
+% \begin{macrocode}
+\ifx\currentgrouplevel\@undefined
+ \PackageWarningNoLine{dvipscol}{%
+ \string\set@color\space cannot be fixed, %
+ because the\MessageBreak
+ e-TeX extensions are not available%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\def\set@color{%
+ \ifcase\currentgrouplevel
+ \special{color \current@color}%
+ \else
+ \special{color push \current@color}%
+ \aftergroup\reset@color
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/dvipscol}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/dvipscol.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/dvipscol.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[\CTAN{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 dvipscol.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@{}}
+% dvipscol.sty & tex/latex/oberdiek/dvipscol.sty\\
+% dvipscol.pdf & doc/latex/oberdiek/dvipscol.pdf\\
+% dvipscol.dtx & source/latex/oberdiek/dvipscol.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk dvipscol.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{dvipscol.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 dvipscol.dtx
+%makeindex -s gind.ist dvipscol.idx
+%pdflatex dvipscol.dtx
+%makeindex -s gind.ist dvipscol.idx
+%pdflatex dvipscol.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{dvipscol.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='dvipscol'>
+ <name>dvipscol</name>
+ <caption>Alter the usage of the dvips colour stack.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2000,2006,2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ The package modifies <tt>\color</tt> (and related commands) to
+ deal with the occasional dvips error: &#x201C;! out of color
+ stack space&#x201D;
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/dvipscol.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/dvipscol.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2000/08/31 v1.0}
+% \item
+% First public release created as answer to
+% a question of Deepak Goel in \xnewsgroup{comp.text.tex}:
+% \URL{``\link{Re: \cs{color{}} problems.\,. :Out of stack space.\,.}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/2d37bb1bf2939b31}
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.1}
+% \item
+% DTX framework.
+% \item
+% Code is not changed.
+% \item
+% LPPL 1.3
+% \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/dvipscol.pdf b/macros/latex/contrib/oberdiek/dvipscol.pdf
new file mode 100644
index 0000000000..0935c2dfdb
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/dvipscol.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/embedfile.dtx b/macros/latex/contrib/oberdiek/embedfile.dtx
new file mode 100644
index 0000000000..43b0ab2770
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/embedfile.dtx
@@ -0,0 +1,2198 @@
+% \iffalse meta-comment
+%
+% File: embedfile.dtx
+% Version: 2018/11/01 v2.8
+% Info: Embed files into PDF
+%
+% Copyright (C) 2006-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 embedfile.dtx
+% and the derived files
+% embedfile.sty, embedfile.pdf, embedfile.ins, embedfile.drv,
+% dtx-attach.sty, embedfile-example-plain.tex,
+% embedfile-example-collection.tex, embedfile-test1.tex,
+% embedfile-test2.tex, embedfile-test3.tex,
+% embedfile-test4.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/embedfile.dtx
+% CTAN:macros/latex/contrib/oberdiek/embedfile.pdf
+%
+% Unpacking:
+% (a) If embedfile.ins is present:
+% tex embedfile.ins
+% (b) Without embedfile.ins:
+% tex embedfile.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{embedfile.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If embedfile.drv is present:
+% latex embedfile.drv
+% (b) Without embedfile.drv:
+% latex embedfile.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 embedfile.dtx
+% makeindex -s gind.ist embedfile.idx
+% pdflatex embedfile.dtx
+% makeindex -s gind.ist embedfile.idx
+% pdflatex embedfile.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/embedfile.sty
+% TDS:tex/generic/oberdiek/dtx-attach.sty
+% TDS:doc/latex/oberdiek/embedfile.pdf
+% TDS:doc/latex/oberdiek/embedfile-example-plain.tex
+% TDS:doc/latex/oberdiek/embedfile-example-collection.tex
+% TDS:doc/latex/oberdiek/test/embedfile-test1.tex
+% TDS:doc/latex/oberdiek/test/embedfile-test2.tex
+% TDS:doc/latex/oberdiek/test/embedfile-test3.tex
+% TDS:doc/latex/oberdiek/test/embedfile-test4.tex
+% TDS:source/latex/oberdiek/embedfile.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: embedfile 2018/11/01 v2.8 Embed files into PDF (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: embedfile
+Version: 2018/11/01 v2.8
+
+Copyright (C) 2006-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 embedfile.dtx
+and the derived files
+ embedfile.sty, embedfile.pdf, embedfile.ins, embedfile.drv,
+ dtx-attach.sty, embedfile-example-plain.tex,
+ embedfile-example-collection.tex, embedfile-test1.tex,
+ embedfile-test2.tex, embedfile-test3.tex,
+ embedfile-test4.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{embedfile.ins}{\from{embedfile.dtx}{install}}%
+ \file{embedfile.drv}{\from{embedfile.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{embedfile.sty}{\from{embedfile.dtx}{package}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{dtx-attach.sty}{\from{embedfile.dtx}{dtxattach}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{embedfile-example-plain.tex}{\from{embedfile.dtx}{exampleplain}}%
+ \file{embedfile-example-collection.tex}{\from{embedfile.dtx}{examplecollection}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{embedfile-test1.tex}{\from{embedfile.dtx}{test1}}%
+% \file{embedfile-test2.tex}{\from{embedfile.dtx}{test2}}%
+% \file{embedfile-test3.tex}{\from{embedfile.dtx}{test3}}%
+% \file{embedfile-test4.tex}{\from{embedfile.dtx}{test4}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{embedfile.xml}{\from{embedfile.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{* embedfile.sty, dtx-attach.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `embedfile.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{embedfile.drv}%
+ [2018/11/01 v2.8 Embed files into PDF (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{embedfile.dtx}%
+\end{document}
+%</driver>
+% \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{embedfile.drv}
+%
+% \title{The \xpackage{embedfile} package}
+% \date{2018/11/01 v2.8}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package embeds files to a PDF document.
+% Currently the only supported driver is \pdfTeX\ $>=$ 1.30 in PDF mode.
+% \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, this
+% package 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 This package 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}
+%
+% \subsection{User interface}
+%
+% This package \xpackage{embedfile} can be used with both
+% \LaTeX\ and \plainTeX. See \autoref{sec:plain} that
+% explains the use with \plainTeX\ by an example.
+% In \LaTeX\ the package is loaded as usually. There are no options.
+% \begin{quote}
+% \verb|\usepackage{embedfile}|
+% \end{quote}
+%
+% \begin{declcs}{embedfile}
+% |[|\meta{options}|]| \M{file}
+% \end{declcs}
+% The macro \cs{embedfile} includes file \meta{file} and
+% attaches it to the PDF document. At the end of the document
+% the sorted list of embedded files are written. Thus you can
+% safely use \cs{embedfile} before \verb|\end{document}|.
+% Embedding files using \cs{AtEndDocument} will only work,
+% if \cs{AtEndDocument} is called before loading the package
+% \xpackage{embedfile}.
+%
+% The \meta{options} are give as key value pairs. The following
+% keys are supported:
+% \begin{description}
+% \item[\xoption{filespec}]
+% This allows to override the file name
+% that appears in the PDF file. If you are using other than
+% simple file names (8-bit, path separators, \dots), look into
+% the PDF specification (\cite{pdfspec}).
+% There are rules how these file names must be written/encoded.
+% Avoid 8-bit characters
+% and other special characters, the behaviour is currently undefined.
+% Use option \xoption{ucfilespec} for more funny file names.
+% The string method, see below, is |escape| since version 2.4.
+%
+% This name is also used as entry in a name tree
+% (see PDF specification: |/EmbeddedFiles|). Therefore the
+% value for \xoption{filespec} must be unique among all
+% embedded files. Also key \xoption{initialfiles} refers
+% to this name, if the file name and the value of \xoption{filespec}
+% are different.
+% \item[\xoption{ucfilespec}]
+% Since PDF 1.7 the file name may be provided in Unicode.
+% The conversion of the option value into a PDF string
+% is controlled by option \xoption{stringmethod}.
+% \item[\xoption{filesystem}]
+% This sets the entry \verb|/FS| in
+% the file specification dictionary, see PDF specification
+% (\cite{pdfspec}).
+% Example: \verb|filesystem=URL|.
+% \item[\xoption{mimetype}]
+% This sets the mime type (\cite{mime}) of the file,
+% see \autoref{sec:plain} for examples and \cite{types}
+% for a list of officially registered types.
+% \item[\xoption{desc}]
+% The description for the file.
+% \item[\xoption{stringmethod}]
+% The package must convert the values of the keys \xoption{ucfilespec}
+% and \xoption{desc} into a PDF string (before version 2.4: \xoption{filespec}
+% and \xoption{desc}). If \xpackage{hyperref}
+% is found, then its \cs{pdfstringdef} will be used, otherwise
+% \pdfTeX's \cs{pdfescapestring} is used. Value \verb|psd|
+% forces the use of \cs{pdfstringdef}, value \verb|escape|
+% the use of \cs{pdfescapestring}.
+% \item[\xoption{\meta{key}.value}] Sets the value of a collection
+% item property, see section \ref{sec:collection}.
+% \item[\xoption{\meta{key}.prefix}]
+% Sets the prefix of a collection item property,
+% see section \ref{sec:collection}.
+% \item[\xoption{id}]
+% The value must be an unique name. Macros
+% \cs{embedfileifobjectexists} and \cs{embedfilegetobject}
+% are using this name later.
+% \end{description}
+%
+% \begin{declcs}{embedfilefinish}
+% \end{declcs}
+% The list of all embedded files must be added as data structure
+% in the PDF file. In case of \LaTeX\ this is automatically done.
+% The package uses \cs{AtEndDocument}. Then the list of all
+% files should be known. However, \plainTeX\ does not know
+% about \cs{AtEndDocument}. Thus the user must call
+% \cs{embedfilefinish} at the end of the document
+% after the last file is embedded.
+%
+% \begin{declcs}{embedfilesetup} \M{options}
+% \end{declcs}
+% Options for \cs{embedfile} and collection support
+% can be set in \cs{embedfilesetup}.
+%
+% \subsection{Collection support (PDF 1.7)}
+% \label{sec:collection}
+%
+% Since PDF 1.7 the embedded files can form a \emph{collection}
+% (sometimes referred as \emph{package}), the main document
+% is called \emph{cover sheet}. See PDF specification
+% 8.2.4 ``Collections'' and 3.10.5 ``Collection items'' \cite{pdfspec}.
+%
+% Usually Acrobat Reader 7 or 8 shows the
+% embedded files in a table at the bottom with the following columns:
+% \begin{quote}
+% \begin{tabular}{@{}l|l|l|l@{}}
+% Name & Description & Modified & Size\\
+% \hline
+% \dots & \dots & \dots & \dots\\
+% \end{tabular}
+% \end{quote}
+% Acrobat Reader 10 shows the embeded files in the left panel
+% and adds a new column for the compressed size.
+%
+% If the files form a collection, then they are displayed
+% in a table left or top (depending on option \xoption{view},
+% see \cs{embedfilesetup}).
+%
+%
+% Collection support is enabled automatically, if
+% it is used.
+%
+% \begin{declcs}{embedfilesetup} \M{options}
+% \end{declcs}
+% The following options are supported in addition
+% to options for \cs{embedfile}:
+% \begin{description}
+% \item[\xoption{view}]
+% If the PDF file contains a collection, then Acrobat Reader 8
+% shows a line at the top below the menu bar and the toolbar.
+% It shows the current selected file, icons for changing the
+% view mode, an options menu.
+% The initial mode how the collection is presented is
+% set by this option \xoption{view}.
+% The following modes/values are supported, the default is |details|:
+% \begin{description}
+% \item[\texttt{details}] The full collection table is displayed
+% at the top below the collection bar.
+% \item[\texttt{tile}] The files of the collection are shown
+% in tile mode on the left.
+% \item[\texttt{hidden}] The collection table is not shown.
+% \end{description}
+% \item[\xoption{initialfile}]
+% Selects the file that is initially presented. Especially
+% useful for an embedded PDF file that is then shown instead
+% of the cover document. There must be an \cs{embedfile} command
+% somewhere whose value for key \xoption{filespec} is used here.
+% The \cs{embedfile} command can drop option \xoption{filespec}
+% if the file name is not different.
+% \end{description}
+%
+% \begin{declcs}{embedfilefield} \M{key} \M{options}
+% \end{declcs}
+% Macro \cs{embedfilefield} defines a column/field in the collection table.
+% The name of the field is \meta{key}.
+% \begin{description}
+% \item[\xoption{type}]
+% sets the type of the field. The supported values are:
+% \begin{description}
+% \item[\texttt{text}] A text field. Its value is set in
+% \cs{embedfile} by option \xoption{\meta{key}.value}.
+% \item[\texttt{date}] A date field. Its value is set in
+% \cs{embedfile} by option \xoption{\meta{key}.value}.
+% A special format is required, see ``3.8.3 Dates'' \cite{pdfspec}.
+% \item[\texttt{number}] A field with an integer or float number.
+% Its value is set in \cs{embedfile} by option
+% \xoption{\meta{key}.value}.
+% \item[\texttt{file}] The file name of the embedded file.
+% \item[\texttt{desc}] The description text of the embedded file. It is
+% set in \cs{embedfile} by option \xoption{desc}.
+% \item[\texttt{moddate}] The modification date of the embedded file.
+% \item[\texttt{size}] The size of the embedded file.
+% \end{description}
+% All types allow the use of a prefix that is disregarded by
+% sorting. The prefix for this field is set in \cs{embedfile} by
+% option \xoption{\meta{key}.prefix}.
+% \item[\xoption{title}] sets the column title.
+% \item[\xoption{visible}] controls whether the column is presented:
+% \begin{description}
+% \item[\texttt{true}] shows the column.
+% \item[\texttt{false}] hides the column.
+% \end{description}
+% Default: \texttt{true}
+% \item[\xoption{edit}]
+% Allows the editing of field values. Does not seem to have an
+% effect for Acrobat Reader.
+% \begin{description}
+% \item[\texttt{true}] enables the feature, if available (depends
+% on the PDF viewer).
+% \item[\texttt{false}] disables the feature.
+% \end{description}
+% Default: \texttt{false}
+% \end{description}
+% The order of \cs{embedfilefield} statements defines the order
+% of the columns.
+%
+% \begin{declcs}{embedfilesort} \M{key-sort-list}
+% \end{declcs}
+% The sort order of the embedded files are controlled by
+% macro \cs{embedfilesort}. \meta{key-sort-list} defines
+% the sort order. The key is a field name defined by \cs{embedfilefield}.
+% Its value is either \texttt{ascending} or \texttt{descending}.
+% The default is \texttt{ascending}.
+%
+% \subsection{Export of object references}
+%
+% Caution: This feature is still experimental. It may be even removed
+% in future versions. Therefore feedback would be nice, if someone
+% has a useful application for this feature.
+%
+% Object numbers are saved, if \xoption{id} is given in \cs{embedfile}.
+% The following objects are supported:
+% \begin{itemize}
+% \item \texttt{EmbeddedFile}
+% \item \texttt{Filespec}
+% \end{itemize}
+%
+% \begin{declcs}{embedfileifobjectexists} \M{id} \M{type}
+% \M{then} \M{else}
+% \end{declcs}
+% Macro \cs{embedfileifobjectexists} tests whether object of \meta{type}
+% is available for the embedded file identified by \meta{id}.
+%
+% \begin{declcs}{embedfilegetobject} \M{id} \M{type}
+% \end{declcs}
+% Macro \cs{embedfilegetobject} expands to the full object reference
+% object of \meta{type} for the embedded file identified by \meta{id}.
+%
+% \subsubsection{Example}
+%
+%\begin{quote}
+%\begin{verbatim}
+%\embedfile[id={foo}]{foo.pdf}
+%\embedfileifobjectexists{foo}{Filespec}{%
+% \typeout{%
+% FileSpec object for `foo': %
+% \embedfilegetobject{foo}{Filespec}%
+% }%
+%}{%
+% \typeout{No Filespec object for `foo'}%
+%}
+%\end{verbatim}
+%\end{quote}
+%
+% \subsection{Examples}
+% \label{sec:examples}
+%
+% \subsubsection{\plainTeX}
+% \label{sec:plain}
+%
+% The package can be used with \plainTeX. It can be used
+% with or without help from \xfile{miniltx.tex}.
+%
+% If additionally package \xpackage{keyval} (\xpackage{graphicx})
+% is needed, load it first. Then package \xpackage{embedfile} avoids
+% a duplicate loading of package \xpackage{keyval}.
+%
+% Because \plainTeX\ does not provide a hook at end of the document,
+% you have to call \cs{embedfilefinish} manually at the end
+% after the last embedded file.
+% \begin{macrocode}
+%<*exampleplain>
+%<<END
+% Load packages
+\input miniltx
+% \def\Gin@driver{pdftex.def}
+% \input graphicx.sty
+\input embedfile.sty
+\resetatcatcode
+
+% default setting
+\embedfilesetup{
+ mimetype=text/plain
+}
+
+% Embed files
+\embedfile[
+ filespec=example.tex,
+ desc={Source code (plain-TeX) of this example}
+]{embedfile-example-plain.tex}
+
+\embedfile[
+ desc={Source of package `embedfile'}
+]{embedfile.dtx}
+
+\embedfile[
+ mimetype=application/pdf,
+ desc={Documentation of package `embedfile'}
+]{embedfile.pdf}
+
+% Some text
+This example document contains three embedded files.
+
+% End of document
+\embedfilefinish % don't forget
+\bye
+%END
+%</exampleplain>
+% \end{macrocode}
+%
+% \subsubsection{Collection example}
+%
+% \begin{macrocode}
+%<*examplecollection>
+%<<END
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage[bookmarks=false]{hyperref}
+% provides \pdfstringdef that is then used by `title' and
+% other keys.
+\usepackage{embedfile}[2018/11/01]
+\embedfilesetup{
+ view=details,
+ initialfile=embedfile.pdf
+}
+\embedfilefield{file}{
+ type=file,
+ title={File name}
+}
+\embedfilefield{description}{
+ type=desc,
+ title={Description}
+}
+\embedfilefield{date}{
+ type=moddate,
+ title={Date}
+}
+\embedfilefield{size}{
+ type=size,
+ title={Size}
+}
+\embedfilefield{type}{
+ type=text,
+ title={Type},
+ visible=false
+}
+\embedfilesort{
+ type,
+ date=descending
+}
+\begin{document}
+An example for embedded files as collection.
+You need Acrobat Reader 8 or higher.
+
+\embedfile[
+ desc={Source file of package `embedfile'},
+ description.prefix={Package: },
+ type.value={DTX}
+]{embedfile.dtx}
+
+\embedfile[
+ desc={Documentation of package `embedfile'},
+ description.prefix={Package: },
+ type.value={PDF}
+]{embedfile.pdf}
+
+\embedfile[
+ desc={The source for this example},
+ description.prefix={Example: },
+ type.value={TEX}
+]{\jobname.tex}
+
+\end{document}
+%END
+%</examplecollection>
+% \end{macrocode}
+%
+% \subsection{Package \xpackage{dtx-attach}}
+%
+% Package \xpackage{dtx-attach} is just a small application of
+% package \xpackage{embedfile}. I am using it for the CTAN
+% documentation of my packages in \CTAN{macros/latex/contrib/oberdiek/}.
+% It also serves as small example for the use of the package with \LaTeX.
+%
+% \begin{macrocode}
+%<*dtxattach>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{dtx-attach}
+ [2018/11/01 v2.8 Embed \string\jobname.dtx (HO)]%
+\RequirePackage{embedfile}[2018/11/01]
+\embedfile[%
+ stringmethod=escape,%
+ mimetype=plain/text,%
+ desc={LaTeX docstrip source archive for package `\jobname'}%
+]{\jobname.dtx}
+%</dtxattach>
+% \end{macrocode}
+%
+% \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@embedfile.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{embedfile}{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@embedfile.sty\endcsname
+\ProvidesPackage{embedfile}%
+ [2018/11/01 v2.8 Embed files into PDF (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 EmFi@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\EmFi@AtEnd{%
+ \EmFi@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{44}{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{96}{12}% `
+\edef\EmFi@AtEnd{\EmFi@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Tools}
+%
+% \begin{macro}{\EmFi@RequirePackage}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \def\EmFi@RequirePackage#1[#2]{%
+ \input #1.sty\relax
+ }%
+\else
+ \let\EmFi@RequirePackage\RequirePackage
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EmFi@Error}
+% \begin{macrocode}
+\EmFi@RequirePackage{infwarerr}[2007/09/09]%
+\def\EmFi@Error{%
+ \@PackageError{embedfile}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Luatex compat
+% \begin{macrocode}
+\ifx\pdfextension\@undefined\else
+ \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax}
+ \protected\def\pdfnames {\pdfextension names }
+ \protected\def\pdfobj {\pdfextension obj }
+ \let\pdfoutput \outputmode
+\fi
+% \end{macrocode}
+%
+% \subsection{Check for recent \pdfTeX\ in PDF mode}
+%
+% Load package \xpackage{ifpdf} and check mode.
+% \begin{macrocode}
+\EmFi@RequirePackage{ifpdf}[2007/09/09]
+\ifpdf
+\else
+ \EmFi@Error{%
+ Missing pdfTeX in PDF mode%
+ }{%
+ Currently other drivers are not supported. %
+ Package loading is aborted.%
+ }%
+ \expandafter\EmFi@AtEnd
+\fi%
+% \end{macrocode}
+% \begin{macrocode}
+\EmFi@RequirePackage{pdftexcmds}[2007/11/11]
+\EmFi@RequirePackage{ltxcmds}[2010/03/01]
+\EmFi@RequirePackage{kvsetkeys}[2010/03/01]
+\EmFi@RequirePackage{kvdefinekeys}[2010/03/01]
+% \end{macrocode}
+% Check version.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@filesize\endcsname\relax
+ \EmFi@Error{%
+ Unsupported pdfTeX version%
+ }{%
+ At least version 1.30 is necessary. Package loading is aborted.%
+ }%
+ \expandafter\EmFi@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Strings}
+%
+% Minimal version of package \xpackage{pdfescape} is 2007/08/27 v1.5
+% because of \cs{EdefSanitize}.
+% \begin{macrocode}
+\EmFi@RequirePackage{pdfescape}[2007/11/11]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\EmFi@temp#1{%
+ \expandafter\EdefSanitize\csname EmFi@S@#1\endcsname{#1}%
+}
+% \end{macrocode}
+% \begin{macro}{\EmFi@details}
+% \begin{macrocode}
+\EmFi@temp{details}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@tile}
+% \begin{macrocode}
+\EmFi@temp{tile}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@hidden}
+% \begin{macrocode}
+\EmFi@temp{hidden}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@text}
+% \begin{macrocode}
+\EmFi@temp{text}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@date}
+% \begin{macrocode}
+\EmFi@temp{date}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@number}
+% \begin{macrocode}
+\EmFi@temp{number}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@file}
+% \begin{macrocode}
+\EmFi@temp{file}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@desc}
+% \begin{macrocode}
+\EmFi@temp{desc}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@moddate}
+% \begin{macrocode}
+\EmFi@temp{moddate}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@creationdate}
+% \begin{macrocode}
+\EmFi@temp{creationdate}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@size}
+% \begin{macrocode}
+\EmFi@temp{size}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@ascending}
+% \begin{macrocode}
+\EmFi@temp{ascending}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@descending}
+% \begin{macrocode}
+\EmFi@temp{descending}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@true}
+% \begin{macrocode}
+\EmFi@temp{true}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@S@false}
+% \begin{macrocode}
+\EmFi@temp{false}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Switches}
+%
+% \begin{macro}{\ifEmFi@collection}
+% \begin{macrocode}
+\ltx@newif\ifEmFi@collection
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi@sort}
+% \begin{macrocode}
+\ltx@newif\ifEmFi@sort
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi@visible}
+% \begin{macrocode}
+\ltx@newif\ifEmFi@visible
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi@edit}
+% \begin{macrocode}
+\ltx@newif\ifEmFi@edit
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi@item}
+% \begin{macrocode}
+\ltx@newif\ifEmFi@item
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi@finished}
+% \begin{macrocode}
+\ltx@newif\ifEmFi@finished
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifEmFi@id}
+% \begin{macrocode}
+\ltx@newif\ifEmFi@id
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Key value definitions}
+%
+% \begin{macro}{\EmFi@GlobalKey}
+% \begin{macrocode}
+\def\EmFi@GlobalKey#1#2{%
+ \global\expandafter\let\csname KV@#1@#2\expandafter\endcsname
+ \csname KV@#1@#2\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@GlobalDefaultKey}
+% \begin{macrocode}
+\def\EmFi@GlobalDefaultKey#1#2{%
+ \EmFi@GlobalKey{#1}{#2}%
+ \global\expandafter\let
+ \csname KV@#1@#2@default\expandafter\endcsname
+ \csname KV@#1@#2@default\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EmFi@DefineKey}
+% \begin{macrocode}
+\def\EmFi@DefineKey#1#2{%
+ \kv@define@key{EmFi}{#1}{%
+ \expandafter\def\csname EmFi@#1\endcsname{##1}%
+ }%
+ \expandafter\def\csname EmFi@#1\endcsname{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% Subtype of the embedded file (optional).
+% \begin{macrocode}
+\EmFi@DefineKey{mimetype}{}
+% \end{macrocode}
+% File specification string.
+% \begin{macrocode}
+\EmFi@DefineKey{filespec}{\EmFi@file}
+% \end{macrocode}
+% File specification string in Unicode.
+% \begin{macrocode}
+\EmFi@DefineKey{ucfilespec}{}
+% \end{macrocode}
+% File system (optional).
+% \begin{macrocode}
+\EmFi@DefineKey{filesystem}{}
+% \end{macrocode}
+% Description (optional).
+% \begin{macrocode}
+\EmFi@DefineKey{desc}{}
+% \end{macrocode}
+% Method for converting text to PDF strings.
+% \begin{macrocode}
+\EmFi@DefineKey{stringmethod}{%
+ \ifx\pdfstringdef\@undefined
+ escape%
+ \else
+ \ifx\pdfstringdef\relax
+ escape%
+ \else
+ psd%
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% Option \xoption{id} as key for object numbers.
+% \begin{macrocode}
+\kv@define@key{EmFi}{id}{%
+ \def\EmFi@id{#1}%
+ \EmFi@idtrue
+}
+% \end{macrocode}
+% \begin{macro}{\EmFi@defobj}
+% \begin{macrocode}
+\def\EmFi@defobj#1{%
+ \ifEmFi@id
+ \expandafter\xdef\csname EmFi@#1@\EmFi@id\endcsname{%
+ \the\pdflastobj\ltx@space 0 R%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfileifobjectexists}
+% \begin{macrocode}
+\def\embedfileifobjectexists#1#2{%
+ \expandafter\ifx\csname EmFi@#2@#1\endcsname\relax
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfilegetobject}
+% \begin{macrocode}
+\def\embedfilegetobject#1#2{%
+ \embedfileifobjectexists{#1}{#2}{%
+ \csname EmFi@#2@#1\endcsname
+ }{%
+ 0 0 R%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Initial view of the collection.
+% \begin{macrocode}
+\kv@define@key{EmFi}{view}[]{%
+ \EdefSanitize\EmFi@temp{#1}%
+ \def\EmFi@next{%
+ \global\EmFi@collectiontrue
+ }%
+ \ifx\EmFi@temp\ltx@empty
+ \let\EmFi@view\EmFi@S@details
+ \else\ifx\EmFi@temp\EmFi@S@details
+ \let\EmFi@view\EmFi@S@details
+ \else\ifx\EmFi@temp\EmFi@S@tile
+ \let\EmFi@view\EmFi@S@tile
+ \else\ifx\EmFi@temp\EmFi@S@hidden
+ \let\EmFi@view\EmFi@S@hidden
+ \else
+ \let\EmFi@next\relax
+ \EmFi@Error{%
+ Unknown value `\EmFi@temp' for key `view'.\MessageBreak
+ Supported values: `details', `tile', `hidden'.%
+ }\@ehc
+ \fi\fi\fi\fi
+ \EmFi@next
+}
+% \end{macrocode}
+% \begin{macrocode}
+\EmFi@DefineKey{initialfile}{}
+% \end{macrocode}
+%
+% \begin{macro}{\embedfilesetup}
+% \begin{macrocode}
+\def\embedfilesetup{%
+ \ifEmFi@finished
+ \def\EmFi@next##1{}%
+ \EmFi@Error{%
+ \string\embedfilefield\ltx@space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \def\EmFi@next{%
+ \kvsetkeys{EmFi}%
+ }%
+ \fi
+ \EmFi@next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EmFi@schema}
+% \begin{macrocode}
+\def\EmFi@schema{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@order}
+% \begin{macrocode}
+\gdef\EmFi@order{0}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@@order}
+% \begin{macrocode}
+\let\EmFi@@order\relax
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@fieldlist}
+% \begin{macrocode}
+\def\EmFi@fieldlist{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@sortcase}
+% \begin{macrocode}
+\def\EmFi@sortcase{0}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfilefield}
+% \begin{macrocode}
+\def\embedfilefield#1#2{%
+ \ifEmFi@finished
+ \EmFi@Error{%
+ \string\embedfilefield\ltx@space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \global\EmFi@collectiontrue
+ \EdefSanitize\EmFi@key{#1}%
+ \expandafter\ifx\csname KV@EmFi@\EmFi@key.prefix\endcsname\relax
+ \begingroup
+ \count@=\EmFi@order
+ \advance\count@ 1 %
+ \xdef\EmFi@order{\the\count@}%
+ \let\EmFi@title\EmFi@key
+ \let\EmFi@type\EmFi@S@text
+ \EmFi@visibletrue
+ \EmFi@editfalse
+ \kvsetkeys{EmFiFi}{#2}%
+ \EmFi@convert\EmFi@title\EmFi@title
+ \xdef\EmFi@schema{%
+ \EmFi@schema
+ /\pdf@escapename{\EmFi@key}<<%
+ /Subtype/%
+ \ifx\EmFi@type\EmFi@S@date D%
+ \else\ifx\EmFi@type\EmFi@S@number N%
+ \else\ifx\EmFi@type\EmFi@S@file F%
+ \else\ifx\EmFi@type\EmFi@S@desc Desc%
+ \else\ifx\EmFi@type\EmFi@S@moddate ModDate%
+ \else\ifx\EmFi@type\EmFi@S@creationdate CreationDate%
+ \else\ifx\EmFi@type\EmFi@S@size Size%
+ \else S%
+ \fi\fi\fi\fi\fi\fi\fi
+ /N(\EmFi@title)%
+ \EmFi@@order{\EmFi@order}%
+ \ifEmFi@visible
+ \else
+ /V false%
+ \fi
+ \ifEmFi@edit
+ /E true%
+ \fi
+ >>%
+ }%
+ \let\do\relax
+ \xdef\EmFi@fieldlist{%
+ \EmFi@fieldlist
+ \do{\EmFi@key}%
+ }%
+ \ifx\EmFi@type\EmFi@S@text
+ \kv@define@key{EmFi}{\EmFi@key.value}{%
+ \EmFi@itemtrue
+ \def\EmFi@temp{##1}%
+ \EmFi@convert\EmFi@temp\EmFi@temp
+ \expandafter\def\csname EmFi@V@#1%
+ \expandafter\endcsname\expandafter{%
+ \expandafter(\EmFi@temp)%
+ }%
+ }%
+ \EmFi@GlobalKey{EmFi}{\EmFi@key.value}%
+ \else\ifx\EmFi@type\EmFi@S@date
+ \kv@define@key{EmFi}{\EmFi@key.value}{%
+ \EmFi@itemtrue
+ \def\EmFi@temp{##1}%
+ \EmFi@convert\EmFi@temp\EmFi@temp
+ \expandafter\def\csname EmFi@V@#1%
+ \expandafter\endcsname\expandafter{%
+ \expandafter(\EmFi@temp)%
+ }%
+ }%
+ \EmFi@GlobalKey{EmFi}{\EmFi@key.value}%
+ \else\ifx\EmFi@type\EmFi@S@number
+ \kv@define@key{EmFi}{\EmFi@key.value}{%
+ \EmFi@itemtrue
+ \expandafter\EdefSanitize\csname EmFi@V@#1\endcsname{ ##1}%
+ }%
+ \EmFi@GlobalKey{EmFi}{\EmFi@key.value}%
+ \fi\fi\fi
+ \kv@define@key{EmFi}{\EmFi@key.prefix}{%
+ \EmFi@itemtrue
+ \expandafter\def\csname EmFi@P@#1\endcsname{##1}%
+ }%
+ \EmFi@GlobalKey{EmFi}{\EmFi@key.prefix}%
+ \kv@define@key{EmFiSo}{\EmFi@key}[ascending]{%
+ \EdefSanitize\EmFi@temp{##1}%
+ \ifx\EmFi@temp\EmFi@S@ascending
+ \def\EmFi@temp{true}%
+ \else\ifx\EmFi@temp\EmFi@S@descending
+ \def\EmFi@temp{false}%
+ \else
+ \def\EmFi@temp{}%
+ \EmFi@Error{%
+ Unknown sort order `\EmFi@temp'.\MessageBreak
+ Supported values: `\EmFi@S@ascending', %
+ `\EmFi@S@descending
+ }\@ehc
+ \fi\fi
+ \ifx\EmFi@temp\ltx@empty
+ \else
+ \xdef\EmFi@sortkeys{%
+ \EmFi@sortkeys
+ /\pdf@escapename{#1}%
+ }%
+ \ifx\EmFi@sortorders\ltx@empty
+ \global\let\EmFi@sortorders\EmFi@temp
+ \gdef\EmFi@sortcase{1}%
+ \else
+ \xdef\EmFi@sortorders{%
+ \EmFi@sortorders
+ \ltx@space
+ \EmFi@temp
+ }%
+ \xdef\EmFi@sortcase{2}%
+ \fi
+ \fi
+ }%
+ \EmFi@GlobalDefaultKey{EmFiSo}\EmFi@key
+ \endgroup
+ \else
+ \EmFi@Error{%
+ Field `\EmFi@key' is already defined%
+ }\@ehc
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\kv@define@key{EmFiFi}{type}{%
+ \EdefSanitize\EmFi@temp{#1}%
+ \ifx\EmFi@temp\EmFi@S@text
+ \let\EmFi@type\EmFi@temp
+ \else\ifx\EmFi@temp\EmFi@S@date
+ \let\EmFi@type\EmFi@temp
+ \else\ifx\EmFi@temp\EmFi@S@number
+ \let\EmFi@type\EmFi@temp
+ \else\ifx\EmFi@temp\EmFi@S@file
+ \let\EmFi@type\EmFi@temp
+ \else\ifx\EmFi@temp\EmFi@S@desc
+ \let\EmFi@type\EmFi@temp
+ \else\ifx\EmFi@temp\EmFi@S@moddate
+ \let\EmFi@type\EmFi@temp
+ \else\ifx\EmFi@temp\EmFi@S@creationdate
+ \let\EmFi@type\EmFi@temp
+ \else\ifx\EmFi@temp\EmFi@S@size
+ \let\EmFi@type\EmFi@temp
+ \else
+ \EmFi@Error{%
+ Unknown type `\EmFi@temp'.\MessageBreak
+ Supported types: `text', `date', `number', `file',\MessageBreak
+ `desc', `moddate', `creationdate', `size'%
+ }%
+ \fi\fi\fi\fi\fi\fi\fi\fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\kv@define@key{EmFiFi}{title}{%
+ \def\EmFi@title{#1}%
+}
+% \end{macrocode}
+% \begin{macro}{\EmFi@setboolean}
+% \begin{macrocode}
+\def\EmFi@setboolean#1#2{%
+ \EdefSanitize\EmFi@temp{#2}%
+ \ifx\EmFi@temp\EmFi@S@true
+ \csname EmFi@#1true\endcsname
+ \else
+ \ifx\EmFi@temp\EmFi@S@false
+ \csname EmFi@#1false\endcsname
+ \else
+ \EmFi@Error{%
+ Unknown value `\EmFi@temp' for key `#1'.\MessageBreak
+ Supported values: `true', `false'%
+ }\@ehc
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\kv@define@key{EmFiFi}{visible}[true]{%
+ \EmFi@setboolean{visible}{#1}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\kv@define@key{EmFiFi}{edit}[true]{%
+ \EmFi@setboolean{edit}{#1}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\EmFi@sortkeys}
+% \begin{macrocode}
+\def\EmFi@sortkeys{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@sortorders}
+% \begin{macrocode}
+\def\EmFi@sortorders{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfilesort}
+% \begin{macrocode}
+\def\embedfilesort{%
+ \kvsetkeys{EmFiSo}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Embed the file}
+%
+% \begin{macro}{\embedfile}
+% \begin{macrocode}
+\def\embedfile{%
+ \ltx@ifnextchar[\EmFi@embedfile{\EmFi@embedfile[]}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@embedfile}
+% \begin{macrocode}
+\def\EmFi@embedfile[#1]#2{%
+ \ifEmFi@finished
+ \EmFi@Error{%
+ \string\embedfile\ltx@space after \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \begingroup
+ \def\EmFi@file{#2}%
+ \kvsetkeys{EmFi}{#1}%
+ \expandafter\expandafter\expandafter
+ \ifx\expandafter\expandafter\expandafter
+ \\\pdf@filesize{\EmFi@file}\\%
+ \EmFi@Error{%
+ File `\EmFi@file' not found%
+ }{%
+ The unknown file is not embedded.%
+ }%
+ \else
+ \edef\EmFi@@filespec{%
+ \pdf@escapestring{\EmFi@filespec}%
+ }%
+ \ifx\EmFi@ucfilespec\ltx@empty
+ \let\EmFi@@ucfilespec\ltx@empty
+ \else
+ \EmFi@convert\EmFi@ucfilespec\EmFi@@ucfilespec
+ \fi
+ \ifx\EmFi@desc\ltx@empty
+ \let\EmFi@@desc\ltx@empty
+ \else
+ \EmFi@convert\EmFi@desc\EmFi@@desc
+ \fi
+ \ifEmFi@item
+ \let\do\EmFi@do
+ \immediate\pdfobj{%
+ <<%
+ \EmFi@fieldlist
+ >>%
+ }%
+ \edef\EmFi@ci{\the\pdflastobj}%
+ \fi
+ \immediate\pdfobj stream attr{%
+ /Type/EmbeddedFile%
+ \ifx\EmFi@mimetype\ltx@empty
+ \else
+ /Subtype/\pdf@escapename{\EmFi@mimetype}%
+ \fi
+ /Params<<%
+ /ModDate(\pdf@filemoddate{\EmFi@file})%
+ /Size \pdf@filesize{\EmFi@file}%
+ /CheckSum<\pdf@filemdfivesum{\EmFi@file}>%
+ >>%
+ }file{\EmFi@file}\relax
+ \EmFi@defobj{EmbeddedFile}%
+ \immediate\pdfobj{%
+ <<%
+ /Type/Filespec%
+ \ifx\EmFi@filesystem\ltx@empty
+ \else
+ /FS/\pdf@escapename{\EmFi@filesystem}%
+ \fi
+ /F(\EmFi@@filespec)%
+ \ifx\EmFi@@ucfilespec\ltx@empty
+ \else
+ /UF(\EmFi@@ucfilespec)%
+ \fi
+ \ifx\EmFi@@desc\ltx@empty
+ \else
+ /Desc(\EmFi@@desc)%
+ \fi
+ /EF<<%
+ /F \the\pdflastobj\ltx@space 0 R%
+ >>%
+ \ifEmFi@item
+ /CI \EmFi@ci\ltx@space 0 R%
+ \fi
+ >>%
+ }%
+ \EmFi@defobj{Filespec}%
+ \EmFi@add{%
+ \EmFi@@filespec
+ }{\the\pdflastobj\ltx@space 0 R}%
+ \fi
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@do}
+% \begin{macrocode}
+\def\EmFi@do#1{%
+ \expandafter\ifx\csname EmFi@P@#1\endcsname\relax
+ \expandafter\ifx\csname EmFi@V@#1\endcsname\relax
+ \else
+ /\pdf@escapename{#1}\csname EmFi@V@#1\endcsname
+ \fi
+ \else
+ /\pdf@escapename{#1}<<%
+ \expandafter\ifx\csname EmFi@V@#1\endcsname\relax
+ \else
+ /D\csname EmFi@V@#1\endcsname
+ \fi
+ /P(\csname EmFi@P@#1\endcsname)%
+ >>%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EmFi@convert}
+% \begin{macrocode}
+\def\EmFi@convert#1#2{%
+ \ifnum\pdf@strcmp{\EmFi@stringmethod}{psd}=0 %
+ \pdfstringdef\EmFi@temp{#1}%
+ \let#2\EmFi@temp
+ \else
+ \edef#2{\pdf@escapestring{#1}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\global\let\EmFi@list\ltx@empty
+% \end{macrocode}
+% \begin{macro}{\EmFi@add}
+% Sorting is done by the insertion sort algorithm.
+% Probably the sorting could be done more reliable.
+% However, the PDF specification is not too clear to me
+% regarding precise sorting rules (how to deal with
+% different encodings, escaped characters, \dots).
+% \begin{macrocode}
+\def\EmFi@add#1#2{%
+ \begingroup
+ \ifx\EmFi@list\ltx@empty
+ \xdef\EmFi@list{\noexpand\do{#1}{#2}}%
+ \else
+ \def\do##1##2{%
+ \ifnum\pdf@strcmp{##1}{#1}>0 %
+ \edef\x{%
+ \toks@{%
+ \the\toks@%
+ \noexpand\do{#1}{#2}%
+ \noexpand\do{##1}{##2}%
+ }%
+ }%
+ \x
+ \def\do####1####2{%
+ \toks@\expandafter{\the\toks@\do{####1}{####2}}%
+ }%
+ \def\stop{%
+ \xdef\EmFi@list{\the\toks@}%
+ }%
+ \else
+ \toks@\expandafter{\the\toks@\do{##1}{##2}}%
+ \fi
+ }%
+ \def\stop{%
+ \xdef\EmFi@list{\the\toks@\noexpand\do{#1}{#2}}%
+ }%
+ \toks@{}%
+ \EmFi@list\stop
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\embedfilefinish}
+% \begin{macrocode}
+\def\embedfilefinish{%
+ \ifEmFi@finished
+ \EmFi@Error{%
+ Too many invocations of \string\embedfilefinish
+ }{%
+ The list of embedded files is already written.%
+ }%
+ \else
+ \ifx\EmFi@list\ltx@empty
+ \else
+% \end{macrocode}
+% Write |/EmbeddedFiles| entry.
+% \begin{macrocode}
+ \global\EmFi@finishedtrue
+ \begingroup
+ \def\do##1##2{%
+ (##1)##2%
+ }%
+ \immediate\pdfobj{%
+ <<%
+ /Names[\EmFi@list]%
+ >>%
+ }%
+ \pdfnames{%
+ /EmbeddedFiles \the\pdflastobj\ltx@space 0 R%
+ }%
+ \endgroup
+% \end{macrocode}
+% Write collection objects.
+% \begin{macrocode}
+ \ifx\EmFi@initialfile\ltx@empty
+ \else
+ \EmFi@collectiontrue
+ \fi
+ \ifEmFi@collection
+ \ifx\EmFi@initialfile\ltx@empty
+ \let\EmFi@@initialfile\ltx@empty
+ \else
+ \edef\EmFi@@initialfile{%
+ \pdf@escapestring{\EmFi@initialfile}%
+ }%
+ \fi
+% \end{macrocode}
+% Look for initial file among the embedded files.
+% \begin{macrocode}
+ \begingroup
+ \let\f=N%
+ \def\do##1##2{%
+ \def\x{##1}%
+ \ifx\x\EmFi@@initialfile
+ \let\f=Y%
+ \let\do\ltx@gobbletwo
+ \fi
+ }%
+ \EmFi@list
+ \expandafter\endgroup
+ \ifx\f Y%
+ \else
+ \@PackageWarningNoLine{embedfile}{%
+ Missing initial file `\EmFi@initialfile'\MessageBreak
+ among the embedded files%
+ }%
+ \let\EmFi@initialfile\ltx@empty
+ \let\EmFi@@initialfile\ltx@empty
+ \fi
+ \ifcase\EmFi@sortcase
+ \def\EmFi@temp{}%
+ \or
+ \def\EmFi@temp{%
+ /S\EmFi@sortkeys
+ /A \EmFi@sortorders
+ }%
+ \else
+ \def\EmFi@temp{%
+ /S[\EmFi@sortkeys]%
+ /A[\EmFi@sortorders]%
+ }%
+ \fi
+ \def\EmFi@@order##1{%
+ \ifnum\EmFi@order>1 %
+ /O ##1%
+ \fi
+ }%
+ \immediate\pdfobj{%
+ <<%
+ \ifx\EmFi@schema\ltx@empty
+ \else
+ /Schema<<\EmFi@schema>>%
+ \fi
+ \ifx\EmFi@@initialfile\ltx@empty
+ \else
+ /D(\EmFi@@initialfile)%
+ \fi
+ \ifx\EmFi@view\EmFi@S@tile
+ /View/T%
+ \else\ifx\EmFi@view\EmFi@S@hidden
+ /View/H%
+ \fi\fi
+ \ifx\EmFi@temp\ltx@empty
+ \EmFi@temp
+ \else
+ /Sort<<\EmFi@temp>>%
+ \fi
+ >>%
+ }%
+ \pdfcatalog{%
+ /Collection \the\pdflastobj\ltx@space0 R%
+ }%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname AtEndDocument\endcsname\relax
+\else
+ \AtEndDocument{\embedfilefinish}%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\EmFi@AtEnd%
+%</package>
+% \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 embedfile.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Simple test}
+%
+% \begin{macrocode}
+%<*test2>
+\input embedfile.sty\relax
+\embedfile[%
+ stringmethod=escape,%
+ mimetype=plain/text,%
+ desc={LaTeX docstrip source archive for package `embedfile'},%
+ id={embedfile.dtx}%
+]{embedfile.dtx}
+\nopagenumbers
+Test (plain-\TeX): {\tt embedfile.dtx} should be embedded.%
+
+\def\Test#1{%
+ \par
+ \embedfileifobjectexists{embedfile.dtx}{#1}{%
+ Object #1 (embedfile.dtx): %
+ \embedfilegetobject{embedfile.dtx}{#1}%
+ }{%
+ \errmessage{Missing object #1 (embedfile.dtx)}%
+ }%
+}
+\Test{EmbeddedFile}
+\Test{Filespec}
+\embedfilefinish
+\bye
+%</test2>
+% \end{macrocode}
+% \begin{macrocode}
+%<*test3>
+\NeedsTeXFormat{LaTeX2e}
+\let\SavedJobname\jobname
+\def\jobname{embedfile}
+\RequirePackage{dtx-attach}[2018/11/01]
+\let\jobname\SavedJobname
+\documentclass{minimal}
+\begin{document}
+ Test (\LaTeX): \texttt{embedfile.dtx} should be embedded.%
+\end{document}
+%</test3>
+% \end{macrocode}
+%
+% \subsection{Test for \iniTeX}
+%
+% \begin{macrocode}
+%<*test4>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\input ifluatex.sty %
+\ifluatex
+ \directlua{%
+ tex.enableprimitives('', {%
+ 'pdflastobj',%
+ 'pdfnames',%
+ 'pdfobj',%
+ 'pdfoutput'%
+ })%
+ }%
+ \ifx\pdfextension\undefined\else
+ \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax}
+ \protected\def\pdfnames {\pdfextension names }
+ \protected\def\pdfobj {\pdfextension obj }
+ \let\pdfoutput \outputmode
+ \fi
+\fi
+\pdfoutput=1 %
+\input embedfile.sty %
+\shipout\hbox{}
+\embedfile[%
+ stringmethod=escape,%
+ mimetype=plain/text,%
+ desc={iniTeX source},%
+]{\jobname.tex}
+\embedfilefinish
+\end
+%</test4>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/embedfile}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/embedfile.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/embedfile.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[\CTAN{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 embedfile.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@{}}
+% embedfile.sty & tex/generic/oberdiek/embedfile.sty\\
+% dtx-attach.sty & tex/generic/oberdiek/dtx-attach.sty\\
+% embedfile.pdf & doc/latex/oberdiek/embedfile.pdf\\
+% embedfile-example-plain.tex & doc/latex/oberdiek/embedfile-example-plain.tex\\
+% embedfile-example-collection.tex & doc/latex/oberdiek/embedfile-example-collection.tex\\
+% test/embedfile-test1.tex & doc/latex/oberdiek/test/embedfile-test1.tex\\
+% test/embedfile-test2.tex & doc/latex/oberdiek/test/embedfile-test2.tex\\
+% test/embedfile-test3.tex & doc/latex/oberdiek/test/embedfile-test3.tex\\
+% test/embedfile-test4.tex & doc/latex/oberdiek/test/embedfile-test4.tex\\
+% embedfile.dtx & source/latex/oberdiek/embedfile.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk embedfile.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{embedfile.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 embedfile.dtx
+%makeindex -s gind.ist embedfile.idx
+%pdflatex embedfile.dtx
+%makeindex -s gind.ist embedfile.idx
+%pdflatex embedfile.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{embedfile.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='embedfile'>
+ <name>embedfile</name>
+ <caption>Embed files into PDF.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006-2011'/>
+ <license type='lppl1.3'/>
+ <version number='2.8'/>
+ <description>
+ This package embeds files in a PDF document, using the PDF
+ format's embedding operation (note the contrast with the attach
+ operation used by the <xref refid='attachfile'>attachfile</xref>
+ and <xref refid='attachfile2'>attachfile2</xref> packages).
+ Currently only <xref refid='pdftex'>pdfTeX</xref> &gt;=1.30, in
+ PDF mode, is supported.
+
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/embedfile.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/embedfile.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{attachfile}
+% Scott Pakin: \textit{The \xpackage{attachfile} package};
+% 2005/02/20 v1.2;
+% \CTAN{macros/latex/contrib/attachfile/}.
+%
+% \bibitem{attachfile2}
+% Heiko Oberdiek: \textit{The \xpackage{attachfile2} package};
+% 2006/08/16 v2.2;
+% \CTAN{macros/latex/contrib/oberdiek/attachfile2.pdf}.
+%
+% \bibitem{pdfspec}
+% Adobe Systems Incorporated:
+% \href{http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference.pdf}%
+% {\textit{PDF Reference, Sixth Edition, Version 1.7}},%
+% Oktober 2006;
+% \url{http://www.adobe.com/devnet/pdf/pdf_reference.html}.
+%
+% \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}{2006/08/16 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.1}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.2}
+% \item
+% Fixes for plain-TeX, wrapper for package \xpackage{keyval} added.
+% \item
+% Catcode section rewritten.
+% \end{Version}
+% \begin{Version}{2007/10/28 v2.0}
+% \item
+% Collection support added (PDF 1.7).
+% \end{Version}
+% \begin{Version}{2007/10/29 v2.1}
+% \item
+% Export of object references by adding new option \xoption{id} and
+% new macros \cs{embedfileifobjectexists} and \cs{embedfilegetobject}.
+% \end{Version}
+% \begin{Version}{2007/11/11 v2.2}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2007/11/25 v2.3}
+% \item
+% Fix in use of \cs{pdf@filesize}, bug introduced in previous version.
+% \end{Version}
+% \begin{Version}{2009/09/25 v2.4}
+% \item
+% Bug fix: If \xpackage{hyperref} is used with option \xoption{unicode},
+% the Unicode encoded file name causes trouble. Therefore \cs{pdfstringdef}
+% is now never used for option \xoption{filespec}, always method
+% \texttt{escape} is applied (Peter Cibulka).
+% \item
+% Bug fix for \xoption{initialfile}.
+% \item
+% Bug fix for file names in \texttt{/EmbeddedFiles}.
+% \item
+% New option \xoption{ucfilespec} for file name support in Unicode
+% (since PDF 1.7).
+% \end{Version}
+% \begin{Version}{2010/03/01 v2.5}
+% \item
+% Compatibility for \iniTeX.
+% \item
+% Package \xpackage{keyval} replaced by packages \xpackage{kvsetkeys}
+% and \xpackage{kvdefinekeys} because of compatibility for \iniTeX.
+% \item
+% TDS location moved from TDS:tex/latex/oberdiek/embedfile.sty to
+% TDS:tex/generic/oberdiek/embedfile.sty.
+% \end{Version}
+% \begin{Version}{2011/04/13 v2.6}
+% \item
+% Docu fixes (thanks Hans-Martin M\"unch).
+% \end{Version}
+% \begin{Version}{2016/05/15 v2.7}
+% \item
+% LuaTeX compatibility
+% \end{Version}
+% \begin{Version}{2018/11/01 v2.8}
+% \item
+% Remove luatex85 package depenency.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/embedfile.pdf b/macros/latex/contrib/oberdiek/embedfile.pdf
new file mode 100644
index 0000000000..1f3ecc552a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/embedfile.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/engord.dtx b/macros/latex/contrib/oberdiek/engord.dtx
new file mode 100644
index 0000000000..5fb4bed15a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/engord.dtx
@@ -0,0 +1,1043 @@
+% \iffalse meta-comment
+%
+% File: engord.dtx
+% Version: 2016/05/16 v1.9
+% Info: Provides English ordinal numbers
+%
+% Copyright (C) 2000, 2003, 2006-2008, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 engord.dtx
+% and the derived files
+% engord.sty, engord.pdf, engord.ins, engord.drv, engord-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/engord.dtx
+% CTAN:macros/latex/contrib/oberdiek/engord.pdf
+%
+% Unpacking:
+% (a) If engord.ins is present:
+% tex engord.ins
+% (b) Without engord.ins:
+% tex engord.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{engord.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If engord.drv is present:
+% latex engord.drv
+% (b) Without engord.drv:
+% latex engord.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 engord.dtx
+% makeindex -s gind.ist engord.idx
+% pdflatex engord.dtx
+% makeindex -s gind.ist engord.idx
+% pdflatex engord.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/engord.sty
+% TDS:doc/latex/oberdiek/engord.pdf
+% TDS:doc/latex/oberdiek/test/engord-test1.tex
+% TDS:source/latex/oberdiek/engord.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: engord 2016/05/16 v1.9 Provides English ordinal numbers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: engord
+Version: 2016/05/16 v1.9
+
+Copyright (C) 2000, 2003, 2006-2008, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 engord.dtx
+and the derived files
+ engord.sty, engord.pdf, engord.ins, engord.drv, engord-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{engord.ins}{\from{engord.dtx}{install}}%
+ \file{engord.drv}{\from{engord.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{engord.sty}{\from{engord.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{engord-test1.tex}{\from{engord.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{engord.xml}{\from{engord.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{* engord.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `engord.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{engord.drv}%
+ [2016/05/16 v1.9 Provides English ordinal numbers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{engord.dtx}%
+\end{document}
+%</driver>
+% \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{engord.drv}
+%
+% \title{The \xpackage{engord} package}
+% \date{2016/05/16 v1.9}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package generates the suffix of English ordinal numbers.
+% It can be used with plain and \LaTeX\ formats.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \begin{declcs}{engord}\,\M{\LaTeX\ counter name}
+% \end{declcs}
+% It prints the value of the \LaTeX\ counter as English
+% ordinal number. It can be used in the same way as
+% \cs{arabic}, \cs{roman}, or \cs{alph}. The command is
+% not available in \plainTeX.
+%
+% \begin{declcs}{engordnumber}\,\M{any \TeX\ number}
+% \end{declcs}
+% It prints the number as English ordinal number.
+%
+% \begin{declcs}{engordletters}\,|{#1}|
+% \end{declcs}
+% This command formats the English ordinal letters
+% after the number. It defaults to \cs{textsuperscript}.
+%
+% \begin{declcs}{engorderror}\,|{#1}|
+% \end{declcs}
+% It can be redefined, if an other error handling is
+% wanted. The argument is a negative number or zero.
+%
+% \begin{declcs}{engordraisetrue}\\
+% \SpecialUsageIndex{\engordraisefalse}\cs{engordraisefalse}
+% \end{declcs}
+% These commands set the switch \cs{ifengordraise} that is
+% asked by the default \cs{engordletters} before raising the
+% ordinal letters.
+%
+% \subsection{Package options}
+%
+% \begin{description}
+% \item[\xoption{normal}:] \cs{engordraisefalse}
+% \item[\xoption{raise}:] \cs{engordraisetrue}
+% \end{description}
+% Default is \xoption{raise}.
+%
+% \subsection{Examples}
+%
+% \begin{itemize}
+% \item
+% |\usepackage[normal]{engord}|\\
+% \begin{tabular}{@{}l@{ $\rightarrow$ }l@{}}
+% |\engordnumber{1}| & 1st\\
+% |\engordnumber{12}| & 12th\\
+% |\engordnumber{123}| & 123rd\\
+% |\engord{page}| & 1st (if page has the value of one)\\
+% \multicolumn{2}{@{}l}{\cs{engordraisetrue}}\\
+% |\engordnumber{12}| & 12\textsuperscript{th}
+% \end{tabular}
+% \item
+% The default output of a counter can be redefined:
+% \begin{quote}
+% |\newcounter{mycounter}|\\
+% |\renewcommand{\theengcounter}{\engord{mycounter}}|
+% \end{quote}
+% \item
+% Because the implementation of \cs{engord} and \cs{engordnumber}
+% is kept expandable, these commands can be used to make
+% command names with an appropriate definition of
+% \cs{engordletters}:
+% \begin{quote}
+% |\renewcommand*{\engordletters}[1]{#1}|\\
+% |\@namedef{My\engordnumber{3}Command}{...}|
+% \end{quote}
+% This generates the command name `\cs{My4rdCommand}'.
+% Since version 1.2 the redefinition can be dropped if
+% the letters are not raised.
+% \item
+% If the letters should not be raised, use \LaTeX\ package
+% option \xoption{normal} or use
+% \begin{quote}
+% \cs{engordraisefalse}
+% \end{quote}
+% Also \cs{engordletters} could be redefined for this purpose:
+% \begin{quote}
+% |\renewcommand*{\engordletters}[1]{#1}|
+% \end{quote}
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Reload check and identification}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@engord.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{engord}{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@engord.sty\endcsname
+\ProvidesPackage{engord}%
+ [2016/05/16 v1.9 Provides English ordinal numbers (HO)]%
+% \end{macrocode}
+%
+% \subsection{Help commands for plain compatibility}
+%
+% \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 EO@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\EO@AtEnd{%
+ \EO@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{36}{3}% $
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^(superscript)
+\TMP@EnsureCode{96}{12}% `
+\edef\EO@AtEnd{\EO@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \begin{macro}{\EO@def}
+% Definitions, \cs{newcommand} does not exist in \plainTeX.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname newcommand\endcsname\relax
+ \def\EO@def{\def}%
+\else
+ \def\EO@def#1{%
+ \newcommand*{#1}{}%
+ \def#1%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+ \input ltxcmds.sty\relax
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{ltxcmds}[2016/05/16]%
+\fi
+% \end{macrocode}
+%
+% \subsection{User macros}
+%
+% \begin{macro}{\ifengordraise}
+% The switch \cs{ifengordraise}, whether the ordinal letters
+% are raised or not. Default is raised because of compatibility.
+% \begin{macrocode}
+\ltx@newif\ifengordraise
+\engordraisetrue
+% \end{macrocode}
+% \end{macro}
+% In \LaTeX\ this also can be controlled by option \xoption{normal}
+% or \xoption{raise}.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname DeclareOption\endcsname\relax
+\else
+ \DeclareOption{normal}{\engordraisefalse}%
+ \DeclareOption{raise}{\engordraisetrue}%
+ \ProcessOptions*\relax
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\engordletters}
+% \cs{engordletters} is called with one argument, the english
+% ordinal letters, and contains the code to format them. It
+% defaults to \cs{textsuperscript} depending on \cs{ifengordraise}.
+% \begin{macrocode}
+\expandafter\ifx\csname engordletters\endcsname\relax
+ \EO@def\engordletters{%
+ \ifengordraise
+ \expandafter\engordtextsuperscript
+ \fi
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\engordtextsuperscript}
+% For \plainTeX\ the definition is quite ugly, redefine
+% \cs{engordtextsuperscript} if you have a better one.
+% \begin{macrocode}
+\expandafter\ifx\csname engordtextsuperscript\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname textsuperscript\endcsname\relax
+ \def\engordtextsuperscript#1{%
+ \relax
+ \ifmmode
+ ^{\rm#1}%
+ \else
+ $^{\rm#1}$%
+ \fi
+ }%
+ \else
+ \def\engordtextsuperscript{\textsuperscript}%
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\engorderror}
+% \cs{engorderror} is called, if the number is zero
+% or negative.
+% \begin{macrocode}
+\expandafter\ifx\csname engorderror\endcsname\relax
+ \EO@def\engorderror#1{%
+ #1\engordletters{!ERROR!}%
+ \@PackageWarning{engord}{%
+ `#1' is not an ordinal number%
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\engord}
+% \cs{engord} expects a \LaTeX\ counter name as argument and
+% calls \cs{engordnumber}. It is defined only, if \LaTeX\ is used.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname newcounter\endcsname\relax
+\else
+ \EO@def\engord#1{%
+ \engordnumber{\value{#1}}%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\engordnumber}
+% \cs{engordnumber} is the user command to print a number as
+% english ordinal number. The argument can be any
+% \TeX\ number like explicit numbers, register values, \dots
+%
+% In a safe way it converts the \TeX\ number argument
+% into a form that only consists of decimal digits.
+% \begin{macrocode}
+\EO@def\engordnumber#1{%
+ \expandafter\EO@number\expandafter{\number#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Suffix generation}
+%
+% \begin{macro}{\EO@number}
+% \cs{EO@number} expects a number with decimal digits as
+% argument and looks at the size of the number and
+% the count of the digits:
+% \begin{macrocode}
+\def\EO@number#1{%
+ \ifnum#1<1 % handle the error case
+ \engorderror{#1}%
+ \else
+ \ifnum#1<21 %
+ \EO@ord{#1}%
+ \else
+ \ifnum#1<100 %
+ \EO@twodigits#1%
+ \else
+ \@ReturnAfterFi{%
+ \EO@reverse#1\@nil{}\EO@afterreverse
+ }%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ReturnAfterFi}
+% An internal help macro to prevent a too deep \cs{if} nesting.
+% \begin{macrocode}
+\long\def\@ReturnAfterFi#1\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EO@ord}
+% \cs{EO@ord} prints the number with ord letters.\\
+% |#1|: decimal digits, |#1| $<$ 21
+% \begin{macrocode}
+\def\EO@ord#1{%
+ #1%
+ \expandafter\engordletters
+ \ifcase#1{th}\or
+ {st}\or
+ {nd}\or
+ {rd}\else
+ {th}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EO@twodigits}
+% \cs{EO@twodigits} expects a number with two digits,\\
+% 20 $<$ number $<$ 100
+% \begin{macrocode}
+\def\EO@twodigits#1#2{%
+ #1\EO@ord{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EO@reverse}
+% \cs{EO@reverse} reverses the digits of the number.\\
+% |#1|: next digit\\
+% |#2|: rest of the digits\\
+% |#3|: already reversed digits\\
+% |#4|: next command to call with the reversed number
+% as argument
+% \begin{macrocode}
+\def\EO@reverse#1#2\@nil#3#4{%
+ \ifx\\#2\\%
+ #4{#1#3}%
+ \else
+ \@ReturnAfterFi{%
+ \EO@reverse#2\@nil{#1#3}{#4}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EO@afterreverse}
+% \cs{EO@afterreverse} calls \cs{EO@reverseback} so that
+% \cs{EO@reverseback} can inspect the digits of the number.
+% \begin{macrocode}
+\def\EO@afterreverse#1{%
+ \EO@reverseback#1\@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EO@reverseback}
+% \cs{EO@reverseback} reverses the reversion.\\
+% |#1|: the last digit of the number\\
+% |#2|: the second last digit of the number\\
+% |#3|: first digits of the number in reversed order,
+% it is not empty, because \cs{EO@reverseback} is
+% only called with numbers $>$ 100.
+% \begin{macrocode}
+\def\EO@reverseback#1#2#3\@nil{%
+ \EO@reverse#3\@nil{}\@firstofone
+ \ifnum#2#1<21 %
+ \EO@ord{#2#1}%
+ \else
+ #2\EO@ord{#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\EO@AtEnd%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \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 engord.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/engord}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/engord.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/engord.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[\CTAN{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 engord.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@{}}
+% engord.sty & tex/generic/oberdiek/engord.sty\\
+% engord.pdf & doc/latex/oberdiek/engord.pdf\\
+% test/engord-test1.tex & doc/latex/oberdiek/test/engord-test1.tex\\
+% engord.dtx & source/latex/oberdiek/engord.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk engord.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{engord.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 engord.dtx
+%makeindex -s gind.ist engord.idx
+%pdflatex engord.dtx
+%makeindex -s gind.ist engord.idx
+%pdflatex engord.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{engord.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='engord'>
+ <name>engord</name>
+ <caption>Converts numbers to English ordinal numbers.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2000,2003,2006-2008,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.9'/>
+ <description>
+ Defines <tt>\engord</tt> (used like <tt>\arabic</tt>,
+ <tt>\roman</tt>, etc.), and <tt>\engordnumber</tt> (which formats
+ a &#x201C;TeX number&#x201D;).
+ <p/>
+ So <tt>\pagenumbering{engord}</tt> gives page numbers <tt>1st,
+ 2nd, 3rd, ...</tt>
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/engord.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/engord.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2000/05/23 v1.0}
+% \item
+% First public release, published in newsgroup \xnewsgroup{de.comp.text.tex}:\\
+% \URL{``\link{Re: Ordinalzahlen in LaTeX?}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/738e2cb4c51759d6}
+% \end{Version}
+% \begin{Version}{2003/04/28 v1.1}
+% \item
+% Bug fix for 30, 40, 50, \dots, 100, 130, \dots
+% \item
+% \cs{ordletters} renamed to documented \cs{engordletters}.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.2}
+% \item
+% Support for \plainTeX.
+% \item
+% Switch \cs{ifengordraise} added.
+% \item
+% Package options \xoption{raise} and \xoption{normal} added.
+% \item
+% DTX framework.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.3}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/04/26 v1.4}
+% \item
+% Use of package \xpackage{infwarerr}.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.5}
+% \item
+% Catcode section added.
+% \end{Version}
+% \begin{Version}{2007/09/20 v1.6}
+% \item
+% Short description fixed (George White).
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.7}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.8}
+% \item
+% Compatibility with \iniTeX.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.9}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/engord.pdf b/macros/latex/contrib/oberdiek/engord.pdf
new file mode 100644
index 0000000000..25ed642363
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/engord.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/enparen.dtx b/macros/latex/contrib/oberdiek/enparen.dtx
new file mode 100644
index 0000000000..301bbe3c3e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/enparen.dtx
@@ -0,0 +1,987 @@
+% \iffalse meta-comment
+%
+% File: enparen.dtx
+% Version: 2016/05/16 v1.1
+% Info: Parentheses nesting
+%
+% Copyright (C) 2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file enparen.dtx
+% and the derived files
+% enparen.sty, enparen.pdf, enparen.ins, enparen.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/enparen.dtx
+% CTAN:macros/latex/contrib/oberdiek/enparen.pdf
+%
+% Unpacking:
+% (a) If enparen.ins is present:
+% tex enparen.ins
+% (b) Without enparen.ins:
+% tex enparen.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{enparen.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If enparen.drv is present:
+% latex enparen.drv
+% (b) Without enparen.drv:
+% latex enparen.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 enparen.dtx
+% makeindex -s gind.ist enparen.idx
+% pdflatex enparen.dtx
+% makeindex -s gind.ist enparen.idx
+% pdflatex enparen.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/enparen.sty
+% TDS:doc/latex/oberdiek/enparen.pdf
+% TDS:source/latex/oberdiek/enparen.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: enparen 2016/05/16 v1.1 Parentheses nesting (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: enparen
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file enparen.dtx
+and the derived files
+ enparen.sty, enparen.pdf, enparen.ins, enparen.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{enparen.ins}{\from{enparen.dtx}{install}}%
+ \file{enparen.drv}{\from{enparen.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{enparen.sty}{\from{enparen.dtx}{package}}%
+}
+
+\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{* enparen.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `enparen.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{enparen.drv}%
+ [2016/05/16 v1.1 Parentheses nesting (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{enparen}[2016/05/16]
+\begin{document}
+ \DocInput{enparen.dtx}%
+\end{document}
+%</driver>
+% \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{enparen.drv}
+%
+% \title{The \xpackage{enparen} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package defines macros to set parentheses that automatically
+% change the symbols from inner to outer fences.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% The \hologo{LaTeX} package provides macros for automatically changed
+% parentheses symbols depending on the fence order.
+% The innermost parentheses are always using the same
+% parentheses. The symbols changes for the outer fences.
+%
+% Example:
+% \begin{quote}
+% \enparen{a \enparen{b} \enparen{c \enparen{d}} \enparen{e}}
+% \end{quote}
+% is generated by
+%\begin{quote}
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{enparen}
+%\begin{document}
+% \enparen{a \enparen{b} \enparen{c \enparen{d}} \enparen{e}}
+%\end{document}
+%\end{verbatim}
+%\end{quote}
+%
+% The package is the result of a newsgroup thread. Dan gives
+% the following specification \cite{dan}:
+% \begin{quote}
+% ``On the other hand, the rules for fences are usually the reverse:
+% innermost fences are always |()|, next outer are |[]|, etc. This means
+% the opening fence has to wait until all the fences between it and
+% the matching close have been detected before it can decide whether
+% to be |(| or |[| or |{|.''
+% \end{quote}
+%
+% The fence level counting starts from innermost parentheses with one.
+% For the next outer fences the level is increased by one.
+% The example above with level indexes:
+% \begin{quote}
+% \def\1{\ensuremath{_{1}}}
+% \def\2{\ensuremath{_{2}}}
+% \def\3{\ensuremath{_{3}}}
+% \enparen{\3a \enparen{\1b}\1 \enparen{\2c \enparen{\1d}\1}\2 \enparen{e}}\3
+% \end{quote}
+% The correct level is only known at the closing symbol. Therefore the
+% correct value is remembered in the main \xext{aux} file and used
+% in the second \hologo{LaTeX} run.
+%
+% \subsection{User macros}
+%
+% \begin{declcs}{enparen} \M{text}
+% \end{declcs}
+% The macro \cs{enparen} puts its argument \meta{text} in parentheses.
+% If the macro is nested, the used fence symbols change for the
+% outer fences.
+%
+% \begin{declcs}{enparenLeft}\\
+% \cs{enparenRight}
+% \end{declcs}
+% Instead of |\enparen{text}| the left and right symbol can be
+% used separately, but in pairs:
+% \begin{quote}
+% |\enparenLeft text\enparenRight|
+% \end{quote}
+% \cs{enparenLeft} and \cs{enparenRight} may be used at different
+% group levels, but they must be properly nested.
+%
+% \begin{declcs}{enparenSetSymbols} \M{level} \M{opening symbol} \M{closing symbol}
+% \end{declcs}
+% Macro \cs{enparenSetSymbols} configures the \meta{opening symbol} and
+% \meta{closing symbol} for the \meta{level}. The \meta{level}
+% is a number and the counting starts with one. Level zero is used,
+% if the correct level is not known (e.g. in the first \hologo{LaTeX} run).
+% The package defines the following sets:
+%\begin{quote}
+%\begin{verbatim}
+%\enparenSetSymbols{0}{(}{)}
+%\enparenSetSymbols{1}{(}{)}
+%\enparenSetSymbols{2}{[}{]}
+%\enparenSetSymbols{3}{\{}{\}}
+%\end{verbatim}
+%\end{quote}
+% Example for changing the third and adding a fourth level:
+%\begin{quote}
+%\begin{verbatim}
+%\enparenSetSymbols{3}{\ensuremath{\langle}}{\ensuremath{\rangle}}
+%\enparenSetSymbols{4}{\{}{\}}
+%\end{verbatim}
+%\end{quote}
+%
+% \begin{declcs}{enparenUnsetSymbols} \M{level}
+% \end{declcs}
+% The symbols for level \meta{level} are removed.
+% Example scenario: Only two nesting levels must be used,
+% the package defines more, then the third level can be
+% disabled by |\enparenUnsetSymbols{3}| and the user
+% gets warnings if parentheses at level 3 are needed.
+%
+% \subsection{Contexts}
+%
+% \begin{declcs}{enparenBeginContext} \M{name}\\
+% \cs{enparenEndContext} \M{name}
+% \end{declcs}
+% If the current text is interrupted by footnotes, floats
+% with captions, then the parentheses inside the text of footnotes,
+% captions, \dots should restart from scratch. This can be achieved
+% by embedding the text inside macros \cs{enparenBeginContext}
+% and \cs{enparenEndContext}. These macros must be properly nested.
+% The \meta{name} for the begin and end macro must be the same.
+% It is a help for debugging problems, because the warning messages
+% show the context name. But it is not necessary that the
+% begin\slash end pairs have different names. Example:
+%\begin{quote}
+%\begin{verbatim}
+%\enparenLeft text before table ...
+%\begin{table}
+% \caption{Table caption}
+% \enparenBegin{Context}{table}
+% Other text \enparen{foobar}.
+% \enparenEnd{Context}{table}
+%\end{table}
+%text after table ...
+%\enparenRight
+%\end{verbatim}
+%\end{quote}
+% The parentheses inside the table environment and context `table'
+% are not nested inside other parentheses: \enparen{foobar}.
+% In case of captions and footnotes the contexts are automatically
+% added, see next section about options.
+%
+% \subsection{Options}
+%
+% \begin{declcs}{enparenSetup} \M{key value list}
+% \end{declcs}
+% Some options (currently all) can also be set after the
+% package is loaded. They can be set in the argument
+% \meta{key value list} of \cs{enparenSetup}. Options are disabled
+% after they are used the last time. Currently all options are boolean
+% options and are disabled in |\begin{document}|.
+%
+% \begin{description}
+% \item[\xoption{caption}:] The caption text is put in a
+% context |caption|.
+% \item[\xoption{footnote}:] The footnote text is put in a
+% context |footnote|.
+% \end{description}
+%
+% Example for disabling the two options at different places:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage[caption=false]{enparen}
+%\enparenSetup{footnote=false}
+%\end{verbatim}
+%\end{quote}
+%
+% \subsection{Notes}
+%
+% \begin{description}
+% \item[Implicite kerning:]
+% Unexpandable stuff might affect the implicite kerning.
+% The package cannot avoid this, because it need to define
+% and redefine macros at the occurence of each symbol.
+% This is done before the opening and after the closing
+% symbol, thus that the implicite kerning inside
+% is not affected.
+% \end{description}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{enparen}
+ [2016/05/16 v1.1 Parentheses nesting (HO)]%
+% \end{macrocode}
+%
+% \subsection{Resources}
+%
+% \begin{macrocode}
+\RequirePackage{ltxcmds}[2011/11/09]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ltx@IfUndefined{numexpr}{%
+ \PackageError{enparen}{%
+ Missing e-TeX's \ltx@backslashchar numexpr.\MessageBreak
+ The package will continue with emergency definitions%
+ }\@ehc
+ \def\enparenLeft{(}%
+ \def\enparenRight{)}%
+ \long\def\enparen#1{\enparenLeft#1\enparenRight}%
+ \let\enparenSetup\ltx@gobble
+ \let\enparenSetSymbols\ltx@gobblethree
+ \let\enparenUnsetSymbols\ltx@gobble
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{protecteddef}[2011/01/31]
+\RequirePackage{atveryend}[2011/06/30]
+\RequirePackage{uniquecounter}[2011/01/30]
+\RequirePackage{zref-base}[2011/03/18]
+\RequirePackage{kvoptions}[2011/06/30]
+\RequirePackage{kvsetkeys}[2011/10/18]
+% \end{macrocode}
+%
+% \begin{macro}{\zref@wrapper@mainaux}
+% \begin{macrocode}
+\providecommand{\zref@wrapper@mainaux}[1]{%
+ \ifx\@auxout\@mainaux
+ #1%
+ \else
+ \begingroup
+ \let\@auxout\@mainaux
+ #1%
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\UniqueCounterNew{enparen}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\zref@newprop{enparen}[0]{}
+% \end{macrocode}
+%
+% \subsection{Contexts}
+%
+% \begin{macro}{\enparenContextDefault}
+% \begin{macrocode}
+\def\enparenContextDefault{main}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparen@ctx}
+% \begin{macrocode}
+\let\enparen@ctx\ltx@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparen@stack}
+% \begin{macrocode}
+\let\enparen@stack\ltx@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Stack for contexts}
+%
+% \begin{macro}{\enparen@CtxStack}
+% \begin{macrocode}
+\global\let\enparen@CtxStack\ltx@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparen@CtxStackPush}
+% \begin{macrocode}
+\def\enparen@CtxStackPush#1{%
+ \xdef\enparen@CtxStack{%
+ {\enparen@ctx}{\enparen@stack}%
+ \enparen@CtxStack
+ }%
+ \xdef\enparen@ctx{#1}%
+ \global\let\enparen@stack\ltx@empty
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparen@CtxStackPop}
+% \begin{macrocode}
+\def\enparen@CtxStackPop{%
+ \ifx\enparen@CtxStack\ltx@empty
+ \PackageWarning{enparen}{%
+ Pop request for empty context stack%
+ }%
+ \global\let\enparen@ctx\enparenContextDefault
+ \global\let\enparen@stack\ltx@empty
+ \else
+ \xdef\enparen@ctx{%
+ \expandafter\ltx@car\enparen@CtxStack\@nil
+ }%
+ \xdef\enparen@stack{%
+ \expandafter\ltx@carsecond\enparen@CtxStack\@nil
+ }%
+ \xdef\enparen@CtxStack{%
+ \expandafter\ltx@cdrtwo\enparen@CtxStack\@nil
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Context user macros}
+%
+% \begin{macro}{\enparenBeginContext}
+% \begin{macrocode}
+\ProtectedDef*{\enparenBeginContext}[1]{%
+ \enparen@CtxStackPush{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\enparenEndContext}
+% \begin{macrocode}
+\ProtectedDef*{\enparenEndContext}[1]{%
+ \edef\enparen@temp{#1}%
+ \ifx\enparen@temp\enparen@ctx
+ \else
+ \PackageWarning{enparen}{%
+ Context mismatch in end request.\MessageBreak
+ `#1' should be ended, but current context\MessageBreak
+ is `\enparen@ctx'%
+ }%
+ \fi
+ \enparenCheckEmptyStack
+ \enparen@CtxStackPop
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparenCheckEmptyStack}
+% \begin{macrocode}
+\ProtectedDef*{\enparenCheckEmptyStack}[0]{%
+ \ifx\enparen@stack\ltx@empty
+ \else
+ \PackageWarning{enparen}{%
+ Ending non-empty stack `\enparen@ctx':\MessageBreak
+ \enparen@PrintStack\MessageBreak
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparen@PrintStack}
+% \begin{macrocode}
+\def\enparen@PrintStack{%
+ \expandafter\enparen@PrintStackAux
+ \enparen@stack\ltx@empty\ltx@empty
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\enparen@PrintStackAux}
+% \begin{macrocode}
+\def\enparen@PrintStackAux#1#2{%
+ \ifx\ltx@empty#1%
+ \else
+ {#1:#2}%
+ \expandafter\enparen@PrintStackAux
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Symbols}
+%
+% \begin{macro}{\enparenSetSymbols}
+% \begin{macrocode}
+\ProtectedDef*{\enparenSetSymbols}[3]{%
+ \expandafter
+ \def\csname enparen@symbol\the\numexpr#1L\endcsname{#2}%
+ \expandafter
+ \def\csname enparen@symbol\the\numexpr#1R\endcsname{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\enparenUnsetSymbols}
+% \begin{macrocode}
+\ProtectedDef*{\enparenUnsetSymbols}[1]{%
+ \expandafter
+ \let\csname enparen@symbol\the\numexpr#1L\endcsname\ltx@undefined
+ \expandafter
+ \let\csname enparen@symbol\the\numexpr#1R\endcsname\ltx@undefined
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\enparenSetSymbols{0}{(}{)}
+\enparenSetSymbols{1}{(}{)}
+\enparenSetSymbols{2}{[}{]}
+\enparenSetSymbols{3}{\{}{\}}
+\enparenSetSymbols{4}{\ensuremath{\langle}}{\ensuremath{\rangle}}
+% \end{macrocode}
+%
+% \subsection{Main user macros}
+%
+% \begin{macro}{\enparen}
+% \begin{macrocode}
+\ProtectedDef{\enparen}[1]{%
+ \enparenLeft#1\enparenRight
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparenLeft}
+% \begin{macrocode}
+\ProtectedDef*{\enparenLeft}[0]{%
+ \UniqueCounterCall{enparen}\enparen@Left
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\enparen@Left}
+% \begin{macrocode}
+\def\enparen@Left#1{%
+ \xdef\enparen@stack{%
+ {#1}{1}%
+ \expandafter\enparen@Inc\expandafter2\expandafter!%
+ \enparen@stack\ltx@empty\ltx@empty
+ }%
+ \edef\enparen@tmp{\zref@extract{enparen#1}{enparen}}%
+ \ltx@IfUndefined{enparen@symbol\enparen@tmp L}{%
+ \PackageWarning{enparen}{%
+ Undefined symbols for level \enparen@tmp
+ }%
+ \csname enparen@symbol0L\endcsname
+ }{%
+ \csname enparen@symbol\enparen@tmp L\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\enparen@Inc}
+% \begin{macrocode}
+\def\enparen@Inc#1!#2#3{%
+ \ifx\ltx@empty#2%
+ \else
+ \ifnum#3<#1 %
+ {#2}{#1}%
+ \expandafter\enparen@Inc
+ \the\numexpr#1+1\expandafter\expandafter\expandafter!%
+ \else
+ {#2}{#3}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparenRight}
+% \begin{macrocode}
+\ProtectedDef*{\enparenRight}[0]{%
+ \ifx\enparen@stack\ltx@empty
+ \PackageWarning{enparen}{%
+ Missing left symbol for right symbol%
+ }%
+ \csname enparen@symbol0R\endcsname
+ \else
+ \expandafter\enparen@Right\enparen@stack\@nil
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparen@Right}
+% \begin{macrocode}
+\def\enparen@Right#1#2#3\@nil{%
+ \ltx@IfUndefined{%
+ enparen@symbol%
+ \zref@extract{enparen#1}{enparen}%
+ R%
+ }{%
+ \csname enparen@symbol0R\endcsname
+ }{%
+ \csname
+ enparen@symbol%
+ \zref@extract{enparen#1}{enparen}%
+ R%
+ \endcsname
+ }%
+ \zref@wrapper@mainaux{%
+ \zref@setcurrent{enparen}{#2}%
+ \zref@labelbyprops{enparen#1}{enparen}%
+ }%
+ \xdef\enparen@stack{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Options}
+%
+% \begin{macrocode}
+\SetupKeyvalOptions{%
+ family=enparen,%
+ prefix=enparen@,%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\enparenSetup}
+% \begin{macrocode}
+\ProtectedDef*{\enparenSetup}[0]{%
+ \kvsetkeys{enparen}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareBoolOption[true]{footnote}
+\DeclareBoolOption[true]{caption}
+\ProcessKeyvalOptions*
+% \end{macrocode}
+%
+% \subsection{Context settings}
+%
+% \begin{macro}{\enparen@AtBegin}
+% \begin{macrocode}
+\def\enparen@AtBegin{%
+ \ifenparen@footnote
+ \let\enparen@org@makefntext\@makefntext
+ \long\def\@makefntext##1{%
+ \enparen@org@makefntext{%
+ \enparenBeginContext{footnote}%
+ ##1%
+ \enparenEndContext{footnote}%
+ }%
+ }%
+ \fi
+ \enparen@Disable{footnote}%
+ \ifenparen@caption
+ \let\enparen@org@makecaption\@makecaption
+ \long\def\@makecaption##1##2{%
+ \enparen@org@makecaption{##1}{%
+ \enparenBeginContext{caption}%
+ ##2%
+ \enparenEndContext{caption}%
+ }%
+ }%
+ \fi
+ \enparen@Disable{caption}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enparen@Disable}
+% \begin{macrocode}
+\def\enparen@Disable#1{%
+ \DisableKeyvalOption[%
+ action=warning,%
+ package=enparen,%
+ ]{enparen}{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\AtBeginDocument{\enparen@AtBegin}
+% \end{macrocode}
+%
+% \subsection{At end of document}
+%
+% \begin{macro}{\enparen@AtEnd}
+% \begin{macrocode}
+\def\enparen@AtEnd{%
+ \enparenCheckEmptyStack
+ \ifx\enparen@CtxStack\ltx@empty
+ \else
+ \PackageWarningNoLine{enparen}{%
+ Context stack is not empty at end of document.\MessageBreak
+ Current stack and contents of context stack:\MessageBreak
+ [\enparen@ctx]:[\enparen@PrintStack]%
+ \expandafter
+ \enparen@PrintContextStack\enparen@CtxStack\relax\relax
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\enparen@PrintContextStack}
+% \begin{macrocode}
+\def\enparen@PrintContextStack#1#2{%
+ \ifx\relax#1\ltx@empty
+ \else
+ \MessageBreak
+ [#1]:[\enparen@PrintStackAux#2\ltx@empty\ltx@empty]% hash-ok
+ \expandafter\enparen@PrintContextStack
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AtVeryEndDocument{\enparen@AtEnd}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/enparen}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/enparen.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/enparen.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[\CTAN{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 enparen.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@{}}
+% enparen.sty & tex/latex/oberdiek/enparen.sty\\
+% enparen.pdf & doc/latex/oberdiek/enparen.pdf\\
+% enparen.dtx & source/latex/oberdiek/enparen.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk enparen.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{enparen.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 enparen.dtx
+%makeindex -s gind.ist enparen.idx
+%pdflatex enparen.dtx
+%makeindex -s gind.ist enparen.idx
+%pdflatex enparen.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+% \bibitem{dan}
+% Dan Luecking: \textit{Re: bracket order};
+% newsgroup \xnewsgroup{comp.text.tex};
+% message id \texttt{\small$\langle$9b07c9c8-ff92-4cbf-b3a9-84efecfeb506@l24g2000yqm.googlegroups.com$\rangle$}
+% 2012-01-05.
+% \url{http://groups.google.com/group/comp.text.tex/msg/8774519da31c2352}
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2012/01/07 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/enparen.pdf b/macros/latex/contrib/oberdiek/enparen.pdf
new file mode 100644
index 0000000000..0431e37295
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/enparen.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/eolgrab.dtx b/macros/latex/contrib/oberdiek/eolgrab.dtx
new file mode 100644
index 0000000000..0965086c9a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/eolgrab.dtx
@@ -0,0 +1,1096 @@
+% \iffalse meta-comment
+%
+% File: eolgrab.dtx
+% Version: 2016/05/16 v1.1
+% Info: Catch arguments delimited by end of line
+%
+% Copyright (C) 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 eolgrab.dtx
+% and the derived files
+% eolgrab.sty, eolgrab.pdf, eolgrab.ins, eolgrab.drv,
+% eolgrab-example-ltx.tex, eolgrab-example-env.tex,
+% eolgrab-example-sec.tex, eolgrab-test1.tex,
+% eolgrab-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/eolgrab.dtx
+% CTAN:macros/latex/contrib/oberdiek/eolgrab.pdf
+%
+% Unpacking:
+% (a) If eolgrab.ins is present:
+% tex eolgrab.ins
+% (b) Without eolgrab.ins:
+% tex eolgrab.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{eolgrab.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If eolgrab.drv is present:
+% latex eolgrab.drv
+% (b) Without eolgrab.drv:
+% latex eolgrab.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 eolgrab.dtx
+% makeindex -s gind.ist eolgrab.idx
+% pdflatex eolgrab.dtx
+% makeindex -s gind.ist eolgrab.idx
+% pdflatex eolgrab.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/eolgrab.sty
+% TDS:doc/latex/oberdiek/eolgrab.pdf
+% TDS:doc/latex/oberdiek/example/eolgrab-example-ltx.tex
+% TDS:doc/latex/oberdiek/example/eolgrab-example-env.tex
+% TDS:doc/latex/oberdiek/example/eolgrab-example-sec.tex
+% TDS:doc/latex/oberdiek/test/eolgrab-test1.tex
+% TDS:doc/latex/oberdiek/test/eolgrab-test2.tex
+% TDS:source/latex/oberdiek/eolgrab.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: eolgrab 2016/05/16 v1.1 Catch arguments delimited by end of line (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: eolgrab
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 eolgrab.dtx
+and the derived files
+ eolgrab.sty, eolgrab.pdf, eolgrab.ins, eolgrab.drv,
+ eolgrab-example-ltx.tex, eolgrab-example-env.tex,
+ eolgrab-example-sec.tex, eolgrab-test1.tex,
+ eolgrab-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{eolgrab.ins}{\from{eolgrab.dtx}{install}}%
+ \file{eolgrab.drv}{\from{eolgrab.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{eolgrab.sty}{\from{eolgrab.dtx}{package}}%
+ \usedir{doc/latex/oberdiek/example}%
+ \file{eolgrab-example-ltx.tex}{\from{eolgrab.dtx}{example-ltx}}%
+ \file{eolgrab-example-env.tex}{\from{eolgrab.dtx}{example-env}}%
+ \file{eolgrab-example-sec.tex}{\from{eolgrab.dtx}{example-sec}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{eolgrab-test1.tex}{\from{eolgrab.dtx}{test1}}%
+% \file{eolgrab-test2.tex}{\from{eolgrab.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{eolgrab.xml}{\from{eolgrab.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{* eolgrab.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `eolgrab.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{eolgrab.drv}%
+ [2016/05/16 v1.1 Catch arguments delimited by end of line (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{eolgrab.dtx}%
+\end{document}
+%</driver>
+% \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{eolgrab.drv}
+%
+% \title{The \xpackage{eolgrab} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package implements a generic argument grabber
+% to catch an argument that is delimited by the line end.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \urldef\urltexhax\url{http://tug.org/mailman/listinfo/texhax}
+% \def\eol/{^^A
+% \meta{\texttt{EOL}}^^A
+% }
+%
+% \section{Documentation}
+%
+% The starting point for this package was a feature
+% request of Arno Trautmann in the mailing list
+% \texttt{texhax}\footnote{Info page for mailing list
+% \texttt{texhax}: \urltexhax} \cite{trautmann-request}.
+% A macro \cs{eolsection} should behave like \cs{section},
+% but the argument should be delimited by the line end
+% instead of given in curly braces:
+% \begin{quote}
+% |\eolsection My Title|
+% \end{quote}
+% Phil Taylor answered this with an implementation for \cs{eolsection}.
+% Because this feature could be useful for other macros as well,
+% I answered with an implementation of \cs{eolgrab} as general solution
+% \cite{oberdiek-eolgrab}.
+%
+% Both formats \hologo{plainTeX} and \hologo{LaTeX} are supported
+% by the package, see the example for \cs{eolsection} below.
+%
+% \begin{declcs}{eolgrab} \M{code} \meta{argument} \eol/
+% \end{declcs}
+% Macro \cs{eolgrab} takes two arguments. The first argument
+% is \meta{code}, a classical undelimited \hologo{TeX} macro argument.
+% The second argument is delimited by the line end \eol/.
+% The macro calls \meta{code} with \meta{argument} as argument
+% in curly braces. Because the catcode of the line end is changed,
+% \cs{eolgrab} will not work in the argument of other macros.
+% Macro \cs{eolgrab} is made robust if either \hologo{eTeX}'s
+% \cs{protected} or \hologo{LaTeX}'s \cs{DeclareRobustCommand}
+% is available.
+%
+% \begin{declcs}{eolgrabopt} \M{code} \meta{argument} \eol/
+% \end{declcs}
+% Macro \cs{eolgrabopt} passes \meta{argument} as optional
+% argument to \meta{code} if \meta{argument} is not empty.
+% \begin{quote}
+% |\eolgrabopt\item foo|
+% \end{quote}
+% becomes to
+% \begin{quote}
+% |\item[{foo}]|
+% \end{quote}
+% The curly argument braces are added to support square brackets
+% inside \meta{argument}.
+% If the \meta{argument} is empty:
+% \begin{quote}
+% |\eolgrabopt\item|
+% \end{quote}
+% then
+% \begin{quote}
+% |\item|
+% \end{quote}
+% is called without optional argument.
+%
+% \subsection{Examples}
+%
+% \begin{itemize}
+% \item
+% The line
+% \begin{quote}
+% |\eolgrab\section My Title|
+% \end{quote}
+% is equivalent to
+% \begin{quote}
+% |\section{My Title}|
+% \end{quote}
+% \item
+% The next example uses the star form of \cs{section}. Then the
+% command to be called consists of two tokens. Therefore the
+% first argument of \cs{eolgrab} needs curly braces:
+% \begin{quote}
+% |\eolgrab{\section*}My Title|
+% \end{quote}
+% becomes
+% \begin{quote}
+% |\section*{My Title}|
+% \end{quote}
+% \item
+% Now \hologo{LaTeX}'s \cs{PackageError} is used. This macro
+% has three arguments, the package or class name, the message
+% text and the help text. A standard help text of \hologo{LaTeX}
+% is used as given in macro \cs{@ehc}. The second argument,
+% the message text is used as argument, delimited by line end:
+% \begin{quote}
+% |\eolgrab{\PackageError{foobar}}%|\\
+% |Some error message text\MessageBreak%|\\
+% |with several lines|\\
+% |\@ehc|
+% \end{quote}
+% In the first two lines of the example, the line end is suppressed
+% by the comment character (percent), thus the argument is delimited
+% by the line end of the third line. The result is:
+% \begin{quote}
+% |\PackageError{foobar}{Some error message text\MessageBreak|\\
+% |with several lines}\@ehc|
+% \end{quote}
+% \item
+% The original request for macro \cs{eolsection}, see above,
+% can be implemented easily with the help of \cs{eolgrab}.
+% Example for \hologo{LaTeX}:
+% \begin{quote}
+% |\usepackage{eolgrab}|\\
+% |\newcommand*{\eolsection}{\eolgrab\section}|
+% \end{quote}
+% Example for \hologo{plainTeX}:
+% \begin{quote}
+% |\input eolgrab.sty\relax|\\
+% |\def\eolsection{\eolgrab\section}|
+% \end{quote}
+% And a sophisticated variant for \hologo{LaTeX} that also supports
+% the star syntax and the optional argument:
+% \begin{macrocode}
+%<*example-sec>
+\documentclass{article}
+\usepackage{eolgrab}
+\makeatletter
+\newcommand*{\eolsection}{%
+ \@ifstar{%
+ \eolgrab{\section*}%
+ }{%
+ \@ifnextchar[{%
+ \eoloptsection
+ }{%
+ \eolgrab\section
+ }%
+ }%
+}
+\newcommand*{\eoloptsection}[1][]{%
+ \eolgrab{\section[{#1}]}%
+}
+\makeatother
+\begin{document}
+\tableofcontents
+\eolsection Section without star and optional argument
+\eolsection*Section with star
+\eolsection[Short section title]Long section title
+\end{document}
+%</example-sec>
+% \end{macrocode}
+% \end{itemize}
+%
+% \subsubsection{Small \hologo{LaTeX} document as example}
+%
+% \begin{macrocode}
+%<*example-ltx>
+\RequirePackage{eolgrab}
+\eolgrab\documentclass article
+\eolgrab\begin document
+\eolgrab\section Hello World
+\eolgrab\emph Some text
+\eolgrab\end document
+%</example-ltx>
+% \end{macrocode}
+%
+% \subsubsection{\hologo{LaTeX} document with environments}
+%
+% \begin{macrocode}
+%<*example-env>
+\documentclass{article}
+\usepackage{eolgrab}
+\newcommand*{\Begin}{\eolgrab \begin}
+\newcommand*{\End }{\eolgrab \end }
+\newcommand*{\Item }{\eolgrabopt\item }
+\Begin document
+ \Begin itemize
+ \Item
+ first item
+ \Item
+ second item
+ \End itemize
+ \Begin description
+ \Item foo
+ is the first syllable of foobar.
+ \Item bar
+ is the second syllable of foobar.
+ \End description
+\End document
+%</example-env>
+% \end{macrocode}
+%
+% \subsection{Limitations}
+%
+% Macro \cs{eolgrab} needs to catch the line end.
+% If \hologo{TeX} reads a line, then it throws away the line end
+% characters (carriage return, line feed) and removes spaces at the
+% end of the line. Then it adds the character with the character code
+% that is given by \cs{endlinechar} at the end of the line. The category
+% code of the inserted character is given by the current value of
+% its \cs{catcode}. If \cs{endlinechar} is not a valid character code
+% (especially if it is negative), then no character is added.
+%
+% In \hologo{plainTeX} and \hologo{LaTeX} the standard settings
+% of the inserted endline character is the character with code 13
+% (or |^||^||M| in \hologo{TeX} notation) with catcode 5 (end of line).
+% That means the inserted end of line character behaves like a space
+% token. For example, it is removed after macro names. Therefore
+% \cs{eolgrab} changes the catcode.
+%
+% Therefore \cs{eolgrab} has some limitations:
+% \begin{itemize}
+% \item
+% Like other verbatim stuff, the macro \cs{eolgrab} cannot be
+% used in the argument of other macros. \cs{eolgrab} want to
+% change the catcode of the end of line character. If this
+% character is read before, because it is processed as argument
+% of another macro, the catcode is already set and is not reassigned
+% later if \cs{eolgrab} changes the category code for this character
+% code.
+% \item
+% The argument must not contain the end of line character.
+% Otherwise the first end of line character is already taken
+% as delimiter, leaving the rest of the line outside the argument.
+% \item
+% Because \cs{eolgrab} is probably mostly used in the line with
+% the delimited argument. Therefore changes of \cs{endlinechar}
+% will not affect the current line.
+% \end{itemize}
+%
+% \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@eolgrab.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{eolgrab}{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@eolgrab.sty\endcsname
+\ProvidesPackage{eolgrab}%
+ [2016/05/16 v1.1 Catch arguments delimited by end of line (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 eolgrab@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\eolgrab@AtEnd{%
+ \eolgrab@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^
+\edef\eolgrab@AtEnd{\eolgrab@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Resources}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+ \input infwarerr.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2010/12/04]%
+ \RequirePackage{infwarerr}[2010/04/08]%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\eolgrab@ifdefinable}
+% \begin{macrocode}
+\ltx@IfUndefined{@ifdefinable}{%
+ \def\eolgrab@ifdefinable#1#2{%
+ \ltx@ifundefined{#1}{#2}{%
+ \@PackageError{eolgrab}{%
+ Command \ltx@backslashchar#1 already defined%
+ }\@ehc
+ }%
+ }%
+}{%
+ \def\eolgrab@ifdefinable#1{%
+ \expandafter\@ifdefinable\csname#1\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Macro \cs{eolgrab}}
+%
+% \begin{macro}{\eolgrab}
+% \begin{macrocode}
+\eolgrab@ifdefinable{eolgrab}{%
+ \ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\eolgrab#1%
+ }{%
+ \newcommand\eolgrab{}%
+ \DeclareRobustCommand*\eolgrab
+ }%
+ }{%
+ \protected\def\eolgrab#1%
+ }{%
+ \begingroup
+ \endlinechar=13 %
+ \catcode13=\ltx@active
+ \eolgrab@{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\eolgrabopt}
+% \begin{macrocode}
+\eolgrab@ifdefinable{eolgrabopt}{%
+ \ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\eolgrabopt#1%
+ }{%
+ \newcommand\eolgrabopt{}%
+ \DeclareRobustCommand*\eolgrabopt
+ }%
+ }{%
+ \protected\def\eolgrabopt#1%
+ }{%
+ \begingroup
+ \endlinechar=13 %
+ \catcode13=\ltx@active
+ \eolgrab@opt{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\begingroup
+ \catcode13=\ltx@active %
+\ltx@firstofone{\endgroup %
+% \end{macrocode}
+% \begin{macro}{\eolgrab@}
+% \begin{macrocode}
+ \def\eolgrab@#1#2^^M{%
+ \endgroup %
+ #1{#2}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eolgrab@opt}
+% \begin{macrocode}
+ \def\eolgrab@opt#1#2^^M{%
+ \endgroup %
+ \ltx@ifempty{#2}{%
+ #1%
+ }{%
+ #1[{#2}]%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\eolgrab@AtEnd%
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \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 eolgrab.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Tests for \hologo{plainTeX}}
+%
+% \begin{macrocode}
+%<*test2>
+\input eolgrab.sty\relax
+\catcode`\{=1 %
+\catcode`\}=2 %
+\eolgrab{\immediate\write16}Hello World
+\def\TestExpected{foo bar}
+\eolgrab{\def\TestResult}foo bar
+
+\ifx\TestExpected\TestResult
+ \immediate\write16{* Ok (foo bar)}%
+\else
+ \errmessage{Test failed (foo bar)}%
+\fi
+
+\begingroup
+ \def\TestExpected{foobar}%
+ \endlinechar=-1 %
+ \eolgrab{\def\TestResult}foo
+ bar
+ ^^M
+ \ifx\TestExpected\TestResult
+ \immediate\write16{* Ok (foobar)}%
+ \else
+ \errmessage{Test failed (foobar)}%
+ \fi
+\endgroup
+
+\csname @@end\endcsname\end
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/eolgrab}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/eolgrab.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/eolgrab.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[\CTAN{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 eolgrab.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@{}}
+% eolgrab.sty & tex/generic/oberdiek/eolgrab.sty\\
+% eolgrab.pdf & doc/latex/oberdiek/eolgrab.pdf\\
+% example/eolgrab-example-ltx.tex & doc/latex/oberdiek/example/eolgrab-example-ltx.tex\\
+% example/eolgrab-example-env.tex & doc/latex/oberdiek/example/eolgrab-example-env.tex\\
+% example/eolgrab-example-sec.tex & doc/latex/oberdiek/example/eolgrab-example-sec.tex\\
+% test/eolgrab-test1.tex & doc/latex/oberdiek/test/eolgrab-test1.tex\\
+% test/eolgrab-test2.tex & doc/latex/oberdiek/test/eolgrab-test2.tex\\
+% eolgrab.dtx & source/latex/oberdiek/eolgrab.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk eolgrab.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{eolgrab.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 eolgrab.dtx
+%makeindex -s gind.ist eolgrab.idx
+%pdflatex eolgrab.dtx
+%makeindex -s gind.ist eolgrab.idx
+%pdflatex eolgrab.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{eolgrab.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='eolgrab'>
+ <name>eolgrab</name>
+ <caption>Catch arguments delimited by end of line.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ The package defines the command <tt>\eolgrab</tt> that reads an
+ string terminated by end of line, and then calls a macro with that
+ string as argument. Thus
+ <pre>\eolgrab\section My title</pre> is equivalent to
+ <pre>\section{My title}</pre>
+ <p/>
+ A second command <tt>\eolgrabopt</tt> provides the string as an
+ optional argument (which is useful for <tt>\item</tt>, for example).
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/eolgrab.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/eolgrab.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+% \bibitem{trautmann-request}
+% Arno Trautmann,
+% \textit{[texhax] read argument until EOL};
+% mailing list \texttt{texthax@tug.org},
+% 2011-01-06;
+% \url{http://tug.org/pipermail/texhax/2011-January/016517.html}.
+%
+% \bibitem{taylor}
+% Philip Taylor,
+% \textit{Re: [texhax] read argument until EOL};
+% mailing list \texttt{texhax@tug.org},
+% 2011-01-06;
+% \url{http://tug.org/pipermail/texhax/2011-January/016519.html}.
+%
+% \bibitem{oberdiek-eolgrab}
+% Heiko Oberdiek,
+% \textit{Re: [texhax] read argument until EOL};
+% mailing list \texttt{texhax@tug.org},
+% 2011-01-06;
+% \url{http://tug.org/pipermail/texhax/2011-January/016526.html}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2011/01/12 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/eolgrab.pdf b/macros/latex/contrib/oberdiek/eolgrab.pdf
new file mode 100644
index 0000000000..b4c96bfadd
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/eolgrab.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/epstopdf.dtx b/macros/latex/contrib/oberdiek/epstopdf.dtx
new file mode 100644
index 0000000000..7f9528f7b3
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/epstopdf.dtx
@@ -0,0 +1,1647 @@
+% \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 <heiko.oberdiek at googlemail.com>
+%
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file 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
+%</ignore>
+%<*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 <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file 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
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*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}
+%</driver>
+% \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 https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \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%
+%</package>
+% \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%
+%</base>
+% \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
+%</test1>
+% \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}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/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[\CTAN{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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk epstopdf.pdf unpack_files output .|
+% \end{quote}
+%
+% \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}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{epstopdf-pkg.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='epstopdf-pkg'>
+ <name>epstopdf-pkg</name>
+ <caption>Call epstopdf "on the fly"</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2001,2006-2010'/>
+ <license type='lppl1.3'/>
+ <version number='2.6'/>
+ <description>
+ The package adds support for EPS files in the
+ <xref refid='graphicx'>graphicx</xref> package when running under
+ PDFTeX. If an EPS graphic is detected, the package spawns a
+ process to convert the EPS to PDF, using the script
+ <xref refid='epstopdf'>epstopdf</xref>. This of course requires
+ that shell escape is enabled for the PDFTeX run.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/epstopdf.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/epstopdf.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \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
new file mode 100644
index 0000000000..c212cc0f3c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/epstopdf.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/etexcmds.dtx b/macros/latex/contrib/oberdiek/etexcmds.dtx
new file mode 100644
index 0000000000..77b500ee14
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/etexcmds.dtx
@@ -0,0 +1,986 @@
+% \iffalse meta-comment
+%
+% File: etexcmds.dtx
+% Version: 2016/05/16 v1.6
+% Info: Avoid name clashes with e-TeX commands
+%
+% Copyright (C) 2007, 2010, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 etexcmds.dtx
+% and the derived files
+% etexcmds.sty, etexcmds.pdf, etexcmds.ins, etexcmds.drv,
+% etexcmds-test1.tex, etexcmds-test2.tex, etexcmds-test3.tex,
+% etexcmds-test4.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/etexcmds.dtx
+% CTAN:macros/latex/contrib/oberdiek/etexcmds.pdf
+%
+% Unpacking:
+% (a) If etexcmds.ins is present:
+% tex etexcmds.ins
+% (b) Without etexcmds.ins:
+% tex etexcmds.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{etexcmds.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If etexcmds.drv is present:
+% latex etexcmds.drv
+% (b) Without etexcmds.drv:
+% latex etexcmds.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 etexcmds.dtx
+% makeindex -s gind.ist etexcmds.idx
+% pdflatex etexcmds.dtx
+% makeindex -s gind.ist etexcmds.idx
+% pdflatex etexcmds.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/etexcmds.sty
+% TDS:doc/latex/oberdiek/etexcmds.pdf
+% TDS:doc/latex/oberdiek/test/etexcmds-test1.tex
+% TDS:doc/latex/oberdiek/test/etexcmds-test2.tex
+% TDS:doc/latex/oberdiek/test/etexcmds-test3.tex
+% TDS:doc/latex/oberdiek/test/etexcmds-test4.tex
+% TDS:source/latex/oberdiek/etexcmds.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: etexcmds
+Version: 2016/05/16 v1.6
+
+Copyright (C) 2007, 2010, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 etexcmds.dtx
+and the derived files
+ etexcmds.sty, etexcmds.pdf, etexcmds.ins, etexcmds.drv,
+ etexcmds-test1.tex, etexcmds-test2.tex, etexcmds-test3.tex,
+ etexcmds-test4.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{etexcmds.ins}{\from{etexcmds.dtx}{install}}%
+ \file{etexcmds.drv}{\from{etexcmds.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{etexcmds.sty}{\from{etexcmds.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{etexcmds-test1.tex}{\from{etexcmds.dtx}{test1}}%
+% \file{etexcmds-test2.tex}{\from{etexcmds.dtx}{test2}}%
+% \file{etexcmds-test3.tex}{\from{etexcmds.dtx}{test3}}%
+% \file{etexcmds-test4.tex}{\from{etexcmds.dtx}{test4}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{etexcmds.xml}{\from{etexcmds.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{* etexcmds.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `etexcmds.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{etexcmds.drv}%
+ [2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{etexcmds.dtx}%
+\end{document}
+%</driver>
+% \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{etexcmds.drv}
+%
+% \title{The \xpackage{etexcmds} package}
+% \date{2016/05/16 v1.6}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% New primitive commands are introduced in \eTeX. Sometimes the
+% names collide with existing macros. This package solves this
+% name clashes by adding a prefix to \eTeX's commands. For example,
+% \eTeX's \cs{unexpanded} is provided as \cs{etex@unexpanded}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{\cs{unexpanded}}
+%
+% \begin{declcs}{etex@unexpanded}
+% \end{declcs}
+% New primitive commands are introduced in \eTeX. Unhappily
+% \cs{unexpanded} collides with a macro in Con\TeX t with the
+% same name. This also affects the \LaTeX\ world. For example,
+% package \xpackage{m-ch-de} loads \xfile{base/syst-gen.tex}
+% that redefines \cs{unexpanded}. Thus this package defines
+% \cs{etex@unexpanded} to get rid of the name clash.
+%
+% \begin{declcs}{ifetex@unexpanded}
+% \end{declcs}
+% Package \xpackage{etexcmds} can be loaded even if \eTeX\ is not
+% present or \cs{unexpanded} cannot be found. The switch
+% \cs{ifetex@unexpanded} tells whether it is safe to use
+% \cs{etex@unexpanded}.
+% The switch is true (\cs{iftrue}) only if the
+% primitive \cs{unexpanded} has been found and \cs{etex@unexpanded}
+% is available.
+%
+% \subsection{\cs{expanded}}
+%
+% Probably \cs{expanded} will be added in \pdfTeX\ 1.50 and
+% \LuaTeX. Again Con\TeX t defines this as macro.
+% Therefore version 1.2 of this packages also provides
+% \cs{etex@expanded} and \cs{ifetex@unexpanded}.
+%
+% \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@etexcmds.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{etexcmds}{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@etexcmds.sty\endcsname
+\ProvidesPackage{etexcmds}%
+ [2016/05/16 v1.6 Avoid name clashes with e-TeX commands (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 etexcmds@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\etexcmds@AtEnd{%
+ \etexcmds@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{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\etexcmds@AtEnd{%
+ \etexcmds@AtEnd
+ \escapechar\the\escapechar\relax
+ \noexpand\endinput
+}
+\escapechar=92 % backslash
+% \end{macrocode}
+%
+% \subsection{Provide \cs{newif}}
+%
+% \begin{macro}{\etexcmds@newif}
+% \begin{macrocode}
+\def\etexcmds@newif#1{%
+ \expandafter\edef\csname etex@#1false\endcsname{%
+ \let
+ \expandafter\noexpand\csname ifetex@#1\endcsname
+ \noexpand\iffalse
+ }%
+ \expandafter\edef\csname etex@#1true\endcsname{%
+ \let
+ \expandafter\noexpand\csname ifetex@#1\endcsname
+ \noexpand\iftrue
+ }%
+ \csname etex@#1false\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Load package \xpackage{infwarerr}}
+%
+% \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]%
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{ifluatex}[2010/03/01]%
+\fi
+% \end{macrocode}
+%
+% \subsection{\cs{unexpanded}}
+%
+% \begin{macro}{\ifetex@unexpanded}
+% \begin{macrocode}
+\etexcmds@newif{unexpanded}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\etex@unexpanded}
+% \begin{macrocode}
+\begingroup
+\edef\x{\string\unexpanded}%
+\edef\y{\meaning\unexpanded}%
+\ifx\x\y
+ \endgroup
+ \let\etex@unexpanded\unexpanded
+ \etex@unexpandedtrue
+\else
+ \edef\y{\meaning\normalunexpanded}%
+ \ifx\x\y
+ \endgroup
+ \let\etex@unexpanded\normalunexpanded
+ \etex@unexpandedtrue
+ \else
+ \edef\y{\meaning\@@unexpanded}%
+ \ifx\x\y
+ \endgroup
+ \let\etex@unexpanded\@@unexpanded
+ \etex@unexpandedtrue
+ \else
+ \ifluatex
+ \ifnum\luatexversion<36 %
+ \else
+ \begingroup
+ \directlua{%
+ tex.enableprimitives('etex@',{'unexpanded'})%
+ }%
+ \global\let\etex@unexpanded\etex@unexpanded
+ \endgroup
+ \fi
+ \fi
+ \edef\y{\meaning\etex@unexpanded}%
+ \ifx\x\y
+ \endgroup
+ \etex@unexpandedtrue
+ \else
+ \endgroup
+ \@PackageInfoNoLine{etexcmds}{%
+ Could not find \string\unexpanded.\MessageBreak
+ That can mean that you are not using e-TeX or%
+ \MessageBreak
+ that some package has redefined \string\unexpanded.%
+ \MessageBreak
+ In the latter case, load this package earlier%
+ }%
+ \etex@unexpandedfalse
+ \fi
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{expanded}}
+%
+% \begin{macro}{\ifetex@expanded}
+% \begin{macrocode}
+\etexcmds@newif{expanded}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\etex@expanded}
+% \begin{macrocode}
+\begingroup
+\edef\x{\string\expanded}%
+\edef\y{\meaning\expanded}%
+\ifx\x\y
+ \endgroup
+ \let\etex@expanded\expanded
+ \etex@expandedtrue
+\else
+ \edef\y{\meaning\normalexpanded}%
+ \ifx\x\y
+ \endgroup
+ \let\etex@expanded\normalexpanded
+ \etex@expandedtrue
+ \else
+ \edef\y{\meaning\@@expanded}%
+ \ifx\x\y
+ \endgroup
+ \let\etex@expanded\@@expanded
+ \etex@expandedtrue
+ \else
+ \ifluatex
+ \ifnum\luatexversion<36 %
+ \else
+ \begingroup
+ \directlua{%
+ tex.enableprimitives('etex@',{'expanded'})%
+ }%
+ \global\let\etex@expanded\etex@expanded
+ \endgroup
+ \fi
+ \fi
+ \edef\y{\meaning\etex@expanded}%
+ \ifx\x\y
+ \endgroup
+ \etex@expandedtrue
+ \else
+ \endgroup
+ \@PackageInfoNoLine{etexcmds}{%
+ Could not find \string\expanded.\MessageBreak
+ That can mean that you are not using pdfTeX 1.50 or%
+ \MessageBreak
+ that some package has redefined \string\expanded.%
+ \MessageBreak
+ In the latter case, load this package earlier%
+ }%
+ \etex@expandedfalse
+ \fi
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\etexcmds@AtEnd%
+%</package>
+% \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 etexcmds.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \begin{macrocode}
+%<*test2>
+\immediate\write16{etexcmds-test2.tex: test file for plainTeX}
+\input etexcmds.sty\relax
+\catcode`\@=11 %
+\edef\x{\string\unexpanded}
+\edef\y{\meaning\etex@unexpanded}
+\ifx\x\y
+\else
+ \@PackageError{etexcmds-test2}{Test failed}\@ehc
+\fi
+\end
+%</test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test3>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{etexcmds-test3.tex}[2016/05/16 v1.6 Test file for LaTeX]
+\RequirePackage{etexcmds}
+\makeatletter
+\edef\x{\string\unexpanded}
+\edef\y{\meaning\etex@unexpanded}
+\ifx\x\y
+\else
+ \@PackageError{etexcmds-test3}{Test failed}\@ehc
+\fi
+\stop
+%</test3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test4>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{etexcmds-test4.tex}[2016/05/16 v1.6 Test file for LaTeX]
+\documentclass{article}
+\usepackage{m-pictex}
+\def\normalwritestatus#1#2{%
+ \typeout{EMERGENCY HACK \string\normalwritestatus}%
+ \typeout{#1: #2}%
+}
+\usepackage{m-ch-de}
+\usepackage{etexcmds}
+\makeatletter
+\ifetex@unexpanded
+ \edef\x{\string\unexpanded}%
+ \edef\y{\meaning\etex@unexpanded}%
+ \ifx\x\y
+ \else
+ \@PackageWarningNoLine{etexcmds-test4}{Test failed}%
+ \fi
+\else
+ \@PackageWarningNoLine{etexcmds-test4}{%
+ Test failed because of ConTeXt%
+ }%
+\fi
+\stop
+%</test4>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/etexcmds}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/etexcmds.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/etexcmds.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[\CTAN{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 etexcmds.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@{}}
+% etexcmds.sty & tex/generic/oberdiek/etexcmds.sty\\
+% etexcmds.pdf & doc/latex/oberdiek/etexcmds.pdf\\
+% test/etexcmds-test1.tex & doc/latex/oberdiek/test/etexcmds-test1.tex\\
+% test/etexcmds-test2.tex & doc/latex/oberdiek/test/etexcmds-test2.tex\\
+% test/etexcmds-test3.tex & doc/latex/oberdiek/test/etexcmds-test3.tex\\
+% test/etexcmds-test4.tex & doc/latex/oberdiek/test/etexcmds-test4.tex\\
+% etexcmds.dtx & source/latex/oberdiek/etexcmds.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk etexcmds.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{etexcmds.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 etexcmds.dtx
+%makeindex -s gind.ist etexcmds.idx
+%pdflatex etexcmds.dtx
+%makeindex -s gind.ist etexcmds.idx
+%pdflatex etexcmds.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{etexcmds.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='etexcmds'>
+ <name>etexcmds</name>
+ <caption>Avoid name clashes with e-TeX commands.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2010,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.6'/>
+ <description>
+ New primitive commands are introduced in e-TeX; sometimes the
+ names collide with existing macros. This package solves the
+ name clashes by adding a prefix to e-TeX&#x2019;s commands. For
+ example, eTeX&#x2019;s <tt>\unexpanded</tt> is provided as
+ <tt>\etex@unexpanded</tt>.
+
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/etexcmds.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/etexcmds.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/05/06 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.1}
+% \item
+% Documentation for \cs{ifetex@unexpanded} added.
+% \item
+% Catcode section rewritten.
+% \end{Version}
+% \begin{Version}{2007/12/12 v1.2}
+% \item
+% \cs{etex@expanded} added.
+% \end{Version}
+% \begin{Version}{2010/01/28 v1.3}
+% \item
+% Compatibility to \hologo{iniTeX} added.
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.4}
+% \item
+% Already loaded package files are not input in \hologo{plainTeX}.
+% \end{Version}
+% \begin{Version}{2011/02/16 v1.5}
+% \item
+% Using \hologo{LuaTeX}'s \texttt{tex.enableprimitives} if available.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.6}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/etexcmds.pdf b/macros/latex/contrib/oberdiek/etexcmds.pdf
new file mode 100644
index 0000000000..c07b06c3b6
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/etexcmds.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/fibnum.dtx b/macros/latex/contrib/oberdiek/fibnum.dtx
new file mode 100644
index 0000000000..ec9f12bcd7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/fibnum.dtx
@@ -0,0 +1,1180 @@
+% \iffalse meta-comment
+%
+% File: fibnum.dtx
+% Version: 2016/05/16 v1.1
+% Info: Fibonacci numbers
+%
+% Copyright (C) 2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 fibnum.dtx
+% and the derived files
+% fibnum.sty, fibnum.pdf, fibnum.ins, fibnum.drv, fibnum.bib,
+% fibnum-test1.tex, fibnum-test-calc.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/fibnum.dtx
+% CTAN:macros/latex/contrib/oberdiek/fibnum.pdf
+%
+% Unpacking:
+% (a) If fibnum.ins is present:
+% tex fibnum.ins
+% (b) Without fibnum.ins:
+% tex fibnum.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{fibnum.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If fibnum.drv is present:
+% latex fibnum.drv
+% (b) Without fibnum.drv:
+% latex fibnum.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 fibnum.dtx
+% bibtex fibnum.aux
+% makeindex -s gind.ist fibnum.idx
+% pdflatex fibnum.dtx
+% makeindex -s gind.ist fibnum.idx
+% pdflatex fibnum.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/fibnum.sty
+% TDS:doc/latex/oberdiek/fibnum.pdf
+% TDS:doc/latex/oberdiek/test/fibnum-test1.tex
+% TDS:doc/latex/oberdiek/test/fibnum-test-calc.tex
+% TDS:source/latex/oberdiek/fibnum.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: fibnum 2016/05/16 v1.1 Fibonacci numbers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: fibnum
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 fibnum.dtx
+and the derived files
+ fibnum.sty, fibnum.pdf, fibnum.ins, fibnum.drv, fibnum.bib,
+ fibnum-test1.tex, fibnum-test-calc.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{fibnum.ins}{\from{fibnum.dtx}{install}}%
+ \file{fibnum.drv}{\from{fibnum.dtx}{driver}}%
+ \nopreamble
+ \nopostamble
+ \file{fibnum.bib}{\from{fibnum.dtx}{bib}}%
+ \usepreamble\defaultpreamble
+ \usepostamble\defaultpostamble
+ \usedir{tex/generic/oberdiek}%
+ \file{fibnum.sty}{\from{fibnum.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{fibnum-test1.tex}{\from{fibnum.dtx}{test1}}%
+% \file{fibnum-test-calc.tex}{\from{fibnum.dtx}{test-calc}}%
+}
+
+\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{* fibnum.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `fibnum.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*bib>
+@online{texhax:abraham,
+ author={Abraham, Jan},
+ title={[texhax] Beginner in TEX MACRO to compute functions},
+ date={2012-04-07},
+ url={http://tug.org/pipermail/texhax/2012-April/019146.html},
+ urldate={2012-04-08},
+}
+@article{knuth:negafibonacci,
+ author={Knuth, Donald E.},
+ title={Negafibonacci Numbers and the Hyperbolic Plane},
+ date={2008-12-11},
+ url={http://research.allacademic.com/meta/p206842_index.html},
+}
+@online{wikipedia:negafibonacci,
+ author={{Wikipedia contributors}},
+ organization={{Wikipedia, The Free Encyclopedia}},
+ title={Fibonacci numbers},
+ language={langenglish},
+ version={486266088},
+ date={2012-04-08},
+ url={http://en.wikipedia.org/w/index.php?title=Fibonacci_number&oldid=486266088},
+ urldate={2012-04-08},
+}
+%</bib>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{fibnum.drv}%
+ [2016/05/16 v1.1 Fibonacci numbers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{amsmath,amsfonts}
+\usepackage{siunitx}
+\usepackage{array}
+\usepackage{tabularx}
+\usepackage{fibnum}[2016/05/16]
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{csquotes}
+\usepackage[
+ backend=bibtex,
+ bibencoding=ascii,
+ alldates=iso8601,
+]{biblatex}[2011/11/13]
+\bibliography{oberdiek-source}
+\bibliography{fibnum}
+\begin{document}
+ \DocInput{fibnum.dtx}%
+\end{document}
+%</driver>
+% \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{fibnum.drv}
+%
+% \title{The \xpackage{fibnum} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package \xpackage{fibnum} provides expandable fibonacci
+% numbers for both \hologo{LaTeX} and \hologo{plainTeX}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% In the mailing list \textsf{texhax} Jan Abraham asked the question,
+% how to get Fibonacci numbers in \hologo{TeX} \cite{texhax:abraham}:
+% \begin{quote}
+% Write a Macro in \hologo{TeX} that compute the function |\fib{m}|
+% All fibonacci numbers from 1 to $m$ ($m < 40$).
+% \end{quote}
+% This packages provides an expandable implementation for the
+% calculation of these numbers for a much larger set of indexes.
+% For practical reasons the index is restricted to the same limitations
+% that apply for \hologo{TeX} integer numbers.
+% The range of the Fibonacci numbers, however, are not limited
+% by the algorithm. They are only restricted to memory limitations,
+% if they are hit.
+%
+% The package is loaded as \hologo{LaTeX} package in \hologo{LaTeX}:
+% \begin{quote}
+% |\usepackage{fibnum}|
+% \end{quote}
+% and as file in \hologo{plainTeX}:
+% \begin{quote}
+% |\input fibnum.sty|
+% \end{quote}
+% The package does not know any options and it provides
+% the macros \cs{fibnum} and \cs{fibnumPreCalc}.
+%
+% \begin{declcs}{fibnum} \M{index}
+% \end{declcs}
+% Macro \cs{fibnum} expects a \hologo{TeX} number as \meta{index}
+% in the official \hologo{TeX} number range from $-(2^{31}-1)$ up to
+% $2^{31}-1$. In exact two expansion steps the macro expands to
+% the Fibnoacci number $F_{\text{\meta{index}}}$. In case of a negative
+% \meta{index}, the ``negafibonacci'' number \cite{wikipedia:negafibonacci}
+% is used. Formally the Fibonacci number $F_n$ with integer
+% index~$n$, $n\in\mathbb{Z}$ and
+% $n\in[\num{-2147483647},\num{2147483647}]$ that is returned by macro
+% \cs{fibnum} with numerical argument $n$ is defined the following way:
+% \begin{gather}
+% \label{eq:def}
+% F_n =
+% \begin{cases}
+% 0 & \text{for $n=0$}\\
+% 1 & \text{for $n=1$}\\
+% F_{n-1} + F_{n-2} & \text{for $n>1$}\\
+% (-1)^{n+1}F_n & \text{for $n<0$}
+% \end{cases}
+% \end{gather}
+% Examples:
+% \begin{quote}
+% \makeatletter
+% \def\x#1{\cs{fibnum}\{#1\}&
+% \edef\X{\fibnum{#1}}\edef\Y{\expandafter\ltx@car\X\@nil}^^A
+% \if-\Y
+% \edef\X{\expandafter\ltx@cdr\X\@nil}^^A
+% \noindent
+% \llap{-}\X
+% \else
+% \X
+% \fi
+% \tabularnewline
+% }
+% \def\y{\multicolumn{1}{@{}c@{}}{$\vdots$}\tabularnewline}
+% \DeclareUrlCommand\UrlNum{^^A
+% \urlstyle{tt}^^A
+% \def\UrlBreaks{\do\0\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9}^^A
+% }
+% \begin{tabularx}{\dimexpr\linewidth+5.7pt\relax}{@{}>{\ttfamily}l@{ $\rightarrow$ \hphantom{\ttfamily-}}>{\ttfamily}X@{}}
+% \x{-6}
+% \x{-5}
+% \x{-4}
+% \x{-3}
+% \x{-2}
+% \x{-1}
+% \x{0}
+% \x{1}
+% \x{2}
+% \x{3}
+% \x{4}
+% \x{5}
+% \x{6}
+% \y
+% \x{10}
+% \y
+% \x{46}
+% \y
+% \cs{fibnum}\{100\} & 354224848179261915075
+% \tabularnewline
+% \y
+% \cs{fibnum}\{200\} & 280571172992510140037611932413038677189525
+% \tabularnewline
+% \y
+% \cs{fibnum}\{1000\} &
+% \raggedright
+% \UrlNum{^^A
+% 434665576869374564356885276750406258025646^^A
+% 605173717804024817290895365554179490518904^^A
+% 038798400792551692959225930803226347752096^^A
+% 896232398733224711616429964409065331879382^^A
+% 98969649928516003704476137795166849228875^^A
+% }
+% \tabularnewline
+% \end{tabularx}\kern-5.7pt\mbox{}
+% \end{quote}
+%
+% \begin{declcs}{fibnumPreCalc} \M{index}
+% \end{declcs}
+% The package already provides precalculated Fibonacci numbers up to
+% index~46. That means that calculations are not necessary for
+% Fibonacci numbers that fit into the range of \hologo{TeX}
+% numbers. Because macro \cs{fibnum} is expandable, it cannot
+% store calculated Fibonacci numbers for later use. Macro definitions
+% are forbidden in expandable contexts. If larger Fibonacci numbers
+% are used more than once, than the compilation time can be shortened
+% by calculating and storing the Fibonacci numbers beforehand.
+% The argument \meta{index} is a \hologo{TeX} number and macro
+% \cs{fibnumPreCalc} ensures that the Fibonacci numbers
+% $F_0$ up to $F_{\lvert\text{\meta{index}}\rvert}$ that are not
+% already known are calculated
+% and stored in internal macros. Internally only non-negative
+% Fibonacci numbers are stored. If \meta{index} is negative, then
+% the needed positive Fibonacci numbers are calculated and stored.
+% Example:
+% \begin{quote}
+% \def\x#1{\begingroup\itshape\texttt{\%} #1\endgroup}
+% |\fibnumPreCalc{50}|\\
+% \x{calculates and stores the values for indexes 47..50.}\\
+% \x{(Values for 0..46 are already stored by the package.)}\\
+% |\fibnum{49}| \x{uses the stored value}\\
+% |\fibnum{51}|
+% \x{only calculates $F_{51}$ from stored values $F_{49}$ and $F_{50}$}\\
+% |\fibnumPreCalc{100}|\\
+% \x{calculates and stores the values for indexes 51..100}\\
+% |\fibnum{100}| \x{uses the stored value for $F_{100}$}\\
+% |\fibnum{-100}|
+% \x{uses the stored value for $F_{100}$}\\
+% \x{$F_{-100}=-F_{100}$ according to equation \eqref{eq:def}.}
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@fibnum.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{fibnum}{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@fibnum.sty\endcsname
+\ProvidesPackage{fibnum}%
+ [2016/05/16 v1.1 Fibonacci numbers (HO)]%
+% \end{macrocode}
+%
+% \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 FibNum@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\FibNum@AtEnd{%
+ \FibNum@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+%\TMP@EnsureCode{36}{3}% $
+%\TMP@EnsureCode{38}{4}% &
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{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{96}{12}% `
+\TMP@EnsureCode{93}{12}% ]
+%\TMP@EnsureCode{94}{12}% ^ (superscript) (!)
+%\TMP@EnsureCode{124}{12}% |
+\edef\FibNum@AtEnd{\FibNum@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Package resources}
+%
+% \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{ltxcmds}[2011/04/18]%
+ \TMP@RequirePackage{intcalc}[2007/09/27]%
+ \TMP@RequirePackage{bigintcalc}[2007/11/11]%
+\else
+ \RequirePackage{ltxcmds}[2011/04/18]%
+ \RequirePackage{intcalc}[2007/09/27]%
+ \RequirePackage{bigintcalc}[2007/11/11]%
+\fi
+% \end{macrocode}
+%
+% \subsection{Setup precalculated values}
+%
+% \begin{macrocode}
+\def\FibNum@temp#1{%
+ \expandafter\def\csname FibNum@#1\endcsname
+}
+\catcode46=9 % dots are ignored
+\FibNum@temp{0}{0}
+\FibNum@temp{1}{1}
+\FibNum@temp{2}{1}
+\FibNum@temp{3}{2}
+\FibNum@temp{4}{3}
+\FibNum@temp{5}{5}
+\FibNum@temp{6}{8}
+\FibNum@temp{7}{13}
+\FibNum@temp{8}{21}
+\FibNum@temp{9}{34}
+\FibNum@temp{10}{55}
+\FibNum@temp{11}{89}
+\FibNum@temp{12}{144}
+\FibNum@temp{13}{233}
+\FibNum@temp{14}{377}
+\FibNum@temp{15}{610}
+\FibNum@temp{16}{987}
+\FibNum@temp{17}{1.597}
+\FibNum@temp{18}{2.584}
+\FibNum@temp{19}{4.181}
+\FibNum@temp{20}{6.765}
+\FibNum@temp{21}{10.946}
+\FibNum@temp{22}{17.711}
+\FibNum@temp{23}{28.657}
+\FibNum@temp{24}{46.368}
+\FibNum@temp{25}{75.025}
+\FibNum@temp{26}{121.393}
+\FibNum@temp{27}{196.418}
+\FibNum@temp{28}{317.811}
+\FibNum@temp{29}{514.229}
+\FibNum@temp{30}{832.040}
+\FibNum@temp{31}{1.346.269}
+\FibNum@temp{32}{2.178.309}
+\FibNum@temp{33}{3.524.578}
+\FibNum@temp{34}{5.702.887}
+\FibNum@temp{35}{9.227.465}
+\FibNum@temp{36}{14.930.352}
+\FibNum@temp{37}{24.157.817}
+\FibNum@temp{38}{39.088.169}
+\FibNum@temp{39}{63.245.986}
+\FibNum@temp{40}{102.334.155}
+\FibNum@temp{41}{165.580.141}
+\FibNum@temp{42}{267.914.296}
+\FibNum@temp{43}{433.494.437}
+\FibNum@temp{44}{701.408.733}
+\FibNum@temp{45}{1.134.903.170}
+\FibNum@temp{46}{1.836.311.903}
+% \end{macrocode}
+% \begin{macro}{\FibNum@max}
+% \begin{macrocode}
+\def\FibNum@max{46}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Macros for precalculating values}
+%
+% \begin{macro}{\fibnumPreCalc}
+% \begin{macrocode}
+\def\fibnumPreCalc#1{%
+ \expandafter\expandafter\expandafter
+ \FibNum@PreCalc\intcalcNum{#1}/%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\FibNum@PreCalc}
+% \begin{macrocode}
+\def\FibNum@PreCalc#1/{%
+ \ifnum#1<\ltx@zero
+ \expandafter\FibNum@PreCalc\ltx@gobble#1/%
+ \else
+ \ifnum#1>\FibNum@max
+ \begingroup
+ \ltx@LocDimenA=#1sp\relax
+ \countdef\FibNum@i=255\relax
+ \FibNum@i=\FibNum@max\relax
+ \edef\FibNum@temp{%
+ \csname FibNum@\the\FibNum@i\endcsname/%
+ }%
+ \advance\FibNum@i by -1\relax
+ \edef\FibNum@temp{%
+ \FibNum@temp
+ \csname FibNum@\the\FibNum@i\endcsname
+ }%
+ \advance\FibNum@i\ltx@two
+ \iftrue
+ \expandafter\FibNum@PreCalcAux\FibNum@temp
+ \fi
+ \endgroup
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\FibNum@PreCalcAux}
+% \begin{macrocode}
+\def\FibNum@PreCalcAux#1/#2\fi{%
+ \fi
+ \edef\FibNum@temp{\BigIntCalcAdd#1!#2!}%
+ \global\expandafter
+ \let\csname FibNum@\the\FibNum@i\endcsname\FibNum@temp
+ \ifnum\FibNum@i=\ltx@LocDimenA
+ \xdef\FibNum@max{\the\FibNum@i}%
+ \else
+ \advance\FibNum@i\ltx@one
+ \expandafter\FibNum@PreCalcAux\FibNum@temp/#1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Expandable calculations}
+%
+% \begin{macro}{\fibnum}
+% \begin{macrocode}
+\def\fibnum#1{%
+ \romannumeral
+ \expandafter\expandafter\expandafter\FibNum@Do\intcalcNum{#1}/%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\FibNum@Do}
+% \begin{macrocode}
+\def\FibNum@Do#1/{%
+ \ifnum#1<\ltx@zero
+ \FibNum@ReturnAfterElseFiFi{%
+ \ifodd#1 %
+ \expandafter\expandafter\expandafter\ltx@zero
+ \else
+ \expandafter\expandafter\expandafter\ltx@zero
+ \expandafter\expandafter\expandafter-%
+ \fi
+ \romannumeral
+ \expandafter\FibNum@Do\ltx@gobble#1/%
+ }%
+ \else
+ \ifnum\FibNum@max<#1 %
+ \ltx@ReturnAfterElseFi{%
+ \expandafter
+ \FibNum@ExpCalc\number\expandafter\IntCalcInc\FibNum@max!%
+ \expandafter\expandafter\expandafter/%
+ \csname FibNum@\FibNum@max
+ \expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter/%
+ \csname FibNum@\expandafter\IntCalcDec\FibNum@max!%
+ \endcsname/%
+ #1%
+ }%
+ \else
+ \expandafter\expandafter\expandafter\ltx@zero
+ \csname FibNum@#1\expandafter\expandafter\expandafter\endcsname
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\FibNum@ReturnAfterElseFiFi}
+% \begin{macrocode}
+\def\FibNum@ReturnAfterElseFiFi#1\else#2\fi\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\FibNum@ExpCalc}
+% \begin{macrocode}
+\def\FibNum@ExpCalc#1/#2/#3/#4\fi{%
+ \fi
+ \ifnum#1=#4 %
+ \ltx@ReturnAfterElseFi{%
+ \expandafter\expandafter\expandafter\ltx@zero
+ \BigIntCalcAdd#2!#3!%
+ }%
+ \else
+ \expandafter\FibNum@ExpCalc
+ \number\IntCalcInc#1!%
+ \expandafter\expandafter\expandafter/%
+ \BigIntCalcAdd#2!#3!/%
+ #2/#4%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\FibNum@AtEnd%
+%</package>
+% \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 fibnum.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test calculations}
+%
+% \begin{macrocode}
+%<*test-calc>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input fibnum.sty\relax
+\else
+ \RequirePackage{fibnum}[2016/05/16]%
+\fi
+\def\TestSet{%
+ \test{0}{0}%
+ \test{1}{1}%
+ \test{2}{1}%
+ \test{3}{2}%
+ \test{4}{3}%
+ \test{5}{5}%
+ \test{6}{8}%
+ \test{7}{13}%
+ \test{8}{21}%
+ \test{9}{34}%
+ \test{10}{55}%
+ \test{11}{89}%
+ \test{12}{144}%
+ \test{13}{233}%
+ \test{14}{377}%
+ \test{15}{610}%
+ \test{16}{987}%
+ \test{17}{1597}%
+ \test{18}{2584}%
+ \test{19}{4181}%
+ \test{20}{6765}%
+ \test{21}{10946}%
+ \test{22}{17711}%
+ \test{23}{28657}%
+ \test{24}{46368}%
+ \test{25}{75025}%
+ \test{26}{121393}%
+ \test{27}{196418}%
+ \test{28}{317811}%
+ \test{29}{514229}%
+ \test{30}{832040}%
+ \test{31}{1346269}%
+ \test{32}{2178309}%
+ \test{33}{3524578}%
+ \test{34}{5702887}%
+ \test{35}{9227465}%
+ \test{36}{14930352}%
+ \test{37}{24157817}%
+ \test{38}{39088169}%
+ \test{39}{63245986}%
+ \test{40}{102334155}%
+ \test{41}{165580141}%
+ \test{42}{267914296}%
+ \test{43}{433494437}%
+ \test{44}{701408733}%
+ \test{45}{1134903170}%
+ \test{46}{1836311903}%
+ \test{47}{2971215073}%
+ \test{48}{4807526976}%
+ \test{49}{7778742049}%
+ \test{50}{12586269025}%
+ \test{51}{20365011074}%
+ \test{52}{32951280099}%
+ \test{53}{53316291173}%
+ \test{54}{86267571272}%
+ \test{55}{139583862445}%
+ \test{56}{225851433717}%
+ \test{57}{365435296162}%
+ \test{58}{591286729879}%
+ \test{59}{956722026041}%
+ \test{60}{1548008755920}%
+ \test{61}{2504730781961}%
+ \test{62}{4052739537881}%
+ \test{63}{6557470319842}%
+ \test{64}{10610209857723}%
+ \test{65}{17167680177565}%
+ \test{66}{27777890035288}%
+ \test{67}{44945570212853}%
+ \test{68}{72723460248141}%
+ \test{69}{117669030460994}%
+ \test{70}{190392490709135}%
+ \test{71}{308061521170129}%
+ \test{72}{498454011879264}%
+ \test{73}{806515533049393}%
+}
+\def\msg#{\immediate\write16}
+\def\test#1#2{%
+ \TestAux{#1}{#2}%
+ \ifnum#1=0 %
+ \else
+ \ifodd#1 %
+ \TestAux{-#1}{#2}%
+ \else
+ \TestAux{-#1}{-#2}%
+ \fi
+ \fi
+}
+\def\TestAux#1#2{%
+ \def\Expected{#2}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\Result
+ \expandafter\expandafter\expandafter{%
+ \fibnum{#1}%
+ }%
+ \ltx@onelevel@sanitize\Result
+ \ifx\Result\Expected
+ \msg{* #1: ok.}%
+ \else
+ \msg{! fib(#1) = #2}%
+ \errmessage{fib(#1) <> \Result}%
+ \fi
+}
+\TestSet
+\setbox0=\hbox{%
+ \msg{* PreCalc{73}}%
+ \fibnumPreCalc{73}%
+}
+\ifdim\wd0=0pt
+\else
+ \errmessage{Unwanted stuff in PreCalc}%
+\fi
+\TestSet
+\csname @@end\endcsname\end
+%</test-calc>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/fibnum}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/fibnum.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/fibnum.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[\CTAN{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 fibnum.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@{}}
+% fibnum.sty & tex/generic/oberdiek/fibnum.sty\\
+% fibnum.pdf & doc/latex/oberdiek/fibnum.pdf\\
+% test/fibnum-test1.tex & doc/latex/oberdiek/test/fibnum-test1.tex\\
+% test/fibnum-test-calc.tex & doc/latex/oberdiek/test/fibnum-test-calc.tex\\
+% fibnum.dtx & source/latex/oberdiek/fibnum.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk fibnum.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{fibnum.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 fibnum.dtx
+%bibtex fibnum.aux
+%makeindex -s gind.ist fibnum.idx
+%pdflatex fibnum.dtx
+%makeindex -s gind.ist fibnum.idx
+%pdflatex fibnum.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \printbibliography[
+% heading=bibnumbered,
+% ]
+%
+% \begin{History}
+% \begin{Version}{2012/04/08 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/fibnum.pdf b/macros/latex/contrib/oberdiek/fibnum.pdf
new file mode 100644
index 0000000000..a18cb065c1
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/fibnum.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/flags.dtx b/macros/latex/contrib/oberdiek/flags.dtx
new file mode 100644
index 0000000000..d763f55168
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/flags.dtx
@@ -0,0 +1,721 @@
+% \iffalse meta-comment
+%
+% File: flags.dtx
+% Version: 2016/05/16 v0.5
+% Info: Setting/clearing of flags in bit fields
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file flags.dtx
+% and the derived files
+% flags.sty, flags.pdf, flags.ins, flags.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/flags.dtx
+% CTAN:macros/latex/contrib/oberdiek/flags.pdf
+%
+% Unpacking:
+% (a) If flags.ins is present:
+% tex flags.ins
+% (b) Without flags.ins:
+% tex flags.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{flags.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If flags.drv is present:
+% latex flags.drv
+% (b) Without flags.drv:
+% latex flags.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 flags.dtx
+% makeindex -s gind.ist flags.idx
+% pdflatex flags.dtx
+% makeindex -s gind.ist flags.idx
+% pdflatex flags.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/flags.sty
+% TDS:doc/latex/oberdiek/flags.pdf
+% TDS:source/latex/oberdiek/flags.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: flags 2016/05/16 v0.5 Setting/clearing of flags in bit fields (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: flags
+Version: 2016/05/16 v0.5
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file flags.dtx
+and the derived files
+ flags.sty, flags.pdf, flags.ins, flags.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{flags.ins}{\from{flags.dtx}{install}}%
+ \file{flags.drv}{\from{flags.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{flags.sty}{\from{flags.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{flags.xml}{\from{flags.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{* flags.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `flags.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{flags.drv}%
+ [2016/05/16 v0.5 Setting/clearing of flags in bit fields (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{flags.dtx}%
+\end{document}
+%</driver>
+% \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{flags.drv}
+%
+% \title{The \xpackage{flags} package}
+% \date{2016/05/16 v0.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{flags} allows the setting and clearing
+% of flags in bit fields and converts the bit field into a
+% decimal number. Currently the bit field is limited to 31 bits.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% A new powerful package \xpackage{bitset} is written by me
+% and supersedes this package:
+% \begin{itemize}
+% \item The bit range is not restricted to 31 bits, only index
+% numbers are objected to \TeX's number limit.
+% \item Many more operations are available.
+% \item No dependency of \eTeX.
+% \end{itemize}
+% Therefore I consider this package as obsolete and
+% have stopped the development of this package.
+%
+% \subsection{User interface}
+%
+% Flag positions are one-based, thus the flag position must be
+% a positive integer. Currently supported range: |1..31|
+%
+% \begin{declcs}{resetflags} \M{fname}
+% \end{declcs}
+% The bit field \meta{fname} is cleared.
+% Currently is is also used for initialization,
+% because a \cs{newflags} macro is not implemented.
+%
+% \begin{declcs}{setflag} \M{fname} \M{position}
+% \end{declcs}
+% The flag at bit position \meta{position} is set in the
+% bit field \meta{fname}.
+%
+% \begin{declcs}{clearflag} \M{fname} \M{position}
+% \end{declcs}
+% The flag at bit position \meta{position} is cleared in the
+% bit field \meta{fname}.
+%
+% \begin{declcs}{printflags} \M{fname}
+% \end{declcs}
+% The bit field \meta{fname} is converted to a decimal number.
+% The macro is expandible.
+%
+% \begin{declcs}{extractflag} \M{fname} \M{position}
+% \end{declcs}
+% Extracts the flag setting at bit position \meta{position}.
+% \cs{extractflag} expands to |1| if the flag is set and |0| otherwise.
+%
+% \begin{declcs}{queryflag} \M{fname} \M{position}
+% \M{set part} \M{clear part}
+% \end{declcs}
+% It is a wrapper for \cs{extractflag}. \meta{set part} is called if
+% \cs{extractflag} returns |1|. Otherwise \meta{clear part} is executed.
+%
+% \paragraph{Example.} See package \xpackage{bookmark}.
+% It uses package \xpackage{flags} for its font style options.
+%
+% \subsection{Requirements}
+%
+% \begin{itemize}
+% \item \eTeX\ (\cs{numexpr})
+% \end{itemize}
+%
+% \subsection{ToDo}
+%
+% \begin{itemize}
+% \raggedright
+% \item Named positions.
+% \item Setting positions by a key-value interface.
+% \item Support for more than 31 bits while maintaining expandibility of
+% \cs{printflags}.
+% \item Eventually \cs{newflags}, \cs{newflagstype}.
+% \end{itemize}
+%
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{flags}%
+ [2016/05/16 v0.5 Setting/clearing of flags in bit fields (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+ \PackageError{flags}{%
+ Missing e-TeX, package loading aborted%
+ }{%
+ This packages makes heavy use of \string\numexpr.%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\resetflags}
+% \begin{macrocode}
+\newcommand*{\resetflags}[1]{%
+ \expandafter\let\csname flags@#1\endcsname\@empty
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\printflags}
+% Macro \cs{printflags} converts the bit field into a decimal
+% number.
+% \begin{macrocode}
+\newcommand*{\printflags}[1]{%
+ \expandafter\@printflags\csname flags@#1\endcsname
+}
+\def\@printflags#1{%
+ \expandafter\@firstofone\expandafter{%
+ \number\numexpr
+ \ifx#1\@empty
+ 0%
+ \else
+ \expandafter\@@printflags#1%
+ \fi
+ }%
+}
+\def\@@printflags#1#2\fi{%
+ \fi
+ #1%
+ \ifx\\#2\\%
+ \else
+ +2*\numexpr\expandafter\@@printflags#2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setflag}
+% \begin{macrocode}
+\newcommand*{\setflag}[2]{%
+ \ifnum#2>\z@
+ \expandafter\@setflag\csname flags@#1\expandafter\endcsname
+ \expandafter{\romannumeral\number\numexpr#2-1\relax000}%
+ \else
+ \PackageError{flags}{Position must be a positive number}\@ehc
+ \fi
+}
+\def\@setflag#1#2{%
+ \ifx#1\relax
+ \let#1\@empty
+ \fi
+ \edef#1{%
+ \expandafter\@@setflag\expandafter{#1}{#2}%
+ }%
+}
+\def\@@setflag#1#2{%
+ \ifx\\#1\\%
+ \FLAGS@zero#2\relax
+ 1%
+ \else
+ \ifx\\#2\\%
+ 1\@gobble#1%
+ \else
+ \@@@setflag#1|#2%
+ \fi
+ \fi
+}
+\def\@@@setflag#1#2|#3#4\fi\fi{%
+ \fi\fi
+ #1%
+ \@@setflag{#2}{#4}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clearflag}
+% \begin{macrocode}
+\newcommand*{\clearflag}[2]{%
+ \ifnum#2>\z@
+ \expandafter\@clearflag\csname flags@#1\expandafter\endcsname
+ \expandafter{\romannumeral\number\numexpr#2-1\relax000}%
+ \else
+ \PackageError{flags}{Position must be a positive number}\@ehc
+ \fi
+}
+\def\@clearflag#1#2{%
+ \ifx#1\relax
+ \let#1\@empty
+ \fi
+ \edef#1{%
+ \expandafter\@@clearflag\expandafter{#1}{#2}%
+ }%
+}
+\def\@@clearflag#1#2{%
+ \ifx\\#1\\%
+ \else
+ \ifx\\#2\\%
+ 0\@gobble#1%
+ \else
+ \@@@clearflag#1|#2%
+ \fi
+ \fi
+}
+\def\@@@clearflag#1#2|#3#4\fi\fi{%
+ \fi\fi
+ #1%
+ \@@clearflag{#2}{#4}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\FLAGS@zero#1{%
+ \ifx#1\relax
+ \else
+ 0%
+ \expandafter\FLAGS@zero
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macro}{\queryflag}
+% \begin{macrocode}
+\newcommand*{\queryflag}[2]{%
+ \ifnum\extractflag{#1}{#2}=\@ne
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extractflag}
+% \begin{macrocode}
+\newcommand*{\extractflag}[1]{%
+ \expandafter\@extractflag\csname flags@#1\endcsname
+}
+\def\@extractflag#1#2{%
+ \ifx#1\@undefined
+ 0%
+ \else
+ \ifx#1\relax
+ 0%
+ \else
+ \ifx#1\@empty
+ 0%
+ \else
+ \expandafter\expandafter\expandafter\@@extractflag
+ \expandafter\expandafter\expandafter{%
+ \expandafter#1\expandafter
+ }\expandafter{%
+ \romannumeral\number\numexpr#2-1\relax000%
+ }%
+ \fi
+ \fi
+ \fi
+}
+\def\@@extractflag#1#2{%
+ \ifx\\#1\\%
+ 0%
+ \else
+ \ifx\\#2\\%
+ \@car#1\@nil
+ \else
+ \@@@extractflag#1|#2%
+ \fi
+ \fi
+}
+\def\@@@extractflag#1#2|#3#4\fi\fi{%
+ \fi\fi
+ \@@extractflag{#2}{#4}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/flags}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/flags.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/flags.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[\CTAN{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 flags.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@{}}
+% flags.sty & tex/latex/oberdiek/flags.sty\\
+% flags.pdf & doc/latex/oberdiek/flags.pdf\\
+% flags.dtx & source/latex/oberdiek/flags.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk flags.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{flags.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 flags.dtx
+%makeindex -s gind.ist flags.idx
+%pdflatex flags.dtx
+%makeindex -s gind.ist flags.idx
+%pdflatex flags.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{flags.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='flags'>
+ <name>flags</name>
+ <caption>Setting and clearing of flags in bit fields.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='0.5'/>
+ <description>
+ This package allows the setting and clearing
+ of flags in bit fields and converts the bit field into a
+ decimal number. Currently the bit field is limited to 31 bits.
+ <p/>
+ It is now deprecated because of new more powerful
+ package <xref refid='bitset'>bitset</xref>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/flags.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/flags.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/02/18 v0.1}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/03/07 v0.2}
+% \item
+% Raise an error if \eTeX\ is not detected.
+% \end{Version}
+% \begin{Version}{2007/03/31 v0.3}
+% \item
+% \cs{queryflag} and \cs{extractflag} added.
+% \item
+% Raise an error if position is not positive in case of
+% \cs{setflag} and \cs{clearflag}.
+% \end{Version}
+% \begin{Version}{2007/09/30 v0.4}
+% \item
+% Package is deprecated because of new more powerful
+% package \xpackage{bitset}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v0.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/flags.pdf b/macros/latex/contrib/oberdiek/flags.pdf
new file mode 100644
index 0000000000..c62e48402e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/flags.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/gettitlestring.dtx b/macros/latex/contrib/oberdiek/gettitlestring.dtx
new file mode 100644
index 0000000000..6ac8997800
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/gettitlestring.dtx
@@ -0,0 +1,1037 @@
+% \iffalse meta-comment
+%
+% File: gettitlestring.dtx
+% Version: 2016/05/16 v1.5
+% Info: Cleanup title references
+%
+% Copyright (C) 2009, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 gettitlestring.dtx
+% and the derived files
+% gettitlestring.sty, gettitlestring.pdf, gettitlestring.ins,
+% gettitlestring.drv, gettitlestring-test1.tex,
+% gettitlestring-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/gettitlestring.dtx
+% CTAN:macros/latex/contrib/oberdiek/gettitlestring.pdf
+%
+% Unpacking:
+% (a) If gettitlestring.ins is present:
+% tex gettitlestring.ins
+% (b) Without gettitlestring.ins:
+% tex gettitlestring.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{gettitlestring.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If gettitlestring.drv is present:
+% latex gettitlestring.drv
+% (b) Without gettitlestring.drv:
+% latex gettitlestring.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 gettitlestring.dtx
+% makeindex -s gind.ist gettitlestring.idx
+% pdflatex gettitlestring.dtx
+% makeindex -s gind.ist gettitlestring.idx
+% pdflatex gettitlestring.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/gettitlestring.sty
+% TDS:doc/latex/oberdiek/gettitlestring.pdf
+% TDS:doc/latex/oberdiek/test/gettitlestring-test1.tex
+% TDS:doc/latex/oberdiek/test/gettitlestring-test2.tex
+% TDS:source/latex/oberdiek/gettitlestring.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: gettitlestring 2016/05/16 v1.5 Cleanup title references (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: gettitlestring
+Version: 2016/05/16 v1.5
+
+Copyright (C) 2009, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 gettitlestring.dtx
+and the derived files
+ gettitlestring.sty, gettitlestring.pdf, gettitlestring.ins,
+ gettitlestring.drv, gettitlestring-test1.tex,
+ gettitlestring-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{gettitlestring.ins}{\from{gettitlestring.dtx}{install}}%
+ \file{gettitlestring.drv}{\from{gettitlestring.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{gettitlestring.sty}{\from{gettitlestring.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{gettitlestring-test1.tex}{\from{gettitlestring.dtx}{test1}}%
+% \file{gettitlestring-test2.tex}{\from{gettitlestring.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{gettitlestring.xml}{\from{gettitlestring.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{* gettitlestring.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `gettitlestring.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{gettitlestring.drv}%
+ [2016/05/16 v1.5 Cleanup title references (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{gettitlestring.dtx}%
+\end{document}
+%</driver>
+% \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{gettitlestring.drv}
+%
+% \title{The \xpackage{gettitlestring} package}
+% \date{2016/05/16 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The \LaTeX\ package addresses packages that are dealing with
+% references to titles (\cs{section}, \cs{caption}, \dots).
+% The package tries to remove \cs{label} and other
+% commands from title strings.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Macros}
+%
+% \begin{declcs}{GetTitleStringSetup} \M{key value list}
+% \end{declcs}
+% The options are given as comma separated key value pairs.
+% See section \ref{sec:options}.
+%
+% \begin{declcs}{GetTitleString} \M{text}\\
+% \cs{GetTitleStringExpand} \M{text}\\
+% \cs{GetTitleStringNonExpand} \M{text}
+% \end{declcs}
+% Macro \cs{GetTitleString} tries to remove unwanted stuff from \meta{text}
+% the result is stored in Macro \cs{GetTitleStringResult}.
+% Two methods are available:
+% \begin{description}
+% \item[\cs{GetTitleStringExpand}:]
+% The \meta{text} is expanded in a context where the unwanted
+% macros are redefined to remove themselves.
+% This is the method used in packages \xpackage{titleref}~\cite{titleref},
+% \xpackage{zref-titleref}~\cite{zref}
+% or class \xclass{memoir}~\cite{memoir}.
+% \cs{protect} is supported, but fragile material might break.
+% \item[\cs{GetTitleStringNonExpand}:]
+% The \meta{text} is not expanded. Thus the removal of unwanted
+% material is more difficult. It is especially removed at the
+% start of the \meta{text} and spaces are removed from the end.
+% Currently only \cs{label} is removed in the whole string,
+% if it is not hidden inside curly braces or part of macro
+% definitions. Thus the removal of unwanted stuff might not be
+% complete, but fragile material will not break.
+% (But the result string can break at a later time, of course).
+% \end{description}
+% Option \xoption{expand} controls which method is used by
+% macro \cs{GetTitleString}.
+%
+% \begin{declcs}{GetTitleStringDisableCommands} \M{code}
+% \end{declcs}
+% The \meta{code} is called right before the
+% text is expanded in \cs{GetTitleStringExpand}.
+% Additional definitions can be given for macros that
+% should be removed.
+% Keep in mind that expansion means that the definitions
+% must work in expandable context. Macros like
+% \cs{@ifstar} or \cs{@ifnextchar} or optional arguments
+% will not work. The macro names in \meta{code} may contain
+% the at sign |@|, it has catcode 11 (letter).
+%
+% \subsection{Options}\label{sec:options}
+%
+% \begin{description}
+% \item[\xoption{expand}:] Boolean option, takes values |true| or |false|.
+% No value means |true|. The option specifies the method to remove
+% unwanted stuff from the title string, see below.
+% \end{description}
+% Options can be set at the following places:
+% \begin{itemize}
+% \item \cs{usepackage}
+% \item Configuration file \xfile{gettitlestring.cfg}.
+% \item \cs{GetTitleStringSetup}
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@gettitlestring.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{gettitlestring}{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@gettitlestring.sty\endcsname
+\ProvidesPackage{gettitlestring}%
+ [2016/05/16 v1.5 Cleanup title references (HO)]%
+% \end{macrocode}
+%
+% \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 GTS@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\GTS@AtEnd{%
+ \GTS@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\GTS@AtEnd{\GTS@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Options}
+%
+% \begin{macrocode}
+\RequirePackage{kvoptions}[2009/07/17]
+\SetupKeyvalOptions{%
+ family=gettitlestring,%
+ prefix=GTS@%
+}
+\newcommand*{\GetTitleStringSetup}{%
+ \setkeys{gettitlestring}%
+}
+\DeclareBoolOption{expand}
+\InputIfFileExists{gettitlestring.cfg}{}{}
+\ProcessKeyvalOptions*\relax
+% \end{macrocode}
+%
+% \subsection{\cs{GetTitleString}}
+%
+% \begin{macro}{\GetTitleString}
+% \begin{macrocode}
+\newcommand*{\GetTitleString}{%
+ \ifGTS@expand
+ \expandafter\GetTitleStringExpand
+ \else
+ \expandafter\GetTitleStringNonExpand
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GetTitleStringExpand}
+% \begin{macrocode}
+\newcommand{\GetTitleStringExpand}[1]{%
+ \def\GetTitleStringResult{#1}%
+ \begingroup
+ \GTS@DisablePredefinedCmds
+ \GTS@DisableHook
+ \edef\x{\endgroup
+ \noexpand\def\noexpand\GetTitleStringResult{%
+ \GetTitleStringResult
+ }%
+ }%
+ \x
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GetTitleString}
+% \begin{macrocode}
+\newcommand{\GetTitleStringNonExpand}[1]{%
+ \def\GetTitleStringResult{#1}%
+ \global\let\GTS@GlobalString\GetTitleStringResult
+ \begingroup
+ \GTS@RemoveLeft
+ \GTS@RemoveRight
+ \endgroup
+ \let\GetTitleStringResult\GTS@GlobalString
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Expand method}
+%
+% \begin{macro}{\GTS@DisablePredefinedCmds}
+% \begin{macrocode}
+\def\GTS@DisablePredefinedCmds{%
+ \let\label\@gobble
+ \let\zlabel\@gobble
+ \let\zref@label\@gobble
+ \let\zref@labelbylist\@gobbletwo
+ \let\zref@labelbyprops\@gobbletwo
+ \let\index\@gobble
+ \let\glossary\@gobble
+ \let\markboth\@gobbletwo
+ \let\@mkboth\@gobbletwo
+ \let\markright\@gobble
+ \let\phantomsection\@empty
+ \def\addcontentsline{\expandafter\@gobble\@gobbletwo}%
+ \let\raggedright\@empty
+ \let\raggedleft\@empty
+ \let\centering\@empty
+ \let\protect\@unexpandable@protect
+ \let\enit@format\@empty % package enumitem
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\GTS@DisableHook}
+% \begin{macrocode}
+\providecommand*{\GTS@DisableHook}{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GetTitleStringDisableCommands}
+% \begin{macrocode}
+\def\GetTitleStringDisableCommands{%
+ \begingroup
+ \makeatletter
+ \GTS@DisableCommands
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GTS@DisableCommands}
+% \begin{macrocode}
+\long\def\GTS@DisableCommands#1{%
+ \toks0=\expandafter{\GTS@DisableHook}%
+ \toks2={#1}%
+ \xdef\GTS@GlobalString{\the\toks0 \the\toks2}%
+ \endgroup
+ \let\GTS@DisableHook\GTS@GlobalString
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Non-expand method}
+%
+% \begin{macrocode}
+\def\GTS@RemoveLeft{%
+ \toks@\expandafter\expandafter\expandafter{%
+ \expandafter\GTS@Car\GTS@GlobalString{}{}{}{}\GTS@Nil
+ }%
+ \edef\GTS@Token{\the\toks@}%
+ \GTS@PredefinedLeftCmds
+ \expandafter\futurelet\expandafter\GTS@Token
+ \expandafter\GTS@TestLeftSpace\GTS@GlobalString\GTS@Nil
+ \GTS@End
+}
+\def\GTS@End{}
+\long\def\GTS@TestLeft#1#2{%
+ \def\GTS@temp{#1}%
+ \ifx\GTS@temp\GTS@Token
+ \toks@\expandafter\expandafter\expandafter{%
+ \expandafter#2\GTS@GlobalString\GTS@Nil
+ }%
+ \expandafter\GTS@TestLeftEnd
+ \fi
+}
+\long\def\GTS@TestLeftEnd#1\GTS@End{%
+ \xdef\GTS@GlobalString{\the\toks@}%
+ \GTS@RemoveLeft
+}
+\long\def\GTS@Car#1#2\GTS@Nil{#1}
+\long\def\GTS@Cdr#1#2\GTS@Nil{#2}
+\long\def\GTS@CdrTwo#1#2#3\GTS@Nil{#3}
+\long\def\GTS@CdrThree#1#2#3#4\GTS@Nil{#4}
+\long\def\GTS@CdrFour#1#2#3#4#5\GTS@Nil{#5}
+\long\def\GTS@TestLeftSpace#1\GTS@Nil{%
+ \ifx\GTS@Token\@sptoken
+ \toks@\expandafter{%
+ \romannumeral-0\GTS@GlobalString
+ }%
+ \expandafter\GTS@TestLeftEnd
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\GTS@PredefinedLeftCmds}
+% \begin{macrocode}
+\def\GTS@PredefinedLeftCmds{%
+ \GTS@TestLeft\Hy@phantomsection\GTS@Cdr
+ \GTS@TestLeft\Hy@SectionAnchor\GTS@Cdr
+ \GTS@TestLeft\Hy@SectionAnchorHref\GTS@CdrTwo
+ \GTS@TestLeft\label\GTS@CdrTwo
+ \GTS@TestLeft\zlabel\GTS@CdrTwo
+ \GTS@TestLeft\index\GTS@CdrTwo
+ \GTS@TestLeft\glossary\GTS@CdrTwo
+ \GTS@TestLeft\markboth\GTS@CdrThree
+ \GTS@TestLeft\@mkboth\GTS@CdrThree
+ \GTS@TestLeft\addcontentsline\GTS@CdrFour
+ \GTS@TestLeft\enit@format\GTS@Cdr % package enumitem
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\GTS@RemoveRight{%
+ \toks@{}%
+ \expandafter\GTS@TestRightLabel\GTS@GlobalString
+ \label{}\GTS@Nil\@nil
+ \GTS@RemoveRightSpace
+}
+\begingroup
+ \def\GTS@temp#1{\endgroup
+ \def\GTS@RemoveRightSpace{%
+ \expandafter\GTS@TestRightSpace\GTS@GlobalString
+ \GTS@Nil#1\GTS@Nil\@nil
+ }%
+ }%
+\GTS@temp{ }
+\def\GTS@TestRightSpace#1 \GTS@Nil#2\@nil{%
+ \ifx\relax#2\relax
+ \else
+ \gdef\GTS@GlobalString{#1}%
+ \expandafter\GTS@RemoveRightSpace
+ \fi
+}
+\def\GTS@TestRightLabel#1\label#2#3\GTS@Nil#4\@nil{%
+ \def\GTS@temp{#3}%
+ \ifx\GTS@temp\@empty
+ \expandafter\gdef\expandafter\GTS@GlobalString\expandafter{%
+ \the\toks@
+ #1%
+ }%
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \toks@\expandafter{\the\toks@#1}%
+ \GTS@TestRightLabel#3\GTS@Nil\@nil
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\GTS@AtEnd%
+%</package>
+% \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 gettitlestring.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test of non-expand method}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\usepackage{gettitlestring}[2016/05/16]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\begin{document}
+\begin{qstest}{non-expand}{non-expand}
+ \def\test#1#2{%
+ \sbox0{%
+ \GetTitleString{#1}%
+ \Expect{#2}*{\GetTitleStringResult}%
+ }%
+ \Expect{0.0pt}*{\the\wd0}%
+ }%
+ \test{}{}%
+ \test{ }{}%
+ \test{ x }{x}%
+ \test{ x y }{x y}%
+ \test{ \relax}{\relax}%
+ \test{\label{f}a}{a}%
+ \test{ \label{f}a}{a}%
+ \test{\label{f} a}{a}%
+ \test{ \label{f} a}{a}%
+ \test{a\label{f}}{a}%
+ \test{a\label{f} }{a}%
+ \test{a \label{f}}{a}%
+ \test{a \label{f} }{a}%
+ \test{a\label{f}b\label{g}}{ab}%
+ \test{a \label{f}b \label{g} }{a b}%
+ \test{a\label{f} b \label{g} }{a b}%
+\end{qstest}
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/gettitlestring}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/gettitlestring.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/gettitlestring.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[\CTAN{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 gettitlestring.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@{}}
+% gettitlestring.sty & tex/generic/oberdiek/gettitlestring.sty\\
+% gettitlestring.pdf & doc/latex/oberdiek/gettitlestring.pdf\\
+% test/gettitlestring-test1.tex & doc/latex/oberdiek/test/gettitlestring-test1.tex\\
+% test/gettitlestring-test2.tex & doc/latex/oberdiek/test/gettitlestring-test2.tex\\
+% gettitlestring.dtx & source/latex/oberdiek/gettitlestring.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk gettitlestring.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{gettitlestring.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 gettitlestring.dtx
+%makeindex -s gind.ist gettitlestring.idx
+%pdflatex gettitlestring.dtx
+%makeindex -s gind.ist gettitlestring.idx
+%pdflatex gettitlestring.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{gettitlestring.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='gettitlestring'>
+ <name>gettitlestring</name>
+ <caption>Clean up title references.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2009,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.5'/>
+ <description>
+ Cleans up the title string (removing <tt>\label</tt> commands) for
+ packages (such as <xref refid='nameref'>nameref</xref>) that
+ typeset such strings.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/gettitlestring.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/gettitlestring.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{memoir}
+% Peter Wilson, Lars Madsen:
+% \textit{The Memoir Class};
+% 2009/11/17 v1.61803398c;
+% \CTAN{macros/latex/contrib/memoir/}
+%
+% \bibitem{titleref}
+% Donald Arsenau:
+% \textit{Titleref.sty};
+% 2001/04/05 ver 3.1;
+% \CTAN{macros/latex/contrib/misc/titleref.sty}
+%
+% \bibitem{zref}
+% Heiko Oberdiek:
+% \textit{The \xpackage{zref} package};
+% 2009/12/08 v2.7;
+% \CTAN{macros/latex/contrib/oberdiek/zref.pdf}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2009/12/08 v1.0}
+% \item
+% The first version.
+% \end{Version}
+% \begin{Version}{2009/12/12 v1.1}
+% \item
+% Short info shortened.
+% \end{Version}
+% \begin{Version}{2009/12/13 v1.2}
+% \item
+% Forgotten third argument for \cs{InputIfFileExists} added.
+% \end{Version}
+% \begin{Version}{2009/12/18 v1.3}
+% \item
+% \cs{Hy@SectionAnchorHref} added for filtering
+% (hyperref 2009/12/18 v6.79w).
+% \end{Version}
+% \begin{Version}{2010/12/03 v1.4}
+% \item
+% Support of package \xpackage{enumitem}: removing
+% \cs{enit@format} from title string (problem report by GL).
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/gettitlestring.pdf b/macros/latex/contrib/oberdiek/gettitlestring.pdf
new file mode 100644
index 0000000000..12386486dc
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/gettitlestring.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/grfext.dtx b/macros/latex/contrib/oberdiek/grfext.dtx
new file mode 100644
index 0000000000..fef35e9181
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/grfext.dtx
@@ -0,0 +1,1182 @@
+% \iffalse meta-comment
+%
+% File: grfext.dtx
+% Version: 2016/05/16 v1.2
+% Info: Manage graphics extensions
+%
+% Copyright (C) 2007, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file grfext.dtx
+% and the derived files
+% grfext.sty, grfext.pdf, grfext.ins, grfext.drv, grfext-test1.tex,
+% grfext-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/grfext.dtx
+% CTAN:macros/latex/contrib/oberdiek/grfext.pdf
+%
+% Unpacking:
+% (a) If grfext.ins is present:
+% tex grfext.ins
+% (b) Without grfext.ins:
+% tex grfext.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{grfext.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If grfext.drv is present:
+% latex grfext.drv
+% (b) Without grfext.drv:
+% latex grfext.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 grfext.dtx
+% makeindex -s gind.ist grfext.idx
+% pdflatex grfext.dtx
+% makeindex -s gind.ist grfext.idx
+% pdflatex grfext.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/grfext.sty
+% TDS:doc/latex/oberdiek/grfext.pdf
+% TDS:doc/latex/oberdiek/test/grfext-test1.tex
+% TDS:doc/latex/oberdiek/test/grfext-test2.tex
+% TDS:source/latex/oberdiek/grfext.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: grfext
+Version: 2016/05/16 v1.2
+
+Copyright (C) 2007, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file grfext.dtx
+and the derived files
+ grfext.sty, grfext.pdf, grfext.ins, grfext.drv, grfext-test1.tex,
+ grfext-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{grfext.ins}{\from{grfext.dtx}{install}}%
+ \file{grfext.drv}{\from{grfext.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{grfext.sty}{\from{grfext.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{grfext-test1.tex}{\from{grfext.dtx}{test1}}%
+% \file{grfext-test2.tex}{\from{grfext.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{grfext.xml}{\from{grfext.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{* grfext.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `grfext.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{grfext.drv}%
+ [2016/05/16 v1.2 Manage graphics extensions (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{grfext.dtx}%
+\end{document}
+%</driver>
+% \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{grfext.drv}
+%
+% \title{The \xpackage{grfext} package}
+% \date{2016/05/16 v1.2}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides macros for adding and reordering
+% graphics extensions of package \xpackage{graphics}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% If you are not familiar with \LaTeX's graphics bundle, please
+% read its documentation \xfile{grffile} \cite{graphics}.
+% The bundle contains two packages for graphics inclusion:
+% \xpackage{graphics} and \xpackage{graphicx}. The first one
+% is loaded by the second one that adds a key value interface.
+%
+% Graphics files are included in both cases by macro
+% \cs{includegraphics}. The file name extension can be omitted.
+% Then the graphics package goes through a list of known
+% extensions until it finds the graphics file. This extension list
+% is set by \cs{DeclareGraphicsExtensions}. The previous contents
+% of the list is overwritten.
+%
+% \subsection{User interface}
+%
+% This package \xpackage{grfext} provides macros that adds entries
+% to the list or remove them. The list may be empty or even
+% undefined before. It is always defined afterwards, but can
+% be empty (especially after removing entries).
+%
+% \begin{declcs}{AppendGraphicsExtensions} * \M{ext-list}\\
+% \cs{PrependGraphicsExtensions} * \M{ext-list}
+% \end{declcs}
+% The argument \meta{ext-list} is a comma separated list whose
+% entries are file name extensions including the dot.
+% But first the entries are removed from
+% \xpackage{graphics}' extension list to avoid multiple
+% occurences of the same extension.
+%
+% Then macro \cs{AppendGraphicsExtensions} adds the entries
+% after the end of \xpackage{graphics}' list, whereas
+% macro \cs{PrependGraphicsExtensions} puts them in front
+% of the list.
+% The order matters if a graphics file is available in
+% different acceptable formats. Then the first extension
+% wins.
+%
+% The star version of these commands only adds an extensions,
+% if a specific graphics rule exists for that extension.
+%
+% \begin{declcs}{RemoveGraphicsExtensions} \M{ext-list}
+% \end{declcs}
+% All occurences of file extensions in \meta{ext-list} are
+% removed from \xpackage{graphics}' extension list.
+%
+% \subsection{Package loading}
+%
+% The package does not define any options. It is loaded
+% as usual in \LaTeX, e.g.:
+% \begin{quote}
+% |\usepackage{grfext}|
+% \end{quote}
+%
+% \begin{declcs}{PrintGraphicsExtensions}
+% \end{declcs}
+% Macro \cs{PrintGraphicsExtensions} writes the current
+% graphics extensions list in the \xfile{.log} file.
+% The macros described before do this automatically
+% after their operation.
+%
+% \subsection{Option support for package \xpackage{graphicx}}
+%
+% Package \xpackage{graphicx} uses the interface of package
+% \xpackage{keyval} in order to specify options for
+% \cs{includegraphics}. The options can also be set using
+% \begin{quote}
+% |\setkeys{Gin}{|\meta{options}|}|
+% \end{quote}
+% The four user macros with the two star forms are available
+% as options in family |Gin| as well:
+% \begin{quote}
+% |AppendGraphicsExtensions={|\meta{ext-list}|}|\\
+% |AppendGraphicsExtensions*={|\meta{ext-list}|}|\\
+% |PrependGraphicsExtensions={|\meta{ext-list}|}|\\
+% |PrependGraphicsExtensions*{|\meta{ext-list}|}|\\
+% |RemoveGraphicsExtensions={|\meta{ext-list}|}|\\
+% |PrintGraphicsExtensions|
+% \end{quote}
+% This makes it easier to locally change the extension list
+% for an included graphics, e.g.:
+% \begin{quote}
+% |\includegraphics[RemoveGraphicsExtensions={.pdf,PDF}]{image}|
+% \end{quote}
+%
+% \subsection{\plainTeX}
+%
+% \LaTeX's graphics packages can also be used with \plainTeX.
+% The necessary basic \LaTeX\ macros are defined in
+% \xfile{miniltx.tex}. This package \xpackage{grfext} also
+% relies on it. Example:
+%\begin{quote}
+%\begin{verbatim}
+%\input miniltx.tex\relax
+%\def\Gin@driver{pdftex.def}
+%\input graphicx.sty\relax
+%\input grfext.sty\relax
+%\resetatcatcode
+%\end{verbatim}
+%\end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{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@grfext.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{grfext}{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@grfext.sty\endcsname
+\ProvidesPackage{grfext}%
+ [2016/05/16 v1.2 Manage graphics extensions (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 grfext@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\grfext@AtEnd{%
+ \grfext@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{44}{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}% ]
+\edef\grfext@AtEnd{\grfext@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{\plainTeX}
+%
+% \begin{macro}{\@expandtwoargs}
+% Requirement is \xfile{miniltx.tex}, but we need also
+% \LaTeX's \cs{@expandtwoargs}.
+% \begin{macrocode}
+\@ifundefined{@expandtwoargs}{%
+ \def\@expandtwoargs#1#2#3{%
+ \edef\reserved@a{\noexpand#1{#2}{#3}}%
+ \reserved@a
+ }%
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Add}
+%
+% \begin{macro}{\AppendGraphicsExtensions}
+% \begin{macrocode}
+\newcommand*{\AppendGraphicsExtensions}{%
+ \@ifundefined{Gin@extensions}{%
+ \let\Gin@extensions\@empty
+ }{}%
+ \@ifstar{\grfext@Append\grfext@Check}{\grfext@Append\grfext@@Add}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grfext@Append}
+% \begin{macrocode}
+\def\grfext@Append#1#2{%
+ \let\grfext@Print\@gobble
+ \edef\grfext@next{%
+ \noexpand\grfext@Add\noexpand#1{%
+ \zap@space#2 \@empty
+ }{\noexpand\Gin@extensions,}{}%
+ }%
+ \grfext@next
+ \let\grfext@Print\grfext@@Print
+ \grfext@Print\AppendGraphicsExtensions
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PrependGraphicsExtensions}
+% \begin{macrocode}
+\newcommand*{\PrependGraphicsExtensions}{%
+ \@ifundefined{Gin@extensions}{%
+ \let\Gin@extensions\@empty
+ }{}%
+ \@ifstar{\grfext@Prepend\grfext@Check}{\grfext@Prepend\grfext@@Add}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grfext@Prepend}
+% \begin{macrocode}
+\def\grfext@Prepend#1#2{%
+ \let\grfext@Print\@gobble
+ \edef\grfext@next{%
+ \noexpand\grfext@Add\noexpand#1{%
+ \zap@space#2 \@empty
+ }{}{,\noexpand\Gin@extensions}%
+ }%
+ \grfext@next
+ \let\grfext@Print\grfext@@Print
+ \grfext@Print\PrependGraphicsExtensions
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\grfext@Add}
+% \begin{macrocode}
+\def\grfext@Add#1#2{%
+ #1{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grfext@@Add}
+% \begin{macrocode}
+\def\grfext@@Add#1#2#3{%
+ \RemoveGraphicsExtensions{#1}%
+ \ifx\Gin@extensions\@empty
+ \def\Gin@extensions{#1}%
+ \else
+ \edef\Gin@extensions{#2#1#3}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Check}
+%
+% \begin{macro}{\grfext@Check}
+% \begin{macrocode}
+\def\grfext@Check#1{%
+ \let\grfext@tmp\@empty
+ \@for\grfext@ext:=#1\do{%
+ \@ifundefined{Gin@rule@\grfext@ext}{%
+ }{%
+ \ifx\grfext@tmp\@empty
+ \let\grfext@tmp\grfext@ext
+ \else
+ \edef\grfext@tmp{\grfext@tmp,\grfext@ext}%
+ \fi
+ }%
+ }%
+ \ifx\grfext@tmp\@empty
+ \def\grfext@next##1##2{}%
+ \else
+ \edef\grfext@next{%
+ \noexpand\grfext@@Add{\grfext@tmp}%
+ }%
+ \fi
+ \grfext@next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Remove}
+%
+% \begin{macro}{\RemoveGraphicsExtensions}
+% \begin{macrocode}
+\newcommand*{\RemoveGraphicsExtensions}[1]{%
+ \@ifundefined{Gin@extensions}{%
+ \def\Gin@extensions{}%
+ }{%
+ \edef\grfext@tmp{\zap@space#1 \@empty}%
+ \@for\grfext@ext:=\grfext@tmp\do{%
+ \def\grfext@next{%
+ \let\grfext@tmp\Gin@extensions
+ \@expandtwoargs
+ \@removeelement\grfext@ext\Gin@extensions\Gin@extensions
+ \ifx\grfext@tmp\Gin@extensions
+ \let\grfext@next\relax
+ \fi
+ \grfext@next
+ }%
+ \grfext@next
+ }%
+ }%
+ \grfext@Print\RemoveGraphicsExtensions
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Print}
+%
+% \begin{macrocode}
+\RequirePackage{infwarerr}[2007/09/09]
+% \end{macrocode}
+%
+% \begin{macro}{\PrintGraphicsExtensions}
+% \begin{macrocode}
+\def\PrintGraphicsExtensions{%
+ \grfext@Print\PrintGraphicsExtensions
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grfext@Print}
+% \begin{macrocode}
+\def\grfext@Print#1{%
+ \@PackageInfo{grfext}{%
+ Graphics extension search list:\MessageBreak
+ \@ifundefined{Gin@extensions}{%
+ <unavailable>%
+ }{%
+ [\Gin@extensions]%
+ }\MessageBreak
+ \string#1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grfext@@Print}
+% \begin{macrocode}
+\let\grfext@@Print\grfext@Print
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Defining options for package \xpackage{graphicx}}
+%
+% \begin{macrocode}
+\RequirePackage{kvdefinekeys}[2010/03/01]
+\kv@define@key{Gin}{AppendGraphicsExtensions}{%
+ \AppendGraphicsExtensions{#1}%
+}
+\kv@define@key{Gin}{AppendGraphicsExtensions*}{%
+ \AppendGraphicsExtensions*{#1}%
+}
+\kv@define@key{Gin}{PrependGraphicsExtensions}{%
+ \PrependGraphicsExtensions{#1}%
+}
+\kv@define@key{Gin}{PrependGraphicsExtensions*}{%
+ \PrependGraphicsExtensions*{#1}%
+}
+\kv@define@key{Gin}{RemoveGraphicsExtensions}{%
+ \RemoveGraphicsExtensions{#1}%
+}
+\kv@define@key{Gin}{PrintGraphicsExtensions}[]{%
+ \PrintGraphicsExtensions
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\grfext@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% Load \xfile{miniltx} for standard catcode test.
+% \begin{macrocode}
+%<*test1>
+\input miniltx.tex\relax
+\resetatcatcode
+%</test1>
+% \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 grfext.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \subsubsection{Preamble}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{article}
+\usepackage[pdftex]{graphics}
+\usepackage{grfext}[2016/05/16]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\makeatletter
+% \end{macrocode}
+%
+% \subsubsection{Detection of unwanted space}
+%
+% \begin{macrocode}
+\let\orig@qstest\qstest
+\let\orig@endqstest\endqstest
+\def\qstest#1#2{%
+ \orig@qstest{#1}{#2}%
+ \setbox0\hbox\bgroup\begingroup\ignorespaces
+}
+\def\endqstest{%
+ \endgroup\egroup
+ \Expect*{\the\wd0}{0.0pt}%
+ \orig@endqstest
+}
+% \end{macrocode}
+%
+% \subsubsection{Generic test macros}
+%
+% \begin{macrocode}
+\def\Test{\@ifnextchar\bgroup\TestInitList\TestInitCmd}%
+\def\TestInitList#1{%
+ \def\Gin@extensions{#1}%
+ \@Test
+}
+\def\TestInitCmd#1{%
+ \let\Gin@extensions#1\relax
+ \@Test
+}
+\def\@Test#1#2{%
+ \TestCmd{#1}%
+ \expandafter\Expect\expandafter*{\Gin@extensions}{#2}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Test for \cs{AppendGraphicsExtensions}}
+%
+% \begin{macrocode}
+\begin{qstest}{AppendGraphicsExtensions}{AppendGraphicsExtensions}
+ \let\TestCmd\AppendGraphicsExtensions
+ \Test\@undefined{.test}{.test}%
+ \Test\relax{.test}{.test}%
+ \Test{}{.test}{.test}%
+ \Test{.foo}{.test}{.foo,.test}%
+ \Test{.foo,.bar}{.test}{.foo,.bar,.test}%
+ \Test{.test}{.test}{.test}%
+ \Test{.foo,.test}{.test}{.foo,.test}%
+ \Test{.test,.foo}{.test}{.foo,.test}%
+ \Test{.foo,.test,.bar}{.test}{.foo,.bar,.test}%
+ \Test{.foo}{.test,.bar}{.foo,.test,.bar}%
+ \Test{.foo}{.test,.foo}{.test,.foo}%
+ \Test{.foo}{ .test ,.bar , .x, .y }{.foo,.test,.bar,.x,.y}%
+ \def\TestCmd{\AppendGraphicsExtensions*}%
+ \Test\@undefined{.test}{}%
+ \Test\relax{.test}{}%
+ \Test{}{.test}{}%
+ \Test{.test}{.test}{.test}%
+ \Test{.foo}{.test}{.foo}%
+ \Test{.foo,.bar}{.test}{.foo,.bar}%
+ \Test{.test}{.test}{.test}%
+ \Test{.foo,.test}{.test}{.foo,.test}%
+ \Test{.test,.foo}{.test}{.test,.foo}%
+ \Test{.foo,.test,.bar}{.test}{.foo,.test,.bar}%
+ \Test{.foo}{.test,.bar}{.foo}%
+ \Test{.foo}{.test,.foo}{.foo}%
+ \DeclareGraphicsRule{.test}{test}{.test}{}%
+ \Test\@undefined{.test}{.test}%
+ \Test\relax{.test}{.test}%
+ \Test{}{.test}{.test}%
+ \Test{.foo}{.test}{.foo,.test}%
+ \Test{.foo,.bar}{.test}{.foo,.bar,.test}%
+ \Test{.test}{.test}{.test}%
+ \Test{.foo,.test}{.test}{.foo,.test}%
+ \Test{.test,.foo}{.test}{.foo,.test}%
+ \Test{.foo,.test,.bar}{.test}{.foo,.bar,.test}%
+ \Test{.foo}{.test,.bar}{.foo,.test}%
+ \Test{.foo}{.test,.foo}{.foo,.test}%
+ \DeclareGraphicsRule{.bar}{bar}{.bar}{}%
+ \Test{.foo}{.test,.bar}{.foo,.test,.bar}%
+ \Test{.bar}{.test,.bar}{.test,.bar}%
+ \Test{.bar}{.bar,.test}{.bar,.test}%
+\end{qstest}
+% \end{macrocode}
+%
+% \subsubsection{Test for \cs{PrependGraphicsExtensions}}
+%
+% \begin{macrocode}
+\begin{qstest}{PrependGraphicsExtensions}{PrependGraphicsExtensions}
+ \let\TestCmd\PrependGraphicsExtensions
+ \Test\@undefined{.test}{.test}%
+ \Test\relax{.test}{.test}%
+ \Test{}{.test}{.test}%
+ \Test{.foo}{.test}{.test,.foo}%
+ \Test{.foo,.bar}{.test}{.test,.foo,.bar}%
+ \Test{.test}{.test}{.test}%
+ \Test{.foo,.test}{.test}{.test,.foo}%
+ \Test{.test,.foo}{.test}{.test,.foo}%
+ \Test{.foo,.test,.bar}{.test}{.test,.foo,.bar}%
+ \Test{.foo}{.test,.bar}{.test,.bar,.foo}%
+ \Test{.foo}{.test,.foo}{.test,.foo}%
+ \Test{.foo}{ .test ,.bar , .x, .y }{.test,.bar,.x,.y,.foo}%
+ \def\TestCmd{\PrependGraphicsExtensions*}%
+ \Test\@undefined{.test}{}%
+ \Test\relax{.test}{}%
+ \Test{}{.test}{}%
+ \Test{.test}{.test}{.test}%
+ \Test{.foo}{.test}{.foo}%
+ \Test{.foo,.bar}{.test}{.foo,.bar}%
+ \Test{.test}{.test}{.test}%
+ \Test{.foo,.test}{.test}{.foo,.test}%
+ \Test{.test,.foo}{.test}{.test,.foo}%
+ \Test{.foo,.test,.bar}{.test}{.foo,.test,.bar}%
+ \DeclareGraphicsRule{.test}{test}{.test}{}%
+ \Test\@undefined{.test}{.test}%
+ \Test\relax{.test}{.test}%
+ \Test{}{.test}{.test}%
+ \Test{.foo}{.test}{.test,.foo}%
+ \Test{.foo,.bar}{.test}{.test,.foo,.bar}%
+ \Test{.test}{.test}{.test}%
+ \Test{.foo,.test}{.test}{.test,.foo}%
+ \Test{.test,.foo}{.test}{.test,.foo}%
+ \Test{.foo,.test,.bar}{.test}{.test,.foo,.bar}%
+ \Test{.foo}{.test,.bar}{.test,.foo}%
+ \Test{.foo}{.test,.foo}{.test,.foo}%
+ \DeclareGraphicsRule{.bar}{bar}{.bar}{}%
+ \Test{.foo}{.test,.bar}{.test,.bar,.foo}%
+ \Test{.bar}{.test,.bar}{.test,.bar}%
+ \Test{.bar}{.bar,.test}{.bar,.test}%
+\end{qstest}
+% \end{macrocode}
+%
+% \subsubsection{Test for \cs{RemoveGraphicsExtensions}}
+%
+% \begin{macrocode}
+\begin{qstest}{RemoveGraphicsExtensions}{RemoveGraphicsExtensions}
+ \let\TestCmd\RemoveGraphicsExtensions
+ \Test\@undefined{.test}{}%
+ \Test\relax{.test}{}%
+ \Test{}{.test}{}%
+ \Test{.foo}{.test}{.foo}%
+ \Test{.foo,.bar}{.test}{.foo,.bar}%
+ \Test{.test}{.test}{}%
+ \Test{.foo,.test}{.test}{.foo}%
+ \Test{.test,.foo}{.test}{.foo}%
+ \Test{.foo,.test,.bar}{.test}{.foo,.bar}%
+ \Test{.test,.test}{.test}{}%
+ \Test{.foo,.test,.bar,.test,.test,.bar}{.test}{.foo,.bar,.bar}%
+ \Test{.foo,.test,.bar,.foo,.test,.bar}{.test,.bar}{.foo,.foo}%
+ \Test{.foo,.test,.bar,.foo,.test,.bar}{ .test , .bar }{.foo,.foo}%
+\end{qstest}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begin{document}
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/grfext}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/grfext.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/grfext.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[\CTAN{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 grfext.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@{}}
+% grfext.sty & tex/latex/oberdiek/grfext.sty\\
+% grfext.pdf & doc/latex/oberdiek/grfext.pdf\\
+% test/grfext-test1.tex & doc/latex/oberdiek/test/grfext-test1.tex\\
+% test/grfext-test2.tex & doc/latex/oberdiek/test/grfext-test2.tex\\
+% grfext.dtx & source/latex/oberdiek/grfext.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk grfext.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{grfext.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 grfext.dtx
+%makeindex -s gind.ist grfext.idx
+%pdflatex grfext.dtx
+%makeindex -s gind.ist grfext.idx
+%pdflatex grfext.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{grfext.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='grfext'>
+ <name>grfext</name>
+ <caption>Manipulate the graphics package's list of extensions.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.2'/>
+ <description>
+ This package provides macros for adding to, and reordering the list of
+ graphics file extensions recognised by package
+ <xref refid='graphics'>graphics</xref>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/grfext.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/grfext.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{graphics}
+% David Carlisle, Sebastian Rahtz: \textit{The \xpackage{graphics} package};
+% 2006/02/20 v1.0o;
+% \CTAN{macros/latex/required/graphics/graphics.dtx}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/09/30 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2010/08/19 v1.1}
+% \item
+% User macros are also made available as keyval options for
+% package \xpackage{graphicx}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.2}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/grfext.pdf b/macros/latex/contrib/oberdiek/grfext.pdf
new file mode 100644
index 0000000000..206ebfdd53
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/grfext.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/grffile.dtx b/macros/latex/contrib/oberdiek/grffile.dtx
new file mode 100644
index 0000000000..acdc69bdeb
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/grffile.dtx
@@ -0,0 +1,1412 @@
+% \iffalse meta-comment
+%
+% File: grffile.dtx
+% Version: 2017/06/30 v1.18
+% Info: Extended file name support for graphics
+%
+% Copyright (C) 2006-2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file grffile.dtx
+% and the derived files
+% grffile.sty, grffile.pdf, grffile.ins, grffile.drv,
+% grffile-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/grffile.dtx
+% CTAN:macros/latex/contrib/oberdiek/grffile.pdf
+%
+% Unpacking:
+% (a) If grffile.ins is present:
+% tex grffile.ins
+% (b) Without grffile.ins:
+% tex grffile.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{grffile.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If grffile.drv is present:
+% latex grffile.drv
+% (b) Without grffile.drv:
+% latex grffile.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 grffile.dtx
+% makeindex -s gind.ist grffile.idx
+% pdflatex grffile.dtx
+% makeindex -s gind.ist grffile.idx
+% pdflatex grffile.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/grffile.sty
+% TDS:doc/latex/oberdiek/grffile.pdf
+% TDS:doc/latex/oberdiek/test/grffile-test1.tex
+% TDS:source/latex/oberdiek/grffile.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: grffile 2017/06/30 v1.18 Extended file name support for graphics (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: grffile
+Version: 2017/06/30 v1.18
+
+Copyright (C) 2006-2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file grffile.dtx
+and the derived files
+ grffile.sty, grffile.pdf, grffile.ins, grffile.drv,
+ grffile-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{grffile.ins}{\from{grffile.dtx}{install}}%
+ \file{grffile.drv}{\from{grffile.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{grffile.sty}{\from{grffile.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{grffile-test1.tex}{\from{grffile.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{grffile.xml}{\from{grffile.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{* grffile.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `grffile.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{grffile.drv}%
+ [2017/06/30 v1.18 Extended file name support for graphics (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{grffile.dtx}%
+\end{document}
+%</driver>
+% \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{grffile.drv}
+%
+% \title{The \xpackage{grffile} package}
+% \date{2017/06/30 v1.18}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package extends the file name processing of package \xpackage{graphics}
+% to support a larger range of file names. For example, the file name
+% may contain several dots. Or in case of \pdfTeX\ in PDF mode the file name may
+% contain spaces.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \subsection{Option \xoption{multidot}}
+%
+% The file name parsing of package \xpackage{graphics} is changed, in order
+% to detect known extensions. This allows both the use of dots inside the
+% base file name and extensions with several dots.
+%
+% Assume there are two files in the currect directory: \texttt{Hello.World.eps}
+% and \texttt{Hello.World.pdf}. \verb|\includegraphics{Hello.World}| will find
+% \verb|Hello.World.pdf| with driver \xoption{pdftex} or
+% \verb|Hello.World.eps| with driver \xoption{dvips}.
+%
+% \paragraph{Limitations:} Problem could occur on systems, which don't
+% use the dot as extension delimiter. These systems needs an own
+% \verb|texsys.cfg| containing definitions for \verb|\filename@parse|.
+% The author could not test that, due to a missing example.
+%
+% \subsection{Option \xoption{babel}}
+%
+% This option allows the use of shorthand characters of package
+% \xpackage{babel} inside the graphics file name. Additionally
+% the tilde `\textasciitilde' is supported. The option
+% is turned on as default. (In version v1.1 or below of this package,
+% the features of this option were part of option \xoption{extendedchars}.)
+%
+% Example:
+% \begin{quote}
+%\begin{verbatim}
+%\usepackage[frenchb]{babel}
+%\usepackage{grffile}
+%Image: \includegraphics{C:/path/image}
+%\end{verbatim}
+% \end{quote}
+%
+% \subsection{Option \xoption{extendedchars}}
+%
+% If the input encoding is the same encoding as the encoding that
+% is used for file names and the driver allows non-ascii characters.
+% Without option \xoption{extendedchars} the 8-bit characters
+% are expanded, if they are active characters. For example,
+% see the \LaTeX\ package \xpackage{inputenc}. However a
+% file name is not input for \LaTeX. Therefore this option
+% \xoption{extendedchars} removes the active status and
+% the 8-bit characters are not expandable any more.
+%
+% Example:
+% \begin{quote}
+% |\usepackage[latin1]{inputenc}|\\
+% |\usepackage[extendedchars]{grffile}|\\
+% |\includegraphics{|\texttt{B\"ackerstra\ss e}|}|
+% \end{quote}
+%
+% If the \verb|draft| option of the graphics package is enabled, the
+% file name is printed with the current font encoding for \verb|\ttfamily|.
+% Thus it is possible, that such characters are omitted or the wrong
+% characters are displayed, if the font encoding is not the same as
+% the file name encoding.
+%
+% \subsection{Option \xoption{encoding}}
+%
+% Consider the following scenario. Your file system is using
+% UTF-8 as encoding for file names. But you use \xoption{latin1}
+% as input encoding for your \TeX\ files, because some packages
+% are not ready for multi-byte encodings (\xpackage{listings}, \dots).
+%
+% Then this option \xoption{encoding} loads support for converting
+% encodings by loading package \xpackage{stringenc}.
+% The option is not defined after the preamble, because
+% \LaTeX\ limits package loading to the preamble.
+%
+% File names are converted, if package \xpackage{stringenc} is loaded
+% and the encodings are known, see options \xoption{inputencoding} and
+% \xoption{filenameencoding}.
+%
+% \subsubsection{Option \xoption{inputencoding}}
+%
+% Option \xoption{inputencoding} specifies the encoding
+% of the file name in your \TeX\ input file.
+%
+% Package \xpackage{inputenx} and package \xpackage{inputenc}
+% since version 2006/02/22 v1.1a remember the name of
+% the input encoding that is looked up by this package.
+% Therefore option \xoption{inputencoding} is usually
+% not mandatory.
+%
+% \subsubsection{Option \xoption{filenameencoding}}
+%
+% This is the encoding of the filename of your file
+% system. This option is mandatory, file names
+% are not converted without this option. The option
+% is disabled, if the value is empty.
+%
+% \subsubsection{Example}
+%
+% Back to the scenario where the file system uses UTF-8 and
+% the \LaTeX\ input files are encodind in latin1.
+% \begin{quote}
+%\begin{verbatim}
+%\usepackage[latin1]{inputenc}[2006/02/22]
+% % \usepackage[latin1]{inputenx}
+%\usepackage{graphicx}
+%\usepackage[encoding,filenameencoding=utf8]{grffile}
+%\end{verbatim}
+% \end{quote}
+%
+% For older versions of package \xoption{inputenc} option
+% \xoption{inputencoding} provides the necessary informations.
+% \begin{quote}
+%\begin{verbatim}
+%\usepackage[latin1]{inputenc}
+%\usepackage{graphicx}
+%\usepackage{grffile}
+%\grffilesetup{
+% encoding,
+% inputencoding=latin1,
+% filenameencoding=utf8,
+%}
+%\end{verbatim}
+% \end{quote}
+%
+% \subsection{Option \xoption{space}}
+%
+% This option allows graphics file names that contain spaces
+% if possible.
+%
+% In general it is not possible to use space inside file names,
+% because \TeX\ considers the space character as termination in its
+% syntax for commands that expect a file name.
+%
+% Regarding graphics inclusion with the package \xpackage{graphics}
+% file names are used in two or three contexts:
+% \begin{enumerate}
+% \item The basic \cs{special} statement or primitive command for
+% graphics inclusion. The \cs{special} statements for
+% drivers \xoption{dvips} or \xoption{dvipdfm} do not allow
+% spaces. However \pdfTeX's primitive \cs{pdfximage}
+% uses curly braces to delimit the file name and allows spaces.
+% In case of \hologo{XeTeX} file names can be enclosed in quotes
+% to support spaces (at the cost that quotes no longer work).
+% \item \cs{includegraphics} checks the existence of the file.
+% Also it looks for the right extension if the extension is
+% not given.
+%
+% If \pdfTeX\ 1.30 is given, the file existence test
+% can be rewritten using a new primitive that allows spaces.
+% This works in both modes DVI and PDF.
+%
+% In case of \hologo{XeTeX} the file existence test is rewritten
+% to automatically add quotes.
+% \item Sometimes files are read as \TeX\ input files. For example,
+% \verb|.bb| files or MPS files.
+% \end{enumerate}
+% If \pdfTeX\ 1.30 or greater is used in PDF mode then the
+% graphics file names may contain spaces except for MPS files.
+% Therefore option \xoption{space} is only enabled by default,
+% if the supported \pdfTeX\ in PDF mode is detected or \hologo{XeTeX}
+% is running.
+% You can enable the option manually, if you know, your DVI driver
+% supports spaces in its \cs{special} syntax and if there is no
+% need to read the image file as \TeX\ input file (third context).
+%
+% \subsection{General use}
+%
+% The options can be given at many places:
+%
+% \begin{enumerate}
+% \item As package options:\\
+% \verb|\usepackage[<options>]{grffile}|
+% \item Setup command of package \xpackage{grffile}:\\
+% \verb|\grffilesetup{<options>}|
+% \item The options are also available as options
+% for package \xpackage{graphicx}:\\
+% \verb|\setkeys{Gin}{<options>}|
+% \item If package \xpackage{graphicx} is loaded the options can also be
+% applied for a single image:\\
+% \verb|\includegraphics[<options>]{...}|
+% \end{enumerate}
+%
+% \subsection{Default settings}
+%
+% \begin{quote}
+% \begin{tabular}{@{}lll@{}}
+% \xoption{multidot} & |true|\\
+% \xoption{babel} & |true|\\
+% \xoption{extendedchars} & |false|\\
+% \xoption{space} & |true| & if \pdfTeX\ 1.30 or greater is used in PDF mode\\
+% & |false| & otherwise
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{grffile}%
+ [2017/06/30 v1.18 Extended file name support for graphics (HO)]%
+% \end{macrocode}
+%
+% \subsection{Catcode stuff}
+%
+% \begin{macrocode}
+\edef\grffile@RestoreCatcodes{%
+ \catcode`\noexpand\=\the\catcode`\=\relax
+ \catcode`\noexpand\:\the\catcode`\:\relax
+ \catcode`\noexpand\.\the\catcode`\.\relax
+ \catcode`\noexpand\'\the\catcode`\'\relax
+ \catcode`\noexpand\<\the\catcode`\<\relax
+ \catcode`\noexpand\>\the\catcode`\>\relax
+ \catcode`\noexpand\*\the\catcode`\*\relax
+ \catcode`\noexpand\^\the\catcode`\^\relax
+ \catcode`\noexpand\~\the\catcode`\~\relax
+}
+\@makeother\=
+\@makeother\:
+\@makeother\.
+\@makeother\'
+\@makeother\<
+\@makeother\>
+\@makeother\*
+\catcode`\^=7 %
+\catcode`\~=\active
+% \end{macrocode}
+%
+% \subsection{Options}
+%
+% \begin{macrocode}
+\RequirePackage{ifpdf}[2010/01/28]
+\RequirePackage{ifxetex}[2010/09/12]
+\RequirePackage{kvoptions}[2006/08/17]
+\SetupKeyvalOptions{%
+ family=Gin,%
+ prefix=grffile@%
+}
+\DeclareDefaultOption{\@unknownoptionerror}
+\DeclareBoolOption[true]{multidot}
+\DeclareBoolOption[true]{babel}
+\DeclareBoolOption[false]{extendedchars}
+\DeclareBoolOption{space}
+\DeclareVoidOption{encoding}{%
+ \RequirePackage{stringenc}\relax
+}
+\DeclareStringOption{inputencoding}
+\DeclareStringOption{filenameencoding}
+\DeclareDefaultOption{%
+ \PassOptionsToPackage\CurrentOption{graphics}%
+}
+% \end{macrocode}
+% Default setting for option \xoption{space}.
+% \begin{macrocode}
+\RequirePackage{pdftexcmds}[2007/11/11]
+\ifxetex
+ \grffile@spacetrue
+\else
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdf@filesize\endcsname\relax
+ \grffile@spacefalse
+ \let\grffile@space@disabled\@empty
+ \def\grffile@spacetrue{%
+ \PackageWarning{grffile}{%
+ Option `space' is not available,\MessageBreak
+ because it needs pdfTeX >= 1.30 or XeTeX%
+ }%
+ }%
+ \else
+ \ifpdf
+ \grffile@spacetrue
+ \else
+ \grffile@spacefalse
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessKeyvalOptions*
+\AtBeginDocument{%
+ \DisableKeyvalOption[package=grffile]{Gin}{encoding}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{graphics}
+% \end{macrocode}
+%
+% \begin{macro}{\grffilesetup}
+% \begin{macrocode}
+\newcommand*{\grffilesetup}{%
+ \setkeys{Gin}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\grffile@org@Ginclude@graphics}
+% \begin{macrocode}
+\let\grffile@org@Ginclude@graphics\Ginclude@graphics
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Ginclude@graphics}
+% \begin{macrocode}
+\renewcommand*{\Ginclude@graphics}{%
+ \ifx\grffile@filenameencoding\@empty
+ \else
+ \ifx\grffile@inputencoding\@empty
+ \expandafter\ifx\csname inputencodingname\endcsname\relax
+ \expandafter\ifx\csname
+ CurrentInputEncodingOption\endcsname\relax
+ \else
+ \let\grffile@inputencoding\CurrentInputEncodingOption
+ \fi
+ \else
+ \let\grffile@inputencoding\inputencodingname
+ \fi
+ \fi
+ \ifx\grffile@inputencoding\@empty
+ \else
+ \grffile@extendedcharstrue
+ \fi
+ \fi
+ \ifnum0\ifgrffile@babel 1\fi\ifgrffile@extendedchars 1\fi>\z@
+ \begingroup
+% \end{macrocode}
+% Support of babel's shorthand characters.
+% \begin{macrocode}
+ \ifgrffile@babel
+ \csname @safe@activestrue\endcsname
+% \end{macrocode}
+% Support of active tilde.
+% \begin{macrocode}
+ \edef~{\string~}%
+% \end{macrocode}
+% Support of characters controlled by package \xpackage{inputenc}.
+% \begin{macrocode}
+ \fi
+ \ifgrffile@extendedchars
+ \grffile@inputenc@loop\^^A\^^H%
+ \grffile@inputenc@loop\^^K\^^K%
+ \grffile@inputenc@loop\^^N\^^_%
+ \grffile@inputenc@loop\^^?\^^ff%
+ \fi
+ \expandafter\grffile@extchar@Ginclude@graphics
+ \else
+ \expandafter\grffile@Ginclude@graphics
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@extchar@Ginclude@graphics}
+% \begin{macrocode}
+\def\grffile@extchar@Ginclude@graphics#1{%
+ \toks@{#1}%
+ \edef\grffile@filename{\the\toks@}%
+ \ifx\grffile@inputencoding\@empty
+ \else
+ \ifx\grfile@filenameencoding\@empty
+ \else
+ \ifx\grffile@inputencoding\grffile@filenameencoding
+ \else
+ \expandafter\ifx\csname StringEncodingConvert\endcsname\relax
+ \PackageError{grffile}{%
+ Package `stringenc' is not loaded,\MessageBreak
+ omitting file name conversion%
+ }\@ehc
+ \else
+ \StringEncodingConvert\grffile@temp\grffile@filename
+ \grffile@inputencoding\grffile@filenameencoding
+ \StringEncodingSuccessFailure{%
+ \let\grffile@filename\grffile@temp
+ }{%
+ \PackageError{grffile}{%
+ Filename conversion failed%
+ }\@ehc
+ }%
+ \fi
+ \fi
+ \fi
+ \fi
+% \toks@\expandafter{\grffile@filename}%
+ \edef\x{\endgroup
+% \noexpand\grffile@Ginclude@graphics{\the\toks@}%
+ \noexpand\grffile@Ginclude@graphics{\grffile@filename}%
+ }%
+ \x
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@inputenc@loop}
+% \begin{macrocode}
+\def\grffile@inputenc@loop#1#2{%
+ \count@=`#1\relax
+ \loop
+ \begingroup
+ \uccode`\~=\count@
+ \uppercase{%
+ \endgroup
+ \edef~{\string~}%
+ }%
+ \ifnum\count@<`#2\relax
+ \advance\count@\@ne
+ \repeat
+}
+% \end{macrocode}
+% \end{macro}
+% Support for option \xoption{space}
+% \begin{macro}{\grffile@space@getbase}
+% \begin{macrocode}
+\def\grffile@space@getbase#1{%
+ \edef\grffile@tempa{%
+ \def\noexpand\@tempa####1#1\noexpand\@nil{%
+ \def\noexpand\Gin@base{####1}%
+ }%
+ }%
+ \grffile@IfFileExists{\filename@area\filename@base#1}{%
+ \grffile@tempa
+ \expandafter\@tempa\grffile@file@found\@nil
+ \edef\Gin@ext{#1}%
+ }{%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@filesize\endcsname\relax
+ \ifxetex
+% \end{macrocode}
+% \begin{macro}{\grffile@XeTeX@IfFileExists}
+% \begin{macrocode}
+ \long\def\grffile@XeTeX@IfFileExists#1{%
+ \openin\@inputcheck"#1" %
+ \ifeof\@inputcheck
+ \closein\@inputcheck
+ \expandafter\@secondoftwo
+ \else
+ \closein\@inputcheck
+ \expandafter\@firstoftwo
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@IfFileExists}
+% \begin{macrocode}
+ \long\def\grffile@IfFileExists#1{%
+ \grffile@XeTeX@IfFileExists{#1}{%
+ \edef\grffile@file@found{#1}%
+ \@firstoftwo
+ }{%
+ \let\reserved@a\@secondoftwo
+ \ifx\input@path\@undefined
+ \else
+ \expandafter\@tfor\expandafter\reserved@b\expandafter
+ :\expandafter=\input@path\do{%
+ \grffile@XeTeX@IfFileExists{\reserved@b#1}{%
+ \edef\grffile@file@found{\reserved@b#1}%
+ \let\reserved@a\@firstoftwo
+ \iftrue\@break@tfor\fi
+ }{}%
+ }%
+ \fi
+ \reserved@a
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@org@Gread@QTm}
+% Patch \cs{Gread@QTm} of \xfile{xetex.def}.
+% \begin{macrocode}
+ \def\grffile@org@Gread@QTm#1{%
+ \IfFileExists{\Gin@base.bb}{%
+ \Gread@eps{\Gin@base.bb}%
+ }{%
+ \G@measure@QTm{\Gin@base}{\Gin@ext}%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \ifx\Gread@QTm\grffile@org@Gread@QTm
+% \end{macrocode}
+% \begin{macro}{\Gread@QTm}
+% \begin{macrocode}
+ \def\Gread@QTm#1{%
+ \grffile@IfFileExists{\Gin@base.bb}{%
+ \Gread@eps{\Gin@base.bb}%
+ }{%
+ \G@measure@QTm{\Gin@base}{\Gin@ext}%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \PackageInfo{grffile}{\string\Gread@QTm\space patched}%
+ \else
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname Gread@QTm\endcsname\relax
+ \@ifpackagelater{graphics}{2017/06/01}
+ {}
+ {%
+ \PackageWarning{grffile}{%
+ \string\Gread@QTm\space of xetex.def not found%
+ }%
+ }%
+ \else
+% \end{macrocode}
+% \begin{macro}{\grffile@org@Gread@QTm}
+% \begin{macrocode}
+ \let\grffile@org@Gread@QTm\Gread@QTm
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Gread@QTm}
+% \begin{macrocode}
+ \def\Gread@QTm#1{%
+ \let\grffile@saved@IfFileExists\IfFileExists
+ \let\IfFileExists\grffile@IfFileExists
+ \grffile@org@GreadQTm{#1}%
+ \let\IfFileExists\grffile@saved@IfFileExists
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \fi
+ \fi
+% \end{macrocode}
+% \begin{macro}{\grffile@org@Gread@eps}
+% \begin{macrocode}
+ \let\grffile@org@Gread@eps\Gread@eps
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \def\grffile@temp#1\immediate\openin#2 #3\grffile@nil#4\grffile@NIL{%
+ \begingroup
+ \toks@{#2}%
+ \edef\grffile@temp{\the\toks@}%
+ \def\grffile@test{\@inputcheck####1}%
+ \ifx\grffile@temp\grffile@test
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \toks@{%
+ #1%
+ \immediate\openin\@inputcheck"##1"\relax
+ #3%
+ }%
+ \expandafter\endgroup
+ \expandafter\def\expandafter\Gread@eps
+ \expandafter##\expandafter1\expandafter{%
+ \the\toks@
+ }%
+ \PackageInfo{grffile}{%
+ \string\Gread@eps\space patched%
+ }%
+ }{%
+ \@ifpackagelater{graphics}{2017/06/01}
+ {}
+ {%
+ \PackageWarning{grffile}{%
+ Unsupported \string\Gread@eps\space not patched%
+ }%
+ }%
+ \endgroup
+ }%
+ }%
+ \expandafter\grffile@temp\Gread@eps{#1}\grffile@nil
+ \immediate\openin{} \grffile@nil\grffile@NIL
+% \end{macrocode}
+% \begin{macrocode}
+ \else
+ \begingroup
+ \let\on@line\@empty
+ \PackageInfo{grffile}{%
+ \string\grffile@IfFileExists\space without space support,%
+ \MessageBreak
+ because pdfTeX's \string\pdffilesize\space is not available%
+ \MessageBreak
+ or XeTeX is not running%
+ }%
+ \endgroup
+% \end{macrocode}
+% \begin{macro}{\grffile@IfFileExists}
+% \begin{macrocode}
+ \long\def\grffile@IfFileExists#1{%
+ \IfFileExists{#1}{%
+ \let\grffile@IFE@next\@firstoftwo
+ }{%
+ \let\grffile@file@found\@filef@und
+ \let\grffile@IFE@next\@secondoftwo
+ }%
+ \grffile@IFE@next
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \fi
+\else
+% \end{macrocode}
+% \begin{macro}{\grffile@IfFileExists}
+% \begin{macrocode}
+ \long\def\grffile@IfFileExists#1{%
+ \expandafter\expandafter\expandafter
+ \ifx\expandafter\expandafter\expandafter\\\pdf@filesize{#1}\\%
+ \let\reserved@a\@secondoftwo
+ \ifx\input@path\@undefined
+ \else
+ \expandafter\@tfor\expandafter\reserved@b\expandafter
+ :\expandafter=\input@path\do{%
+ \expandafter\expandafter\expandafter
+ \ifx\expandafter\expandafter\expandafter
+ \\\pdf@filesize{\reserved@b#1}\\%
+ \else
+ \edef\grffile@file@found{\reserved@b#1}%
+ \let\reserved@a\@firstoftwo
+ \@break@tfor
+ \fi
+ }%
+ \fi
+ \expandafter\reserved@a
+ \else
+ \edef\grffile@file@found{#1}%
+ \expandafter\@firstoftwo
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+% \begin{macro}{\grffile@Ginclude@graphics}
+% \begin{macrocode}
+\def\grffile@Ginclude@graphics#1{%
+ \begingroup
+ \ifgrffile@space
+ \let\Gin@getbase\grffile@space@getbase
+ \fi
+ \ifgrffile@multidot
+ \let\filename@base\@empty
+ \let\filename@simple\grffile@filename@simple
+ \fi
+ \grffile@org@Ginclude@graphics{#1}%
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@filename@simple}
+% \begin{macrocode}
+\def\grffile@filename@simple#1.#2\\{%
+ \ifx\\#2\\%
+ \def\filename@base{#1}%
+ \let\filename@ext\relax
+ \else
+ \def\filename@base{}%
+ \grffile@analyze@ext{#1}.{#2}\\%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@analyze@ext}
+% \begin{macrocode}
+\def\grffile@analyze@ext#1.#2\\{%
+ \let\grffile@next\relax
+ \ifx\\#2\\%
+ \edef\filename@base{\filename@base#1}%
+ \let\filename@ext\relax
+ \def\grffile@next{\grffile@try@extlist}%
+ \else
+ \edef\filename@base{\filename@base #1}%
+ \edef\filename@ext{\filename@dot#2\\}%
+ \expandafter\ifx\csname Gin@rule@.\filename@ext\endcsname\relax
+ \edef\filename@base{\filename@base.}%
+ \def\grffile@next{\grffile@analyze@ext#2\\}%
+ \else
+ \grffile@IfFileExists{\filename@area\filename@base.\filename@ext}{%
+ % success
+ }{%
+ \edef\filename@base{\filename@base.\filename@ext}%
+ \let\filename@ext\relax
+ \def\grffile@next{\grffile@try@extlist}%
+ }%
+ \fi
+ \fi
+ \grffile@next
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@try@extlist}
+% \begin{macrocode}
+\def\grffile@try@extlist{%
+ \@for\grffile@temp:=\Gin@extensions\do{%
+ \grffile@IfFileExists{\filename@area\filename@base\grffile@temp}{%
+ \ifx\filename@ext\relax
+ \edef\filename@ext{\expandafter\@gobble\grffile@temp\@empty}%
+ \fi
+ }{}%
+ }%
+ \ifx\filename@ext\relax
+ \expandafter\let\expandafter\filename@base\expandafter\@empty
+ \expandafter\grffile@use@last@ext\filename@base.\\%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@use@last@ext}
+% \begin{macrocode}
+\def\grffile@use@last@ext#1.#2\\{%
+ \ifx\\#2\\%
+ \edef\filename@base{\expandafter\filename@dot\filename@base\\}%
+ \def\filename@ext{#1}%
+ \expandafter\@gobble
+ \else
+ \edef\filename@base{\filename@base#1.}%
+ \expandafter\@firstofone
+ \fi
+ {%
+ \grffile@use@last@ext#2\\%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Print current option setting
+% \begin{macro}{\grffile@option@status}
+% \begin{macrocode}
+\def\grffile@option@status#1{%
+ \begingroup
+ \let\on@line\@empty
+ \PackageInfo{grffile}{%
+ Option `#1' is %
+ \expandafter\ifx\csname ifgrffile@#1\expandafter\endcsname
+ \csname iftrue\endcsname
+ set to `true'%
+ \else
+ \expandafter\ifx\csname grffile@#1@disabled\endcsname\@empty
+ not available%
+ \else
+ set to `false'%
+ \fi
+ \fi
+ }%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\grffile@option@status{multidot}
+\grffile@option@status{extendedchars}
+\grffile@option@status{space}
+% \end{macrocode}
+%
+% \subsection{Fix \cs{Gin@ii} of package \xpackage{graphicx}}
+%
+% If the image file name contains the hash character
+% macro \cs{Gin@ii} of package \xpackage{graphicx} breaks.
+% \begin{macro}{\grffile@Gin@ii@graphicx}
+% \begin{macrocode}
+\def\grffile@Gin@ii@graphicx[#1]#2{%
+ \def\@tempa{[}%
+ \def\@tempb{#2}%
+ \ifx\@tempa\@tempb
+ \def\@tempa{\Gin@iii[#1][}% hash-ok
+ \expandafter\@tempa
+ \else
+ \begingroup
+ \@tempswafalse
+ \toks@{\Ginclude@graphics{#2}}%
+ \setkeys{Gin}{#1}%
+ \Gin@esetsize
+ \the\toks@
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@Gin@ii@fixed}
+% \begin{macrocode}
+\def\grffile@Gin@ii@fixed[#1]#2{%
+ \def\@tempa{[}%
+ \begingroup
+ \toks@={#2}%
+ \edef\@tempb{\the\toks@}%
+ \expandafter\endgroup
+ \ifx\@tempa\@tempb
+ \def\@tempa{\Gin@iii[#1][}% hash-ok
+ \expandafter\@tempa
+ \else
+ \begingroup
+ \@tempswafalse
+ \toks@{\Ginclude@graphics{#2}}%
+ \setkeys{Gin}{#1}%
+ \Gin@esetsize
+ \the\toks@
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\grffile@Fix@Gin@ii}
+% \begin{macrocode}
+\def\grffile@Fix@Gin@ii{%
+ \let\Gin@ii\grffile@Gin@ii@fixed
+ \begingroup
+ \escapechar=92 %
+ \PackageInfo{grffile}{\string\Gin@ii\space of package `graphicx' fixed}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\ifx\Gin@ii\grffile@Gin@ii@graphicx
+ \grffile@Fix@Gin@ii
+\else
+ \AtBeginDocument{\grffile@Fix@Gin@ii}%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\grffile@RestoreCatcodes
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Multidot with default rule}
+%
+% \begin{macrocode}
+%<*test1>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{filecontents}
+% file grffile-test.mp:
+% beginfig(1);
+% draw fullcircle scaled 2cm withpen pencircle scaled 2mm;
+% endfig;
+% end
+\begin{filecontents*}{grffile-test.1}
+%!PS
+%%BoundingBox: -32 -32 32 32
+%%Creator: MetaPost
+%%CreationDate: 2004.06.16:1257
+%%Pages: 1
+%%EndProlog
+%%Page: 1 1
+ 0 5.66928 dtransform truncate idtransform setlinewidth pop [] 0 setdash
+ 1 setlinejoin 10 setmiterlimit
+newpath 28.34645 0 moveto
+28.34645 7.51828 25.35938 14.72774 20.04356 20.04356 curveto
+14.72774 25.35938 7.51828 28.34645 0 28.34645 curveto
+-7.51828 28.34645 -14.72774 25.35938 -20.04356 20.04356 curveto
+-25.35938 14.72774 -28.34645 7.51828 -28.34645 0 curveto
+-28.34645 -7.51828 -25.35938 -14.72774 -20.04356 -20.04356 curveto
+-14.72774 -25.35938 -7.51828 -28.34645 0 -28.34645 curveto
+7.51828 -28.34645 14.72774 -25.35938 20.04356 -20.04356 curveto
+25.35938 -14.72774 28.34645 -7.51828 28.34645 0 curveto closepath stroke
+showpage
+%%EOF
+\end{filecontents*}
+\usepackage{graphicx}
+\usepackage[multidot]{grffile}[2008/10/13]
+\DeclareGraphicsRule{*}{mps}{*}{} % for pdflatex
+\begin{document}
+\includegraphics{grffile-test.1}
+\end{document}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/grffile}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/grffile.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/grffile.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[\CTAN{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 grffile.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@{}}
+% grffile.sty & tex/latex/oberdiek/grffile.sty\\
+% grffile.pdf & doc/latex/oberdiek/grffile.pdf\\
+% test/grffile-test1.tex & doc/latex/oberdiek/test/grffile-test1.tex\\
+% grffile.dtx & source/latex/oberdiek/grffile.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk grffile.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{grffile.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 grffile.dtx
+%makeindex -s gind.ist grffile.idx
+%pdflatex grffile.dtx
+%makeindex -s gind.ist grffile.idx
+%pdflatex grffile.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{grffile.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='grffile'>
+ <name>grffile</name>
+ <caption>Extended file name support for graphics.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006-2012'/>
+ <license type='lppl1.3'/>
+ <version number='1.18'/>
+ <description>
+ The package extends the file name processing of package
+ <xref refid='graphics'>graphics</xref> to support a larger range
+ of file names. For example, the file name may contain several dots.
+
+ Or in case of <xref refid='pdftex'>pdfTeX</xref> in PDF mode the
+ file name may contain spaces.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/grffile.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/grffile.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{graphics}
+% David Carlisle, Sebastian Rahtz: \textit{The \xpackage{graphics} package};
+% 2006/02/20 v1.0o;
+% \CTAN{macros/latex/required/graphics/graphics.dtx}.
+%
+% \bibitem{graphicx}
+% Sebastian Rahtz, Heiko Oberdiek:
+% \textit{The \xpackage{graphicx} package};
+% 1999/02/16 v1.0f;
+% \CTAN{macros/latex/required/graphics/graphicx.dtx}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2004/07/18 v0.5}
+% \item
+% First version, published in newsgroup \xnewsgroup{de.comp.text.tex}:\\
+% \URL{``\link{Re: Dateinamenproblem}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/b85984095d1a3c95}
+% \end{Version}
+% \begin{Version}{2006/08/15 v1.0}
+% \item
+% File existence check by new primitives of pdfTeX 1.30.
+% \item
+% Implementation partly rewritten.
+% \item
+% New DTX framework.
+% \end{Version}
+% \begin{Version}{2006/08/17 v1.1}
+% \item
+% Adaptation to version 2.3 of package \xpackage{kvoptions}.
+% \end{Version}
+% \begin{Version}{2006/11/30 v1.2}
+% \item
+% New option \xoption{babel}. Before this feature was part
+% of option \xoption{extendedchars}.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.3}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/06/13 v1.4}
+% \item
+% Encoding support added with options \xoption{encoding},
+% \xoption{inputencoding}, and \xoption{filenameencoding}.
+% \end{Version}
+% \begin{Version}{2007/08/16 v1.5}
+% \item
+% Bug fix in encoding support.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.6}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2007/11/24 v1.7}
+% \item
+% Bug fix of broken previous version.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.8}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2008/10/13 v1.9}
+% \item
+% Fix for option `multidot' with default rule.
+% \end{Version}
+% \begin{Version}{2009/09/25 v1.10}
+% \item
+% Rewrite of `multidot' algorithm to fix a problem
+% (`multidot' with \cs{graphicspath}).
+% \end{Version}
+% \begin{Version}{2010/01/28 v1.11}
+% \item
+% Undefined \cs{pdf@filesize} fixed.
+% \end{Version}
+% \begin{Version}{2010/08/26 v1.12}
+% \item
+% Macro \cs{Gin@ii} of package \xpackage{graphicx} fixed
+% for the case that the file name contains a hash.
+% \end{Version}
+% \begin{Version}{2010/12/09 v1.13}
+% \item
+% Option \xoption{space} also supports \hologo{XeTeX}.
+% \end{Version}
+% \begin{Version}{2011/10/04 v1.14}
+% \item
+% Fix for option \xoption{space} support of \hologo{XeTeX}
+% for EPS files (\cs{Gread@eps}). (Bug reported by Peter Davis.)
+% \end{Version}
+% \begin{Version}{2011/10/17 v1.15}
+% \item
+% Bug fix for option \xoption{space} support of \hologo{XeTeX}.
+% Wrong usage of \cs{@break@tfor} fixed.
+% (Bug reported by Martin Schr\"oder.)
+% \end{Version}
+% \begin{Version}{2012/04/05 v1.16}
+% \item
+% Some fix for option \xoption{extendedchars}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.17}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2017/06/30 v1.18}
+% \item
+% Update to follow \xpackage{graphics} changes.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/grffile.pdf b/macros/latex/contrib/oberdiek/grffile.pdf
new file mode 100644
index 0000000000..e2b71da6e6
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/grffile.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hobsub.dtx b/macros/latex/contrib/oberdiek/hobsub.dtx
new file mode 100644
index 0000000000..dd01a4126e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hobsub.dtx
@@ -0,0 +1,1490 @@
+% \iffalse meta-comment
+%
+% File: hobsub.dtx
+% Version: 2016/05/16 v1.14
+% Info: Construct package bundles
+%
+% Copyright (C) 2011, 2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 hobsub.dtx
+% and the derived files
+% hobsub.sty, hobsub.pdf, hobsub.ins, hobsub.drv, hobsub-generic.sty,
+% hobsub-hyperref.sty, hobsub-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hobsub.dtx
+% CTAN:macros/latex/contrib/oberdiek/hobsub.pdf
+%
+% Unpacking:
+% (a) If hobsub.ins is present:
+% tex hobsub.ins
+% (b) Without hobsub.ins:
+% tex hobsub.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hobsub.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hobsub.drv is present:
+% latex hobsub.drv
+% (b) Without hobsub.drv:
+% latex hobsub.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 hobsub.dtx
+% makeindex -s gind.ist hobsub.idx
+% pdflatex hobsub.dtx
+% makeindex -s gind.ist hobsub.idx
+% pdflatex hobsub.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/hobsub.sty
+% TDS:tex/generic/oberdiek/hobsub-generic.sty
+% TDS:tex/generic/oberdiek/hobsub-hyperref.sty
+% TDS:doc/latex/oberdiek/hobsub.pdf
+% TDS:doc/latex/oberdiek/test/hobsub-test1.tex
+% TDS:source/latex/oberdiek/hobsub.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hobsub 2016/05/16 v1.14 Construct package bundles (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hobsub
+Version: 2016/05/16 v1.14
+
+Copyright (C) 2011, 2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 hobsub.dtx
+and the derived files
+ hobsub.sty, hobsub.pdf, hobsub.ins, hobsub.drv, hobsub-generic.sty,
+ hobsub-hyperref.sty, hobsub-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hobsub.ins}{\from{hobsub.dtx}{install}}%
+ \file{hobsub.drv}{\from{hobsub.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{hobsub.sty}{\from{hobsub.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{hobsub-test1.tex}{\from{hobsub.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hobsub.xml}{\from{hobsub.dtx}{catalogue}}%
+}
+\let\hobsubSavedNormalLine\normalLine
+\def\hobsubGobble#1{}
+\begingroup
+ \lccode`\0=32 % space
+ \lccode`\1=35 % hash
+ \lccode`\2=37 % percent
+ \lccode`\3=92 % backslash
+ \lccode`\4=123 % {
+ \lccode`\5=125 % }
+\lowercase{\endgroup
+ \let\hobsubTokenSpaceOther= 0%
+ \let\hobsubTokenHash= 1%
+ \let\hobsubTokenPercent= 2%
+ \let\hobsubTokenBackslash= 3%
+ \let\hobsubTokenBraceLeft= 4%
+ \let\hobsubTokenBraceRight= 5%
+ \def\hobsubNormalLineWithSpace{%
+ \hobsubSavedNormalLine0%
+ }%
+}
+\def\normalLine{%
+ \futurelet\hobsubToken\hobsubFirst
+}
+\def\hobsubFirst{%
+ \ifx\hobsubToken\hobsubTokenSpaceOther
+ \expandafter\expandafter\expandafter\futurelet
+ \expandafter\expandafter\expandafter\hobsubToken
+ \expandafter\expandafter\expandafter\hobsubNext
+ \expandafter\hobsubGobble
+ \else
+ \expandafter\hobsubSavedNormalLine
+ \fi
+}
+\def\hobsubNext{%
+ \ifx\hobsubToken\hobsubTokenSpaceOther
+ \expandafter\expandafter\expandafter\futurelet
+ \expandafter\expandafter\expandafter\hobsubToken
+ \expandafter\expandafter\expandafter\hobsubNext
+ \expandafter\hobsubGobble
+ \else
+ \let\hobsubWithSpace=Y%
+ \ifx\hobsubToken\hobsubTokenBackslash
+ \let\hobsubWithSpace=N%
+ \else
+ \ifx\hobsubToken\hobsubTokenBraceRight
+ \let\hobsubWithSpace=N%
+ \else
+ \ifx\hobsubToken\hobsubTokenBraceLeft
+ \let\hobsubWithSpace=N%
+ \else
+ \ifx\hobsubToken\hobsubTokenPercent
+ \let\hobsubWithSpace=N%
+ \else
+ \ifx\hobsubToken\hobsubTokenHash
+ \let\hobsubWithSpace=N%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifx\hobsubWithSpace Y%
+ \expandafter\expandafter\expandafter\hobsubNormalLineWithSpace
+ \else
+ \expandafter\expandafter\expandafter\hobsubSavedNormalLine
+ \fi
+ \fi
+}
+\generate{%
+ \usedir{tex/generic/oberdiek}%
+ \file{hobsub-generic.sty}{%
+ \from{hobsub.dtx}{generic,preamble,infwarerr}%
+ \from{infwarerr.dtx}{package}%
+ \from{hobsub.dtx}{post,ltxcmds}%
+ \from{ltxcmds.dtx}{package}%
+ \from{hobsub.dtx}{post,ifluatex}%
+ \from{ifluatex.dtx}{package}%
+ \from{hobsub.dtx}{post,ifvtex}%
+ \from{ifvtex.dtx}{package}%
+ \from{hobsub.dtx}{post,intcalc}%
+ \from{intcalc.dtx}{package}%
+ \from{hobsub.dtx}{post,ifpdf}%
+ \from{ifpdf.dtx}{package}%
+ \from{hobsub.dtx}{post,etexcmds}%
+ \from{etexcmds.dtx}{package}%
+ \from{hobsub.dtx}{post,kvsetkeys}%
+ \from{kvsetkeys.dtx}{package}%
+ \from{hobsub.dtx}{post,kvdefinekeys}%
+ \from{kvdefinekeys.dtx}{package}%
+ \from{hobsub.dtx}{post,luatex-loader}%
+ \from{luatex.dtx}{loader}%
+ \from{hobsub.dtx}{post,pdftexcmds}%
+ \from{pdftexcmds.dtx}{package}%
+ \from{hobsub.dtx}{post,pdfescape}%
+ \from{pdfescape.dtx}{package}%
+ \from{hobsub.dtx}{post,bigintcalc}%
+ \from{bigintcalc.dtx}{package}%
+ \from{hobsub.dtx}{post,bitset}%
+ \from{bitset.dtx}{package}%
+ \from{hobsub.dtx}{post,uniquecounter}%
+ \from{uniquecounter.dtx}{package}%
+ \from{hobsub.dtx}{post,atend}%
+ }%
+}
+\generate{%
+ \usedir{tex/generic/oberdiek}%
+ \file{hobsub-hyperref.sty}{%
+ \from{hobsub.dtx}{hyperref,preamble,,letltxmacro}%
+ \from{letltxmacro.dtx}{package}%
+ \from{hobsub.dtx}{post,hopatch}%
+ \from{hopatch.dtx}{package}%
+ \from{hobsub.dtx}{post,xcolor-patch}%
+ \from{hycolor.dtx}{xcolor}%
+ \from{hobsub.dtx}{post,atveryend}%
+ \from{atveryend.dtx}{package}%
+ \from{hobsub.dtx}{post,atbegshi}%
+ \from{atbegshi.dtx}{package}%
+ \from{hobsub.dtx}{post,refcount}%
+ \from{refcount.dtx}{package}%
+ \from{hobsub.dtx}{post,hycolor}%
+ \from{hycolor.dtx}{package}%
+ \from{hobsub.dtx}{post}%
+ }%
+}
+\let\normalLine\hobsubSavedNormalLine
+
+\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{* hobsub.sty, hobsub-generic.sty, hobsub-hyperref.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hobsub.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hobsub.drv}%
+ [2016/05/16 v1.14 Construct package bundles (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{array}
+\usepackage{caption}
+\renewcommand*{\bottomfraction}{.5}
+\renewcommand*{\topfraction}{.5}
+\begin{document}
+ \DocInput{hobsub.dtx}%
+\end{document}
+%</driver>
+% \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{hobsub.drv}
+%
+% \title{The \xpackage{hobsub} package}
+% \date{2016/05/16 v1.14}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{hobsub} implements the idea of loading
+% several packages in one big collection package.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \def\TableGeneric{^^A
+% \TableEntry{\xpackage{infwarerr}}{}{2010/04/08 v1.3}^^A
+% \TableEntry{\xpackage{ltxcmds}}{}{2011/11/09 v1.22}^^A
+% \TableEntry{\xpackage{ifluatex}}{}{2010/03/01 v1.3}^^A
+% \TableEntry{\xpackage{ifvtex}}{}{2010/03/01 v1.5}^^A
+% \TableEntry{\xpackage{intcalc}}{}{2007/09/27 v1.1}^^A
+% \TableEntry{\xpackage{ifpdf}}{\xpackage{ifluatex}}{2011/01/30 v2.3}^^A
+% \TableEntry{\xpackage{etexcmds}}{}{2011/02/16 v1.5}^^A
+% \TableEntry{\xpackage{kvsetkeys}}{}{2012/04/25 v1.16}^^A
+% \TableEntry{\xpackage{kvdefinekeys}}{}{2011/04/07 v1.3}^^A
+% \TableEntry{\xpackage{luatex-loader}}{}{2010/03/09 v0.4}^^A
+% \TableEntry{\xpackage{pdftexcmds}}{\xpackage{ifluatex}, \xpackage{ifpdf}, \xpackage{infwarerr}, \xpackage{ltxcmds}, \xpackage{luatex-loader}}{2011/11/29 v0.20}^^A
+% \TableEntry{\xpackage{pdfescape}}{\xpackage{ltxcmds}, \xpackage{pdftexcmds}}{2011/11/25 v1.13}^^A
+% \TableEntry{\xpackage{bigintcalc}}{\xpackage{pdftexcmds}}{2012/04/08 v1.3}^^A
+% \TableEntry{\xpackage{bitset}}{\xpackage{bigintcalc}, \xpackage{infwarerr}, \xpackage{intcalc}}{2011/01/30 v1.1}^^A
+% \TableEntry{\xpackage{uniquecounter}}{\xpackage{bigintcalc}, \xpackage{infwarerr}}{2011/01/30 v1.2}^^A
+% }
+% \def\TableHyperref{^^A
+% \TableEntry{\xpackage{letltxmacro}}{}{2010/09/02 v1.4}^^A
+% \TableEntry{\xpackage{hopatch}}{}{2016/05/16 v1.2}^^A
+% \TableEntry{\xpackage{xcolor-patch}}{}{2011/01/30 v1.7}^^A
+% \TableEntry{\xpackage{atveryend}}{}{2011/06/30 v1.8}^^A
+% \TableEntry{\xpackage{atbegshi}}{\xpackage{ifpdf}, \xpackage{infwarerr}, \xpackage{ltxcmds}}{2011/10/05 v1.16}^^A
+% \TableEntry{\xpackage{refcount}}{\xpackage{infwarerr}, \xpackage{ltxcmds}}{2011/10/16 v3.4}^^A
+% \TableEntry{\xpackage{hycolor}}{\xpackage{xcolor-patch}}{2011/01/30 v1.7}^^A
+% }
+%
+% \newenvironment{TableList}[2][htbp]{^^A
+% \begin{table}[{#1}]^^A
+% \centering
+% \caption{Overview \xpackage{hobsub-#2}}^^A
+% \label{tab:#2}^^A
+% \begin{tabular}{ll>{\raggedright}p{.4\linewidth}}^^A
+% \bfseries Package & \bfseries Release &
+% \bfseries Dependencies\tabularnewline
+% \hline
+% }{^^A
+% \end{tabular}^^A
+% \end{table}^^A
+% }
+% \newcommand*{\TableEntry}[3]{%
+% #1&#3&#2\tabularnewline
+% }
+%
+% \renewcommand*{\arraystretch}{1.1}
+% \setlength{\extrarowheight}{2pt}
+%
+% \section{Documentation}
+%
+% In January 2011 the mailing list lualatex-dev discussed
+% ``quietening lualatex console output'' \cite{lualatex:quiet}.
+% Inspired from this, I implemented this package \xpackage{hobsub}
+% to load several packages in one file. The package is applied for
+% two packages collections that are subsets of my package bundle
+% \xpackage{oberdiek}.
+% \begin{description}
+% \item[\xpackage{hobsub-generic}] is a collection of packages
+% that can also be used with \hologo{plainTeX}.
+% \item[\xpackage{hobsub-hyperref}] is a collection of packages
+% that is used by package \xpackage{hyperref}.
+% \end{description}
+%
+% Package \xpackage{hobsub} provides the macros that
+% are used in the collection packages and might be used
+% in other projects as well. But there are many caveats,
+% some of them are discussed below.
+%
+% The most serious problem is consistency. A package
+% that is available as standalone package and is part
+% of a collection might have different versions.
+% Because my packages are organized in a bundle and should
+% be installed and updated as bundle, the risk seems low
+% to me. However, if a single package is updated manually, for
+% example for testing, then it should be loaded before the
+% collection that contains the package with an older version.
+% In a collection, the package will not be loaded again if it
+% is already loaded.
+%
+% \subsection{Usage}
+%
+% The collection packages \xpackage{hobsub-generic} and
+% \xpackage{hobsub-hyperref} are loaded as usual:
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% |\usepackage{hobsub-generic}| & \hologo{LaTeX}\\
+% |\input hobsub-generic.sty| & \hologo{plainTeX}
+% \end{tabular}
+% \end{quote}
+% or
+% \begin{quote}|\usepackage{hobsub-hyperref}|\end{quote}
+% Of course, both \cs{usepackage} or \cs{RequirePackage}
+% can be used.
+%
+% If you need requirements on the version date of a package
+% inside a collection, then specify them afterwards, for
+% example:
+% \begin{quote}
+% |\usepackage{hobsub-generic}|\\
+% |\usepackage{ltxcmds}[2010/12/04]% |^^A
+% {\itshape |\ltx@ifblank is needed|}
+% \end{quote}
+%
+% Also it is not garanteed that a package will be always
+% part of a collection. Therefore it does not harm,
+% to make the requirements explicite \emph{after}
+% a collection is loaded, see the previous example.
+% \hologo{LaTeX} knows that a
+% package is already loaded and does not load it again.
+%
+% \subsection{Supported features}
+%
+% \begin{description}
+% \item[No reloads:] If a package is already loaded then it
+% is not reloaded again if it is part of a collection package.
+% \item[\cs{listfiles}:]
+% Each package that is loaded in a collection is also
+% added to the output of \cs{listfiles}.
+% \item[\cs{@currname}, \cs{@currext}]
+% are updated, they are used by \hologo{LaTeX}'s
+% \cs{ProvidesPackage}.
+% \item[\cs{AtEndOfPackage}:]
+% \hologo{LaTeX}'s hook mechanism that is used for
+% \cs{AtEndOfPackage} is supported. However none of the
+% packages in the collections are using \cs{AtEndOfPackage},
+% therefore this feature is completely untested.
+% \end{description}
+%
+% \subsection{Common limitations}
+%
+% \begin{description}
+% \item[\cs{endinput}:]
+% Often a package is using \cs{endinput}, either added by
+% \xpackage{docstrip}, or to stop package loading at an earlier
+% time. Therefore \cs{endinput} must be catched during package
+% loading to prevent that the collection package is closed
+% too early before reading all packages it contains.
+%
+% This redefinition of \cs{endinput} fails if the package loads
+% other files that contain \cs{endinput}. To some degree it could
+% be catched by redefining macros that load files. But this will
+% not work for the primitive \cs{input}.
+% \item[Options:]
+% \hologo{LaTeX}'s package options are not supported.
+% Therefore the packages that are put in a collection must
+% not support options.
+% \item[Hook packages:]
+% Some packages and classes provides hooks for packages, see
+% packages \xpackage{scrlfile}, \xpackage{filehook}
+% or class \xclass{memoir}. These hooks are not supported
+% for embedded packages inside a collection package.
+% Because of the problem with \cs{endinput}, these hooks
+% are not supported. The hooks might contain code that
+% loads other files that execute \cs{endinput}.
+% \end{description}
+%
+% \subsection{Package \xpackage{hobsub-generic}}
+%
+% \begin{TableList}[bp]{generic}\TableGeneric\end{TableList}
+%
+% Collection `generic' contains some of the \hologo{plainTeX} compatible
+% packages of my bundle, see table \ref{tab:generic}.
+% It adds the following restrictions to any package
+% that is part of this collection:
+% \begin{description}
+% \item[Generic formats:] The following formats must be supported:
+% \hologo{LaTeX}, \hologo{plainTeX} and even \hologo{iniTeX}.
+% This applies to the collection package \xpackage{hobsub-generic}
+% the same way.
+% \item[Prefixed macros:]
+% Any package of this collection should only define macros with
+% prefixed names to avoid name clashes. Resources like registers
+% must not be allocated and other global states should not be
+% changed except for added macro definitions.
+% \end{description}
+% Thus the package \xpackage{hobsub-generic} can also preloaded
+% in the format file with \hologo{iniTeX}.
+%
+% \subsection{Package \xpackage{hobsub-hyperref}}
+%
+% \begin{TableList}[tp]{hyperref}\TableHyperref\end{TableList}
+%
+% Collection `hyperref' contains additional packages that are
+% used by package \xpackage{hyperref} and that does not fit
+% in collection `generic', see table{tab:hyperref}.
+% The latter collection package
+% \xpackage{hobsub-generic} is loaded via a conventional
+% \cs{RequirePackage}.
+%
+% Because most of the packages in the collection `hyperref'
+% needs \hologo{LaTeX}, the collection requires \hologo{LaTeX}.
+%
+% \subsection{Package \xpackage{hobsub}}
+%
+% This section is for advanced users that might want to
+% build a collection package. Then it can be done by
+% using \xpackage{hobsub}:
+% \begin{quote}
+% \dots\\
+% |\RequirePackage{hobsub}[2016/05/16]|\\
+% \dots\\
+% |\hobsub@StartPackage{foo1}|\\
+% \textit{\dots\unskip\ package code of \xfile{foo1.sty} \dots}\\
+% |\endinput|\\
+% |<hobsub>|\\
+% |\hobsub@StopPackage|\\
+% |\hobsub@StartPackage{bar2}|\\
+% \textit{\dots\unskip\ package code of \xfile{bar2.sty} \dots}\\
+% |\endinput|\\
+% |<hobsub>|\\
+% |\hobsub@StopPackage|
+% \dots
+% \end{quote}
+% But be aware of the caveats and limitations, see above.
+% Only quite a small portion of the packages can be embedded
+% like this.
+%
+% \clearpage
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Reload check and package identification}
+%
+% \subsubsection{Package \xpackage{hobsub}}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@hobsub.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{hobsub}{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@hobsub.sty\endcsname
+\ProvidesPackage{hobsub}%
+ [2016/05/16 v1.14 Construct package bundles (HO)]%
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{hobsub-generic}}
+%
+% \begin{macrocode}
+%<*generic>
+% \end{macrocode}
+% 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@hobsub-generic.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{hobsub-generic}{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@hobsub-generic.sty\endcsname
+\ProvidesPackage{hobsub-generic}%
+ [2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)]%
+% \end{macrocode}
+% \begin{macrocode}
+%</generic>
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{hobsub-hyperref}}
+%
+% \begin{macrocode}
+%<*hyperref>
+% \end{macrocode}
+% 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@hobsub-hyperref.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{hobsub-hyperref}{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@hobsub-hyperref.sty\endcsname
+\ProvidesPackage{hobsub-hyperref}%
+ [2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)]%
+% \end{macrocode}
+% \begin{macrocode}
+%</hyperref>
+% \end{macrocode}
+%
+% \subsection{Catcodes}
+%
+% \begin{macrocode}
+%<*package|generic|hyperref>
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \catcode64=11 % @
+ \def\x{\endgroup
+ \expandafter\edef\csname HOBsub@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\HOBsub@AtEnd{%
+ \HOBsub@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{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\HOBsub@AtEnd{\HOBsub@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package|generic|hyperref>
+% \end{macrocode}
+%
+% \subsection{Package \xpackage{hobsub-hyperref} loads \xpackage{hobsub-generic}}
+%
+% \begin{macrocode}
+%<*hyperref>
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{hobsub-generic}[2016/05/16]
+%</hyperref>
+% \end{macrocode}
+%
+% \subsection{Preamble}
+%
+% \begin{macrocode}
+%<*preamble>
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ver@hobsub.sty\endcsname\relax
+\else
+ \expandafter\hobsub@GobbleRemainingPackage
+\fi
+%</preamble>
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+%<*package|preamble>
+% \end{macrocode}
+%
+% \begin{macro}{\HOBsub@OrgEndinput}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname HOBsub@OrgEndinput\endcsname\relax
+ \let\HOBsub@OrgEndinput\endinput
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\hobsub@GobbleRemainingPackage}
+% \begin{macrocode}
+\def\hobsub@GobbleRemainingPackage{%
+ \begingroup
+ \catcode92=14 % backslash: comment
+ \catcode32=14 % space: comment
+ \catcode35=14 % hash: comment
+ \catcode123=14 % left brace: comment
+ \catcode125=14 % right brace: comment
+ \catcode60=3 % less: math
+ \catcode62=4 % greater: align
+ \endlinechar=-1 %
+ \HOBsub@GobbleRemainingPackage
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOBsub@GobbleRemainingPackage}
+% \begin{macrocode}
+\catcode60=3 % less: dollar
+\catcode62=4 % greater: align
+\long\def\HOBsub@GobbleRemainingPackage#1<hobsub>{%
+ \endgroup
+}
+\catcode60=12 % less: other
+\catcode62=12 % greater: other
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hobsub@StartPackage}
+% \begin{macrocode}
+\def\hobsub@StartPackage#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname ver@#1.sty\endcsname\relax
+ \let\HOBsub@OrgCurrName\@currname
+ \let\HOBsub@OrgCurrExt\@currext
+ \csname @pushfilename\endcsname
+ \def\@currname{#1}%
+ \def\@currext{sty}%
+ \expandafter\def\csname\@currname.\@currext-h@@k\endcsname{}%
+ \let\endinput\hobsub@GobbleRemainingPackage
+ \def\hobsub@StopPackage{%
+ \let\hobsub@StopPackage\relax
+ \HOBsub@StopPackage
+% \hobsub@Info{hobsub}{Package `#1' loaded}%
+ }%
+ \hobsub@AddToFileList{#1.sty}%
+ \else
+ \hobsub@Info{hobsub}{Skipping package `#1' (already loaded)}%
+ \let\hobsub@StopPackage\relax
+ \expandafter\hobsub@GobbleRemainingPackage
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hobsub@StopPackage}
+% \begin{macrocode}
+\let\hobsub@StopPackage\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hobsub@Info}
+% \begin{macrocode}
+\def\hobsub@Info#1#2{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname @PackageInfoNoLine\endcsname\relax
+ \immediate\write-1{Package #1 Info: #2.}%
+ \else
+ \let\hobsub@Info\@PackageInfoNoLine
+ \hobsub@Info{#1}{#2}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOBsub@StopPackage}
+% \begin{macrocode}
+\def\HOBsub@StopPackage{%
+ \csname\@currname.\@currext-h@@k\endcsname
+ \let\endinput\HOBsub@OrgEndinput
+ \csname @popfilename\endcsname
+ \let\@currname\HOBsub@OrgCurrName
+ \let\@currext\HOBsub@OrgCurrExt
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hobsub@AddToFileList}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname @addtofilelist\endcsname\relax
+ \def\hobsub@AddToFileList#1{}%
+\else
+ \def\hobsub@AddToFileList#1{%
+ \@addtofilelist{#1}%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package|preamble>
+% \end{macrocode}
+%
+% \subsection{End of preamble for subset packages}
+%
+% Add the end marker for possible skipping of previous
+% macros, if package \xpackage{hobsub} was already loaded.
+% \begin{macrocode}
+%<*preamble>
+\hobsub@GobbleRemainingPackage
+<hobsub>
+% \end{macrocode}
+%
+% All macros of package \xpackage{hobsub} are now available.
+% Now we officially load the package \xpackage{hobsub} inline
+% for proper package identification.
+% \begin{macrocode}
+\hobsub@StartPackage{hobsub}%
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ProvidesPackage\endcsname\relax
+ \immediate\write-1{%
+ Package: hobsub 2016/05/16 v1.14 Construct package bundles (HO)%
+ }%
+\else
+ \ProvidesPackage{hobsub}%
+ [2016/05/16 v1.14 Construct package bundles (HO)]%
+\fi
+%</preamble>
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+%<*post|preamble>
+ \endinput
+<hobsub>
+\hobsub@StopPackage
+%</post|preamble>
+% \end{macrocode}
+%
+% \subsection{Package list}
+%
+% \begin{macrocode}
+%<infwarerr>\hobsub@StartPackage{infwarerr}
+%<ltxcmds>\hobsub@StartPackage{ltxcmds}
+%<ifluatex>\hobsub@StartPackage{ifluatex}
+%<ifvtex>\hobsub@StartPackage{ifvtex}
+%<intcalc>\hobsub@StartPackage{intcalc}
+%<ifpdf>\hobsub@StartPackage{ifpdf}
+%<etexcmds>\hobsub@StartPackage{etexcmds}
+%<kvsetkeys>\hobsub@StartPackage{kvsetkeys}
+%<kvdefinekeys>\hobsub@StartPackage{kvdefinekeys}
+%<*luatex-loader>
+\ifluatex
+\else
+ \expandafter\hobsub@GobbleRemainingPackage
+\fi
+\hobsub@StartPackage{luatex-loader}
+%</luatex-loader>
+%<pdftexcmds>\hobsub@StartPackage{pdftexcmds}
+%<pdfescape>\hobsub@StartPackage{pdfescape}
+%<bigintcalc>\hobsub@StartPackage{bigintcalc}
+%<bitset>\hobsub@StartPackage{bitset}
+%<uniquecounter>\hobsub@StartPackage{uniquecounter}
+%<letltxmacro>\hobsub@StartPackage{letltxmacro}
+%<hopatch>\hobsub@StartPackage{hopatch}
+%<xcolor-patch>\hobsub@StartPackage{xcolor-patch}
+%<atveryend>\hobsub@StartPackage{atveryend}
+%<atbegshi>\hobsub@StartPackage{atbegshi}
+%<refcount>\hobsub@StartPackage{refcount}
+%<hycolor>\hobsub@StartPackage{hycolor}
+% \end{macrocode}
+%
+% \subsection{End of packages}
+%
+% \begin{macrocode}
+%<package|atend>\HOBsub@AtEnd%
+% \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 hobsub.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hobsub}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hobsub.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hobsub.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[\CTAN{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 hobsub.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@{}}
+% hobsub.sty & tex/generic/oberdiek/hobsub.sty\\
+% hobsub-generic.sty & tex/generic/oberdiek/hobsub-generic.sty\\
+% hobsub-hyperref.sty & tex/generic/oberdiek/hobsub-hyperref.sty\\
+% hobsub.pdf & doc/latex/oberdiek/hobsub.pdf\\
+% test/hobsub-test1.tex & doc/latex/oberdiek/test/hobsub-test1.tex\\
+% hobsub.dtx & source/latex/oberdiek/hobsub.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hobsub.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hobsub.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 hobsub.dtx
+%makeindex -s gind.ist hobsub.idx
+%pdflatex hobsub.dtx
+%makeindex -s gind.ist hobsub.idx
+%pdflatex hobsub.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hobsub.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hobsub'>
+ <name>hobsub</name>
+ <caption>Construct package bundles</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2011,2012'/>
+ <license type='lppl1.3'/>
+ <version number='1.14'/>
+ <description>
+ The package offers a means of loading a bundle of (other) packages
+ &#x201C;at once&#x201D;, offering a means of reducing the amount of log output
+ as the packages are loaded, and an aide-memoire for complicated
+ requirements. In some ways, loading a package via hobsub behaves
+ much like loading the package in the normal way; for example,
+ reloads are suppressed, as in LaTeX proper, and correct
+ <tt>\listfiles</tt> output is produced.
+ <p/>
+ Examples provided are a &#x2018;generic&#x2019; bundle (comprising the author&#x2019;s
+ packages that can be used with Plain TeX) and a &#x2018;hyperref&#x2019; bundle
+ (comprising packages useful when generating hypertext output with
+ LaTeX).
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hobsub.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hobsub.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+% \bibitem{lualatex:quiet}
+% Will Robertson,
+% \textit{[lltx] quietening lualatex console output};
+% mailing list \textsf{lualatex-dev at tug.org},
+% 2011-01-29;
+% \url{http://tug.org/pipermail/lualatex-dev/2011-January/001031.html}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2011/01/30 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2011/04/16 v1.1}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/04/17 v1.2}
+% \item
+% White spaces at line begins are removed or reduced
+% in the generated collection packages.
+% \end{Version}
+% \begin{Version}{2011/04/18 v1.3}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/04/23 v1.4}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/06/24 v1.5}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/06/30 v1.6}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/07/01 v1.7}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/07/28 v1.8}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/08/22 v1.9}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/10/16 v1.10}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2011/11/29 v1.11}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2012/04/25 v1.12}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2012/05/28 v1.13}
+% \item
+% Package updates.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.14}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hobsub.pdf b/macros/latex/contrib/oberdiek/hobsub.pdf
new file mode 100644
index 0000000000..8ea8176611
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hobsub.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hologo.dtx b/macros/latex/contrib/oberdiek/hologo.dtx
new file mode 100644
index 0000000000..8ef086f21f
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hologo.dtx
@@ -0,0 +1,5108 @@
+% \iffalse meta-comment
+%
+% File: hologo.dtx
+% Version: 2017/05/01 v1.13
+% Info: A logo collection with bookmark support
+%
+% Copyright (C) 2010-2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 hologo.dtx
+% and the derived files
+% hologo.sty, hologo.pdf, hologo.ins, hologo.drv, hologo-example.tex,
+% hologo-test1.tex, hologo-test-spacefactor.tex,
+% hologo-test-list.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hologo.dtx
+% CTAN:macros/latex/contrib/oberdiek/hologo.pdf
+%
+% Unpacking:
+% (a) If hologo.ins is present:
+% tex hologo.ins
+% (b) Without hologo.ins:
+% tex hologo.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hologo.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hologo.drv is present:
+% latex hologo.drv
+% (b) Without hologo.drv:
+% latex hologo.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 hologo.dtx
+% makeindex -s gind.ist hologo.idx
+% pdflatex hologo.dtx
+% makeindex -s gind.ist hologo.idx
+% pdflatex hologo.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/hologo.sty
+% TDS:doc/latex/oberdiek/hologo.pdf
+% TDS:doc/latex/oberdiek/example/hologo-example.tex
+% TDS:doc/latex/oberdiek/test/hologo-test1.tex
+% TDS:doc/latex/oberdiek/test/hologo-test-spacefactor.tex
+% TDS:doc/latex/oberdiek/test/hologo-test-list.tex
+% TDS:source/latex/oberdiek/hologo.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hologo 2017/05/01 v1.13 A logo collection with bookmark support (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hologo
+Version: 2017/05/01 v1.13
+
+Copyright (C) 2010-2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 hologo.dtx
+and the derived files
+ hologo.sty, hologo.pdf, hologo.ins, hologo.drv, hologo-example.tex,
+ hologo-test1.tex, hologo-test-spacefactor.tex,
+ hologo-test-list.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hologo.ins}{\from{hologo.dtx}{install}}%
+ \file{hologo.drv}{\from{hologo.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{hologo.sty}{\from{hologo.dtx}{package}}%
+ \usedir{doc/latex/oberdiek/example}%
+ \file{hologo-example.tex}{\from{hologo.dtx}{example}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{hologo-test1.tex}{\from{hologo.dtx}{test1}}%
+% \file{hologo-test-spacefactor.tex}{\from{hologo.dtx}{test-spacefactor}}%
+% \file{hologo-test-list.tex}{\from{hologo.dtx}{test-list}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hologo.xml}{\from{hologo.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{* hologo.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hologo.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hologo.drv}%
+ [2017/05/01 v1.13 A logo collection with bookmark support (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{hologo}[2017/05/01]
+\usepackage{longtable}
+\usepackage{array}
+\usepackage{paralist}
+%\usepackage[T1]{fontenc}
+%\usepackage{lmodern}
+\begin{document}
+ \DocInput{hologo.dtx}%
+\end{document}
+%</driver>
+% \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{hologo.drv}
+%
+% \title{The \xpackage{hologo} package}
+% \date{2017/05/01 v1.13}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package starts a collection of logos with support for bookmarks
+% strings.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Logo macros}
+%
+% \begin{declcs}{hologo} \M{name}
+% \end{declcs}
+% Macro \cs{hologo} sets the logo with name \meta{name}.
+% The following table shows the supported names.
+%
+% \begingroup
+% \def\hologoEntry#1#2#3{^^A
+% #1&#2&\hologoLogoSetup{#1}{variant=#2}\hologo{#1}&#3\tabularnewline
+% }
+% \begin{longtable}{>{\ttfamily}l>{\ttfamily}lll}
+% \rmfamily\bfseries{name} & \rmfamily\bfseries variant
+% & \bfseries logo & \bfseries since\\
+% \hline
+% \endhead
+% \hologoList
+% \end{longtable}
+% \endgroup
+%
+% \begin{declcs}{Hologo} \M{name}
+% \end{declcs}
+% Macro \cs{Hologo} starts the logo \meta{name} with an uppercase
+% letter. As an exception small greek letters are not converted
+% to uppercase. Examples, see \hologo{eTeX} and \hologo{ExTeX}.
+%
+% \subsection{Setup macros}
+%
+% The package does not support package options, but the following
+% setup macros can be used to set options.
+%
+% \begin{declcs}{hologoSetup} \M{key value list}
+% \end{declcs}
+% Macro \cs{hologoSetup} sets global options.
+%
+% \begin{declcs}{hologoLogoSetup} \M{logo} \M{key value list}
+% \end{declcs}
+% Some options can also be used to configure a logo.
+% These settings take precedence over global option settings.
+%
+% \subsection{Options}\label{sec:options}
+%
+% There are boolean and string options:
+% \begin{description}
+% \item[Boolean option:]
+% It takes |true| or |false|
+% as value. If the value is omitted, then |true| is used.
+% \item[String option:]
+% A value must be given as string. (But the string might be empty.)
+% \end{description}
+% The following options can be used both in \cs{hologoSetup}
+% and \cs{hologoLogoSetup}:
+% \begin{description}
+% \def\entry#1{\item[\xoption{#1}:]}
+% \entry{break}
+% enables or disables line breaks inside the logo. This setting is
+% refined by options \xoption{hyphenbreak}, \xoption{spacebreak}
+% or \xoption{discretionarybreak}.
+% Default is |false|.
+% \entry{hyphenbreak}
+% enables or disables the line break right after the hyphen character.
+% \entry{spacebreak}
+% enables or disables line breaks at space characters.
+% \entry{discretionarybreak}
+% enables or disables line breaks at hyphenation points
+% (inserted by \cs{-}).
+% \end{description}
+% Macro \cs{hologoLogoSetup} also knows:
+% \begin{description}
+% \item[\xoption{variant}:]
+% This is a string option. It specifies a variant of a logo that
+% must exist. An empty string selects the package default variant.
+% \end{description}
+% Example:
+% \begin{quote}
+% |\hologoSetup{break=false}|\\
+% |\hologoLogoSetup{plainTeX}{variant=hyphen,hyphenbreak}|\\
+% Then ``plain-\TeX'' contains one break point after the hyphen.
+% \end{quote}
+%
+% \subsection{Driver options}
+%
+% Sometimes graphical operations are needed to construct some
+% glyphs (e.g.\ \hologo{XeTeX}). If package \xpackage{graphics}
+% or package \xpackage{pgf} are found, then the macros are taken
+% from there. Otherwise the packge defines its own operations
+% and therefore needs the driver information. Many drivers are
+% detected automatically (\hologo{pdfTeX}/\hologo{LuaTeX}
+% in PDF mode, \hologo{XeTeX}, \hologo{VTeX}). These have precedence
+% over a driver option. The driver can be given as package option
+% or using \cs{hologoDriverSetup}.
+% The following list contains the recognized driver options:
+% \begin{itemize}
+% \item \xoption{pdftex}, \xoption{luatex}
+% \item \xoption{dvipdfm}, \xoption{dvipdfmx}
+% \item \xoption{dvips}, \xoption{dvipsone}, \xoption{xdvi}
+% \item \xoption{xetex}
+% \item \xoption{vtex}
+% \end{itemize}
+% The left driver of a line is the driver name that is used internally.
+% The following names are aliases for drivers that use the
+% same method. Therefore the entry in the \xext{log} file for
+% the used driver prints the internally used driver name.
+% \begin{description}
+% \item[\xoption{driverfallback}:]
+% This option expects a driver that is used,
+% if the driver could not be detected automatically.
+% \end{description}
+%
+% \begin{declcs}{hologoDriverSetup} \M{driver option}
+% \end{declcs}
+% The driver can also be configured after package loading
+% using \cs{hologoDriverSetup}, also the way for \hologo{plainTeX}
+% to setup the driver.
+%
+% \subsection{Font setup}
+%
+% Some logos require a special font, but should also be usable by
+% \hologo{plainTeX}. Therefore the package provides some ways
+% to influence the font settings. The options below
+% take font settings as values. Both font commands
+% such as \cs{sffamily} and macros that take one argument
+% like \cs{textsf} can be used.
+%
+% \begin{declcs}{hologoFontSetup} \M{key value list}
+% \end{declcs}
+% Macro \cs{hologoFontSetup} sets the fonts for all logos.
+% Supported keys:
+% \begin{description}
+% \def\entry#1{\item[\xoption{#1}:]}
+% \entry{general}
+% This font is used for all logos. The default is empty.
+% That means no special font is used.
+% \entry{bibsf}
+% This font is used for
+% {\hologoLogoSetup{BibTeX}{variant=sf}\hologo{BibTeX}}
+% with variant \xoption{sf}.
+% \entry{rm}
+% This font is a serif font. It is used for \hologo{ExTeX}.
+% \entry{sc}
+% This font specifies a small caps font. It is used for
+% {\hologoLogoSetup{BibTeX}{variant=sc}\hologo{BibTeX}}
+% with variant \xoption{sc}.
+% \entry{sf}
+% This font specifies a sans serif font. The default
+% is \cs{sffamily}, then \cs{sf} is tried. Otherwise
+% a warning is given. It is used by \hologo{KOMAScript}.
+% \entry{sy}
+% This is the font for math symbols (e.g. cmsy).
+% It is used by \hologo{AmS}, \hologo{NTS}, \hologo{ExTeX}.
+% \entry{logo}
+% \hologo{METAFONT} and \hologo{METAPOST} are using that font.
+% In \hologo{LaTeX} \cs{logofamily} is used and
+% the definitions of package \xpackage{mflogo} are used
+% if the package is not loaded.
+% Otherwise the \cs{tenlogo} is used and defined
+% if it does not already exists.
+% \end{description}
+%
+% \begin{declcs}{hologoLogoFontSetup} \M{logo} \M{key value list}
+% \end{declcs}
+% Fonts can also be set for a logo or logo component separately,
+% see the following list.
+% The keys are the same as for \cs{hologoFontSetup}.
+%
+% \begin{longtable}{>{\ttfamily}l>{\sffamily}ll}
+% \meta{logo} & keys & result\\
+% \hline
+% \endhead
+% BibTeX & bibsf & {\hologoLogoSetup{BibTeX}{variant=sf}\hologo{BibTeX}}\\[.5ex]
+% BibTeX & sc & {\hologoLogoSetup{BibTeX}{variant=sc}\hologo{BibTeX}}\\[.5ex]
+% ExTeX & rm & \hologo{ExTeX}\\
+% SliTeX & rm & \hologo{SliTeX}\\[.5ex]
+% AmS & sy & \hologo{AmS}\\
+% ExTeX & sy & \hologo{ExTeX}\\
+% NTS & sy & \hologo{NTS}\\[.5ex]
+% KOMAScript & sf & \hologo{KOMAScript}\\[.5ex]
+% METAFONT & logo & \hologo{METAFONT}\\
+% METAPOST & logo & \hologo{METAPOST}\\[.5ex]
+% SliTeX & sc \hologo{SliTeX}
+% \end{longtable}
+%
+% \subsubsection{Font order}
+%
+% For all logos the font \xoption{general} is applied first.
+% Example:
+%\begin{quote}
+%|\hologoFontSetup{general=\color{red}}|
+%\end{quote}
+% will print red logos.
+% Then if the font uses a special font \xoption{sf}, for example,
+% the font is applied that is setup by \cs{hologoLogoFontSetup}.
+% If this font is not setup, then the common font setup
+% by \cs{hologoFontSetup} is used. Otherwise a warning is given,
+% that there is no font configured.
+%
+% \subsection{Additional user macros}
+%
+% Usually a variant of a logo is configured by using
+% \cs{hologoLogoSetup}, because it is bad style to mix
+% different variants of the same logo in the same text.
+% There the following macros are a convenience for testing.
+%
+% \begin{declcs}{hologoVariant} \M{name} \M{variant}\\
+% \cs{HologoVariant} \M{name} \M{variant}
+% \end{declcs}
+% Logo \meta{name} is set using \meta{variant} that specifies
+% explicitely which variant of the macro is used. If the argument
+% is empty, then the default form of the logo is used
+% (configurable by \cs{hologoLogoSetup}).
+%
+% \cs{HologoVariant} is used if the logo is set in a context
+% that needs an uppercase first letter (beginning of a sentence, \dots).
+%
+% \begin{declcs}{hologoList}\\
+% \cs{hologoEntry} \M{logo} \M{variant} \M{since}
+% \end{declcs}
+% Macro \cs{hologoList} contains all logos that are provided
+% by the package including variants. The list consists of calls
+% of \cs{hologoEntry} with three arguments starting with the
+% logo name \meta{logo} and its variant \meta{variant}. An empty
+% variant means the current default. Argument \meta{since} specifies
+% with version of the package \xpackage{hologo} is needed to get
+% the logo. If the logo is fixed, then the date gets updated.
+% Therefore the date \meta{since} is not exactly the date of
+% the first introduction, but rather the date of the latest fix.
+%
+% Before \cs{hologoList} can be used, macro \cs{hologoEntry} needs
+% a definition. The example file in section \ref{sec:example}
+% shows applications of \cs{hologoList}.
+%
+% \subsection{Supported contexts}
+%
+% Macros \cs{hologo} and friends support special contexts:
+% \begin{itemize}
+% \item \hologo{LaTeX}'s protection mechanism.
+% \item Bookmarks of package \xpackage{hyperref}.
+% \item Package \xpackage{tex4ht}.
+% \item The macros can be used inside \cs{csname} constructs,
+% if \cs{ifincsname} is available (\hologo{pdfTeX}, \hologo{XeTeX},
+% \hologo{LuaTeX}).
+% \end{itemize}
+%
+% \subsection{Example}
+% \label{sec:example}
+%
+% The following example prints the logos in different fonts.
+% \begin{macrocode}
+%<*example>
+%<<verbatim
+\NeedsTeXFormat{LaTeX2e}
+\documentclass[a4paper]{article}
+\usepackage[
+ hmargin=20mm,
+ vmargin=20mm,
+]{geometry}
+\pagestyle{empty}
+\usepackage{hologo}[2017/05/01]
+\usepackage{longtable}
+\usepackage{array}
+\setlength{\extrarowheight}{2pt}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage{pdflscape}
+\usepackage[
+ pdfencoding=auto,
+]{hyperref}
+\hypersetup{
+ pdfauthor={Heiko Oberdiek},
+ pdftitle={Example for package `hologo'},
+ pdfsubject={Logos with fonts lmr, lmss, qtm, qpl, qhv},
+}
+\usepackage{bookmark}
+
+% Print the logo list on the console
+
+\begingroup
+ \typeout{}%
+ \typeout{*** Begin of logo list ***}%
+ \newcommand*{\hologoEntry}[3]{%
+ \typeout{#1 \ifx\\#2\\\else(#2) \fi[#3]}%
+ }%
+ \hologoList
+ \typeout{*** End of logo list ***}%
+ \typeout{}%
+\endgroup
+
+\begin{document}
+\begin{landscape}
+
+ \section{Example file for package `hologo'}
+
+ % Table for font names
+
+ \begin{longtable}{>{\bfseries}ll}
+ \textbf{font} & \textbf{Font name}\\
+ \hline
+ lmr & Latin Modern Roman\\
+ lmss & Latin Modern Sans\\
+ qtm & \TeX\ Gyre Termes\\
+ qhv & \TeX\ Gyre Heros\\
+ qpl & \TeX\ Gyre Pagella\\
+ \end{longtable}
+
+ % Logo list with logos in different fonts
+
+ \begingroup
+ \newcommand*{\SetVariant}[2]{%
+ \ifx\\#2\\%
+ \else
+ \hologoLogoSetup{#1}{variant=#2}%
+ \fi
+ }%
+ \newcommand*{\hologoEntry}[3]{%
+ \SetVariant{#1}{#2}%
+ \raisebox{1em}[0pt][0pt]{\hypertarget{#1@#2}{}}%
+ \bookmark[%
+ dest={#1@#2},%
+ ]{%
+ #1\ifx\\#2\\\else\space(#2)\fi: \Hologo{#1}, \hologo{#1} %
+ [Unicode]%
+ }%
+ \hypersetup{unicode=false}%
+ \bookmark[%
+ dest={#1@#2},%
+ ]{%
+ #1\ifx\\#2\\\else\space(#2)\fi: \Hologo{#1}, \hologo{#1} %
+ [PDFDocEncoding]%
+ }%
+ \texttt{#1}%
+ &%
+ \texttt{#2}%
+ &%
+ \Hologo{#1}%
+ &%
+ \SetVariant{#1}{#2}%
+ \hologo{#1}%
+ &%
+ \SetVariant{#1}{#2}%
+ \fontfamily{qtm}\selectfont
+ \hologo{#1}%
+ &%
+ \SetVariant{#1}{#2}%
+ \fontfamily{qpl}\selectfont
+ \hologo{#1}%
+ &%
+ \SetVariant{#1}{#2}%
+ \textsf{\hologo{#1}}%
+ &%
+ \SetVariant{#1}{#2}%
+ \fontfamily{qhv}\selectfont
+ \hologo{#1}%
+ \tabularnewline
+ }%
+ \begin{longtable}{llllllll}%
+ \textbf{\textit{logo}} & \textbf{\textit{variant}} &
+ \texttt{\string\Hologo} &
+ \textbf{lmr} & \textbf{qtm} & \textbf{qpl} &
+ \textbf{lmss} & \textbf{qhv}
+ \tabularnewline
+ \hline
+ \endhead
+ \hologoList
+ \end{longtable}%
+ \endgroup
+
+\end{landscape}
+\end{document}
+%verbatim
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@hologo.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{hologo}{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@hologo.sty\endcsname
+\ProvidesPackage{hologo}%
+ [2017/05/01 v1.13 A logo collection with bookmark support (HO)]%
+% \end{macrocode}
+%
+% \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 HOLOGO@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\HOLOGO@AtEnd{%
+ \HOLOGO@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{34}{12}% "
+\TMP@EnsureCode{36}{3}% $
+\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{59}{12}% ;
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{63}{12}% ?
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^ (superscript)
+\TMP@EnsureCode{95}{8}% _ (subscript)
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{124}{12}% |
+\edef\HOLOGO@AtEnd{%
+ \HOLOGO@AtEnd
+ \escapechar\the\escapechar\relax
+ \noexpand\endinput
+}
+\escapechar=92 %
+% \end{macrocode}
+%
+% \subsection{Logo list}
+%
+% \begin{macro}{\hologoList}
+% \begin{macrocode}
+\def\hologoList{%
+ \hologoEntry{(La)TeX}{}{2011/10/01}%
+ \hologoEntry{AmSLaTeX}{}{2010/04/16}%
+ \hologoEntry{AmSTeX}{}{2010/04/16}%
+ \hologoEntry{biber}{}{2011/10/01}%
+ \hologoEntry{BibTeX}{}{2011/10/01}%
+ \hologoEntry{BibTeX}{sf}{2011/10/01}%
+ \hologoEntry{BibTeX}{sc}{2011/10/01}%
+ \hologoEntry{BibTeX8}{}{2011/11/22}%
+ \hologoEntry{ConTeXt}{}{2011/03/25}%
+ \hologoEntry{ConTeXt}{narrow}{2011/03/25}%
+ \hologoEntry{ConTeXt}{simple}{2011/03/25}%
+ \hologoEntry{emTeX}{}{2010/04/26}%
+ \hologoEntry{eTeX}{}{2010/04/08}%
+ \hologoEntry{ExTeX}{}{2011/10/01}%
+ \hologoEntry{HanTheThanh}{}{2011/11/29}%
+ \hologoEntry{iniTeX}{}{2011/10/01}%
+ \hologoEntry{KOMAScript}{}{2011/10/01}%
+ \hologoEntry{La}{}{2010/05/08}%
+ \hologoEntry{LaTeX}{}{2010/04/08}%
+ \hologoEntry{LaTeX2e}{}{2010/04/08}%
+ \hologoEntry{LaTeX3}{}{2010/04/24}%
+ \hologoEntry{LaTeXe}{}{2010/04/08}%
+ \hologoEntry{LaTeXML}{}{2011/11/22}%
+ \hologoEntry{LaTeXTeX}{}{2011/10/01}%
+ \hologoEntry{LuaLaTeX}{}{2010/04/08}%
+ \hologoEntry{LuaTeX}{}{2010/04/08}%
+ \hologoEntry{LyX}{}{2011/10/01}%
+ \hologoEntry{METAFONT}{}{2011/10/01}%
+ \hologoEntry{MetaFun}{}{2011/10/01}%
+ \hologoEntry{METAPOST}{}{2011/10/01}%
+ \hologoEntry{MetaPost}{}{2011/10/01}%
+ \hologoEntry{MiKTeX}{}{2011/10/01}%
+ \hologoEntry{NTS}{}{2011/10/01}%
+ \hologoEntry{OzMF}{}{2011/10/01}%
+ \hologoEntry{OzMP}{}{2011/10/01}%
+ \hologoEntry{OzTeX}{}{2011/10/01}%
+ \hologoEntry{OzTtH}{}{2011/10/01}%
+ \hologoEntry{PCTeX}{}{2011/10/01}%
+ \hologoEntry{pdfTeX}{}{2011/10/01}%
+ \hologoEntry{pdfLaTeX}{}{2011/10/01}%
+ \hologoEntry{PiC}{}{2011/10/01}%
+ \hologoEntry{PiCTeX}{}{2011/10/01}%
+ \hologoEntry{plainTeX}{}{2010/04/08}%
+ \hologoEntry{plainTeX}{space}{2010/04/16}%
+ \hologoEntry{plainTeX}{hyphen}{2010/04/16}%
+ \hologoEntry{plainTeX}{runtogether}{2010/04/16}%
+ \hologoEntry{SageTeX}{}{2011/11/22}%
+ \hologoEntry{SLiTeX}{}{2011/10/01}%
+ \hologoEntry{SLiTeX}{lift}{2011/10/01}%
+ \hologoEntry{SLiTeX}{narrow}{2011/10/01}%
+ \hologoEntry{SLiTeX}{simple}{2011/10/01}%
+ \hologoEntry{SliTeX}{}{2011/10/01}%
+ \hologoEntry{SliTeX}{narrow}{2011/10/01}%
+ \hologoEntry{SliTeX}{simple}{2011/10/01}%
+ \hologoEntry{SliTeX}{lift}{2011/10/01}%
+ \hologoEntry{teTeX}{}{2011/10/01}%
+ \hologoEntry{TeX}{}{2010/04/08}%
+ \hologoEntry{TeX4ht}{}{2011/11/22}%
+ \hologoEntry{TTH}{}{2011/11/22}%
+ \hologoEntry{virTeX}{}{2011/10/01}%
+ \hologoEntry{VTeX}{}{2010/04/24}%
+ \hologoEntry{Xe}{}{2010/04/08}%
+ \hologoEntry{XeLaTeX}{}{2010/04/08}%
+ \hologoEntry{XeTeX}{}{2010/04/08}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Load resources}
+%
+% \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{ltxcmds}[2011/02/04]%
+ \TMP@RequirePackage{infwarerr}[2010/04/08]%
+ \TMP@RequirePackage{kvsetkeys}[2010/03/01]%
+ \TMP@RequirePackage{kvdefinekeys}[2010/03/01]%
+ \TMP@RequirePackage{pdftexcmds}[2010/04/01]%
+ \TMP@RequirePackage{ifpdf}[2010/01/28]%
+ \TMP@RequirePackage{ifluatex}[2010/03/01]%
+ \ltx@IfUndefined{newif}{%
+ \expandafter\let\csname newif\endcsname\ltx@newif
+ }{}%
+ \TMP@RequirePackage{ifxetex}[2009/01/23]%
+ \TMP@RequirePackage{ifvtex}[2010/03/01]%
+\else
+ \RequirePackage{ltxcmds}[2011/02/04]%
+ \RequirePackage{infwarerr}[2010/04/08]%
+ \RequirePackage{kvsetkeys}[2010/03/01]%
+ \RequirePackage{kvdefinekeys}[2010/03/01]%
+ \RequirePackage{pdftexcmds}[2010/04/01]%
+ \RequirePackage{ifpdf}[2010/01/28]%
+ \RequirePackage{ifluatex}[2010/03/01]%
+ \RequirePackage{ifxetex}[2009/01/23]%
+ \RequirePackage{ifvtex}[2010/03/01]%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\HOLOGO@IfDefined}
+% \begin{macrocode}
+\def\HOLOGO@IfExists#1{%
+ \ifx\@undefined#1%
+ \expandafter\ltx@secondoftwo
+ \else
+ \ifx\relax#1%
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\expandafter\expandafter\ltx@firstoftwo
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Setup macros}
+%
+% \begin{macro}{\hologoSetup}
+% \begin{macrocode}
+\def\hologoSetup{%
+ \let\HOLOGO@name\relax
+ \HOLOGO@Setup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hologoLogoSetup}
+% \begin{macrocode}
+\def\hologoLogoSetup#1{%
+ \edef\HOLOGO@name{#1}%
+ \ltx@IfUndefined{HoLogo@\HOLOGO@name}{%
+ \@PackageError{hologo}{%
+ Unknown logo `\HOLOGO@name'%
+ }\@ehc
+ \ltx@gobble
+ }{%
+ \HOLOGO@Setup
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@Setup}
+% \begin{macrocode}
+\def\HOLOGO@Setup{%
+ \kvsetkeys{HoLogo}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Options}
+%
+% \begin{macro}{\HOLOGO@DeclareBoolOption}
+% \begin{macrocode}
+\def\HOLOGO@DeclareBoolOption#1{%
+ \expandafter\chardef\csname HOLOGOOPT@#1\endcsname\ltx@zero
+ \kv@define@key{HoLogo}{#1}[true]{%
+ \def\HOLOGO@temp{##1}%
+ \ifx\HOLOGO@temp\HOLOGO@true
+ \ifx\HOLOGO@name\relax
+ \expandafter\chardef\csname HOLOGOOPT@#1\endcsname=\ltx@one
+ \else
+ \expandafter\chardef\csname
+ HoLogoOpt@#1@\HOLOGO@name\endcsname\ltx@one
+ \fi
+ \HOLOGO@SetBreakAll{#1}%
+ \else
+ \ifx\HOLOGO@temp\HOLOGO@false
+ \ifx\HOLOGO@name\relax
+ \expandafter\chardef\csname HOLOGOOPT@#1\endcsname=\ltx@zero
+ \else
+ \expandafter\chardef\csname
+ HoLogoOpt@#1@\HOLOGO@name\endcsname=\ltx@zero
+ \fi
+ \HOLOGO@SetBreakAll{#1}%
+ \else
+ \@PackageError{hologo}{%
+ Unknown value `##1' for boolean option `#1'.\MessageBreak
+ Known values are `true' and `false'%
+ }\@ehc
+ \fi
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@SetBreakAll}
+% \begin{macrocode}
+\def\HOLOGO@SetBreakAll#1{%
+ \def\HOLOGO@temp{#1}%
+ \ifx\HOLOGO@temp\HOLOGO@break
+ \ifx\HOLOGO@name\relax
+ \chardef\HOLOGOOPT@hyphenbreak=\HOLOGOOPT@break
+ \chardef\HOLOGOOPT@spacebreak=\HOLOGOOPT@break
+ \chardef\HOLOGOOPT@discretionarybreak=\HOLOGOOPT@break
+ \else
+ \expandafter\chardef
+ \csname HoLogoOpt@hyphenbreak@\HOLOGO@name\endcsname=%
+ \csname HoLogoOpt@break@\HOLOGO@name\endcsname
+ \expandafter\chardef
+ \csname HoLogoOpt@spacebreak@\HOLOGO@name\endcsname=%
+ \csname HoLogoOpt@break@\HOLOGO@name\endcsname
+ \expandafter\chardef
+ \csname HoLogoOpt@discretionarybreak@\HOLOGO@name
+ \endcsname=%
+ \csname HoLogoOpt@break@\HOLOGO@name\endcsname
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@true}
+% \begin{macrocode}
+\def\HOLOGO@true{true}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOLOGO@false}
+% \begin{macrocode}
+\def\HOLOGO@false{false}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOLOGO@break}
+% \begin{macrocode}
+\def\HOLOGO@break{break}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\HOLOGO@DeclareBoolOption{break}
+\HOLOGO@DeclareBoolOption{hyphenbreak}
+\HOLOGO@DeclareBoolOption{spacebreak}
+\HOLOGO@DeclareBoolOption{discretionarybreak}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\kv@define@key{HoLogo}{variant}{%
+ \ifx\HOLOGO@name\relax
+ \@PackageError{hologo}{%
+ Option `variant' is not available in \string\hologoSetup,%
+ \MessageBreak
+ Use \string\hologoLogoSetup\space instead%
+ }\@ehc
+ \else
+ \edef\HOLOGO@temp{#1}%
+ \ifx\HOLOGO@temp\ltx@empty
+ \expandafter
+ \let\csname HoLogoOpt@variant@\HOLOGO@name\endcsname\@undefined
+ \else
+ \ltx@IfUndefined{HoLogo@\HOLOGO@name @\HOLOGO@temp}{%
+ \@PackageError{hologo}{%
+ Unknown variant `\HOLOGO@temp' of logo `\HOLOGO@name'%
+ }\@ehc
+ }{%
+ \expandafter
+ \let\csname HoLogoOpt@variant@\HOLOGO@name\endcsname
+ \HOLOGO@temp
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macro}{\HOLOGO@Variant}
+% \begin{macrocode}
+\def\HOLOGO@Variant#1{%
+ #1%
+ \ltx@ifundefined{HoLogoOpt@variant@#1}{%
+ }{%
+ @\csname HoLogoOpt@variant@#1\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Break/no-break support}
+%
+% \begin{macro}{\HOLOGO@space}
+% \begin{macrocode}
+\def\HOLOGO@space{%
+ \ltx@ifundefined{HoLogoOpt@spacebreak@\HOLOGO@name}{%
+ \ltx@ifundefined{HoLogoOpt@break@\HOLOGO@name}{%
+ \chardef\HOLOGO@temp=\HOLOGOOPT@spacebreak
+ }{%
+ \chardef\HOLOGO@temp=%
+ \csname HoLogoOpt@break@\HOLOGO@name\endcsname
+ }%
+ }{%
+ \chardef\HOLOGO@temp=%
+ \csname HoLogoOpt@spacebreak@\HOLOGO@name\endcsname
+ }%
+ \ifcase\HOLOGO@temp
+ \penalty10000 %
+ \fi
+ \ltx@space
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@hyphen}
+% \begin{macrocode}
+\def\HOLOGO@hyphen{%
+ \ltx@ifundefined{HoLogoOpt@hyphenbreak@\HOLOGO@name}{%
+ \ltx@ifundefined{HoLogoOpt@break@\HOLOGO@name}{%
+ \chardef\HOLOGO@temp=\HOLOGOOPT@hyphenbreak
+ }{%
+ \chardef\HOLOGO@temp=%
+ \csname HoLogoOpt@break@\HOLOGO@name\endcsname
+ }%
+ }{%
+ \chardef\HOLOGO@temp=%
+ \csname HoLogoOpt@hyphenbreak@\HOLOGO@name\endcsname
+ }%
+ \ifcase\HOLOGO@temp
+ \ltx@mbox{-}%
+ \else
+ -%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@discretionary}
+% \begin{macrocode}
+\def\HOLOGO@discretionary{%
+ \ltx@ifundefined{HoLogoOpt@discretionarybreak@\HOLOGO@name}{%
+ \ltx@ifundefined{HoLogoOpt@break@\HOLOGO@name}{%
+ \chardef\HOLOGO@temp=\HOLOGOOPT@discretionarybreak
+ }{%
+ \chardef\HOLOGO@temp=%
+ \csname HoLogoOpt@break@\HOLOGO@name\endcsname
+ }%
+ }{%
+ \chardef\HOLOGO@temp=%
+ \csname HoLogoOpt@discretionarybreak@\HOLOGO@name\endcsname
+ }%
+ \ifcase\HOLOGO@temp
+ \else
+ \-%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@mbox}
+% \begin{macrocode}
+\def\HOLOGO@mbox#1{%
+ \ltx@ifundefined{HoLogoOpt@break@\HOLOGO@name}{%
+ \chardef\HOLOGO@temp=\HOLOGOOPT@hyphenbreak
+ }{%
+ \chardef\HOLOGO@temp=%
+ \csname HoLogoOpt@break@\HOLOGO@name\endcsname
+ }%
+ \ifcase\HOLOGO@temp
+ \ltx@mbox{#1}%
+ \else
+ #1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Font support}
+%
+% \begin{macro}{\HoLogoFont@font}
+% \begin{tabular}{@{}ll@{}}
+% |#1|:& logo name\\
+% |#2|:& font short name\\
+% |#3|:& text
+% \end{tabular}
+% \begin{macrocode}
+\def\HoLogoFont@font#1#2#3{%
+ \begingroup
+ \ltx@IfUndefined{HoLogoFont@logo@#1.#2}{%
+ \ltx@IfUndefined{HoLogoFont@font@#2}{%
+ \@PackageWarning{hologo}{%
+ Missing font `#2' for logo `#1'%
+ }%
+ #3%
+ }{%
+ \csname HoLogoFont@font@#2\endcsname{#3}%
+ }%
+ }{%
+ \csname HoLogoFont@logo@#1.#2\endcsname{#3}%
+ }%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoFont@Def}
+% \begin{macrocode}
+\def\HoLogoFont@Def#1{%
+ \expandafter\def\csname HoLogoFont@font@#1\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoFont@LogoDef}
+% \begin{macrocode}
+\def\HoLogoFont@LogoDef#1#2{%
+ \expandafter\def\csname HoLogoFont@logo@#1.#2\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Font defaults}
+%
+% \begin{macro}{\HoLogoFont@font@general}
+% \begin{macrocode}
+\HoLogoFont@Def{general}{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoFont@font@rm}
+% \begin{macrocode}
+\ltx@IfUndefined{rmfamily}{%
+ \ltx@IfUndefined{rm}{%
+ }{%
+ \HoLogoFont@Def{rm}{\rm}%
+ }%
+}{%
+ \HoLogoFont@Def{rm}{\rmfamily}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoFont@font@sf}
+% \begin{macrocode}
+\ltx@IfUndefined{sffamily}{%
+ \ltx@IfUndefined{sf}{%
+ }{%
+ \HoLogoFont@Def{sf}{\sf}%
+ }%
+}{%
+ \HoLogoFont@Def{sf}{\sffamily}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoFont@font@bibsf}
+% In case of \hologo{plainTeX} the original small caps
+% variant is used as default. In \hologo{LaTeX}
+% the definition of package \xpackage{dtklogos} \cite{dtklogos}
+% is used.
+%\begin{quote}
+%\begin{verbatim}
+%\DeclareRobustCommand{\BibTeX}{%
+% B%
+% \kern-.05em%
+% \hbox{%
+% $\m@th$% %% force math size calculations
+% \csname S@\f@size\endcsname
+% \fontsize\sf@size\z@
+% \math@fontsfalse
+% \selectfont
+% I%
+% \kern-.025em%
+% B
+% }%
+% \kern-.08em%
+% \-%
+% \TeX
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\ltx@IfUndefined{selectfont}{%
+ \ltx@IfUndefined{tensc}{%
+ \font\tensc=cmcsc10\relax
+ }{}%
+ \HoLogoFont@Def{bibsf}{\tensc}%
+}{%
+ \HoLogoFont@Def{bibsf}{%
+ $\mathsurround=0pt$%
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size{0pt}%
+ \math@fontsfalse
+ \selectfont
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoFont@font@sc}
+% \begin{macrocode}
+\ltx@IfUndefined{scshape}{%
+ \ltx@IfUndefined{tensc}{%
+ \font\tensc=cmcsc10\relax
+ }{}%
+ \HoLogoFont@Def{sc}{\tensc}%
+}{%
+ \HoLogoFont@Def{sc}{\scshape}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoFont@font@sy}
+% \begin{macrocode}
+\ltx@IfUndefined{usefont}{%
+ \ltx@IfUndefined{tensy}{%
+ }{%
+ \HoLogoFont@Def{sy}{\tensy}%
+ }%
+}{%
+ \HoLogoFont@Def{sy}{%
+ \usefont{OMS}{cmsy}{m}{n}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoFont@font@logo}
+% \begin{macrocode}
+\begingroup
+ \def\x{LaTeX2e}%
+\expandafter\endgroup
+\ifx\fmtname\x
+ \ltx@IfUndefined{logofamily}{%
+ \DeclareRobustCommand\logofamily{%
+ \not@math@alphabet\logofamily\relax
+ \fontencoding{U}%
+ \fontfamily{logo}%
+ \selectfont
+ }%
+ }{}%
+ \ltx@IfUndefined{logofamily}{%
+ }{%
+ \HoLogoFont@Def{logo}{\logofamily}%
+ }%
+\else
+ \ltx@IfUndefined{tenlogo}{%
+ \font\tenlogo=logo10\relax
+ }{}%
+ \HoLogoFont@Def{logo}{\tenlogo}%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Font setup}
+%
+% \begin{macro}{\hologoFontSetup}
+% \begin{macrocode}
+\def\hologoFontSetup{%
+ \let\HOLOGO@name\relax
+ \HOLOGO@FontSetup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hologoLogoFontSetup}
+% \begin{macrocode}
+\def\hologoLogoFontSetup#1{%
+ \edef\HOLOGO@name{#1}%
+ \ltx@IfUndefined{HoLogo@\HOLOGO@name}{%
+ \@PackageError{hologo}{%
+ Unknown logo `\HOLOGO@name'%
+ }\@ehc
+ \ltx@gobble
+ }{%
+ \HOLOGO@FontSetup
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@FontSetup}
+% \begin{macrocode}
+\def\HOLOGO@FontSetup{%
+ \kvsetkeys{HoLogoFont}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\HOLOGO@temp#1{%
+ \kv@define@key{HoLogoFont}{#1}{%
+ \ifx\HOLOGO@name\relax
+ \HoLogoFont@Def{#1}{##1}%
+ \else
+ \HoLogoFont@LogoDef\HOLOGO@name{#1}{##1}%
+ \fi
+ }%
+}
+\HOLOGO@temp{general}
+\HOLOGO@temp{sf}
+% \end{macrocode}
+%
+% \subsection{Generic logo commands}
+%
+% \begin{macrocode}
+\HOLOGO@IfExists\hologo{%
+ \@PackageError{hologo}{%
+ \string\hologo\ltx@space is already defined.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \HOLOGO@AtEnd
+}%
+\HOLOGO@IfExists\hologoRobust{%
+ \@PackageError{hologo}{%
+ \string\hologoRobust\ltx@space is already defined.\MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \HOLOGO@AtEnd
+}%
+% \end{macrocode}
+%
+% \subsubsection{\cs{hologo} and friends}
+%
+% \begin{macrocode}
+\ifluatex
+ \expandafter\ltx@firstofone
+\else
+ \expandafter\ltx@gobble
+\fi
+{%
+ \ltx@IfUndefined{ifincsname}{%
+ \ifnum\luatexversion<36 %
+ \expandafter\ltx@gobble
+ \else
+ \expandafter\ltx@firstofone
+ \fi
+ {%
+ \begingroup
+ \ifcase0%
+ \directlua{%
+ if tex.enableprimitives then %
+ tex.enableprimitives('HOLOGO@', {'ifincsname'})%
+ else %
+ tex.print('1')%
+ end%
+ }%
+ \ifx\HOLOGO@ifincsname\@undefined 1\fi%
+ \relax
+ \expandafter\ltx@firstofone
+ \else
+ \endgroup
+ \expandafter\ltx@gobble
+ \fi
+ {%
+ \global\let\ifincsname\HOLOGO@ifincsname
+ }%
+ \HOLOGO@temp
+ }%
+ }{}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\ltx@IfUndefined{ifincsname}{%
+ \catcode`$=14 %
+}{%
+ \catcode`$=9 %
+}
+% \end{macrocode}
+%
+% \begin{macro}{\hologo}
+% \begin{macrocode}
+\def\hologo#1{%
+$ \ifincsname
+$ \ltx@ifundefined{HoLogoCs@\HOLOGO@Variant{#1}}{%
+$ #1%
+$ }{%
+$ \csname HoLogoCs@\HOLOGO@Variant{#1}\endcsname\ltx@firstoftwo
+$ }%
+$ \else
+ \HOLOGO@IfExists\texorpdfstring\texorpdfstring\ltx@firstoftwo
+ {%
+ \hologoRobust{#1}%
+ }{%
+ \ltx@ifundefined{HoLogoBkm@\HOLOGO@Variant{#1}}{%
+ \ltx@ifundefined{HoLogo@#1}{?#1?}{#1}%
+ }{%
+ \csname HoLogoBkm@\HOLOGO@Variant{#1}\endcsname
+ \ltx@firstoftwo
+ }%
+ }%
+$ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Hologo}
+% \begin{macrocode}
+\def\Hologo#1{%
+$ \ifincsname
+$ \ltx@ifundefined{HoLogoCs@\HOLOGO@Variant{#1}}{%
+$ #1%
+$ }{%
+$ \csname HoLogoCs@\HOLOGO@Variant{#1}\endcsname\ltx@secondoftwo
+$ }%
+$ \else
+ \HOLOGO@IfExists\texorpdfstring\texorpdfstring\ltx@firstoftwo
+ {%
+ \HologoRobust{#1}%
+ }{%
+ \ltx@ifundefined{HoLogoBkm@\HOLOGO@Variant{#1}}{%
+ \ltx@ifundefined{HoLogo@#1}{?#1?}{#1}%
+ }{%
+ \csname HoLogoBkm@\HOLOGO@Variant{#1}\endcsname
+ \ltx@secondoftwo
+ }%
+ }%
+$ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hologoVariant}
+% \begin{macrocode}
+\def\hologoVariant#1#2{%
+ \ifx\relax#2\relax
+ \hologo{#1}%
+ \else
+$ \ifincsname
+$ \ltx@ifundefined{HoLogoCs@#1@#2}{%
+$ #1%
+$ }{%
+$ \csname HoLogoCs@#1@#2\endcsname\ltx@firstoftwo
+$ }%
+$ \else
+ \HOLOGO@IfExists\texorpdfstring\texorpdfstring\ltx@firstoftwo
+ {%
+ \hologoVariantRobust{#1}{#2}%
+ }{%
+ \ltx@ifundefined{HoLogoBkm@#1@#2}{%
+ \ltx@ifundefined{HoLogo@#1}{?#1?}{#1}%
+ }{%
+ \csname HoLogoBkm@#1@#2\endcsname
+ \ltx@firstoftwo
+ }%
+ }%
+$ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HologoVariant}
+% \begin{macrocode}
+\def\HologoVariant#1#2{%
+ \ifx\relax#2\relax
+ \Hologo{#1}%
+ \else
+$ \ifincsname
+$ \ltx@ifundefined{HoLogoCs@#1@#2}{%
+$ #1%
+$ }{%
+$ \csname HoLogoCs@#1@#2\endcsname\ltx@secondoftwo
+$ }%
+$ \else
+ \HOLOGO@IfExists\texorpdfstring\texorpdfstring\ltx@firstoftwo
+ {%
+ \HologoVariantRobust{#1}{#2}%
+ }{%
+ \ltx@ifundefined{HoLogoBkm@#1@#2}{%
+ \ltx@ifundefined{HoLogo@#1}{?#1?}{#1}%
+ }{%
+ \csname HoLogoBkm@#1@#2\endcsname
+ \ltx@secondoftwo
+ }%
+ }%
+$ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\catcode`\$=3 %
+% \end{macrocode}
+%
+% \subsubsection{\cs{hologoRobust} and friends}
+%
+% \begin{macro}{\hologoRobust}
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\hologoRobust#1%
+ }{%
+ \DeclareRobustCommand*\hologoRobust[1]%
+ }%
+}{%
+ \protected\def\hologoRobust#1%
+}%
+{%
+ \edef\HOLOGO@name{#1}%
+ \ltx@IfUndefined{HoLogo@\HOLOGO@Variant\HOLOGO@name}{%
+ \@PackageError{hologo}{%
+ Unknown logo `\HOLOGO@name'%
+ }\@ehc
+ ?\HOLOGO@name?%
+ }{%
+ \ltx@IfUndefined{ver@tex4ht.sty}{%
+ \HoLogoFont@font\HOLOGO@name{general}{%
+ \csname HoLogo@\HOLOGO@Variant\HOLOGO@name\endcsname
+ \ltx@firstoftwo
+ }%
+ }{%
+ \ltx@IfUndefined{HoLogoHtml@\HOLOGO@Variant\HOLOGO@name}{%
+ \HOLOGO@name
+ }{%
+ \csname HoLogoHtml@\HOLOGO@Variant\HOLOGO@name\endcsname
+ \ltx@firstoftwo
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HologoRobust}
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\HologoRobust#1%
+ }{%
+ \DeclareRobustCommand*\HologoRobust[1]%
+ }%
+}{%
+ \protected\def\HologoRobust#1%
+}%
+{%
+ \edef\HOLOGO@name{#1}%
+ \ltx@IfUndefined{HoLogo@\HOLOGO@Variant\HOLOGO@name}{%
+ \@PackageError{hologo}{%
+ Unknown logo `\HOLOGO@name'%
+ }\@ehc
+ ?\HOLOGO@name?%
+ }{%
+ \ltx@IfUndefined{ver@tex4ht.sty}{%
+ \HoLogoFont@font\HOLOGO@name{general}{%
+ \csname HoLogo@\HOLOGO@Variant\HOLOGO@name\endcsname
+ \ltx@secondoftwo
+ }%
+ }{%
+ \ltx@IfUndefined{HoLogoHtml@\HOLOGO@Variant\HOLOGO@name}{%
+ \expandafter\HOLOGO@Uppercase\HOLOGO@name
+ }{%
+ \csname HoLogoHtml@\HOLOGO@Variant\HOLOGO@name\endcsname
+ \ltx@secondoftwo
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\hologoVariantRobust}
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\hologoVariantRobust#1#2%
+ }{%
+ \DeclareRobustCommand*\hologoVariantRobust[2]%
+ }%
+}{%
+ \protected\def\hologoVariantRobust#1#2%
+}%
+{%
+ \begingroup
+ \hologoLogoSetup{#1}{variant={#2}}%
+ \hologoRobust{#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HologoVariantRobust}
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\HologoVariantRobust#1#2%
+ }{%
+ \DeclareRobustCommand*\HologoVariantRobust[2]%
+ }%
+}{%
+ \protected\def\HologoVariantRobust#1#2%
+}%
+{%
+ \begingroup
+ \hologoLogoSetup{#1}{variant={#2}}%
+ \HologoRobust{#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hologorobust}
+% Macro \cs{hologorobust} is only defined for compatibility.
+% Its use is deprecated.
+% \begin{macrocode}
+\def\hologorobust{\hologoRobust}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Helpers}
+%
+% \begin{macro}{\HOLOGO@Uppercase}
+% Macro \cs{HOLOGO@Uppercase} is restricted to \cs{uppercase},
+% because \hologo{plainTeX} or \hologo{iniTeX} do not provide
+% \cs{MakeUppercase}.
+% \begin{macrocode}
+\def\HOLOGO@Uppercase#1{\uppercase{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@PdfdocUnicode}
+% \begin{macrocode}
+\def\HOLOGO@PdfdocUnicode{%
+ \ifx\ifHy@unicode\iftrue
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@Math}
+% \begin{macrocode}
+\def\HOLOGO@MathSetup{%
+ \mathsurround0pt\relax
+ \HOLOGO@IfExists\f@series{%
+ \if b\expandafter\ltx@car\f@series x\@nil
+ \csname boldmath\endcsname
+ \fi
+ }{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@TempDimen}
+% \begin{macrocode}
+\dimendef\HOLOGO@TempDimen=\ltx@zero
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOLOGO@NegativeKerning}
+% \begin{macrocode}
+\def\HOLOGO@NegativeKerning#1{%
+ \begingroup
+ \HOLOGO@TempDimen=0pt\relax
+ \comma@parse@normalized{#1}{%
+ \ifdim\HOLOGO@TempDimen=0pt %
+ \expandafter\HOLOGO@@NegativeKerning\comma@entry
+ \fi
+ \ltx@gobble
+ }%
+ \ifdim\HOLOGO@TempDimen<0pt %
+ \kern\HOLOGO@TempDimen
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOLOGO@@NegativeKerning}
+% \begin{macrocode}
+\def\HOLOGO@@NegativeKerning#1#2{%
+ \setbox\ltx@zero\hbox{#1#2}%
+ \HOLOGO@TempDimen=\wd\ltx@zero
+ \setbox\ltx@zero\hbox{#1\kern0pt#2}%
+ \advance\HOLOGO@TempDimen by -\wd\ltx@zero
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@SpaceFactor}
+% \begin{macrocode}
+\def\HOLOGO@SpaceFactor{%
+ \spacefactor1000 %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@Span}
+% \begin{macrocode}
+\def\HOLOGO@Span#1#2{%
+ \HCode{<span class="HoLogo-#1">}%
+ #2%
+ \HCode{</span>}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Text subscript}
+%
+% \begin{macro}{\HOLOGO@SubScript}%
+% \begin{macrocode}
+\def\HOLOGO@SubScript#1{%
+ \ltx@IfUndefined{textsubscript}{%
+ \ltx@IfUndefined{text}{%
+ \ltx@mbox{%
+ \mathsurround=0pt\relax
+ $%
+ _{%
+ \ltx@IfUndefined{sf@size}{%
+ \mathrm{#1}%
+ }{%
+ \mbox{%
+ \fontsize\sf@size{0pt}\selectfont
+ #1%
+ }%
+ }%
+ }%
+ $%
+ }%
+ }{%
+ \ltx@mbox{%
+ \mathsurround=0pt\relax
+ $_{\text{#1}}$%
+ }%
+ }%
+ }{%
+ \textsubscript{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\hologo{TeX} and friends}
+%
+% \subsubsection{\hologo{TeX}}
+%
+% \begin{macro}{\HoLogo@TeX}
+% Source: \hologo{LaTeX} kernel.
+% \begin{macrocode}
+\def\HoLogo@TeX#1{%
+ T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\HOLOGO@SpaceFactor
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@TeX}
+% \begin{macrocode}
+\def\HoLogoHtml@TeX#1{%
+ \HoLogoCss@TeX
+ \HOLOGO@Span{TeX}{%
+ T%
+ \HOLOGO@Span{e}{%
+ E%
+ }%
+ X%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@TeX}
+% \begin{macrocode}
+\def\HoLogoCss@TeX{%
+ \Css{%
+ span.HoLogo-TeX span.HoLogo-e{%
+ position:relative;%
+ top:.5ex;%
+ margin-left:-.1667em;%
+ margin-right:-.125em;%
+ }%
+ }%
+ \Css{%
+ a span.HoLogo-TeX span.HoLogo-e{%
+ text-decoration:none;%
+ }%
+ }%
+ \global\let\HoLogoCss@TeX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{plainTeX}}
+%
+% \begin{macro}{\HoLogo@plainTeX@space}
+% Source: ``The \hologo{TeX}book''
+% \begin{macrocode}
+\def\HoLogo@plainTeX@space#1{%
+ \HOLOGO@mbox{#1{p}{P}lain}\HOLOGO@space\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@plainTeX@space}
+% \begin{macrocode}
+\def\HoLogoCs@plainTeX@space#1{#1{p}{P}lain TeX}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@plainTeX@space}
+% \begin{macrocode}
+\def\HoLogoBkm@plainTeX@space#1{%
+ #1{p}{P}lain \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@plainTeX@space}
+% \begin{macrocode}
+\def\HoLogoHtml@plainTeX@space#1{%
+ #1{p}{P}lain \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@plainTeX@hyphen}
+% \begin{macrocode}
+\def\HoLogo@plainTeX@hyphen#1{%
+ \HOLOGO@mbox{#1{p}{P}lain}\HOLOGO@hyphen\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@plainTeX@hyphen}
+% \begin{macrocode}
+\def\HoLogoCs@plainTeX@hyphen#1{#1{p}{P}lain-TeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@plainTeX@hyphen}
+% \begin{macrocode}
+\def\HoLogoBkm@plainTeX@hyphen#1{%
+ #1{p}{P}lain-\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@plainTeX@hyphen}
+% \begin{macrocode}
+\def\HoLogoHtml@plainTeX@hyphen#1{%
+ #1{p}{P}lain-\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@plainTeX@runtogether}
+% \begin{macrocode}
+\def\HoLogo@plainTeX@runtogether#1{%
+ \HOLOGO@mbox{#1{p}{P}lain\hologo{TeX}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@plainTeX@runtogether}
+% \begin{macrocode}
+\def\HoLogoCs@plainTeX@runtogether#1{#1{p}{P}lainTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@plainTeX@runtogether}
+% \begin{macrocode}
+\def\HoLogoBkm@plainTeX@runtogether#1{%
+ #1{p}{P}lain\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@plainTeX@runtogether}
+% \begin{macrocode}
+\def\HoLogoHtml@plainTeX@runtogether#1{%
+ #1{p}{P}lain\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@plainTeX}
+% \begin{macrocode}
+\def\HoLogo@plainTeX{\HoLogo@plainTeX@space}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@plainTeX}
+% \begin{macrocode}
+\def\HoLogoCs@plainTeX{\HoLogoCs@plainTeX@space}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@plainTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@plainTeX{\HoLogoBkm@plainTeX@space}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@plainTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@plainTeX{\HoLogoHtml@plainTeX@space}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{LaTeX}}
+%
+% Source: \hologo{LaTeX} kernel.
+%\begin{quote}
+%\begin{verbatim}
+%\DeclareRobustCommand{\LaTeX}{%
+% L%
+% \kern-.36em%
+% {%
+% \sbox\z@ T%
+% \vbox to\ht\z@{%
+% \hbox{%
+% \check@mathfonts
+% \fontsize\sf@size\z@
+% \math@fontsfalse
+% \selectfont
+% A%
+% }%
+% \vss
+% }%
+% }%
+% \kern-.15em%
+% \TeX
+%}
+%\end{verbatim}
+%\end{quote}
+%
+% \begin{macro}{\HoLogo@La}
+% \begin{macrocode}
+\def\HoLogo@La#1{%
+ L%
+ \kern-.36em%
+ \begingroup
+ \setbox\ltx@zero\hbox{T}%
+ \vbox to\ht\ltx@zero{%
+ \hbox{%
+ \ltx@ifundefined{check@mathfonts}{%
+ \csname sevenrm\endcsname
+ }{%
+ \check@mathfonts
+ \fontsize\sf@size{0pt}%
+ \math@fontsfalse\selectfont
+ }%
+ A%
+ }%
+ \vss
+ }%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@LaTeX}
+% Source: \hologo{LaTeX} kernel.
+% \begin{macrocode}
+\def\HoLogo@LaTeX#1{%
+ \hologo{La}%
+ \kern-.15em%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@LaTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@LaTeX#1{%
+ \HoLogoCss@LaTeX
+ \HOLOGO@Span{LaTeX}{%
+ L%
+ \HOLOGO@Span{a}{%
+ A%
+ }%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@LaTeX}
+% \begin{macrocode}
+\def\HoLogoCss@LaTeX{%
+ \Css{%
+ span.HoLogo-LaTeX span.HoLogo-a{%
+ position:relative;%
+ top:-.5ex;%
+ margin-left:-.36em;%
+ margin-right:-.15em;%
+ font-size:85\%;%
+ }%
+ }%
+ \global\let\HoLogoCss@LaTeX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{(La)TeX}}
+%
+% \begin{macro}{\HoLogo@LaTeXTeX}
+% The kerning around the parentheses is taken
+% from package \xpackage{dtklogos} \cite{dtklogos}.
+%\begin{quote}
+%\begin{verbatim}
+%\DeclareRobustCommand{\LaTeXTeX}{%
+% (%
+% \kern-.15em%
+% L%
+% \kern-.36em%
+% {%
+% \sbox\z@ T%
+% \vbox to\ht0{%
+% \hbox{%
+% $\m@th$%
+% \csname S@\f@size\endcsname
+% \fontsize\sf@size\z@
+% \math@fontsfalse
+% \selectfont
+% A%
+% }%
+% \vss
+% }%
+% }%
+% \kern-.2em%
+% )%
+% \kern-.15em%
+% \TeX
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\def\HoLogo@LaTeXTeX#1{%
+ (%
+ \kern-.15em%
+ \hologo{La}%
+ \kern-.2em%
+ )%
+ \kern-.15em%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@LaTeXTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@LaTeXTeX#1{(La)TeX}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@(La)TeX}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogo@(La)TeX\endcsname\HoLogo@LaTeXTeX
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@(La)TeX}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogoBkm@(La)TeX\endcsname\HoLogoBkm@LaTeXTeX
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@LaTeXTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@LaTeXTeX#1{%
+ \HoLogoCss@LaTeXTeX
+ \HOLOGO@Span{LaTeXTeX}{%
+ (%
+ \HOLOGO@Span{L}{L}%
+ \HOLOGO@Span{a}{A}%
+ \HOLOGO@Span{ParenRight}{)}%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@(La)TeX}
+% Kerning after opening parentheses and before closing parentheses
+% is $-0.1$\,em. The original values $-0.15$\,em
+% looked too ugly for a serif font.
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogoHtml@(La)TeX\endcsname\HoLogoHtml@LaTeXTeX
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@LaTeXTeX}
+% \begin{macrocode}
+\def\HoLogoCss@LaTeXTeX{%
+ \Css{%
+ span.HoLogo-LaTeXTeX span.HoLogo-L{%
+ margin-left:-.1em;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-LaTeXTeX span.HoLogo-a{%
+ position:relative;%
+ top:-.5ex;%
+ margin-left:-.36em;%
+ margin-right:-.1em;%
+ font-size:85\%;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-LaTeXTeX span.HoLogo-ParenRight{%
+ margin-right:-.15em;%
+ }%
+ }%
+ \global\let\HoLogoCss@LaTeXTeX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{LaTeXe}}
+%
+% \begin{macro}{\HoLogo@LaTeXe}
+% Source: \hologo{LaTeX} kernel
+% \begin{macrocode}
+\def\HoLogo@LaTeXe#1{%
+ \hologo{LaTeX}%
+ \kern.15em%
+ \hbox{%
+ \HOLOGO@MathSetup
+ 2%
+ $_{\textstyle\varepsilon}$%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoCs@LaTeXe}
+% \begin{macrocode}
+\ifnum64=`\^^^^0040\relax % test for big chars of LuaTeX/XeTeX
+ \catcode`\$=9 %
+ \catcode`\&=14 %
+\else
+ \catcode`\$=14 %
+ \catcode`\&=9 %
+\fi
+\def\HoLogoCs@LaTeXe#1{%
+ LaTeX2%
+$ \string ^^^^0395%
+& e%
+}%
+\catcode`\$=3 %
+\catcode`\&=4 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoBkm@LaTeXe}
+% \begin{macrocode}
+\def\HoLogoBkm@LaTeXe#1{%
+ \hologo{LaTeX}%
+ 2%
+ \HOLOGO@PdfdocUnicode{e}{\textepsilon}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoHtml@LaTeXe}
+% \begin{macrocode}
+\def\HoLogoHtml@LaTeXe#1{%
+ \HoLogoCss@LaTeXe
+ \HOLOGO@Span{LaTeX2e}{%
+ \hologo{LaTeX}%
+ \HOLOGO@Span{2}{2}%
+ \HOLOGO@Span{e}{%
+ \HOLOGO@MathSetup
+ \ensuremath{\textstyle\varepsilon}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@LaTeXe}
+% \begin{macrocode}
+\def\HoLogoCss@LaTeXe{%
+ \Css{%
+ span.HoLogo-LaTeX2e span.HoLogo-2{%
+ padding-left:.15em;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-LaTeX2e span.HoLogo-e{%
+ position:relative;%
+ top:.35ex;%
+ text-decoration:none;%
+ }%
+ }%
+ \global\let\HoLogoCss@LaTeXe\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@LaTeX2e}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogo@LaTeX2e\endcsname\HoLogo@LaTeXe
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@LaTeX2e}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogoCs@LaTeX2e\endcsname\HoLogoCs@LaTeXe
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@LaTeX2e}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogoBkm@LaTeX2e\endcsname\HoLogoBkm@LaTeXe
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@LaTeX2e}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogoHtml@LaTeX2e\endcsname\HoLogoHtml@LaTeXe
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{LaTeX3}}
+%
+% \begin{macro}{\HoLogo@LaTeX3}
+% Source: \hologo{LaTeX} kernel
+% \begin{macrocode}
+\expandafter\def\csname HoLogo@LaTeX3\endcsname#1{%
+ \hologo{LaTeX}%
+ 3%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoBkm@LaTeX3}
+% \begin{macrocode}
+\expandafter\def\csname HoLogoBkm@LaTeX3\endcsname#1{%
+ \hologo{LaTeX}%
+ 3%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@LaTeX3}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogoHtml@LaTeX3\expandafter\endcsname
+\csname HoLogo@LaTeX3\endcsname
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{LaTeXML}}
+%
+% \begin{macro}{\HoLogo@LaTeXML}
+% \begin{macrocode}
+\def\HoLogo@LaTeXML#1{%
+ \HOLOGO@mbox{%
+ \hologo{La}%
+ \kern-.15em%
+ T%
+ \kern-.1667em%
+ \lower.5ex\hbox{E}%
+ \kern-.125em%
+ \HoLogoFont@font{LaTeXML}{sc}{xml}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@pdfLaTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@LaTeXML#1{%
+ \HOLOGO@Span{LaTeXML}{%
+ \HoLogoCss@LaTeX
+ \HoLogoCss@TeX
+ \HOLOGO@Span{LaTeX}{%
+ L%
+ \HOLOGO@Span{a}{%
+ A%
+ }%
+ }%
+ \HOLOGO@Span{TeX}{%
+ T%
+ \HOLOGO@Span{e}{%
+ E%
+ }%
+ }%
+ \HCode{<span style="font-variant: small-caps;">}%
+ xml%
+ \HCode{</span>}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{eTeX}}
+%
+% \begin{macro}{\HoLogo@eTeX}
+% Source: package \xpackage{etex}
+% \begin{macrocode}
+\def\HoLogo@eTeX#1{%
+ \ltx@mbox{%
+ \HOLOGO@MathSetup
+ $\varepsilon$%
+ -%
+ \HOLOGO@NegativeKerning{-T,T-,To}%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@eTeX}
+% \begin{macrocode}
+\ifnum64=`\^^^^0040\relax % test for big chars of LuaTeX/XeTeX
+ \catcode`\$=9 %
+ \catcode`\&=14 %
+\else
+ \catcode`\$=14 %
+ \catcode`\&=9 %
+\fi
+\def\HoLogoCs@eTeX#1{%
+$ #1{\string ^^^^0395}{\string ^^^^03b5}%
+& #1{e}{E}%
+ TeX%
+}%
+\catcode`\$=3 %
+\catcode`\&=4 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@eTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@eTeX#1{%
+ \HOLOGO@PdfdocUnicode{#1{e}{E}}{\textepsilon}%
+ -%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@eTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@eTeX#1{%
+ \ltx@mbox{%
+ \HOLOGO@MathSetup
+ $\varepsilon$%
+ -%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{iniTeX}}
+%
+% \begin{macro}{\HoLogo@iniTeX}
+% \begin{macrocode}
+\def\HoLogo@iniTeX#1{%
+ \HOLOGO@mbox{%
+ #1{i}{I}ni\hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@iniTeX}
+% \begin{macrocode}
+\def\HoLogoCs@iniTeX#1{#1{i}{I}niTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@iniTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@iniTeX#1{%
+ #1{i}{I}ni\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@iniTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@iniTeX\HoLogo@iniTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{virTeX}}
+%
+% \begin{macro}{\HoLogo@virTeX}
+% \begin{macrocode}
+\def\HoLogo@virTeX#1{%
+ \HOLOGO@mbox{%
+ #1{v}{V}ir\hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@virTeX}
+% \begin{macrocode}
+\def\HoLogoCs@virTeX#1{#1{v}{V}irTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@virTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@virTeX#1{%
+ #1{v}{V}ir\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@virTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@virTeX\HoLogo@virTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{SliTeX}}
+%
+% \paragraph{Definitions of the three variants.}
+%
+% \begin{macro}{\HoLogo@SLiTeX@lift}
+% \begin{macrocode}
+\def\HoLogo@SLiTeX@lift#1{%
+ \HoLogoFont@font{SliTeX}{rm}{%
+ S%
+ \kern-.06em%
+ L%
+ \kern-.18em%
+ \raise.32ex\hbox{\HoLogoFont@font{SliTeX}{sc}{i}}%
+ \HOLOGO@discretionary
+ \kern-.06em%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@SLiTeX@lift}
+% \begin{macrocode}
+\def\HoLogoBkm@SLiTeX@lift#1{SLiTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SLiTeX@lift}
+% \begin{macrocode}
+\def\HoLogoHtml@SLiTeX@lift#1{%
+ \HoLogoCss@SLiTeX@lift
+ \HOLOGO@Span{SLiTeX-lift}{%
+ \HoLogoFont@font{SliTeX}{rm}{%
+ S%
+ \HOLOGO@Span{L}{L}%
+ \HOLOGO@Span{i}{i}%
+ \hologo{TeX}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@SLiTeX@lift}
+% \begin{macrocode}
+\def\HoLogoCss@SLiTeX@lift{%
+ \Css{%
+ span.HoLogo-SLiTeX-lift span.HoLogo-L{%
+ margin-left:-.06em;%
+ margin-right:-.18em;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-SLiTeX-lift span.HoLogo-i{%
+ position:relative;%
+ top:-.32ex;%
+ margin-right:-.06em;%
+ font-variant:small-caps;%
+ }%
+ }%
+ \global\let\HoLogoCss@SLiTeX@lift\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@SliTeX@simple}
+% \begin{macrocode}
+\def\HoLogo@SliTeX@simple#1{%
+ \HoLogoFont@font{SliTeX}{rm}{%
+ \ltx@mbox{%
+ \HoLogoFont@font{SliTeX}{sc}{Sli}%
+ }%
+ \HOLOGO@discretionary
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@SliTeX@simple}
+% \begin{macrocode}
+\def\HoLogoBkm@SliTeX@simple#1{SliTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SliTeX@simple}
+% \begin{macrocode}
+\let\HoLogoHtml@SliTeX@simple\HoLogo@SliTeX@simple
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@SliTeX@narrow}
+% \begin{macrocode}
+\def\HoLogo@SliTeX@narrow#1{%
+ \HoLogoFont@font{SliTeX}{rm}{%
+ \ltx@mbox{%
+ S%
+ \kern-.06em%
+ \HoLogoFont@font{SliTeX}{sc}{%
+ l%
+ \kern-.035em%
+ i%
+ }%
+ }%
+ \HOLOGO@discretionary
+ \kern-.06em%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@SliTeX@narrow}
+% \begin{macrocode}
+\def\HoLogoBkm@SliTeX@narrow#1{SliTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SliTeX@narrow}
+% \begin{macrocode}
+\def\HoLogoHtml@SliTeX@narrow#1{%
+ \HoLogoCss@SliTeX@narrow
+ \HOLOGO@Span{SliTeX-narrow}{%
+ \HoLogoFont@font{SliTeX}{rm}{%
+ S%
+ \HOLOGO@Span{l}{l}%
+ \HOLOGO@Span{i}{i}%
+ \hologo{TeX}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@SliTeX@narrow}
+% \begin{macrocode}
+\def\HoLogoCss@SliTeX@narrow{%
+ \Css{%
+ span.HoLogo-SliTeX-narrow span.HoLogo-l{%
+ margin-left:-.06em;%
+ margin-right:-.035em;%
+ font-variant:small-caps;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-SliTeX-narrow span.HoLogo-i{%
+ margin-right:-.06em;%
+ font-variant:small-caps;%
+ }%
+ }%
+ \global\let\HoLogoCss@SliTeX@narrow\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Macro set completion.}
+%
+% \begin{macro}{\HoLogo@SLiTeX@simple}
+% \begin{macrocode}
+\def\HoLogo@SLiTeX@simple{\HoLogo@SliTeX@simple}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@SLiTeX@simple}
+% \begin{macrocode}
+\def\HoLogoBkm@SLiTeX@simple{\HoLogoBkm@SliTeX@simple}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SLiTeX@simple}
+% \begin{macrocode}
+\def\HoLogoHtml@SLiTeX@simple{\HoLogoHtml@SliTeX@simple}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@SLiTeX@narrow}
+% \begin{macrocode}
+\def\HoLogo@SLiTeX@narrow{\HoLogo@SliTeX@narrow}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@SLiTeX@narrow}
+% \begin{macrocode}
+\def\HoLogoBkm@SLiTeX@narrow{\HoLogoBkm@SliTeX@narrow}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SLiTeX@narrow}
+% \begin{macrocode}
+\def\HoLogoHtml@SLiTeX@narrow{\HoLogoHtml@SliTeX@narrow}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@SliTeX@lift}
+% \begin{macrocode}
+\def\HoLogo@SliTeX@lift{\HoLogo@SLiTeX@lift}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@SliTeX@lift}
+% \begin{macrocode}
+\def\HoLogoBkm@SliTeX@lift{\HoLogoBkm@SLiTeX@lift}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SliTeX@lift}
+% \begin{macrocode}
+\def\HoLogoHtml@SliTeX@lift{\HoLogoHtml@SLiTeX@lift}
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Defaults.}
+%
+% \begin{macro}{\HoLogo@SLiTeX}
+% \begin{macrocode}
+\def\HoLogo@SLiTeX{\HoLogo@SLiTeX@lift}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@SLiTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@SLiTeX{\HoLogoBkm@SLiTeX@lift}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SLiTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@SLiTeX{\HoLogoHtml@SLiTeX@lift}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@SliTeX}
+% \begin{macrocode}
+\def\HoLogo@SliTeX{\HoLogo@SliTeX@narrow}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@SliTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@SliTeX{\HoLogoBkm@SliTeX@narrow}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SliTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@SliTeX{\HoLogoHtml@SliTeX@narrow}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{LuaTeX}}
+%
+% \begin{macro}{\HoLogo@LuaTeX}
+% The kerning is an idea of Hans Hagen, see mailing list
+% `luatex at tug dot org' in March 2010.
+% \begin{macrocode}
+\def\HoLogo@LuaTeX#1{%
+ \HOLOGO@mbox{%
+ Lua%
+ \HOLOGO@NegativeKerning{aT,oT,To}%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@LuaTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@LuaTeX\HoLogo@LuaTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{LuaLaTeX}}
+%
+% \begin{macro}{\HoLogo@LuaLaTeX}
+% \begin{macrocode}
+\def\HoLogo@LuaLaTeX#1{%
+ \HOLOGO@mbox{%
+ Lua%
+ \hologo{LaTeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@LuaLaTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@LuaLaTeX\HoLogo@LuaLaTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{XeTeX}, \hologo{XeLaTeX}}
+%
+% \begin{macro}{\HOLOGO@IfCharExists}
+% \begin{macrocode}
+\ifluatex
+ \ifnum\luatexversion<36 %
+ \else
+ \def\HOLOGO@IfCharExists#1{%
+ \ifnum
+ \directlua{%
+ if luaotfload and luaotfload.aux then
+ if luaotfload.aux.font_has_glyph(%
+ font.current(), \number#1) then %
+ tex.print("1") %
+ end %
+ elseif font and font.fonts and font.current then %
+ local f = font.fonts[font.current()]%
+ if f.characters and f.characters[\number#1] then %
+ tex.print("1")%
+ end %
+ end%
+ }0=\ltx@zero
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+ }%
+ \fi
+\fi
+\ltx@IfUndefined{HOLOGO@IfCharExists}{%
+ \def\HOLOGO@@IfCharExists#1{%
+ \begingroup
+ \tracinglostchars=\ltx@zero
+ \setbox\ltx@zero=\hbox{%
+ \kern7sp\char#1\relax
+ \ifnum\lastkern>\ltx@zero
+ \expandafter\aftergroup\csname iffalse\endcsname
+ \else
+ \expandafter\aftergroup\csname iftrue\endcsname
+ \fi
+ }%
+ % \if{true|false} from \aftergroup
+ \endgroup
+ \expandafter\ltx@firstoftwo
+ \else
+ \endgroup
+ \expandafter\ltx@secondoftwo
+ \fi
+ }%
+ \ifxetex
+ \ltx@IfUndefined{XeTeXfonttype}{}{%
+ \ltx@IfUndefined{XeTeXcharglyph}{}{%
+ \def\HOLOGO@IfCharExists#1{%
+ \ifnum\XeTeXfonttype\font>\ltx@zero
+ \expandafter\ltx@firstofthree
+ \else
+ \expandafter\ltx@gobble
+ \fi
+ {%
+ \ifnum\XeTeXcharglyph#1>\ltx@zero
+ \expandafter\ltx@firstoftwo
+ \else
+ \expandafter\ltx@secondoftwo
+ \fi
+ }%
+ \HOLOGO@@IfCharExists{#1}%
+ }%
+ }%
+ }%
+ \fi
+}{}
+\ltx@ifundefined{HOLOGO@IfCharExists}{%
+ \ifnum64=`\^^^^0040\relax % test for big chars of LuaTeX/XeTeX
+ \let\HOLOGO@IfCharExists\HOLOGO@@IfCharExists
+ \else
+ \def\HOLOGO@IfCharExists#1{%
+ \ifnum#1>255 %
+ \expandafter\ltx@fourthoffour
+ \fi
+ \HOLOGO@@IfCharExists{#1}%
+ }%
+ \fi
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@Xe}
+% Source: package \xpackage{dtklogos}
+% \begin{macrocode}
+\def\HoLogo@Xe#1{%
+ X%
+ \kern-.1em\relax
+ \HOLOGO@IfCharExists{"018E}{%
+ \lower.5ex\hbox{\char"018E}%
+ }{%
+ \chardef\HOLOGO@choice=\ltx@zero
+ \ifdim\fontdimen\ltx@one\font>0pt %
+ \ltx@IfUndefined{rotatebox}{%
+ \ltx@IfUndefined{pgftext}{%
+ \ltx@IfUndefined{psscalebox}{%
+ \ltx@IfUndefined{HOLOGO@ScaleBox@\hologoDriver}{%
+ }{%
+ \chardef\HOLOGO@choice=4 %
+ }%
+ }{%
+ \chardef\HOLOGO@choice=3 %
+ }%
+ }{%
+ \chardef\HOLOGO@choice=2 %
+ }%
+ }{%
+ \chardef\HOLOGO@choice=1 %
+ }%
+ \ifcase\HOLOGO@choice
+ \HOLOGO@WarningUnsupportedDriver{Xe}%
+ e%
+ \or % 1: \rotatebox
+ \begingroup
+ \setbox\ltx@zero\hbox{\rotatebox{180}{E}}%
+ \ltx@LocDimenA=\dp\ltx@zero
+ \advance\ltx@LocDimenA by -.5ex\relax
+ \raise\ltx@LocDimenA\box\ltx@zero
+ \endgroup
+ \or % 2: \pgftext
+ \lower.5ex\hbox{%
+ \pgfpicture
+ \pgftext[rotate=180]{E}%
+ \endpgfpicture
+ }%
+ \or % 3: \psscalebox
+ \begingroup
+ \setbox\ltx@zero\hbox{\psscalebox{-1 -1}{E}}%
+ \ltx@LocDimenA=\dp\ltx@zero
+ \advance\ltx@LocDimenA by -.5ex\relax
+ \raise\ltx@LocDimenA\box\ltx@zero
+ \endgroup
+ \or % 4: \HOLOGO@PointReflectBox
+ \lower.5ex\hbox{\HOLOGO@PointReflectBox{E}}%
+ \else
+ \@PackageError{hologo}{Internal error (choice/it}\@ehc
+ \fi
+ \else
+ \ltx@IfUndefined{reflectbox}{%
+ \ltx@IfUndefined{pgftext}{%
+ \ltx@IfUndefined{psscalebox}{%
+ \ltx@IfUndefined{HOLOGO@ScaleBox@\hologoDriver}{%
+ }{%
+ \chardef\HOLOGO@choice=4 %
+ }%
+ }{%
+ \chardef\HOLOGO@choice=3 %
+ }%
+ }{%
+ \chardef\HOLOGO@choice=2 %
+ }%
+ }{%
+ \chardef\HOLOGO@choice=1 %
+ }%
+ \ifcase\HOLOGO@choice
+ \HOLOGO@WarningUnsupportedDriver{Xe}%
+ e%
+ \or % 1: reflectbox
+ \lower.5ex\hbox{%
+ \reflectbox{E}%
+ }%
+ \or % 2: \pgftext
+ \lower.5ex\hbox{%
+ \pgfpicture
+ \pgftransformxscale{-1}%
+ \pgftext{E}%
+ \endpgfpicture
+ }%
+ \or % 3: \psscalebox
+ \lower.5ex\hbox{%
+ \psscalebox{-1 1}{E}%
+ }%
+ \or % 4: \HOLOGO@Reflectbox
+ \lower.5ex\hbox{%
+ \HOLOGO@ReflectBox{E}%
+ }%
+ \else
+ \@PackageError{hologo}{Internal error (choice/up)}\@ehc
+ \fi
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@Xe}
+% \begin{macrocode}
+\def\HoLogoHtml@Xe#1{%
+ \HoLogoCss@Xe
+ \HOLOGO@Span{Xe}{%
+ X%
+ \HOLOGO@Span{e}{%
+ \HCode{&\ltx@hashchar x018e;}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@Xe}
+% \begin{macrocode}
+\def\HoLogoCss@Xe{%
+ \Css{%
+ span.HoLogo-Xe span.HoLogo-e{%
+ position:relative;%
+ top:.5ex;%
+ left-margin:-.1em;%
+ }%
+ }%
+ \global\let\HoLogoCss@Xe\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@XeTeX}
+% \begin{macrocode}
+\def\HoLogo@XeTeX#1{%
+ \hologo{Xe}%
+ \kern-.15em\relax
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoHtml@XeTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@XeTeX#1{%
+ \HoLogoCss@XeTeX
+ \HOLOGO@Span{XeTeX}{%
+ \hologo{Xe}%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@XeTeX}
+% \begin{macrocode}
+\def\HoLogoCss@XeTeX{%
+ \Css{%
+ span.HoLogo-XeTeX span.HoLogo-TeX{%
+ margin-left:-.15em;%
+ }%
+ }%
+ \global\let\HoLogoCss@XeTeX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@XeLaTeX}
+% \begin{macrocode}
+\def\HoLogo@XeLaTeX#1{%
+ \hologo{Xe}%
+ \kern-.13em%
+ \hologo{LaTeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@XeLaTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@XeLaTeX#1{%
+ \HoLogoCss@XeLaTeX
+ \HOLOGO@Span{XeLaTeX}{%
+ \hologo{Xe}%
+ \hologo{LaTeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@XeLaTeX}
+% \begin{macrocode}
+\def\HoLogoCss@XeLaTeX{%
+ \Css{%
+ span.HoLogo-XeLaTeX span.HoLogo-Xe{%
+ margin-right:-.13em;%
+ }%
+ }%
+ \global\let\HoLogoCss@XeLaTeX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{pdfTeX}, \hologo{pdfLaTeX}}
+%
+% \begin{macro}{\HoLogo@pdfTeX}
+% \begin{macrocode}
+\def\HoLogo@pdfTeX#1{%
+ \HOLOGO@mbox{%
+ #1{p}{P}df\hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@pdfTeX}
+% \begin{macrocode}
+\def\HoLogoCs@pdfTeX#1{#1{p}{P}dfTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@pdfTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@pdfTeX#1{%
+ #1{p}{P}df\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@pdfTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@pdfTeX\HoLogo@pdfTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@pdfLaTeX}
+% \begin{macrocode}
+\def\HoLogo@pdfLaTeX#1{%
+ \HOLOGO@mbox{%
+ #1{p}{P}df\hologo{LaTeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@pdfLaTeX}
+% \begin{macrocode}
+\def\HoLogoCs@pdfLaTeX#1{#1{p}{P}dfLaTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@pdfLaTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@pdfLaTeX#1{%
+ #1{p}{P}df\hologo{LaTeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@pdfLaTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@pdfLaTeX\HoLogo@pdfLaTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{VTeX}}
+%
+% \begin{macro}{\HoLogo@VTeX}
+% \begin{macrocode}
+\def\HoLogo@VTeX#1{%
+ \HOLOGO@mbox{%
+ V\hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@VTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@VTeX\HoLogo@VTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{AmS}, \dots}
+%
+% Source: class \xclass{amsdtx}
+%
+% \begin{macro}{\HoLogo@AmS}
+% \begin{macrocode}
+\def\HoLogo@AmS#1{%
+ \HoLogoFont@font{AmS}{sy}{%
+ A%
+ \kern-.1667em%
+ \lower.5ex\hbox{M}%
+ \kern-.125em%
+ S%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@AmS}
+% \begin{macrocode}
+\def\HoLogoBkm@AmS#1{AmS}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@AmS}
+% \begin{macrocode}
+\def\HoLogoHtml@AmS#1{%
+ \HoLogoCss@AmS
+% \HoLogoFont@font{AmS}{sy}{%
+ \HOLOGO@Span{AmS}{%
+ A%
+ \HOLOGO@Span{M}{M}%
+ S%
+ }%
+% }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@AmS}
+% \begin{macrocode}
+\def\HoLogoCss@AmS{%
+ \Css{%
+ span.HoLogo-AmS span.HoLogo-M{%
+ position:relative;%
+ top:.5ex;%
+ margin-left:-.1667em;%
+ margin-right:-.125em;%
+ text-decoration:none;%
+ }%
+ }%
+ \global\let\HoLogoCss@AmS\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@AmSTeX}
+% \begin{macrocode}
+\def\HoLogo@AmSTeX#1{%
+ \hologo{AmS}%
+ \HOLOGO@hyphen
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@AmSTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@AmSTeX#1{AmS-TeX}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@AmSTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@AmSTeX\HoLogo@AmSTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@AmSLaTeX}
+% \begin{macrocode}
+\def\HoLogo@AmSLaTeX#1{%
+ \hologo{AmS}%
+ \HOLOGO@hyphen
+ \hologo{LaTeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@AmSLaTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@AmSLaTeX#1{AmS-LaTeX}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@AmSLaTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@AmSLaTeX\HoLogo@AmSLaTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{BibTeX}}
+%
+% \begin{macro}{\HoLogo@BibTeX@sc}
+% A definition of \hologo{BibTeX} is provided in
+% the documentation source for the manual of \hologo{BibTeX}
+% \cite{btxdoc}.
+%\begin{quote}
+%\begin{verbatim}
+%\def\BibTeX{%
+% {%
+% \rm
+% B%
+% \kern-.05em%
+% {%
+% \sc
+% i%
+% \kern-.025em %
+% b%
+% }%
+% \kern-.08em
+% T%
+% \kern-.1667em%
+% \lower.7ex\hbox{E}%
+% \kern-.125em%
+% X%
+% }%
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\def\HoLogo@BibTeX@sc#1{%
+ B%
+ \kern-.05em%
+ \HoLogoFont@font{BibTeX}{sc}{%
+ i%
+ \kern-.025em%
+ b%
+ }%
+ \HOLOGO@discretionary
+ \kern-.08em%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@BibTeX@sc}
+% \begin{macrocode}
+\def\HoLogoHtml@BibTeX@sc#1{%
+ \HoLogoCss@BibTeX@sc
+ \HOLOGO@Span{BibTeX-sc}{%
+ B%
+ \HOLOGO@Span{i}{i}%
+ \HOLOGO@Span{b}{b}%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@BibTeX@sc}
+% \begin{macrocode}
+\def\HoLogoCss@BibTeX@sc{%
+ \Css{%
+ span.HoLogo-BibTeX-sc span.HoLogo-i{%
+ margin-left:-.05em;%
+ margin-right:-.025em;%
+ font-variant:small-caps;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-BibTeX-sc span.HoLogo-b{%
+ margin-right:-.08em;%
+ font-variant:small-caps;%
+ }%
+ }%
+ \global\let\HoLogoCss@BibTeX@sc\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@BibTeX@sf}
+% Variant \xoption{sf} avoids trouble with unavailable
+% small caps fonts (e.g., bold versions of Computer Modern or
+% Latin Modern). The definition is taken from
+% package \xpackage{dtklogos} \cite{dtklogos}.
+%\begin{quote}
+%\begin{verbatim}
+%\DeclareRobustCommand{\BibTeX}{%
+% B%
+% \kern-.05em%
+% \hbox{%
+% $\m@th$% %% force math size calculations
+% \csname S@\f@size\endcsname
+% \fontsize\sf@size\z@
+% \math@fontsfalse
+% \selectfont
+% I%
+% \kern-.025em%
+% B
+% }%
+% \kern-.08em%
+% \-%
+% \TeX
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\def\HoLogo@BibTeX@sf#1{%
+ B%
+ \kern-.05em%
+ \HoLogoFont@font{BibTeX}{bibsf}{%
+ I%
+ \kern-.025em%
+ B%
+ }%
+ \HOLOGO@discretionary
+ \kern-.08em%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@BibTeX@sf}
+% \begin{macrocode}
+\def\HoLogoHtml@BibTeX@sf#1{%
+ \HoLogoCss@BibTeX@sf
+ \HOLOGO@Span{BibTeX-sf}{%
+ B%
+ \HoLogoFont@font{BibTeX}{bibsf}{%
+ \HOLOGO@Span{i}{I}%
+ B%
+ }%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@BibTeX@sf}
+% \begin{macrocode}
+\def\HoLogoCss@BibTeX@sf{%
+ \Css{%
+ span.HoLogo-BibTeX-sf span.HoLogo-i{%
+ margin-left:-.05em;%
+ margin-right:-.025em;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-BibTeX-sf span.HoLogo-TeX{%
+ margin-left:-.08em;%
+ }%
+ }%
+ \global\let\HoLogoCss@BibTeX@sf\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@BibTeX}
+% \begin{macrocode}
+\def\HoLogo@BibTeX{\HoLogo@BibTeX@sf}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@BibTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@BibTeX{\HoLogoHtml@BibTeX@sf}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{BibTeX8}}
+%
+% \begin{macro}{\HoLogo@BibTeX8}
+% \begin{macrocode}
+\expandafter\def\csname HoLogo@BibTeX8\endcsname#1{%
+ \hologo{BibTeX}%
+ 8%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoBkm@BibTeX8}
+% \begin{macrocode}
+\expandafter\def\csname HoLogoBkm@BibTeX8\endcsname#1{%
+ \hologo{BibTeX}%
+ 8%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@BibTeX8}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogoHtml@BibTeX8\expandafter\endcsname
+\csname HoLogo@BibTeX8\endcsname
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{ConTeXt}}
+%
+% \begin{macro}{\HoLogo@ConTeXt@simple}
+% \begin{macrocode}
+\def\HoLogo@ConTeXt@simple#1{%
+ \HOLOGO@mbox{Con}%
+ \HOLOGO@discretionary
+ \HOLOGO@mbox{\hologo{TeX}t}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@ConTeXt@simple}
+% \begin{macrocode}
+\let\HoLogoHtml@ConTeXt@simple\HoLogo@ConTeXt@simple
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@ConTeXt@narrow}
+% This definition of logo \hologo{ConTeXt} with variant \xoption{narrow}
+% comes from TUGboat's class \xclass{ltugboat} (version 2010/11/15 v2.8).
+% \begin{macrocode}
+\def\HoLogo@ConTeXt@narrow#1{%
+ \HOLOGO@mbox{C\kern-.0333emon}%
+ \HOLOGO@discretionary
+ \kern-.0667em%
+ \HOLOGO@mbox{\hologo{TeX}\kern-.0333emt}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@ConTeXt@narrow}
+% \begin{macrocode}
+\def\HoLogoHtml@ConTeXt@narrow#1{%
+ \HoLogoCss@ConTeXt@narrow
+ \HOLOGO@Span{ConTeXt-narrow}{%
+ \HOLOGO@Span{C}{C}%
+ on%
+ \hologo{TeX}%
+ t%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@ConTeXt@narrow}
+% \begin{macrocode}
+\def\HoLogoCss@ConTeXt@narrow{%
+ \Css{%
+ span.HoLogo-ConTeXt-narrow span.HoLogo-C{%
+ margin-left:-.0333em;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-ConTeXt-narrow span.HoLogo-TeX{%
+ margin-left:-.0667em;%
+ margin-right:-.0333em;%
+ }%
+ }%
+ \global\let\HoLogoCss@ConTeXt@narrow\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@ConTeXt}
+% \begin{macrocode}
+\def\HoLogo@ConTeXt{\HoLogo@ConTeXt@narrow}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@ConTeXt}
+% \begin{macrocode}
+\def\HoLogoHtml@ConTeXt{\HoLogoHtml@ConTeXt@narrow}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{emTeX}}
+%
+% \begin{macro}{\HoLogo@emTeX}
+% \begin{macrocode}
+\def\HoLogo@emTeX#1{%
+ \HOLOGO@mbox{#1{e}{E}m}%
+ \HOLOGO@discretionary
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@emTeX}
+% \begin{macrocode}
+\def\HoLogoCs@emTeX#1{#1{e}{E}mTeX}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@emTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@emTeX#1{%
+ #1{e}{E}m\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@emTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@emTeX\HoLogo@emTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{ExTeX}}
+%
+% \begin{macro}{\HoLogo@ExTeX}
+% The definition is taken from the FAQ of the
+% project \hologo{ExTeX}
+% \cite{ExTeX-FAQ}.
+%\begin{quote}
+%\begin{verbatim}
+%\def\ExTeX{%
+% \textrm{% Logo always with serifs
+% \ensuremath{%
+% \textstyle
+% \varepsilon_{%
+% \kern-0.15em%
+% \mathcal{X}%
+% }%
+% }%
+% \kern-.15em%
+% \TeX
+% }%
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\def\HoLogo@ExTeX#1{%
+ \HoLogoFont@font{ExTeX}{rm}{%
+ \ltx@mbox{%
+ \HOLOGO@MathSetup
+ $%
+ \textstyle
+ \varepsilon_{%
+ \kern-0.15em%
+ \HoLogoFont@font{ExTeX}{sy}{X}%
+ }%
+ $%
+ }%
+ \HOLOGO@discretionary
+ \kern-.15em%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@ExTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@ExTeX#1{%
+ \HoLogoCss@ExTeX
+ \HoLogoFont@font{ExTeX}{rm}{%
+ \HOLOGO@Span{ExTeX}{%
+ \ltx@mbox{%
+ \HOLOGO@MathSetup
+ $\textstyle\varepsilon$%
+ \HOLOGO@Span{X}{$\textstyle\chi$}%
+ \hologo{TeX}%
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@ExTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@ExTeX#1{%
+ \HOLOGO@PdfdocUnicode{#1{e}{E}x}{\textepsilon\textchi}%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@ExTeX}
+% \begin{macrocode}
+\def\HoLogoCss@ExTeX{%
+ \Css{%
+ span.HoLogo-ExTeX{%
+ font-family:serif;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-ExTeX span.HoLogo-TeX{%
+ margin-left:-.15em;%
+ }%
+ }%
+ \global\let\HoLogoCss@ExTeX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{MiKTeX}}
+%
+% \begin{macro}{\HoLogo@MiKTeX}
+% \begin{macrocode}
+\def\HoLogo@MiKTeX#1{%
+ \HOLOGO@mbox{MiK}%
+ \HOLOGO@discretionary
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@MiKTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@MiKTeX\HoLogo@MiKTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{OzTeX} and friends}
+%
+% Source: \hologo{OzTeX} FAQ \cite{OzTeX}:
+% \begin{quote}
+% |\def\OzTeX{O\kern-.03em z\kern-.15em\TeX}|\\
+% (There is no kerning in OzMF, OzMP and OzTtH.)
+% \end{quote}
+%
+% \begin{macro}{\HoLogo@OzTeX}
+% \begin{macrocode}
+\def\HoLogo@OzTeX#1{%
+ O%
+ \kern-.03em %
+ z%
+ \kern-.15em %
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@OzTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@OzTeX#1{%
+ \HoLogoCss@OzTeX
+ \HOLOGO@Span{OzTeX}{%
+ O%
+ \HOLOGO@Span{z}{z}%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@OzTeX}
+% \begin{macrocode}
+\def\HoLogoCss@OzTeX{%
+ \Css{%
+ span.HoLogo-OzTeX span.HoLogo-z{%
+ margin-left:-.03em;%
+ margin-right:-.15em;%
+ }%
+ }%
+ \global\let\HoLogoCss@OzTeX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@OzMF}
+% \begin{macrocode}
+\def\HoLogo@OzMF#1{%
+ \HOLOGO@mbox{OzMF}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogo@OzMP}
+% \begin{macrocode}
+\def\HoLogo@OzMP#1{%
+ \HOLOGO@mbox{OzMP}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogo@OzTtH}
+% \begin{macrocode}
+\def\HoLogo@OzTtH#1{%
+ \HOLOGO@mbox{OzTtH}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{PCTeX}}
+%
+% \begin{macro}{\HoLogo@PCTeX}
+% \begin{macrocode}
+\def\HoLogo@PCTeX#1{%
+ \HOLOGO@mbox{PC}%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@PCTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@PCTeX\HoLogo@PCTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{PiCTeX}}
+%
+% The original definitions from \xfile{pictex.tex} \cite{PiCTeX}:
+%\begin{quote}
+%\begin{verbatim}
+%\def\PiC{%
+% P%
+% \kern-.12em%
+% \lower.5ex\hbox{I}%
+% \kern-.075em%
+% C%
+%}
+%\def\PiCTeX{%
+% \PiC
+% \kern-.11em%
+% \TeX
+%}
+%\end{verbatim}
+%\end{quote}
+%
+% \begin{macro}{\HoLogo@PiC}
+% \begin{macrocode}
+\def\HoLogo@PiC#1{%
+ P%
+ \kern-.12em%
+ \lower.5ex\hbox{I}%
+ \kern-.075em%
+ C%
+ \HOLOGO@SpaceFactor
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@PiC}
+% \begin{macrocode}
+\def\HoLogoHtml@PiC#1{%
+ \HoLogoCss@PiC
+ \HOLOGO@Span{PiC}{%
+ P%
+ \HOLOGO@Span{i}{I}%
+ C%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@PiC}
+% \begin{macrocode}
+\def\HoLogoCss@PiC{%
+ \Css{%
+ span.HoLogo-PiC span.HoLogo-i{%
+ position:relative;%
+ top:.5ex;%
+ margin-left:-.12em;%
+ margin-right:-.075em;%
+ text-decoration:none;%
+ }%
+ }%
+ \global\let\HoLogoCss@PiC\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@PiCTeX}
+% \begin{macrocode}
+\def\HoLogo@PiCTeX#1{%
+ \hologo{PiC}%
+ \HOLOGO@discretionary
+ \kern-.11em%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@PiCTeX}
+% \begin{macrocode}
+\def\HoLogoHtml@PiCTeX#1{%
+ \HoLogoCss@PiCTeX
+ \HOLOGO@Span{PiCTeX}{%
+ \hologo{PiC}%
+ \hologo{TeX}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@PiCTeX}
+% \begin{macrocode}
+\def\HoLogoCss@PiCTeX{%
+ \Css{%
+ span.HoLogo-PiCTeX span.HoLogo-PiC{%
+ margin-right:-.11em;%
+ }%
+ }%
+ \global\let\HoLogoCss@PiCTeX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{teTeX}}
+%
+% \begin{macro}{\HoLogo@teTeX}
+% \begin{macrocode}
+\def\HoLogo@teTeX#1{%
+ \HOLOGO@mbox{#1{t}{T}e}%
+ \HOLOGO@discretionary
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@teTeX}
+% \begin{macrocode}
+\def\HoLogoCs@teTeX#1{#1{t}{T}dfTeX}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@teTeX}
+% \begin{macrocode}
+\def\HoLogoBkm@teTeX#1{%
+ #1{t}{T}e\hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@teTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@teTeX\HoLogo@teTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{TeX4ht}}
+%
+% \begin{macro}{\HoLogo@TeX4ht}
+% \begin{macrocode}
+\expandafter\def\csname HoLogo@TeX4ht\endcsname#1{%
+ \HOLOGO@mbox{\hologo{TeX}4ht}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@TeX4ht}
+% \begin{macrocode}
+\expandafter
+\let\csname HoLogoHtml@TeX4ht\expandafter\endcsname
+\csname HoLogo@TeX4ht\endcsname
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{\hologo{SageTeX}}
+%
+% \begin{macro}{\HoLogo@SageTeX}
+% \begin{macrocode}
+\def\HoLogo@SageTeX#1{%
+ \HOLOGO@mbox{Sage}%
+ \HOLOGO@discretionary
+ \HOLOGO@NegativeKerning{eT,oT,To}%
+ \hologo{TeX}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@SageTeX}
+% \begin{macrocode}
+\let\HoLogoHtml@SageTeX\HoLogo@SageTeX
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\hologo{METAFONT} and friends}
+%
+% \begin{macro}{\HoLogo@METAFONT}
+% \begin{macrocode}
+\def\HoLogo@METAFONT#1{%
+ \HoLogoFont@font{METAFONT}{logo}{%
+ \HOLOGO@mbox{META}%
+ \HOLOGO@discretionary
+ \HOLOGO@mbox{FONT}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@METAPOST}
+% \begin{macrocode}
+\def\HoLogo@METAPOST#1{%
+ \HoLogoFont@font{METAPOST}{logo}{%
+ \HOLOGO@mbox{META}%
+ \HOLOGO@discretionary
+ \HOLOGO@mbox{POST}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@MetaFun}
+% \begin{macrocode}
+\def\HoLogo@MetaFun#1{%
+ \HOLOGO@mbox{Meta}%
+ \HOLOGO@discretionary
+ \HOLOGO@mbox{Fun}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogo@MetaPost}
+% \begin{macrocode}
+\def\HoLogo@MetaPost#1{%
+ \HOLOGO@mbox{Meta}%
+ \HOLOGO@discretionary
+ \HOLOGO@mbox{Post}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Others}
+%
+% \subsubsection{\hologo{biber}}
+%
+% \begin{macro}{\HoLogo@biber}
+% \begin{macrocode}
+\def\HoLogo@biber#1{%
+ \HOLOGO@mbox{#1{b}{B}i}%
+ \HOLOGO@discretionary
+ \HOLOGO@mbox{ber}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCs@biber}
+% \begin{macrocode}
+\def\HoLogoCs@biber#1{#1{b}{B}iber}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@biber}
+% \begin{macrocode}
+\def\HoLogoBkm@biber#1{%
+ #1{b}{B}iber%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@biber}
+% \begin{macrocode}
+\let\HoLogoHtml@biber\HoLogo@biber
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{KOMAScript}}
+%
+% \begin{macro}{\HoLogo@KOMAScript}
+% The definition for \hologo{KOMAScript} is taken
+% from \hologo{KOMAScript} (\xfile{scrlogo.dtx}, reformatted) \cite{scrlogo}:
+%\begin{quote}
+%\begin{verbatim}
+%\@ifundefined{KOMAScript}{%
+% \DeclareRobustCommand{\KOMAScript}{%
+% \textsf{%
+% K\kern.05em O\kern.05emM\kern.05em A%
+% \kern.1em-\kern.1em %
+% Script%
+% }%
+% }%
+%}{}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\def\HoLogo@KOMAScript#1{%
+ \HoLogoFont@font{KOMAScript}{sf}{%
+ \HOLOGO@mbox{%
+ K\kern.05em%
+ O\kern.05em%
+ M\kern.05em%
+ A%
+ }%
+ \kern.1em%
+ \HOLOGO@hyphen
+ \kern.1em%
+ \HOLOGO@mbox{Script}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@KOMAScript}
+% \begin{macrocode}
+\def\HoLogoBkm@KOMAScript#1{%
+ KOMA-Script%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@KOMAScript}
+% \begin{macrocode}
+\def\HoLogoHtml@KOMAScript#1{%
+ \HoLogoCss@KOMAScript
+ \HoLogoFont@font{KOMAScript}{sf}{%
+ \HOLOGO@Span{KOMAScript}{%
+ K%
+ \HOLOGO@Span{O}{O}%
+ M%
+ \HOLOGO@Span{A}{A}%
+ \HOLOGO@Span{hyphen}{-}%
+ Script%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@KOMAScript}
+% \begin{macrocode}
+\def\HoLogoCss@KOMAScript{%
+ \Css{%
+ span.HoLogo-KOMAScript{%
+ font-family:sans-serif;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-KOMAScript span.HoLogo-O{%
+ padding-left:.05em;%
+ padding-right:.05em;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-KOMAScript span.HoLogo-A{%
+ padding-left:.05em;%
+ }%
+ }%
+ \Css{%
+ span.HoLogo-KOMAScript span.HoLogo-hyphen{%
+ padding-left:.1em;%
+ padding-right:.1em;%
+ }%
+ }%
+ \global\let\HoLogoCss@KOMAScript\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{LyX}}
+%
+% \begin{macro}{\HoLogo@LyX}
+% The definition is taken from the documentation source files
+% of \hologo{LyX}, \xfile{Intro.lyx} \cite{LyX}:
+%\begin{quote}
+%\begin{verbatim}
+%\def\LyX{%
+% \texorpdfstring{%
+% L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@%
+% }{%
+% LyX%
+% }%
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\def\HoLogo@LyX#1{%
+ L%
+ \kern-.1667em%
+ \lower.25em\hbox{Y}%
+ \kern-.125em%
+ X%
+ \HOLOGO@SpaceFactor
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@LyX}
+% \begin{macrocode}
+\def\HoLogoHtml@LyX#1{%
+ \HoLogoCss@LyX
+ \HOLOGO@Span{LyX}{%
+ L%
+ \HOLOGO@Span{y}{Y}%
+ X%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoCss@LyX}
+% \begin{macrocode}
+\def\HoLogoCss@LyX{%
+ \Css{%
+ span.HoLogo-LyX span.HoLogo-y{%
+ position:relative;%
+ top:.25em;%
+ margin-left:-.1667em;%
+ margin-right:-.125em;%
+ text-decoration:none;%
+ }%
+ }%
+ \global\let\HoLogoCss@LyX\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\hologo{NTS}}
+%
+% \begin{macro}{\HoLogo@NTS}
+% Definition for \hologo{NTS} can be found in
+% package \xpackage{etex\textunderscore man} for the \hologo{eTeX} manual \cite{etexman}
+% and in package \xpackage{dtklogos} \cite{dtklogos}:
+%\begin{quote}
+%\begin{verbatim}
+%\def\NTS{%
+% \leavevmode
+% \hbox{%
+% $%
+% \cal N%
+% \kern-0.35em%
+% \lower0.5ex\hbox{$\cal T$}%
+% \kern-0.2em%
+% S%
+% $%
+% }%
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\def\HoLogo@NTS#1{%
+ \HoLogoFont@font{NTS}{sy}{%
+ N\/%
+ \kern-.35em%
+ \lower.5ex\hbox{T\/}%
+ \kern-.2em%
+ S\/%
+ }%
+ \HOLOGO@SpaceFactor
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\Hologo{TTH} (\hologo{TeX} to HTML translator)}
+%
+% Source: \url{http://hutchinson.belmont.ma.us/tth/}
+% In the HTML source the second `T' is printed as subscript.
+%\begin{quote}
+%\begin{verbatim}
+%T<sub>T</sub>H
+%\end{verbatim}
+%\end{quote}
+% \begin{macro}{\HoLogo@TTH}
+% \begin{macrocode}
+\def\HoLogo@TTH#1{%
+ \ltx@mbox{%
+ T\HOLOGO@SubScript{T}H%
+ }%
+ \HOLOGO@SpaceFactor
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HoLogoHtml@TTH}
+% \begin{macrocode}
+\def\HoLogoHtml@TTH#1{%
+ T\HCode{<sub>}T\HCode{</sub>}H%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\Hologo{HanTheThanh}}
+%
+% Partial source: Package \xpackage{dtklogos}.
+% The double accent is U+1EBF (latin small letter e with circumflex
+% and acute).
+% \begin{macro}{\HoLogo@HanTheThanh}
+% \begin{macrocode}
+\def\HoLogo@HanTheThanh#1{%
+ \ltx@mbox{H\`an}%
+ \HOLOGO@space
+ \ltx@mbox{%
+ Th%
+ \HOLOGO@IfCharExists{"1EBF}{%
+ \char"1EBF\relax
+ }{%
+ \^e\hbox to 0pt{\hss\raise .5ex\hbox{\'{}}}%
+ }%
+ }%
+ \HOLOGO@space
+ \ltx@mbox{Th\`anh}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoBkm@HanTheThanh}
+% \begin{macrocode}
+\def\HoLogoBkm@HanTheThanh#1{%
+ H\`an %
+ Th\HOLOGO@PdfdocUnicode{\^e}{\9036\277} %
+ Th\`anh%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HoLogoHtml@HanTheThanh}
+% \begin{macrocode}
+\def\HoLogoHtml@HanTheThanh#1{%
+ H\`an %
+ Th\HCode{&\ltx@hashchar x1ebf;} %
+ Th\`anh%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Driver detection}
+%
+% \begin{macrocode}
+\HOLOGO@IfExists\InputIfFileExists{%
+ \InputIfFileExists{hologo.cfg}{}{}%
+}{%
+ \ltx@IfUndefined{pdf@filesize}{%
+ \def\HOLOGO@InputIfExists{%
+ \openin\HOLOGO@temp=hologo.cfg\relax
+ \ifeof\HOLOGO@temp
+ \closein\HOLOGO@temp
+ \else
+ \closein\HOLOGO@temp
+ \begingroup
+ \def\x{LaTeX2e}%
+ \expandafter\endgroup
+ \ifx\fmtname\x
+ \input{hologo.cfg}%
+ \else
+ \input hologo.cfg\relax
+ \fi
+ \fi
+ }%
+ \ltx@IfUndefined{newread}{%
+ \chardef\HOLOGO@temp=15 %
+ \def\HOLOGO@CheckRead{%
+ \ifeof\HOLOGO@temp
+ \HOLOGO@InputIfExists
+ \else
+ \ifcase\HOLOGO@temp
+ \@PackageWarningNoLine{hologo}{%
+ Configuration file ignored, because\MessageBreak
+ a free read register could not be found%
+ }%
+ \else
+ \begingroup
+ \count\ltx@cclv=\HOLOGO@temp
+ \advance\ltx@cclv by \ltx@minusone
+ \edef\x{\endgroup
+ \chardef\noexpand\HOLOGO@temp=\the\count\ltx@cclv
+ \relax
+ }%
+ \x
+ \fi
+ \fi
+ }%
+ }{%
+ \csname newread\endcsname\HOLOGO@temp
+ \HOLOGO@InputIfExists
+ }%
+ }{%
+ \edef\HOLOGO@temp{\pdf@filesize{hologo.cfg}}%
+ \ifx\HOLOGO@temp\ltx@empty
+ \else
+ \ifnum\HOLOGO@temp>0 %
+ \begingroup
+ \def\x{LaTeX2e}%
+ \expandafter\endgroup
+ \ifx\fmtname\x
+ \input{hologo.cfg}%
+ \else
+ \input hologo.cfg\relax
+ \fi
+ \else
+ \@PackageInfoNoLine{hologo}{%
+ Empty configuration file `hologo.cfg' ignored%
+ }%
+ \fi
+ \fi
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\HOLOGO@temp#1#2{%
+ \kv@define@key{HoLogoDriver}{#1}[]{%
+ \begingroup
+ \def\HOLOGO@temp{##1}%
+ \ltx@onelevel@sanitize\HOLOGO@temp
+ \ifx\HOLOGO@temp\ltx@empty
+ \else
+ \@PackageError{hologo}{%
+ Value (\HOLOGO@temp) not permitted for option `#1'%
+ }%
+ \@ehc
+ \fi
+ \endgroup
+ \def\hologoDriver{#2}%
+ }%
+}%
+\def\HOLOGO@@temp#1#2{%
+ \ifx\kv@value\relax
+ \HOLOGO@temp{#1}{#1}%
+ \else
+ \HOLOGO@temp{#1}{#2}%
+ \fi
+}%
+\kv@parse@normalized{%
+ pdftex,%
+ luatex=pdftex,%
+ dvipdfm,%
+ dvipdfmx=dvipdfm,%
+ dvips,%
+ dvipsone=dvips,%
+ xdvi=dvips,%
+ xetex,%
+ vtex,%
+}\HOLOGO@@temp
+% \end{macrocode}
+%
+% \begin{macrocode}
+\kv@define@key{HoLogoDriver}{driverfallback}{%
+ \def\HOLOGO@DriverFallback{#1}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\HOLOGO@DriverFallback}
+% \begin{macrocode}
+\def\HOLOGO@DriverFallback{dvips}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hologoDriverSetup}
+% \begin{macrocode}
+\def\hologoDriverSetup{%
+ \let\hologoDriver\ltx@undefined
+ \HOLOGO@DriverSetup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@DriverSetup}
+% \begin{macrocode}
+\def\HOLOGO@DriverSetup#1{%
+ \kvsetkeys{HoLogoDriver}{#1}%
+ \HOLOGO@CheckDriver
+ \ltx@ifundefined{hologoDriver}{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\kvsetkeys{HoLogoDriver}{\HOLOGO@DriverFallback}%
+ }\x
+ }{}%
+ \@PackageInfoNoLine{hologo}{Using driver `\hologoDriver'}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@CheckDriver}
+% \begin{macrocode}
+\def\HOLOGO@CheckDriver{%
+ \ifpdf
+ \def\hologoDriver{pdftex}%
+ \let\HOLOGO@pdfliteral\pdfliteral
+ \ifluatex
+ \ifx\pdfextension\@undefined\else
+ \protected\def\pdfliteral{\pdfextension literal}%
+ \let\HOLOGO@pdfliteral\pdfliteral
+ \fi
+ \ltx@IfUndefined{HOLOGO@pdfliteral}{%
+ \ifnum\luatexversion<36 %
+ \else
+ \begingroup
+ \let\HOLOGO@temp\endgroup
+ \ifcase0%
+ \directlua{%
+ if tex.enableprimitives then %
+ tex.enableprimitives('HOLOGO@', {'pdfliteral'})%
+ else %
+ tex.print('1')%
+ end%
+ }%
+ \ifx\HOLOGO@pdfliteral\@undefined 1\fi%
+ \relax%
+ \endgroup
+ \let\HOLOGO@temp\relax
+ \global\let\HOLOGO@pdfliteral\HOLOGO@pdfliteral
+ \fi%
+ \HOLOGO@temp
+ \fi
+ }{}%
+ \fi
+ \ltx@IfUndefined{HOLOGO@pdfliteral}{%
+ \@PackageWarningNoLine{hologo}{%
+ Cannot find \string\pdfliteral
+ }%
+ }{}%
+ \else
+ \ifxetex
+ \def\hologoDriver{xetex}%
+ \else
+ \ifvtex
+ \def\hologoDriver{vtex}%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@WarningUnsupportedDriver}
+% \begin{macrocode}
+\def\HOLOGO@WarningUnsupportedDriver#1{%
+ \@PackageWarningNoLine{hologo}{%
+ Logo `#1' needs driver specific macros,\MessageBreak
+ but driver `\hologoDriver' is not supported.\MessageBreak
+ Use a different driver or\MessageBreak
+ load package `graphics' or `pgf'%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Reflect box macros}
+%
+% Skip driver part if not needed.
+% \begin{macrocode}
+\ltx@IfUndefined{reflectbox}{}{%
+ \ltx@IfUndefined{rotatebox}{}{%
+ \HOLOGO@AtEnd
+ }%
+}
+\ltx@IfUndefined{pgftext}{}{%
+ \HOLOGO@AtEnd
+}
+\ltx@IfUndefined{psscalebox}{}{%
+ \HOLOGO@AtEnd
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\HOLOGO@temp{LaTeX2e}
+\ifx\fmtname\HOLOGO@temp
+ \RequirePackage{kvoptions}[2011/06/30]%
+ \ProcessKeyvalOptions{HoLogoDriver}%
+\fi
+\HOLOGO@DriverSetup{}
+% \end{macrocode}
+%
+% \begin{macro}{\HOLOGO@ReflectBox}
+% \begin{macrocode}
+\def\HOLOGO@ReflectBox#1{%
+ \begingroup
+ \setbox\ltx@zero\hbox{\begingroup#1\endgroup}%
+ \setbox\ltx@two\hbox{%
+ \kern\wd\ltx@zero
+ \csname HOLOGO@ScaleBox@\hologoDriver\endcsname{-1}{1}{%
+ \hbox to 0pt{\copy\ltx@zero\hss}%
+ }%
+ }%
+ \wd\ltx@two=\wd\ltx@zero
+ \box\ltx@two
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOLOGO@PointReflectBox}
+% \begin{macrocode}
+\def\HOLOGO@PointReflectBox#1{%
+ \begingroup
+ \setbox\ltx@zero\hbox{\begingroup#1\endgroup}%
+ \setbox\ltx@two\hbox{%
+ \kern\wd\ltx@zero
+ \raise\ht\ltx@zero\hbox{%
+ \csname HOLOGO@ScaleBox@\hologoDriver\endcsname{-1}{-1}{%
+ \hbox to 0pt{\copy\ltx@zero\hss}%
+ }%
+ }%
+ }%
+ \wd\ltx@two=\wd\ltx@zero
+ \box\ltx@two
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We must define all variants because of dynamic driver setup.
+% \begin{macrocode}
+\def\HOLOGO@temp#1#2{#2}
+% \end{macrocode}
+%
+% \begin{macro}{\HOLOGO@ScaleBox@pdftex}
+% \begin{macrocode}
+\HOLOGO@temp{pdftex}{%
+ \def\HOLOGO@ScaleBox@pdftex#1#2#3{%
+ \HOLOGO@pdfliteral{%
+ q #1 0 0 #2 0 0 cm%
+ }%
+ #3%
+ \HOLOGO@pdfliteral{%
+ Q%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOLOGO@ScaleBox@dvips}
+% \begin{macrocode}
+\HOLOGO@temp{dvips}{%
+ \def\HOLOGO@ScaleBox@dvips#1#2#3{%
+ \special{ps:%
+ gsave %
+ currentpoint %
+ currentpoint translate %
+ #1 #2 scale %
+ neg exch neg exch translate%
+ }%
+ #3%
+ \special{ps:%
+ currentpoint %
+ grestore %
+ moveto%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOLOGO@ScaleBox@dvipdfm}
+% \begin{macrocode}
+\HOLOGO@temp{dvipdfm}{%
+ \let\HOLOGO@ScaleBox@dvipdfm\HOLOGO@ScaleBox@dvips
+}
+% \end{macrocode}
+% \end{macro}
+% Since \hologo{XeTeX} v0.6.
+% \begin{macro}{\HOLOGO@ScaleBox@xetex}
+% \begin{macrocode}
+\HOLOGO@temp{xetex}{%
+ \def\HOLOGO@ScaleBox@xetex#1#2#3{%
+ \special{x:gsave}%
+ \special{x:scale #1 #2}%
+ #3%
+ \special{x:grestore}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOLOGO@ScaleBox@vtex}
+% \begin{macrocode}
+\HOLOGO@temp{vtex}{%
+ \def\HOLOGO@ScaleBox@vtex#1#2#3{%
+ \special{r(#1,0,0,#2,0,0}%
+ #3%
+ \special{r)}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\HOLOGO@AtEnd%
+%</package>
+% \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 hologo.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Spacefactor}
+%
+% The space factor must be 1000 after a logo. If it is greater 1000
+% then the following space is a space after a sentence closing point.
+% If the space factor is smaller 1000 then an immediate following
+% dot is interpreted as abbreviation, not sentence closing point.
+%
+% \begin{macrocode}
+%<*test-spacefactor>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{hologo}[2017/05/01]
+\usepackage{kvsetkeys}
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\begin{document}
+\begin{qstest}{spacefactor}{spacefactor}
+\newcommand*{\Test}[1]{%
+ \sbox0{%
+ \hologo{#1}%
+ \Expect*{1000 (#1)}*{\the\spacefactor\space(#1)}%
+ }%
+}%
+\makeatletter
+\def\TestList{}
+\def\hologoEntry#1#2#3{%
+ \edef\TestList{%
+ \ifx\TestList\@empty
+ \else
+ \TestList,%
+ \fi
+ #1%
+ \ifx\\#2\\%
+ \else
+ ={variant=#2}%
+ \fi
+ }%
+}
+\hologoList
+\expandafter\kv@parse@normalized\expandafter{%
+ \TestList
+}{%
+ \begingroup
+ \let\@logo=\kv@key
+ \ifx\kv@value\relax
+ \else
+ \expandafter\hologoLogoSetup\expandafter\@logo\expandafter{%
+ \kv@value
+ }%
+ \fi
+ \Test\@logo
+ \endgroup
+ \@gobbletwo
+}
+\end{qstest}
+\end{document}
+%</test-spacefactor>
+% \end{macrocode}
+%
+% \subsection{Complete list}
+%
+% \begin{macrocode}
+%<*test-list>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass[12pt,a4paper]{article}
+\usepackage{hologo}[2017/05/01]
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage{parskip}
+\usepackage[unicode]{hyperref}[2011/09/28]
+\usepackage{bookmark}[2011/09/19]
+\bookmarksetup{%
+ numbered,%
+ open,%
+ openlevel=2,%
+}
+\renewcommand*{\contentsname}{List of logos}
+\begin{document}
+\tableofcontents
+\def\TestFont#1#2#3#4#5#6{%
+ \begingroup
+ \usefont{#3}{#4}{#5}{#6}%
+ \HologoVariant{#1}{#2}/\hologoVariant{#1}{#2}%
+ \quad
+ \begingroup\scriptsize\hologoVariant{#1}{#2}\endgroup
+ \quad
+ \endgroup
+ (#3/#4/#5/#6)%
+ \par
+}
+\makeatletter
+\def\hologoEntry#1#2#3{%
+ \section{%
+ \HologoVariant{#1}{#2}/\hologoVariant{#1}{#2} %
+ {[#1\ifx\\#2\\\else\space(#2)\fi]}% hash-ok
+ }% braces around [] because of bug in tex4ht
+ \begingroup
+ \hypersetup{unicode=false}%
+ \bookmark[%
+ dest=\@currentHref,%
+ rellevel=1,%
+ keeplevel,%
+ ]{%
+ \HologoVariant{#1}{#2}/\hologoVariant{#1}{#2} %
+ (PDFDocEncoding)%
+ }%
+ \endgroup
+ \TestFont{#1}{#2}{OT1}{cmr}{m}{n}%
+ \TestFont{#1}{#2}{OT1}{cmss}{m}{n}%
+ \TestFont{#1}{#2}{OT1}{cmr}{b}{n}%
+ \TestFont{#1}{#2}{OT1}{cmr}{m}{it}%
+ \TestFont{#1}{#2}{OT1}{cmtt}{m}{n}%
+ \TestFont{#1}{#2}{T1}{lmr}{m}{n}%
+ \TestFont{#1}{#2}{T1}{lmss}{m}{n}%
+ \TestFont{#1}{#2}{T1}{lmr}{b}{n}%
+ \TestFont{#1}{#2}{T1}{lmr}{m}{it}%
+ \TestFont{#1}{#2}{T1}{lmtt}{m}{n}%
+ \TestFont{#1}{#2}{T1}{lmvtt}{m}{n}%
+ \TestFont{#1}{#2}{T1}{qtm}{m}{n}%
+ \TestFont{#1}{#2}{T1}{qhv}{m}{n}%
+ \TestFont{#1}{#2}{T1}{qtm}{b}{n}%
+ \TestFont{#1}{#2}{T1}{qtm}{m}{it}%
+ \TestFont{#1}{#2}{T1}{qcr}{m}{n}%
+ \newpage
+}
+\makeatother
+\hologoList
+\end{document}
+%</test-list>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hologo}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hologo.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hologo.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[\CTAN{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 hologo.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@{}}
+% hologo.sty & tex/generic/oberdiek/hologo.sty\\
+% hologo.pdf & doc/latex/oberdiek/hologo.pdf\\
+% example/hologo-example.tex & doc/latex/oberdiek/example/hologo-example.tex\\
+% test/hologo-test1.tex & doc/latex/oberdiek/test/hologo-test1.tex\\
+% test/hologo-test-spacefactor.tex & doc/latex/oberdiek/test/hologo-test-spacefactor.tex\\
+% test/hologo-test-list.tex & doc/latex/oberdiek/test/hologo-test-list.tex\\
+% hologo.dtx & source/latex/oberdiek/hologo.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hologo.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hologo.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 hologo.dtx
+%makeindex -s gind.ist hologo.idx
+%pdflatex hologo.dtx
+%makeindex -s gind.ist hologo.idx
+%pdflatex hologo.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hologo.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hologo'>
+ <name>hologo</name>
+ <caption>A collection of logos with bookmark support.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2010-2012'/>
+ <license type='lppl1.3'/>
+ <version number='1.10'/>
+ <description>
+ The package defines a single command <tt>\hologo</tt>, whose
+ argument is the usual case-confused ASCII version of the logo.
+ The command is bookmark-enabled, so that every logo becomes
+ available in bookmarks without further work.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hologo.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hologo.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+%
+% \bibitem{btxdoc}
+% Oren Patashnik,
+% \textit{\hologo{BibTeX}ing},
+% 1988-02-08.\\
+% \CTAN{biblio/bibtex/base/}
+%
+% \bibitem{dtklogos}
+% Gerd Neugebauer, DANTE,
+% \textit{Package \xpackage{dtklogos}},
+% 2011-04-25.\\
+% \CTAN{usergrps/dante/dtk/dtklogos.sty}
+%
+% \bibitem{etexman}
+% The \hologo{NTS} Team,
+% \textit{The \hologo{eTeX} manual},
+% 1998-02.\\
+% \CTAN{systems/e-tex/v2/doc/}
+%
+% \bibitem{ExTeX-FAQ}
+% The \hologo{ExTeX} group,
+% \textit{\hologo{ExTeX}: FAQ -- How is \hologo{ExTeX} typeset?},
+% 2007-04-14.\\
+% \url{http://www.extex.org/documentation/faq.html}
+%
+% \bibitem{LyX}
+% ^^A@MISC{ LyX,
+% ^^A title = {{LyX 2.0.0 -- The Document Processor [Computer software and manual]}},
+% ^^A author = {{The LyX Team}},
+% ^^A howpublished = {Internet: http://www.lyx.org},
+% ^^A year = {2011-05-08},
+% ^^A note = {Retrieved May 10, 2011, from http://www.lyx.org},
+% ^^A url = {http://www.lyx.org/}
+% ^^A}
+% The \hologo{LyX} Team,
+% \textit{\hologo{LyX} -- The Document Processor},
+% 2011-05-08.\\
+% \url{http://www.lyx.org/}
+%
+% \bibitem{OzTeX}
+% Andrew Trevorrow,
+% \hologo{OzTeX} FAQ: What is the correct way to typeset ``\hologo{OzTeX}''?,
+% 2011-09-15 (visited).
+% \url{http://www.trevorrow.com/oztex/ozfaq.html#oztex-logo}
+%
+% \bibitem{PiCTeX}
+% Michael Wichura,
+% \textit{The \hologo{PiCTeX} macro package},
+% 1987-09-21.
+% \CTAN{graphics/pictex/}
+%
+% \bibitem{scrlogo}
+% Markus Kohm,
+% \textit{\hologo{KOMAScript} Datei \xfile{scrlogo.dtx}},
+% 2009-01-30.\\
+% \CTAN{install/macros/latex/contrib/komascript.tds.zip}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2010/04/08 v1.0}
+% \item
+% The first version.
+% \end{Version}
+% \begin{Version}{2010/04/16 v1.1}
+% \item
+% \cs{Hologo} added for support of logos at start of a sentence.
+% \item
+% \cs{hologoSetup} and \cs{hologoLogoSetup} added.
+% \item
+% Options \xoption{break}, \xoption{hyphenbreak}, \xoption{spacebreak}
+% added.
+% \item
+% Variant support added by option \xoption{variant}.
+% \end{Version}
+% \begin{Version}{2010/04/24 v1.2}
+% \item
+% \hologo{LaTeX3} added.
+% \item
+% \hologo{VTeX} added.
+% \end{Version}
+% \begin{Version}{2010/11/21 v1.3}
+% \item
+% \hologo{iniTeX}, \hologo{virTeX} added.
+% \end{Version}
+% \begin{Version}{2011/03/25 v1.4}
+% \item
+% \hologo{ConTeXt} with variants added.
+% \item
+% Option \xoption{discretionarybreak} added as refinement for
+% option \xoption{break}.
+% \end{Version}
+% \begin{Version}{2011/04/21 v1.5}
+% \item
+% Wrong TDS directory for test files fixed.
+% \end{Version}
+% \begin{Version}{2011/10/01 v1.6}
+% \item
+% Support for package \xpackage{tex4ht} added.
+% \item
+% Support for \cs{csname} added if \cs{ifincsname} is available.
+% \item
+% New logos:
+% \hologo{(La)TeX},
+% \hologo{biber},
+% \hologo{BibTeX} (\xoption{sc}, \xoption{sf}),
+% \hologo{emTeX},
+% \hologo{ExTeX},
+% \hologo{KOMAScript},
+% \hologo{La},
+% \hologo{LyX},
+% \hologo{MiKTeX},
+% \hologo{NTS},
+% \hologo{OzMF},
+% \hologo{OzMP},
+% \hologo{OzTeX},
+% \hologo{OzTtH},
+% \hologo{PCTeX},
+% \hologo{PiC},
+% \hologo{PiCTeX},
+% \hologo{METAFONT},
+% \hologo{MetaFun},
+% \hologo{METAPOST},
+% \hologo{MetaPost},
+% \hologo{SLiTeX} (\xoption{lift}, \xoption{narrow}, \xoption{simple}),
+% \hologo{SliTeX} (\xoption{narrow}, \xoption{simple}, \xoption{lift}),
+% \hologo{teTeX}.
+% \item
+% Fixes:
+% \hologo{iniTeX},
+% \hologo{pdfLaTeX},
+% \hologo{pdfTeX},
+% \hologo{virTeX}.
+% \item
+% \cs{hologoFontSetup} and \cs{hologoLogoFontSetup} added.
+% \item
+% \cs{hologoVariant} and \cs{HologoVariant} added.
+% \end{Version}
+% \begin{Version}{2011/11/22 v1.7}
+% \item
+% New logos:
+% \hologo{BibTeX8},
+% \hologo{LaTeXML},
+% \hologo{SageTeX},
+% \hologo{TeX4ht},
+% \hologo{TTH}.
+% \item
+% \hologo{Xe} and friends: Driver stuff fixed.
+% \item
+% \hologo{Xe} and friends: Support for italic added.
+% \item
+% \hologo{Xe} and friends: Package support for \xpackage{pgf}
+% and \xpackage{pstricks} added.
+% \end{Version}
+% \begin{Version}{2011/11/29 v1.8}
+% \item
+% New logos:
+% \hologo{HanTheThanh}.
+% \end{Version}
+% \begin{Version}{2011/12/21 v1.9}
+% \item
+% Patch for package \xpackage{ifxetex} added for the case that
+% \cs{newif} is undefined in \hologo{iniTeX}.
+% \item
+% Some fixes for \hologo{iniTeX}.
+% \end{Version}
+% \begin{Version}{2012/04/26 v1.10}
+% \item
+% Fix in bookmark version of logo ``\hologo{HanTheThanh}''.
+% \end{Version}
+% \begin{Version}{2016/05/12 v1.11}
+% \item
+% Update HOLOGO@IfCharExists (previously in texlive)
+% \item define pdfliteral in current luatex.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.12}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2017/05/01 v1.13}
+% \item
+% Removing spurious comments in bibliography. (github PR from yudai-nkt)
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hologo.pdf b/macros/latex/contrib/oberdiek/hologo.pdf
new file mode 100644
index 0000000000..266f19fc2d
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hologo.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/holtxdoc.dtx b/macros/latex/contrib/oberdiek/holtxdoc.dtx
new file mode 100644
index 0000000000..9f7648bc68
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/holtxdoc.dtx
@@ -0,0 +1,862 @@
+% \iffalse meta-comment
+%
+% File: holtxdoc.dtx
+% Version: 2019/07/27 v0.28
+% Info: Private additional ltxdoc support
+%
+% Copyright (C) 1999-2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file holtxdoc.dtx
+% and the derived files
+% holtxdoc.sty, holtxdoc.pdf, holtxdoc.ins, holtxdoc.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/holtxdoc.dtx
+% CTAN:macros/latex/contrib/oberdiek/holtxdoc.pdf
+%
+% Unpacking:
+% (a) If holtxdoc.ins is present:
+% tex holtxdoc.ins
+% (b) Without holtxdoc.ins:
+% tex holtxdoc.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{holtxdoc.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If holtxdoc.drv is present:
+% latex holtxdoc.drv
+% (b) Without holtxdoc.drv:
+% latex holtxdoc.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 holtxdoc.dtx
+% makeindex -s gind.ist holtxdoc.idx
+% pdflatex holtxdoc.dtx
+% makeindex -s gind.ist holtxdoc.idx
+% pdflatex holtxdoc.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/holtxdoc.sty
+% TDS:doc/latex/oberdiek/holtxdoc.pdf
+% TDS:source/latex/oberdiek/holtxdoc.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: holtxdoc 2019/07/27 v0.28 Private additional ltxdoc support (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: holtxdoc
+Version: 2019/07/27 v0.28
+
+Copyright (C) 1999-2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file holtxdoc.dtx
+and the derived files
+ holtxdoc.sty, holtxdoc.pdf, holtxdoc.ins, holtxdoc.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{holtxdoc.ins}{\from{holtxdoc.dtx}{install}}%
+ \file{holtxdoc.drv}{\from{holtxdoc.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{holtxdoc.sty}{\from{holtxdoc.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{holtxdoc.xml}{\from{holtxdoc.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{* holtxdoc.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `holtxdoc.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{holtxdoc.drv}%
+ [2019/07/27 v0.28 Private additional ltxdoc support (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{holtxdoc.dtx}%
+\end{document}
+%</driver>
+% \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{holtxdoc.drv}
+%
+% \title{The \xpackage{holtxdoc} package}
+% \date{2019/07/27 v0.28}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package is used for the documentation of my packages in
+% DTX format. It contains some private macros and setup for
+% my needs. Thus do not use it. I have separated the part
+% that may be useful for others in package \xpackage{hypdoc}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{No usage}
+%
+% Caution: \emph{This package is not intended for public use!}
+%
+% It contains the macros and settings to generate the
+% documentation of my packages in \CTAN{macros/latex/contrib/oberdiek/}.
+% Thus the package does not know anything about compatibility. Only
+% my current packages' documentation must compile.
+%
+% Older versions were more interesting, because they contained code
+% to add \xpackage{hyperref}'s features to \LaTeX's \xpackage{doc}
+% system, e.g. bookmarks and index links. I separated this stuff
+% and made a new package \xpackage{hypdoc}.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{holtxdoc}%
+ [2019/07/27 v0.28 Private additional ltxdoc support (HO)]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\PassOptionsToPackage{pdfencoding=auto}{hyperref}
+\RequirePackage[numbered]{hypdoc}[2010/03/26]
+\RequirePackage{hyperref}[2010/03/30]
+\RequirePackage{pdftexcmds}[2010/04/01]
+\RequirePackage{ltxcmds}[2010/03/09]
+\RequirePackage{hologo}[2011/11/22]
+\RequirePackage{ifluatex}[2010/03/01]
+\RequirePackage{array}
+% \end{macrocode}
+%
+% \subsection{Help macros}
+%
+% \begin{macrocode}
+\def\hld@info#1{%
+ \PackageInfo{holtxdoc}{#1\@gobble}%
+}
+\def\hld@warn#1{%
+ \PackageWarningNoLine{holtxdoc}{#1}%
+}
+% \end{macrocode}
+%
+% \subsection{Font setup for \hologo{LuaLaTeX}}
+%
+% \begin{macrocode}
+\ifluatex
+ \RequirePackage{fontspec}[2011/09/18]%
+ \RequirePackage{unicode-math}[2011/09/19]%
+ \setmathfont{latinmodern-math.otf}%
+\fi
+% \end{macrocode}
+%
+% \subsection{Date}
+%
+% \begin{macrocode}
+\ltx@IfUndefined{pdf@filemoddate}{%
+}{%
+ \edef\hld@temp{\pdf@filemoddate{\jobname.dtx}}%
+ \ifx\hld@temp\ltx@empty
+ \else
+ \begingroup
+ \def\x#1:#2#3#4#5#6#7#8#9{%
+ \year=#2#3#4#5\relax
+ \month=#6#7\relax
+ \day=#8#9\relax
+ \y
+ }%
+ \def\y#1#2#3#4#5\@nil{%
+ \time=#1#2\relax
+ \multiply\time by 60\relax
+ \advance\time#3#4\relax
+ }%
+ \expandafter\x\hld@temp\@nil
+ \edef\x{\endgroup
+ \year=\the\year\relax
+ \month=\the\month\relax
+ \day=\the\day\relax
+ \time=\the\time\relax
+ }%
+ \x
+ \edef\hld@temp{%
+ \noexpand\hypersetup{%
+ pdfcreationdate=\hld@temp,%
+ pdfmoddate=\hld@temp
+ }%
+ }%
+ \hld@temp
+ \fi
+}
+% \end{macrocode}
+%
+% \subsection{History}
+%
+% \begin{macro}{\historyname}
+% \begin{macrocode}
+\providecommand*{\historyname}{History}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\newcommand*{\StartHistory}{%
+ \section{\historyname}%
+}
+\@ifpackagelater{hyperref}{2009/11/27}{%
+ \newcommand*{\HistVersion}[1]{%
+ \subsection*{[#1]}% hash-ok
+ \addcontentsline{toc}{subsection}{[#1]}% hash-ok
+ \def\HistLabel##1{%
+ \begingroup
+ \protected@edef\@currentlabel{[#1]}% hash-ok
+ \label{##1}%
+ \endgroup
+ }%
+ }%
+}{%
+ \newcommand*{\HistVersion}[1]{%
+ \subsection*{%
+ \phantomsection
+ \addcontentsline{toc}{subsection}{[#1]}% hash-ok
+ [#1]% hash-ok
+ }%
+ \def\HistLabel##1{%
+ \begingroup
+ \protected@edef\@currentlabel{[#1]}% hash-ok
+ \label{##1}%
+ \endgroup
+ }%
+ }%
+}
+\newenvironment{History}{%
+ \StartHistory
+ \def\Version##1{%
+ \HistVersion{##1}%
+ \@ifnextchar\end{%
+ \let\endVersion\relax
+ }{%
+ \let\endVersion\enditemize
+ \itemize
+ }%
+ }%
+ \raggedright
+}{}
+% \end{macrocode}
+%
+% \subsection{Formatting macros}
+%
+% \cs{UrlFoot}\\
+% |#1|: text\\
+% |#2|: url
+% \begin{macrocode}
+\newcommand{\URL}[2]{%
+ \begingroup
+ \def\link{\href{#2}}%
+ #1%
+ \endgroup
+ \footnote{Url: \url{#2}}%
+}
+% \end{macrocode}
+% \cs{NameEmail}\\
+% |#1|: name\\
+% |#2|: email address
+% \begin{macrocode}
+\newcommand*{\NameEmail}[2]{%
+ \expandafter\hld@NameEmail\expandafter{#2}{#1}%
+}
+\def\hld@NameEmail#1#2{%
+ \expandafter\hld@@NameEmail\expandafter{#2}{#1}%
+}
+\def\hld@@NameEmail#1#2{%
+ \ifx\\#1#2\\%
+ \hld@warn{%
+ Command \string\NameEmail\space without name and email%
+ }%
+ \else
+ \ifx\\#1\\%
+ \href{mailto:#2}{\nolinkurl{#2}}%
+ \else
+ #1%
+ \ifx\\#2\\%
+ \else
+ \footnote{%
+ #1's email address: %
+ \href{mailto:#2}{\nolinkurl{#2}}%
+ }%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand*{\Package}[1]{\texttt{#1}}
+\newcommand*{\File}[1]{\texttt{#1}}
+\newcommand*{\Verb}[1]{\texttt{#1}}
+\newcommand*{\CS}[1]{\texttt{\expandafter\@gobble\string\\#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand*{\CTAN}[1]{%
+ \href{http://ctan.org/pkg/#1}{\nolinkurl{CTAN:#1}}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*{\Newsgroup}[1]{%
+ \href{http://groups.google.com/group/#1/topics}{\nolinkurl{news:#1}}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand*{\xpackage}[1]{\textsf{#1}}
+\newcommand*{\xmodule}[1]{\textsf{#1}}
+\newcommand*{\xclass}[1]{\textsf{#1}}
+\newcommand*{\xoption}[1]{\textsf{#1}}
+\newcommand*{\xfile}[1]{\texttt{#1}}
+\newcommand*{\xext}[1]{\texttt{.#1}}
+\newcommand*{\xemail}[1]{%
+ \textless\texttt{#1}\textgreater%
+}
+\newcommand*{\xnewsgroup}[1]{%
+ \href{news:#1}{\nolinkurl{#1}}%
+}
+% \end{macrocode}
+%
+% The following environment |declcs| is derived from
+% environment |decl| of \xfile{ltxguide.cls}:
+% \begin{macrocode}
+\newenvironment{declcs}[1]{%
+ \par
+ \addvspace{4.5ex plus 1ex}%
+ \vskip -\parskip
+ \noindent
+ \hspace{-\leftmargini}%
+ \def\M##1{\texttt{\{}\meta{##1}\texttt{\}}}%
+ \def\*{\unskip\,\texttt{*}}%
+ \begin{tabular}{|l|}%
+ \hline
+ \expandafter\SpecialUsageIndex\csname #1\endcsname
+ \cs{#1}%
+}{%
+ \\%
+ \hline
+ \end{tabular}%
+ \nobreak
+ \par
+ \nobreak
+ \vspace{2.3ex}%
+ \vskip -\parskip
+ \noindent
+ \ignorespacesafterend
+}
+% \end{macrocode}
+%
+% \subsection{Names}
+%
+% \begin{macrocode}
+\def\eTeX{\hologo{eTeX}}
+\def\pdfTeX{\hologo{pdfTeX}}
+\def\pdfLaTeX{\hologo{pdfLaTeX}}
+\def\LuaTeX{\hologo{LuaTeX}}
+\def\LuaLaTeX{\hologo{LuaLaTeX}}
+\def\XeTeX{\hologo{XeTeX}}
+\def\XeLaTeX{\hologo{XeLaTeX}}
+\def\plainTeX{\hologo{plainTeX}}
+\providecommand*{\teTeX}{te\TeX}
+\providecommand*{\mikTeX}{mik\TeX}
+\providecommand*{\MakeIndex}{\textsl{MakeIndex}}
+\providecommand*{\docstrip}{\textsf{docstrip}}
+\providecommand*{\iniTeX}{\mbox{ini-\TeX}}
+\providecommand*{\VTeX}{V\TeX}
+% \end{macrocode}
+%
+% \subsection{Setup}
+%
+% \subsubsection{Package \xpackage{doc}}
+%
+% \begin{macrocode}
+\CodelineIndex
+\EnableCrossrefs
+\setcounter{IndexColumns}{2}
+% \end{macrocode}
+% \begin{macrocode}
+\DoNotIndex{\begingroup,\endgroup,\bgroup,\egroup}
+\DoNotIndex{\def,\edef,\xdef,\global,\long,\let}
+\DoNotIndex{\expandafter,\noexpand,\string}
+\DoNotIndex{\else,\fi,\or}
+\DoNotIndex{\relax}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\IndexPrologue{%
+ \section*{Index}%
+ \markboth{Index}{Index}%
+ Numbers written in italic refer to the page %
+ where the corresponding entry is described; %
+ numbers underlined refer to the %
+ \ifcodeline@index
+ code line of the %
+ \fi
+ definition; plain numbers refer to the %
+ \ifcodeline@index
+ code lines %
+ \else
+ pages %
+ \fi
+ where the entry is used.%
+}
+% \end{macrocode}
+%
+% \subsubsection{Page layout}
+% \begin{macrocode}
+\addtolength{\textheight}{\headheight}
+\addtolength{\textheight}{\headsep}
+\setlength{\headheight}{0pt}
+\setlength{\headsep}{0pt}
+% \end{macrocode}
+% \begin{macrocode}
+\addtolength{\topmargin}{-10mm}
+\addtolength{\textheight}{20mm}
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/holtxdoc}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/holtxdoc.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/holtxdoc.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[\CTAN{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 holtxdoc.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@{}}
+% holtxdoc.sty & tex/latex/oberdiek/holtxdoc.sty\\
+% holtxdoc.pdf & doc/latex/oberdiek/holtxdoc.pdf\\
+% holtxdoc.dtx & source/latex/oberdiek/holtxdoc.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk holtxdoc.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{holtxdoc.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 holtxdoc.dtx
+%makeindex -s gind.ist holtxdoc.idx
+%pdflatex holtxdoc.dtx
+%makeindex -s gind.ist holtxdoc.idx
+%pdflatex holtxdoc.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{holtxdoc.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='holtxdoc'>
+ <name>holtxdoc</name>
+ <caption>Documentation macros for oberdiek bundle, etc.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1999-2012'/>
+ <license type='lppl1.3'/>
+ <version number='0.28'/>
+ <description>
+ These are personal macros, which are not necessarily useful to
+ other authors (they are provided as part off the source of others
+ of the author's packages). Macros that may be of use to other
+ authors are available separately, in package
+ <xref refid='hypdoc'>hypdoc</xref>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/holtxdoc.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/holtxdoc.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1999/06/26 v0.3}
+% \item
+% \dots
+% \end{Version}
+% \begin{Version}{2000/08/14 v0.4}
+% \item
+% \dots
+% \end{Version}
+% \begin{Version}{2001/08/27 v0.5}
+% \item
+% \dots
+% \end{Version}
+% \begin{Version}{2001/09/02 v0.6}
+% \item
+% \dots
+% \end{Version}
+% \begin{Version}{2006/06/02 v0.7}
+% \item
+% Major change: most is put into a new package \xpackage{hypdoc}.
+% \end{Version}
+% \begin{Version}{2007/10/21 v0.8}
+% \item
+% \cs{XeTeX} and \cs{XeLaTeX} added.
+% \end{Version}
+% \begin{Version}{2007/11/11 v0.9}
+% \item
+% \cs{LuaTeX} added.
+% \end{Version}
+% \begin{Version}{2007/12/12 v0.10}
+% \item
+% \cs{iniTeX} added.
+% \end{Version}
+% \begin{Version}{2008/08/11 v0.11}
+% \item
+% \cs{Newsgroup}, \cs{xnewsgroup}, and \cs{URL} updated.
+% \end{Version}
+% \begin{Version}{2009/08/07 v0.12}
+% \item
+% \cs{xmodule} added.
+% \end{Version}
+% \begin{Version}{2009/12/02 v0.13}
+% \item
+% Anchor hack for unnumbered subsections is removed for
+% \xpackage{hyperref} $\ge$ 2009/11/27 6.79k.
+% \end{Version}
+% \begin{Version}{2010/02/03 v0.14}
+% \item
+% \cs{XeTeX} and \cs{XeLaTeX} are made robust.
+% \end{Version}
+% \begin{Version}{2010/03/10 v0.15}
+% \item
+% \cs{LuaTeX} changed according to Hans Hagen's definition
+% in the luatex mailing list.
+% \end{Version}
+% \begin{Version}{2010/04/03 v0.16}
+% \item
+% Use date and time of \xext{dtx} file.
+% \end{Version}
+% \begin{Version}{2010/04/08 v0.17}
+% \item
+% Option \xoption{pdfencoding=auto} added for package \xpackage{hyperref}.
+% \item
+% Package \xpackage{hologo} added.
+% \end{Version}
+% \begin{Version}{2010/04/18 v0.18}
+% \item
+% Standard index prologue replaced by corrected prologue.
+% \end{Version}
+% \begin{Version}{2010/04/24 v0.19}
+% \item
+% Requested date of package \xpackage{hologo} updated.
+% \end{Version}
+% \begin{Version}{2010/12/03 v0.20}
+% \item
+% History is now set using \cs{raggedright}.
+% \end{Version}
+% \begin{Version}{2011/02/04 v0.21}
+% \item
+% GL needs \cs{protected@edef} instead of \cs{edef} in \cs{HistLabel}.
+% \end{Version}
+% \begin{Version}{2011/11/22 v0.22}
+% \item
+% Font stuff added for \hologo{LuaLaTeX}.
+% \end{Version}
+% \begin{Version}{2012/03/07 v0.23}
+% \item
+% Accept empty history version.
+% \end{Version}
+% \begin{Version}{2012/03/21 v0.24}
+% \item
+% Section title for history uses \cs{historyname}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v0.25}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/05/16 v0.26}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/05/17 v0.27}
+% \item
+% New name for lm math font
+% \end{Version}
+% \begin{Version}{2019/07/27 v0.28}
+% \item Use CTAN's preferred URL form for packages
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/holtxdoc.pdf b/macros/latex/contrib/oberdiek/holtxdoc.pdf
new file mode 100644
index 0000000000..0424029a50
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/holtxdoc.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hopatch.dtx b/macros/latex/contrib/oberdiek/hopatch.dtx
new file mode 100644
index 0000000000..651396aeda
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hopatch.dtx
@@ -0,0 +1,964 @@
+% \iffalse meta-comment
+%
+% File: hopatch.dtx
+% Version: 2016/05/16 v1.3
+% Info: Wrapper for package hooks
+%
+% Copyright (C) 2011, 2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file hopatch.dtx
+% and the derived files
+% hopatch.sty, hopatch.pdf, hopatch.ins, hopatch.drv,
+% hopatch-test1.tex, hopatch-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hopatch.dtx
+% CTAN:macros/latex/contrib/oberdiek/hopatch.pdf
+%
+% Unpacking:
+% (a) If hopatch.ins is present:
+% tex hopatch.ins
+% (b) Without hopatch.ins:
+% tex hopatch.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hopatch.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hopatch.drv is present:
+% latex hopatch.drv
+% (b) Without hopatch.drv:
+% latex hopatch.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 hopatch.dtx
+% makeindex -s gind.ist hopatch.idx
+% pdflatex hopatch.dtx
+% makeindex -s gind.ist hopatch.idx
+% pdflatex hopatch.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/hopatch.sty
+% TDS:doc/latex/oberdiek/hopatch.pdf
+% TDS:doc/latex/oberdiek/test/hopatch-test1.tex
+% TDS:doc/latex/oberdiek/test/hopatch-test2.tex
+% TDS:source/latex/oberdiek/hopatch.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hopatch 2016/05/16 v1.3 Wrapper for package hooks (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hopatch
+Version: 2016/05/16 v1.3
+
+Copyright (C) 2011, 2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file hopatch.dtx
+and the derived files
+ hopatch.sty, hopatch.pdf, hopatch.ins, hopatch.drv,
+ hopatch-test1.tex, hopatch-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hopatch.ins}{\from{hopatch.dtx}{install}}%
+ \file{hopatch.drv}{\from{hopatch.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{hopatch.sty}{\from{hopatch.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{hopatch-test1.tex}{\from{hopatch.dtx}{test1}}%
+% \file{hopatch-test2.tex}{\from{hopatch.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hopatch.xml}{\from{hopatch.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{* hopatch.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hopatch.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hopatch.drv}%
+ [2016/05/16 v1.3 Wrapper for package hooks (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{caption}
+\usepackage{array}
+\setlength{\extrarowheight}{1pt}
+\renewcommand*{\arraystretch}{1.1}
+\begin{document}
+ \DocInput{hopatch.dtx}%
+\end{document}
+%</driver>
+% \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{hopatch.drv}
+%
+% \title{The \xpackage{hopatch} package}
+% \date{2016/05/16 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This packages provides a wrapper to various package hooks
+% provided by other packages or classes, but does not define
+% own hooks.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% Sometimes I want to add code right after a package
+% has been loaded. Examples are bug fixes, adaptations,
+% or added features as needed by package \xpackage{hyperref},
+% for instance.
+%
+% Unhappily \hologo{LaTeX} does not provide this kind of
+% hook. \cs{AtEndOfPackage} can be used inside the package
+% only, because \hologo{LaTeX} clears the hook right before
+% it loads the package.
+%
+% However, there are already many packages and classes
+% that provide hooks that are executed after the package
+% is loaded, see table~\ref{tab:hooks}.
+%
+% \begin{table}
+% \caption{After package hooking}
+% \label{tab:hooks}
+% \begin{tabular}{ll}
+% \bfseries Macro & \bfseries Provider\\
+% \hline
+% \cs{AfterPackage} & package \xpackage{scrlfile} \cite{scrlfile}\\
+% \cs{AtEndOfPackageFile} & package \xpackage{filehook} \cite{filehook}\\
+% \cs{AtEndPackage} & class \xclass{memoir} \cite{memoir}
+% \end{tabular}
+% \end{table}
+%
+% Package \xpackage{hopatch} can be used without the packages
+% of table~\ref{tab:hooks}. But for an early executing right
+% after a package is loaded, one of the following class or
+% packages should be loaded before using \cs{hopatch@AfterPackage}:
+% \begin{itemize}
+% \item package \xpackage{filehook}
+% \item package \xpackage{scrlfile}
+% \item class \xclass{memoir}
+% \end{itemize}
+%
+% \begin{table}
+% \caption{After begin document hooking}
+% \begin{tabular}{ll}
+% \bfseries Macro & \bfseries Provider\\
+% \hline
+% \cs{AtBeginDocument} & \hologo{LaTeX}'s kernel\\
+% \cs{AtEndPreamble} & package \xpackage{etoolbox} \cite{etoolbox}\\
+% \cs{AfterEndPreamble} & package \xpackage{etoolbox}
+% \end{tabular}
+% \end{table}
+%
+% Therefore I skip writing a new package for hooking into
+% \hologo{LaTeX}'s package management and use this package
+% to provide a wrapper to patch a package after it is loaded.
+%
+% \begin{declcs}{hopatch@AfterPackage} \M{package} \M{patch code}
+% \end{declcs}
+% If the package is already loaded, the \meta{patch code} is executed
+% immediately.
+% Otherwise the \meta{patch code} is stored in a command and tried
+% at later locations until the package is available.
+%
+% The patch is tried in the following order:
+% \begin{enumerate}
+% \item If the package is already loaded, the patch is
+% applied immediately. Further locations are not tried.
+% \item \cs{AtEndPackage}, provided by class \xclass{memoir} \cite{memoir},
+% and \cs{AfterPackage}, provided by package \xpackage{scrlfile} \cite{scrlfile},
+% are called right after the package file is input before
+% the hook of \hologo{LaTeX}'s \cs{AtEndOfPackage}.
+% \item \cs{AtEndOfPackageFile}, provided by package \xpackage{filehook} \cite{filehook},
+% is called after the package is loaded and after the hook of
+% \hologo{LaTeX}'s \cs{AtEndOfPackage}.
+% \item \cs{AtEndPreamble}, provided by package \xpackage{etoolbox} \cite{etoolbox},
+% is called at the beginning of |\begin{document}| before the hook
+% of \hologo{LaTeX}'s \cs{AtBeginDocument}.
+% \item \cs{AtBeginDocument}, provided by \hologo{LaTeX}.
+% \item \cs{AfterEndDocument}, provided by package \xpackage{etoolbox} \cite{etoolbox},
+% is called at the very end of |\begin{document}|. Preamble commands are
+% already forbidden there.
+% \end{enumerate}
+% Because of the various locations the patch code is restricted to
+% limitations:
+% \begin{itemize}
+% \item
+% Preamble commands, see \hologo{LaTeX}'s \cs{@onlypreamble}
+% throw an error if used after |\begin{document}|. This is already
+% the case for \cs{AfterEndDocument}. Therefore preamble commands
+% are forbidden in the patching code.
+% There are four exceptions \cs{@ifpackageloaded}, \cs{@ifclassloaded},
+% \cs{@ifpackagelater} and \cs{@ifclasslater}. They are redefined
+% during \cs{AfterEndDocument} using the counterparts of
+% package \xpackage{ltxcmds} \cite{ltxcmds}.
+% \item
+% \cs{AfterPackage} of package \xpackage{scrlfile} and \cs{AtEndPackage}
+% of class \xclass{memoir} call the hook before \hologo{LaTeX}'s
+% \cs{AtEndOfPackage}.
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Catcodes and package identification}
+%
+% \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 HOpatch@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\HOpatch@AtEnd{%
+ \HOpatch@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\HOpatch@AtEnd{\HOpatch@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hopatch}%
+ [2016/05/16 v1.3 Wrapper for package hooks (HO)]
+% \end{macrocode}
+%
+% \subsection{Resources}
+%
+% \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{ltxcmds}[2010/12/12]%
+\else
+ \RequirePackage{ltxcmds}[2010/12/12]%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\HOpatch@counter}
+% \begin{macrocode}
+\def\HOpatch@counter{0}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOpatch@StepCounter}
+% \begin{macrocode}
+\ltx@ifundefined{numexpr}{%
+ \def\HOpatch@StepCounter{%
+ \begingroup
+ \count@\HOpatch@counter\relax
+ \advance\count@\ltx@one\relax
+ \edef\x{\endgroup
+ \noexpand\def\noexpand\HOpatch@counter{\the\count@}%
+ }%
+ \x
+ }%
+}{%
+ \def\HOpatch@StepCounter{%
+ \edef\HOpatch@counter{%
+ \the\numexpr\HOpatch@counter+\ltx@one\relax
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOpatch@list}
+% \begin{macrocode}
+\def\HOpatch@list{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOpatch@Add}
+% \begin{macrocode}
+\def\HOpatch@Add{%
+ \ltx@LocalAppendToMacro\HOpatch@list
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Package patching}
+%
+% \begin{macro}{\hopatch@AfterPackage}
+% \begin{macrocode}
+\def\hopatch@AfterPackage#1{%
+ \ltx@ifpackageloaded{#1}{%
+ \ltx@firstofone
+ }{%
+ \HOpatch@AfterPackage{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HOpatch@AfterPackage}
+% \begin{macrocode}
+\def\HOpatch@AfterPackage#1{%
+ \edef\HOpatch@temp{#1}%
+ \HOpatch@StepCounter
+ \expandafter\HOpatch@@AfterPackage
+ \csname HOpatch@\HOpatch@counter\expandafter\endcsname{%
+ \HOpatch@temp
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOpatch@@AfterPackage}
+% \begin{macrocode}
+\def\HOpatch@@AfterPackage#1#2#3{%
+ \begingroup
+ \toks@{#3}%
+ \xdef\HOpatch@gtemp{%
+ \noexpand\ltx@ifpackageloaded{#2}{%
+ \noexpand\let\noexpand#1\noexpand\relax
+ \the\toks@
+ }{}%
+ }%
+ \endgroup
+ \let#1\HOpatch@gtemp
+ \HOpatch@Add#1%
+ \HOpatch@Try{AfterPackage}{#2}#1%
+ \HOpatch@Try{AtEndPackage}{#2}#1%
+ \HOpatch@Try{AtEndOfPackageFile}{#2}#1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HOpatch@Try}
+% \begin{macrocode}
+\def\HOpatch@Try#1#2#3{%
+ \ltx@ifundefined{#1}{}{%
+ \csname #1\endcsname{#2}{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\AtBeginDocument{\HOpatch@list}
+\ltx@ifundefined{AtEndPreamble}{}{%
+ \ltx@ifundefined{@endpreamblehook}{}{%
+ \AtEndPreamble{\HOpatch@list}%
+ }%
+}
+\ltx@ifundefined{AfterEndPreamble}{}{%
+ \ltx@ifundefined{@afterendpreamblehook}{}{%
+ \AfterEndPreamble{%
+ \let\HOpatch@OrgIfPackageLoaded\@ifpackageloaded
+ \let\HOpatch@OrgIfPackageLater\@ifpackagelater
+ \let\HOpatch@OrgIfClassLoaded\@ifclassloaded
+ \let\HOpatch@OrgIfClassLater\@ifclasslater
+ \let\@ifpackageloaded\ltx@ifpackageloaded
+ \let\@ifpackagelater\ltx@ifpackagelater
+ \let\@ifclassloaded\ltx@ifclassloaded
+ \let\@ifclasslater\ltx@ifclasslater
+ \HOpatch@list
+ \let\@ifpackageloaded\HOpatch@OrgIfPackageLoaded
+ \let\@ifpackagelater\HOpatch@OrgIfPackageLater
+ \let\@ifclassloaded\HOpatch@OrgIfClassLoaded
+ \let\@ifclasslater\HOpatch@OrgIfClassLater
+ }%
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\HOpatch@AtEnd%
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \begin{macrocode}
+%<*test1>
+\def\LoadCommand{\RequirePackage{hopatch}[2016/05/16]}
+%</test1>
+% \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 hopatch.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\providecommand\variant{0}
+\RequirePackage{filecontents}
+\begin{filecontents}{foo.sty}
+\ProvidesPackage{foo}
+\def\msg#{\immediate\write16}
+\def\foo#1{%
+ \msg{\fooformat{#1}}%
+}
+\def\fooformat#1{[#1]}% hash-ok
+\foo{* Executing foo at package loading}
+\end{filecontents}
+
+\ifnum\variant=1 %
+ \documentclass{memoir}%
+\else
+ \documentclass{article}%
+\fi
+
+\ifcase\variant\relax
+\or % 1
+\or % 2
+ \usepackage{etoolbox}%
+\or % 3
+ \usepackage{scrlfile}%
+\or % 4
+ \usepackage{filehook}%
+\fi
+
+\AtBeginDocument{\foo{* AtBeginDocument before hopatch}}
+\usepackage{hopatch}
+\AtBeginDocument{\foo{* AtBeginDocument after hopatch}}
+
+\makeatletter
+\hopatch@AfterPackage{foo}{%
+ \def\fooformat#1{<<#1>>}%
+}
+\makeatother
+
+\AtBeginDocument{\foo{* AtBeginDocument before foo}}
+\usepackage{foo}
+\AtBeginDocument{\foo{* AtBeginDocument after foo}}
+
+\foo{* Executing in preamble}
+
+\begin{document}
+\foo{* Executing in document}
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hopatch}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hopatch.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hopatch.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[\CTAN{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 hopatch.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@{}}
+% hopatch.sty & tex/latex/oberdiek/hopatch.sty\\
+% hopatch.pdf & doc/latex/oberdiek/hopatch.pdf\\
+% test/hopatch-test1.tex & doc/latex/oberdiek/test/hopatch-test1.tex\\
+% test/hopatch-test2.tex & doc/latex/oberdiek/test/hopatch-test2.tex\\
+% hopatch.dtx & source/latex/oberdiek/hopatch.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hopatch.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hopatch.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 hopatch.dtx
+%makeindex -s gind.ist hopatch.idx
+%pdflatex hopatch.dtx
+%makeindex -s gind.ist hopatch.idx
+%pdflatex hopatch.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hopatch.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hopatch'>
+ <name>hopatch</name>
+ <caption>Load patches for packages.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2011,2012'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ The hopatch package provides a command with which the user may
+ register a piece of patch code for a particular package. Hopatch
+ will apply the patch immediately, if the relevant package has
+ already been loaded; otherwise it will store the patch until the
+ package appears.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hopatch.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hopatch.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+%
+% \bibitem{etoolbox}
+% Philipp Lehman:
+% \textit{The etoolbox Package}
+% 2011-01-03.
+% \CTAN{macros/latex/contrib/etoolbox/etoolbox.pdf}
+%
+% \bibitem{filehook}
+% Martin Scharrer:
+% \textit{The filehook Package};
+% 2011-01-09.
+% \CTAN{macros/latex/contrib/filehook/filehook.pdf}
+%
+% \bibitem{ltxcmds}
+% Heiko Oberdiek:
+% \textit{The ltxcmds Package};
+% 2010-12-12.
+% \CTAN{macros/latex/contrib/oberdiek/ltxcmds.pdf}
+%
+% \bibitem{memoir}
+% Peter Wilson, Lars Madsen:
+% \textit{The Memoir Class for Configurable Typesetting, User Guide};
+% 2010.
+% \CTAN{macros/latex/contrib/memoir/memman.pdf}
+%
+% \bibitem{scrlfile}
+% Markus Kohm, Jens-Uwe Morawski:
+% \textit{The Guide KOMA-Script};
+% 2011-01-20.
+% \CTAN{macros/latex/contrib/koma-script/scrguien.pdf}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2011/01/30 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2011/06/24 v1.1}
+% \item
+% Fix the use of \cs{AtEndPreamble} and \cs{AfterEndPreamble}.
+% They are redefined by package \xpackage{etoolbox} after their
+% hooks are used and generate an error message then.
+% \end{Version}
+% \begin{Version}{2012/05/28 v1.2}
+% \item
+% Fix for use without \hologo{eTeX}
+% (thanks Gordon Lee).
+% \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/hopatch.pdf b/macros/latex/contrib/oberdiek/hopatch.pdf
new file mode 100644
index 0000000000..22d5e7da4a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hopatch.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hycolor.dtx b/macros/latex/contrib/oberdiek/hycolor.dtx
new file mode 100644
index 0000000000..79bfe8d13f
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hycolor.dtx
@@ -0,0 +1,2229 @@
+% \iffalse meta-comment
+%
+% File: hycolor.dtx
+% Version: 2016/05/16 v1.8
+% Info: Color options for hyperref/bookmark
+%
+% Copyright (C) 2007-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file hycolor.dtx
+% and the derived files
+% hycolor.sty, hycolor.pdf, hycolor.ins, hycolor.drv,
+% xcolor-patch.sty, hycolor-test1.tex, hycolor-test2.tex,
+% hycolor-test3.tex, hycolor-test-xcol1.tex,
+% hycolor-test-xcol2.tex, hycolor-test-xcol3.tex,
+% hycolor-test-xcol4.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hycolor.dtx
+% CTAN:macros/latex/contrib/oberdiek/hycolor.pdf
+%
+% Unpacking:
+% (a) If hycolor.ins is present:
+% tex hycolor.ins
+% (b) Without hycolor.ins:
+% tex hycolor.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hycolor.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hycolor.drv is present:
+% latex hycolor.drv
+% (b) Without hycolor.drv:
+% latex hycolor.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 hycolor.dtx
+% makeindex -s gind.ist hycolor.idx
+% pdflatex hycolor.dtx
+% makeindex -s gind.ist hycolor.idx
+% pdflatex hycolor.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/hycolor.sty
+% TDS:tex/latex/oberdiek/xcolor-patch.sty
+% TDS:doc/latex/oberdiek/hycolor.pdf
+% TDS:doc/latex/oberdiek/test/hycolor-test1.tex
+% TDS:doc/latex/oberdiek/test/hycolor-test2.tex
+% TDS:doc/latex/oberdiek/test/hycolor-test3.tex
+% TDS:doc/latex/oberdiek/test/hycolor-test-xcol1.tex
+% TDS:doc/latex/oberdiek/test/hycolor-test-xcol2.tex
+% TDS:doc/latex/oberdiek/test/hycolor-test-xcol3.tex
+% TDS:doc/latex/oberdiek/test/hycolor-test-xcol4.tex
+% TDS:source/latex/oberdiek/hycolor.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hycolor 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hycolor
+Version: 2016/05/16 v1.8
+
+Copyright (C) 2007-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file hycolor.dtx
+and the derived files
+ hycolor.sty, hycolor.pdf, hycolor.ins, hycolor.drv,
+ xcolor-patch.sty, hycolor-test1.tex, hycolor-test2.tex,
+ hycolor-test3.tex, hycolor-test-xcol1.tex,
+ hycolor-test-xcol2.tex, hycolor-test-xcol3.tex,
+ hycolor-test-xcol4.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hycolor.ins}{\from{hycolor.dtx}{install}}%
+ \file{hycolor.drv}{\from{hycolor.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{hycolor.sty}{\from{hycolor.dtx}{package}}%
+ \file{xcolor-patch.sty}{\from{hycolor.dtx}{xcolor}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{hycolor-test1.tex}{\from{hycolor.dtx}{test,test1}}%
+% \file{hycolor-test2.tex}{\from{hycolor.dtx}{test,test2}}%
+% \file{hycolor-test3.tex}{\from{hycolor.dtx}{test,test3}}%
+% \file{hycolor-test-xcol1.tex}{\from{hycolor.dtx}{test-xcolor,xcol1}}%
+% \file{hycolor-test-xcol2.tex}{\from{hycolor.dtx}{test-xcolor,xcol2}}%
+% \file{hycolor-test-xcol3.tex}{\from{hycolor.dtx}{test-xcolor,xcol3}}%
+% \file{hycolor-test-xcol4.tex}{\from{hycolor.dtx}{test-xcolor-fbox}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hycolor.xml}{\from{hycolor.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{* hycolor.sty, xcolor-patch.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hycolor.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hycolor.drv}%
+ [2016/05/16 v1.8 Color options for hyperref/bookmark (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage[ruled]{algorithm2e}
+
+\makeatletter
+\newcommand*{\makedefaultH}[1]{%
+ \expandafter\edef\csname #1\endcsname{%
+ \noexpand\@protected@testopt
+ \expandafter\noexpand\csname#1\endcsname
+ \expandafter\noexpand\csname
+ \expandafter\string\csname#1\endcsname\endcsname
+ {H}%
+ }%
+}
+\makeatother
+\makedefaultH{algorithm}
+\makedefaultH{procedure}
+\makedefaultH{function}
+
+\SetKwInput{KwParam}{Param}
+\newcommand*{\Param}[2]{%
+ \KwParam{\ArgSty{#1} (#2)}%
+}
+\newcommand*{\Dat}[1]{%
+ \texttt{\upshape#1}%
+}
+\newcommand*{\Var}[1]{%
+ \ArgSty{#1}%
+}
+\newcommand*{\Gets}{%
+ \ensuremath{\leftarrow}%
+ \ %
+}
+
+\makeatletter
+\newcommand*{\bs}{\texttt{\@backslashchar}}
+\makeatother
+\begin{document}
+ \DocInput{hycolor.dtx}%
+\end{document}
+%</driver>
+% \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{hycolor.drv}
+%
+% \title{The \xpackage{hycolor} package}
+% \date{2016/05/16 v1.8}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{hycolor} implements the color option stuff that
+% is used by packages \xpackage{hyperref} and \xpackage{bookmark}.
+% It is not intended as package for the user.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% The package \xpackage{hycolor} implements color options
+% for packages \xpackage{hyperref} and \xpackage{bookmark}.
+%
+% Package \xpackage{xcolor} provides macros for extracting
+% color values and converting color data to other color models.
+% If this package is loaded, the full range of color specifications
+% of packages \xpackage{color} and \xpackage{xcolor} are supported
+% including the optional argument for the color model.
+% \begin{quote}
+% |\hypersetup{linkbordercolor=red}%| needs \xpackage{xcolor}\\
+% |\hypersetup{linkbordercolor=[named]{red}}%| needs \xpackage{xcolor}\\
+% |\hypersetup{linkbordercolor=[rgb]{1,0,0}}|\\
+% \end{quote}
+%
+% Without package \xpackage{xcolor} some of the options only
+% support some models, if they are given directly, e.g.:
+% \begin{quote}
+% |\bookmarksetup{color=[rgb]{1,0,0}}|
+% \end{quote}
+%
+% Because of compatibility some options of \xpackage{hyperref}
+% also support space separated RGB values:
+% \begin{quote}
+% |\hypersetup{linkbordercolor=1 0 0}%| is the same as\\
+% |\hypersetup{linkbordercolor=[rgb]{1,0,0}}|
+% \end{quote}
+%
+% Coloring is optional, it can be turned off by using an empty
+% value:
+% \begin{quote}
+% |\hypersetup{linkbordercolor={}}|
+% \end{quote}
+%
+% The PDF specification knows some kind of an emtpy color setting
+% without values. This applies to form field colors. The new
+% A virtual color model \texttt{empty} is introduced for this
+% purpose, e.g.
+% \begin{quote}
+% |\TextField[backgroundcolor={[empty]{}}, ...]{...}%| or\\
+% |\TextField[{backgroundcolor=[empty]{}, ...}]{...}|
+% \end{quote}
+% PDF specification 1.7 also allows this for border link colors.
+% But this isn't currently supported by this package, because
+% the tested viewers (AR7/Linux, xpdf 3.00, ghostscript 8.54)
+% don't support this yet. In contrary ghostscript generates an
+% error message.
+%
+% \subsection{Summary}
+%
+% \begin{quote}
+% \begin{tabular}{@{}llll@{}}
+% Color option & Models without \xpackage{xcolor}
+% & RGB color & Model empty\\
+% \hline
+% |BKM.color| & |gray|, |rgb| & no & no\\
+% |Hyp.*color| & all & no & no\\
+% |Hyp.*bordercolor| & |gray|, |rgb| & yes & no\\
+% |Field.*color| & |gray|, |rgb|, |cmyk| & yes & yes\\
+% |AtFi.color| & |gray|, |rgb| & yes & no\\
+% \end{tabular}
+% \end{quote}
+% ``RGB color'' means that the color value can be given as
+% space separated RGB numbers (real numbers in the range
+% from 0 to 1).
+% Explanation of the color option prefixes:
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% Prefix & Explanation\\
+% \hline
+% |BKM| & Package \xpackage{bookmark}\\
+% |Hyp| & Package \xpackage{hyperref}:
+% package options or |\hypersetup|\\
+% |Field| & Package \xpackage{hyperref}:
+% Form field options\\
+% |AtFi| & Package \xpackage{attachfile2}: option \xoption{color}\\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hycolor}%
+ [2016/05/16 v1.8 Color options for hyperref/bookmark (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{xcolor-patch}[2016/05/16]
+% \end{macrocode}
+%
+% \subsection{Normalization}
+%
+% \subsubsection{Sanitize value of color option}
+%
+% \begin{procedure}
+% \Param{cmd}{macro}
+% \Param{value}{value of color option}
+% \BlankLine
+% \KwResult{\ArgSty{value} is expanded, sanitized, and
+% stored in macro \ArgSty{cmd}.}
+% \caption{DefSanitized(cmd, value)}
+% \BlankLine
+% Initialize active characters\;
+% \ArgSty{cmd} := Expand \ArgSty{value}\;
+% Sanitize \ArgSty{cmd}\;
+% \end{procedure}
+% \emph{Sanitization} means that the string does not contain any
+% macros or special tokens. It consists of characters with
+% catcode 12 (other). The only exception is the space with
+% catcode 10 (space).
+% \begin{macro}{\HyColor@DefSanitized}
+% \begin{macrocode}
+\begingroup
+ \catcode`\!=13 %
+ \catcode`\:=13 %
+ \catcode`\-=13 %
+ \catcode`\+=13 %
+ \catcode`\;=13 %
+ \catcode`\"=13 %
+ \catcode`\>=13 %
+ \edef\x{%
+ \def\noexpand!{\string!}%
+ \def\noexpand:{\string:}%
+ \def\noexpand-{\string-}%
+ \def\noexpand+{\string+}%
+ \def\noexpand;{\string;}%
+ \def\noexpand"{\string"}%
+ \def\noexpand>{\string>}%
+ }%
+ \def\y#1{\endgroup
+ \def\HyColor@DefSanitized##1##2{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ #1%
+ \edef\x{\endgroup
+ \def\noexpand##1{##2}%
+ }%
+ \x
+ \@onelevel@sanitize##1%
+ }%
+ }%
+\expandafter\y\expandafter{\x}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Normalize result}
+%
+% \begin{procedure}
+% \Param{value}{Sanitized explicit number}
+% \Param{cmd}{Macro that stores result}
+% \BlankLine
+% \KwResult{\ArgSty{cmd} contains normalized number}
+% \caption{NormalizeNum(value, cmd)}
+% \BlankLine
+% \uIf{\Var{value}\,\Dat{pt} $<$ \Dat{0pt}}{
+% \ArgSty{cmd} \Gets \Dat{0}\;
+% }
+% \uElseIf{number before dot of \Var{value} $<$ \Dat{1}}{
+% \Var{cmd} \Gets number after dot of \Var{value}\;
+% \Var{cmd} \Gets strip trailing zeros from \Var{cmd}\;
+% \If{dot remains only}{
+% \Var{cmd} \Gets \Dat{0}\;
+% }
+% }
+% \Else{
+% \Var{cmd} \Gets \Dat{1}\;
+% }
+% \end{procedure}
+% The number is limited to the range between 0.0 and 1.0 and
+% formatted as short PDF number without leading or trailing zeros.
+% The precision of the number isn't changed.
+% \begin{macro}{\HyColor@NormalizeNum}
+% \begin{macrocode}
+\def\HyColor@NormalizeNum#1#2{%
+ \ifdim#1pt<\z@
+ \def#2{0}%
+ \else
+ \edef#2{\zap@space#1 \@empty}%
+ \expandafter\HyColor@CheckDot#2..\@nil#2%
+ \fi
+}
+\def\HyColor@CheckDot#1.#2.#3\@nil#4{%
+ \ifnum0#1<\@ne
+ \ifx\\#2\\%
+ \def#4{0}%
+ \else
+ \edef#4{\HyColor@ReverseString#2\@nil{}}%
+ \edef#4{\expandafter\HyColor@StripLeadingZeros#4\@empty}%
+ \ifx#4\@empty
+ \def#4{0}%
+ \else
+ \edef#4{.\expandafter\HyColor@ReverseString#4\@nil{}}%
+ \fi
+ \fi
+ \else
+ \def#4{1}%
+ \fi
+}
+\def\HyColor@ReverseString#1#2\@nil#3{%
+ \ifx\\#2\\%
+ #1#3%
+ \else
+ \@ReturnAfterFi{%
+ \HyColor@ReverseString#2\@nil{#1#3}%
+ }%
+ \fi
+}
+\long\def\@ReturnAfterFi#1\fi{\fi#1}
+\def\HyColor@StripLeadingZeros#1{%
+ \ifx#10%
+ \expandafter\HyColor@StripLeadingZeros
+ \else
+ #1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HyColor@NormalizeCommaRGB}
+% \begin{macrocode}
+\def\HyColor@NormalizeCommaRGB#1,#2,#3\@nil#4{%
+ \HyColor@NormalizeNum{#1}\HyColor@temp
+ \let#4\HyColor@temp
+ \HyColor@NormalizeNum{#2}\HyColor@temp
+ \edef#4{#4 \HyColor@temp}%
+ \HyColor@NormalizeNum{#3}\HyColor@temp
+ \edef#4{#4 \HyColor@temp}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HyColor@NormalizeCommaCMYK}
+% \begin{macrocode}
+\def\HyColor@NormalizeCommaCMYK#1,#2,#3,#4\@nil#5{%
+ \HyColor@NormalizeNum{#1}\HyColor@temp
+ \let#5\HyColor@temp
+ \HyColor@NormalizeNum{#2}\HyColor@temp
+ \edef#5{#5 \HyColor@temp}%
+ \HyColor@NormalizeNum{#3}\HyColor@temp
+ \edef#5{#5 \HyColor@temp}%
+ \HyColor@NormalizeNum{#4}\HyColor@temp
+ \edef#5{#5 \HyColor@temp}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Main algorithm for color options}
+%
+% \begin{procedure}
+% \Param{key}{name of color option}
+% \Param{value}{value of color option}
+% \Param{cmd}{macro that stores result}
+% \BlankLine
+% \KwResult{Macro \ArgSty{cmd} contains the calculated
+% color specification string or has the meaning of \cs{relax}
+% if the color must not set}
+% \caption{MainColorOptionAlgorithm(key, value, cmd)}
+% \BlankLine
+% DefSanitized(\ArgSty{temp}, \ArgSty{value})\;
+% Call option specific algorithm(\ArgSty{key}, \ArgSty{temp}, \ArgSty{cmd})\;
+% \end{procedure}
+%
+% \subsection{Package \xpackage{bookmark}}
+%
+% Since v0.8 2007/03/27 package \xpackage{bookmark} only provides
+% one color option \xoption{color}. Because option \xoption{rgbcolor}
+% can easily given as color specification in model rgb:
+% \begin{quote}
+% |rgbcolor=|\meta{r} \meta{g} \meta{b} $\equiv$
+% |color=[rgb]{|\meta{r}|,|\meta{g}|,|\meta{b}|}|
+% \end{quote}
+% Package \xpackage{bookmark} stores the result in macro \cs{BKM@color}.
+% The empty string is interpreted as \emph{no color}.
+%
+% \begin{procedure}
+% \Param{value}{value of option \xoption{color}}
+% \Param{cmd}{macro for result}
+% \Param{package}{package name for error message}
+% \Param{option}{option name for error message}
+% \caption{BookmarkColor(value, cmd, package, option)}
+% \BlankLine
+% \Switch{\Var{value}}{
+% \Case{empty}{
+% \Var{cmd} \Gets no color\;
+% }
+% \Case{with model}{
+% \eIf{with xcolor}{
+% \Var{cmd} \Gets ConvertToRGB(\Var{model}, \Var{values})\;
+% }{
+% \uIf{model $=$ rgb}{
+% \Var{cmd} \Gets \Var{values} as normalized values\;
+% }
+% \uElseIf{model $=$ gray}{
+% \Var{cmd} \Gets \Var{values} as normalized tripled values\;
+% }
+% \Else{
+% error\;
+% }
+% }
+% }
+% \Other{
+% \eIf{with xcolor}{
+% (\Var{model}, \Var{values} \Gets get model and values\;
+% \Var{cmd} \Gets ConvertToRGB(\Var{model}, \Var{values})\;
+% }{
+% error\;
+% }
+% }
+% }
+% \end{procedure}
+%
+% \begin{macrocode}
+\def\HyColor@BookmarkColor#1#2#3#4{%
+ \HyColor@IfModel{#1}{%
+ \HyColor@IfXcolor{%
+ \convertcolorspec\HyColor@model\HyColor@values
+ \HyColor@model@rgb#2%
+ \expandafter\HyColor@NormalizeCommaRGB#2\@nil#2%
+ }{%
+ \ifx\HyColor@model\HyColor@model@rgb
+ \expandafter\HyColor@NormalizeCommaRGB\HyColor@values\@nil#2%
+ \else
+ \ifx\HyColor@model\HyColor@model@gray
+ \expandafter\HyColor@NormalizeNum
+ \expandafter{\HyColor@values}#2%
+ \edef#2{#2 #2 #2}%
+ \else
+ \let#2\@empty
+ \HyColor@ErrorModelNoXcolor{#3}{#4}%
+ \fi
+ \fi
+ }%
+ }{%
+ \let#2\HyColor@values
+ \ifx#2\@empty
+ \else
+ \HyColor@IfXcolor{%
+ \extractcolorspec{#1}#2%
+ \expandafter\convertcolorspec#2\HyColor@model@rgb#2%
+ \expandafter\HyColor@NormalizeCommaRGB#2\@nil#2%
+ }{%
+ \let#2\@empty
+ \HyColor@ErrorSpecNoXcolor{#3}{#4}%
+ }%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\HyColor@ErrorModelNoXcolor#1#2{%
+ \PackageError{#1}{%
+ Color model `\HyColor@model' is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `#2=[\HyColor@model]{\HyColor@values}'%
+ }\@ehc
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\HyColor@ErrorSpecNoXcolor#1#2{%
+ \PackageError{#1}{%
+ This color specification is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `#2=\HyColor@values'%
+ }\@ehc
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\HyColor@IfModel#1{%
+ \@ifnextchar[{%
+ \HyColor@WithModel
+ }{%
+ \HyColor@WithoutModel
+ }%
+ #1\@nil
+}
+\def\HyColor@WithModel[#1]#2\@nil{%
+ \HyColor@DefSanitized\HyColor@model{#1}%
+ \HyColor@DefSanitized\HyColor@values{#2}%
+ \@firstoftwo
+}
+\def\HyColor@WithoutModel#1\@nil{%
+ \let\HyColor@model\relax
+ \HyColor@DefSanitized\HyColor@values{#1}%
+ \@secondoftwo
+}
+% \end{macrocode}
+%
+% \subsection{Utils}
+%
+% \begin{macro}{\@ReturnAfterFi}
+% \begin{macrocode}
+\long\def\@ReturnAfterFi#1\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HyColor@IfXcolor}
+% \begin{macrocode}
+\def\HyColor@IfXcolor{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname convertcolorspec\endcsname\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\HyColor@model@empty{empty}
+\@onelevel@sanitize\HyColor@model@empty
+\def\HyColor@model@gray{gray}
+\@onelevel@sanitize\HyColor@model@gray
+\def\HyColor@model@rgb{rgb}
+\@onelevel@sanitize\HyColor@model@rgb
+\def\HyColor@model@cmyk{cmyk}
+\@onelevel@sanitize\HyColor@model@cmyk
+\def\HyColor@model@Gray{Gray}
+\@onelevel@sanitize\HyColor@model@Gray
+% \end{macrocode}
+%
+% \subsection{Package \xpackage{hyperref}}
+%
+% \subsubsection{Options \xoption{Hyp.*color}}
+%
+% \begin{macrocode}
+\def\HyColor@UseColor#1{%
+ \ifx#1\relax
+ \else
+ \ifx#1\@empty
+ \else
+ \expandafter\HyColor@@UseColor#1\@nil
+ \fi
+ \fi
+}
+\def\HyColor@@UseColor{%
+ \@ifnextchar[\HyColor@@@UseColor\HyColor@@@@UseColor
+}
+\def\HyColor@@@UseColor[#1]#2\@nil{%
+ \color[{#1}]{#2}%
+}
+\def\HyColor@@@@UseColor#1\@nil{%
+ \color{#1}%
+}
+% \end{macrocode}
+%
+% \begin{procedure}
+% \Param{value}{value of the option}
+% \Param{cmd}{macro for result}
+% \caption{HyperrefColor(value, cmd)}
+% \BlankLine
+% \Switch{\Var{value}}{
+% \Case{empty}{
+% \Var{cmd} \Gets no color\;
+% }
+% \Case{with model}{
+% Call \cs{color} with model\;
+% }
+% \Case{without model}{
+% Call \cs{color} without model\;
+% }
+% }
+% \end{procedure}
+%
+% \begin{macrocode}
+\def\HyColor@HyperrefColor#1#2{%
+ \HyColor@IfModel{#1}{%
+ \edef#2{[{\HyColor@model}]{\HyColor@values}}%
+ }{%
+ \let#2\HyColor@values
+ \ifx#2\@empty
+ \let#2\relax
+ \fi
+ }%
+}
+% \end{macrocode}
+%
+% \subsubsection{Generic algorithm}
+%
+% \begin{procedure}
+% \small
+% \Param{value}{value of the option}
+% \Param{cmd}{macro for result}
+% \Param{package}{package name for error message}
+% \Param{option}{option name for error message}
+% \caption{Algorithm X0134(value, cmd, package, option)}
+% \BlankLine
+% \Switch{\Var{value}}{
+% \Case{empty}{
+% \Var{cmd} \Gets no color\;
+% }
+% \Case{with model}{
+% \Switch{\Var{model}}{
+% \Case{empty}{
+% \Var{cmd} \Gets ""\;
+% }
+% \Case{gray, rgb, cmyk}{
+% \Var{cmd} \Gets \Var{output}()\;
+% }
+% \Case{Gray}{
+% \eIf{with xcolor}{
+% (\Var{model}, \Var{values}) \Gets convert to gray\;
+% }{
+% error(\Var{package}, \Var{option}, "Missing xcolor"),
+% \Var{cmd} \Gets no color\;
+% }
+% }
+% \Else{
+% \eIf{with xcolor}{
+% (\Var{model}, \Var{values}) \Gets convert to rgb\;
+% \Var{cmd} \Gets \Var{output}()\;
+% }{
+% error(\Var{package}, \Var{option}, "Missing xcolor"),
+% \Var{cmd} \Gets no color\;
+% }
+% }
+% }
+% }
+% \Case{rgb values}{
+% (\Var{model}, \Var{values}) \Gets ("rgb", (r,g,b))\;
+% \Var{cmd} \Gets \Var{output}()\;
+% }
+% \Case{without model}{
+% \eIf{with xcolor}{
+% (\Var{model}, \Var{values}) \Gets
+% get model and values(\Var{value})\;
+% \Switch{\Var{model}}{
+% \Case{gray, rgb, cmyk}{
+% \Var{cmd} \Gets \Var{output}()\;
+% }
+% \Case{Gray}{
+% (\Var{model}, \Var{values}) \Gets convert to gray\;
+% \Var{cmd} \Gets \Var{output}()\;
+% }
+% \Else{
+% (\Var{model}, \Var{values}) \Gets convert to rgb\;
+% \Var{cmd} \Gets \Var{output}()\;
+% }
+% }
+% }{
+% error(\Var{package}, \Var{option}, "Missing xcolor"),
+% \Var{cmd} \Gets no color\;
+% }
+% }
+% }
+% \end{procedure}
+%
+% \begin{macro}{\HyColor@XZeroOneThreeFour}
+% \begin{macrocode}
+\def\HyColor@XZeroOneThreeFour#1#2#3#4{%
+ \HyColor@IfModel{#1}{%
+ \ifx\HyColor@model\HyColor@model@empty
+ \let#2\@empty
+ \else\ifx\HyColor@model\HyColor@model@gray
+ \expandafter\HyColor@NormalizeNum
+ \expandafter{\HyColor@values}#2%
+ \else\ifx\HyColor@model\HyColor@model@rgb
+ \expandafter\HyColor@NormalizeCommaRGB\HyColor@values\@nil#2%
+ \else\ifx\HyColor@model\HyColor@model@cmyk
+ \expandafter\HyColor@NormalizeCommaCMYK\HyColor@values\@nil#2%
+ \else\ifx\HyColor@model\HyColor@model@Gray
+ \HyColor@IfXcolor{%
+ \convertcolorspec\HyColor@model\HyColor@values
+ \HyColor@model@gray#2%
+ \expandafter\HyColor@NormalizeNum\expandafter{#2}#2%
+ \let\HyColor@model\HyColor@model@gray
+ }{%
+ \let#2\relax
+ \HyColor@ErrorModelNoXcolor{#3}{#4}%
+ }%
+ \else
+ \HyColor@IfXcolor{%
+ \convertcolorspec\HyColor@model\HyColor@values
+ \HyColor@model@rgb#2%
+ \expandafter\HyColor@NormalizeCommaRGB#2\@nil#2%
+ \let\HyColor@model\HyColor@model@rgb
+ }{%
+ \let#2\relax
+ \HyColor@ErrorModelNoXcolor{#3}{#4}%
+ }%
+ \fi\fi\fi\fi\fi
+ }{%
+ \let#2\HyColor@values
+ \ifx#2\@empty
+ \let#2\relax
+ \else
+ \expandafter\HyColor@IfRGB\expandafter{\HyColor@values}{%
+ \expandafter\HyColor@NormalizeCommaRGB\HyColor@values\@nil#2%
+ }{%
+ \HyColor@IfXcolor{%
+ \expandafter\extractcolorspec\expandafter{\HyColor@values}#2%
+ \edef\HyColor@model{\expandafter\@firstoftwo#2}%
+ \edef\HyColor@values{\expandafter\@secondoftwo#2}%
+ \ifx\HyColor@model\HyColor@model@gray
+ \expandafter\HyColor@NormalizeNum\expandafter
+ {\HyColor@values}#2%
+ \else\ifx\HyColor@model\HyColor@model@rgb
+ \expandafter\HyColor@NormalizeCommaRGB
+ \HyColor@values\@nil#2%
+ \else\ifx\HyColor@model\HyColor@model@cmyk
+ \expandafter\HyColor@NormalizeCommaCMYK
+ \HyColor@values\@nil#2%
+ \else\ifx\HyColor@model\HyColor@model@Gray
+ \convertcolorspec\HyColor@model\HyColor@values
+ \HyColor@model@gray#2%
+ \expandafter\HyColor@NormalizeNum\expandafter
+ {\HyColor@values}#2%
+ \let\HyColor@model\HyColor@model@gray
+ \else
+ \convertcolorspec\HyColor@model\HyColor@values
+ \HyColor@model@rgb#2%
+ \expandafter\HyColor@NormalizeCommaRGB#2\@nil#2%
+ \let\HyColor@model\HyColor@model@rgb
+ \fi\fi\fi\fi
+ }{%
+ \let#2\relax
+ \HyColor@ErrorSpecNoXcolor{#3}{#4}%
+ }%
+ }%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Field options}
+%
+% \begin{macro}{\HyColor@FieldBColor}
+% \begin{macrocode}
+\let\HyColor@FieldBColor\HyColor@XZeroOneThreeFour
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HyColor@FieldColor}
+% \begin{macrocode}
+\def\HyColor@FieldColor#1#2#3#4{%
+ \let\HyColor@model\@empty
+ \HyColor@XZeroOneThreeFour{#1}{#2}{#3}{#4}%
+ \ifx#2\relax
+ \let#2\@empty
+ \else
+ \ifx#2\@empty
+ \else
+ \ifx\HyColor@model\HyColor@model@gray
+ \edef#2{#2 g}%
+ \else\ifx\HyColor@model\HyColor@model@rgb
+ \edef#2{#2 rg}%
+ \else\ifx\HyColor@model\HyColor@model@cmyk
+ \edef#2{#2 k}%
+ \else
+ \PackageError{#3}{Internal error: unsupported color model}\@ehc
+ \fi\fi\fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Detection for naked RGB values}
+%
+% \begin{macro}{\HyColor@IfRGB}
+% \begin{macrocode}
+\newif\ifHyColor@result
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfmatch\endcsname\relax
+ \expandafter\@firstoftwo
+\else
+ \expandafter\@secondoftwo
+\fi
+{%
+ \begingroup
+ \def\x#1{\endgroup
+ \def\HyColor@IfRGB##1{%
+ \HyColor@@IfRGB##1#1#1#1\@nil
+ }%
+ }%
+ \x{ }%
+ \edef\HyColor@TwoSpaces{\space\space}%
+ \def\HyColor@@IfRGB#1 #2 #3 #4\@nil{%
+ \HyColor@resulttrue
+ \def\HyColor@temp{#4}%
+ \ifx\HyColor@temp\HyColor@TwoSpaces
+ \HyColor@CheckNum{#1}%
+ \ifHyColor@result
+ \HyColor@CheckNum{#2}%
+ \ifHyColor@result
+ \HyColor@CheckNum{#3}%
+ \fi
+ \fi
+ \else
+ \HyColor@resultfalse
+ \fi
+ \ifHyColor@result
+ \let\HyColor@model\HyColor@model@rgb
+ \edef\HyColor@values{#1,#2,#3}%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ }%
+ \def\HyColor@zero{0}%
+ \def\HyColor@one{1}%
+ \def\HyColor@dot{.}%
+ \def\HyColor@CheckNum#1{%
+ \def\HyColor@temp{#1}%
+ \ifx\HyColor@temp\@empty
+ \HyColor@resultfalse
+ \else
+ \edef\HyColor@temp{\@car#1\@nil}%
+ \ifx\HyColor@temp\HyColor@zero
+ \else
+ \ifx\HyColor@temp\HyColor@one
+ \else
+ \ifx\HyColor@temp\HyColor@dot
+ \else
+ \HyColor@resultfalse
+ \fi
+ \fi
+ \fi
+ \fi
+ }%
+}{%
+ \def\HyColor@MatchNum{%
+ (0*1\string\.0*|0*1|0+\string\.?[0-9]*|\string\.[0-9]+)%
+ }%
+ \def\HyColor@IfRGB#1{%
+ \ifnum\pdfmatch{^\HyColor@MatchNum\space\HyColor@MatchNum
+ \space\HyColor@MatchNum$}{#1}>\z@
+ \let\HyColor@model\HyColor@model@rgb
+ \edef\HyColor@values{%
+ \expandafter\strip@prefix\pdflastmatch1,%
+ \expandafter\strip@prefix\pdflastmatch2,%
+ \expandafter\strip@prefix\pdflastmatch3%
+ }%
+ \HyColor@resulttrue
+ \expandafter\@firstoftwo
+ \else
+ \HyColor@resultfalse
+ \expandafter\@secondoftwo
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Options \xoption{*bordercolor}}
+%
+% \begin{procedure}
+% \Param{value}{value of the option}
+% \Param{cmd}{macro for result}
+% \Param{package, option}{package and option for error message}
+% \caption{HyperrefBorderColor(value, cmd, package, option)}
+% \BlankLine
+% \Switch{\Var{value}}{
+% \Case{empty}{
+% \Var{cmd} \Gets no color\;
+% }
+% \Case{with model}{
+% \eIf{with xcolor}{
+% (\Var{model}, \Var{values}) \Gets convert to rgb\;
+% \Var{cmd} \Gets output values\;
+% }{
+% \Switch{\Var{model}}{
+% \Case{rgb, gray}{
+% \Var{cmd} \Gets output values\;
+% }
+% \Else{
+% error(\Var{package}, \Var{option}, "Missing xcolor")\;
+% \Var{cmd} \Gets no color\;
+% }
+% }
+% }
+% }
+% \Case{rgb values}{
+% \Var{cmd} \Gets output values\;
+% }
+% \Case{without model}{
+% \eIf{with xcolor}{
+% (\Var{model}, \Var{values}) \Gets convert to rgb\;
+% \Var{cmd} \Gets output values\;
+% }{
+% error(\Var{package}, \Var{option}, "Missing xcolor");
+% \Var{cmd} \Gets no color\;
+% }
+% }
+% }
+% \end{procedure}
+%
+% \begin{macro}{\HyColor@HyperrefBorderColor}
+% \begin{macrocode}
+\def\HyColor@HyperrefBorderColor#1#2#3#4{%
+ \HyColor@IfModel{#1}{%
+ \HyColor@IfXcolor{%
+ \convertcolorspec\HyColor@model\HyColor@values
+ \HyColor@model@rgb#2%
+ \expandafter\HyColor@NormalizeCommaRGB#2\@nil#2%
+ }{%
+ \ifx\HyColor@model\HyColor@model@rgb
+ \expandafter\HyColor@NormalizeCommaRGB\HyColor@values\@nil#2%
+ \else
+ \ifx\HyColor@model\HyColor@model@gray
+ \expandafter\HyColor@NormalizeNum
+ \expandafter{\HyColor@values}#2%
+ \edef#2{#2 #2 #2}%
+ \else
+ \let#2\relax
+ \HyColor@ErrorModelNoXcolor{#3}{#4}%
+ \fi
+ \fi
+ }%
+ }{%
+ \let#2\HyColor@values
+ \ifx#2\@empty
+ \let#2\relax
+ \else
+ \expandafter\HyColor@IfRGB\expandafter{\HyColor@values}{%
+ \expandafter\HyColor@NormalizeCommaRGB\HyColor@values\@nil#2%
+ }{%
+ \HyColor@IfXcolor{%
+ \extractcolorspec{#1}#2%
+ \expandafter\convertcolorspec#2\HyColor@model@rgb#2%
+ \expandafter\HyColor@NormalizeCommaRGB#2\@nil#2%
+ }{%
+ \let#2\relax
+ \HyColor@ErrorSpecNoXcolor{#3}{#4}%
+ }%
+ }%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Package \xpackage{attachfile2}}
+%
+% Before PDF-1.7 only RGB values are permitted in annotations.
+% Since PDF-1.7 the color entry in annotations understands
+% several color models, depending on the size of the color array:
+% \begin{itemize}
+% \item Zero entries: means transparent, not useful for
+% file attachments. AR7/Linux and AR8/Linux show black instead.
+% \item One entry: color model `gray'.
+% \item Three entries: color model `rgb'.
+% \item Four entries: color model `cmyk'.
+% \end{itemize}
+% An empty color specification is interpreted as ``no color''.
+%
+% \begin{macro}{\HyColor@DetectPdfVersion}
+% \begin{macrocode}
+\def\HyColor@DetectPdfVersion{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname Hy@pdfversion\endcsname\relax
+ \global\chardef\HyColor@PdfVersion=0 %
+ \else
+ \global\chardef\HyColor@PdfVersion=\Hy@pdfversion\relax
+ \fi
+ \global\let\HyColor@DetectPdfVersion\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HyColor@SpaceToComma}
+% \begin{macrocode}
+\def\HyColor@SpaceToComma#1 #2\@nil{%
+ #1%
+ \ifx\relax#2\relax
+ \expandafter\@gobble
+ \else
+ ,%
+ \expandafter\@firstofone
+ \fi
+ {%
+ \HyColor@SpaceToComma#2\@nil
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HyColor@AttachfileColor}
+% \begin{macrocode}
+\def\HyColor@AttachfileColor#1#2#3#4#5#6{%
+ \def#2{#1}%
+ \ifx#2\@empty
+ \let#3\@gobble
+ \let#4\@empty
+ \else
+ \HyColor@resultfalse
+ \HyColor@XZeroOneThreeFour{#1}#3{#5}{#6}%
+ \ifHyColor@result
+ \edef#2{%
+ [rgb]{\expandafter\HyColor@SpaceToComma#3 \@nil}%
+ }%
+ \fi
+ \ifx\HyColor@model\HyColor@model@rgb
+ \edef#4{/C[#3]}% hash-ok
+ \edef#3##1{%
+ #3 %
+ \noexpand\csname atfi@SETRGBCOLOR##1\noexpand\endcsname
+ }%
+ \else
+ \ifx\HyColor@model\HyColor@model@gray
+ \HyColor@DetectPdfVersion
+ \ifnum\HyColor@PdfVersion<7 %
+ \edef#4{/C[#3 #3 #3]}% hash-ok
+ \else
+ \edef#4{/C[#3]}% hash-ok
+ \fi
+ \edef#3##1{%
+ #3 %
+ \noexpand\csname atfi@SETGRAYCOLOR##1\noexpand\endcsname
+ }%
+ \else
+ \ifx\HyColor@model\HyColor@model@cmyk
+ \HyColor@DetectPdfVersion
+ \ifnum\HyColor@PdfVersion<7 %
+ \HyColor@IfModel{#1}{%
+ \HyColor@IfXcolor{%
+ \convertcolorspec\HyColor@model\HyColor@values
+ \HyColor@model@rgb#4%
+ \expandafter\HyColor@NormalizeCommaRGB#4\@nil#4%
+ \edef#4{/C[#4]}% hash-ok
+ }{%
+ \let#4\@empty
+ \HyColor@ErrorModelNoXcolor{#5}{#6}%
+ }%
+ }{%
+ \HyColor@IfXcolor{%
+ \extractcolorspec{#1}#4%
+ \expandafter\convertcolorspec#4%
+ \HyColor@model@rgb#4%
+ \expandafter\HyColor@NormalizeCommaRGB#4\@nil#4%
+ \edef#4{/C[#4]}% hash-ok
+ }{%
+ \let#4\@empty
+ \HyColor@ErrorSpecNoXcolor{#5}{#6}%
+ }%
+ }%
+ \else
+ \edef#4{/C[#3]}% hash-ok
+ \fi
+ \edef#3##1{%
+ #3 %
+ \noexpand\csname atfi@SETCMYKCOLOR##1\noexpand\endcsname
+ }%
+ \else
+ \ifx\HyColor@model\HyColor@model@empty
+ \PackageError{#5}{%
+ Color model `empty' is not permitted for option `#6'%
+ }\@ehc
+ \let#2\@empty
+ \let#3\@gobble
+ \let#4\@empty
+ \else
+ \ifx\HyColor@model\relax % (missing xcolor)
+ \let#3\@gobble
+ \let#4\@empty
+ \else
+ \PackageError{#5}{%
+ Internal error: unsupported color model%
+ }\@ehc
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \subsection{Patch for package \xpackage{xcolor}}
+%
+% Because the test files triggered a bug in package \xpackage{xcolor}
+% of version 2007/01/21 v2.11.
+% I contacted the author of \xpackage{xcolor} Uwe Kern. He responded
+% with a test version 2007/03/27 v2.12a00 that fixes the problem.
+% However, apparently he did not found the time for an official
+% release yet. Thus I have reluctantly written the following
+% patch package using the fixes of v2.12a00.
+%
+% The patch is immediately applied if package \xpackage{xcolor}
+% is already loaded.
+% Otherwise the patch is delayed using \cs{AfterPackage} if
+% package \xpackage{scrlfile} is loaded. As last resort
+% \cs{AtBeginDocument} is used.
+% \begin{macrocode}
+%<*xcolor>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{xcolor-patch}[2016/05/16 xcolor patch]
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{hopatch}[2016/05/16]
+\hopatch@AfterPackage{xcolor}{%
+% \end{macrocode}
+% \begin{macro}{\XC@ifxcase}
+% \begin{macrocode}
+ \long\def\reserved@a#1#2#3{%
+ \long\def\@@tmp##1##2{%
+ \ifx#1##1%
+ \toks@{##2}%
+ \expandafter\remove@to@nnil
+ \else
+ \expandafter\@@tmp
+ \fi
+ }%
+ \@@tmp#2#1{#3}\@nnil\the\toks@
+ }%
+ \ifx\XC@ifxcase\reserved@a
+ \long\def\XC@ifxcase#1#2#3{%
+ \long\def\XC@if@##1##2{%
+ \ifx#1##1%
+ \toks@{##2}%
+ \expandafter\remove@to@nnil
+ \else
+ \expandafter\XC@if@
+ \fi
+ }%
+ \XC@if@#2#1{#3}\@nnil
+ \the\toks@
+ }%
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\XC@ifcase}
+% \begin{macrocode}
+ \long\def\reserved@a#1#2#3{%
+ \long\def\@@tmp##1##2{%
+ \@expandtwoargs\in@{,#1,}{,##1,}%
+ \ifin@
+ \toks@{##2}%
+ \expandafter\remove@to@nnil
+ \else
+ \expandafter\@@tmp
+ \fi
+ }%
+ \@@tmp#2{#1}{#3}\@nnil
+ \the\toks@
+ }%
+ \ifx\XC@ifcase\reserved@a
+ \long\def\XC@ifcase#1#2#3{%
+ \long\def\XC@if@##1##2{%
+ \@expandtwoargs\in@{,#1,}{,##1,}%
+ \ifin@
+ \toks@{##2}%
+ \expandafter\remove@to@nnil
+ \else
+ \expandafter\XC@if@
+ \fi
+ }%
+ \XC@if@#2{#1}{#3}\@nnil
+ \the\toks@
+ }%
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\XC@cnv@gray}
+% \begin{macrocode}
+ \def\reserved@a#1,{%
+ \XC@ifxcase\tm{%
+ \XC@mod@rgb{%
+ \XC@calcN{#1}\@@tmp
+ \edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}%
+ }%
+ \XC@mod@cmy{%
+ \XC@calcC{#1}\@@tmp
+ \edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}%
+ }%
+ \XC@mod@cmyk{%
+ \XC@calcC{#1}\@@tmp
+ \edef\@@tmp{0,0,0,\@@tmp}%
+ }%
+ \XC@mod@RGB{%
+ \edef\@@scl{\rangeRGB}%
+ \XC@calcM{#1}\@@tmp
+ \edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}%
+ }%
+ \XC@mod@HTML{%
+ \edef\@@scl{\@cclv}%
+ \XC@calcM{#1}\@@tmp
+ \XC@calcH\@@tmp\@@tmp
+ \edef\@@tmp{\@@tmp\@@tmp\@@tmp}%
+ }%
+ \XC@mod@HSB{%
+ \edef\@@scl{\rangeHSB}%
+ \XC@calcM{#1}\@@tmp
+ \edef\@@tmp{0,0,\@@tmp}%
+ }%
+ \XC@mod@Gray{%
+ \edef\@@scl{\rangeGray}%
+ \XC@calcM{#1}\@@tmp
+ }%
+ }%
+ {%
+ \XC@calcN{#1}\@@tmp
+ \edef\@@tmp{0,0,\@@tmp}%
+ }%
+ }%
+ \ifx\XC@cnv@gray\reserved@a
+ \def\XC@cnv@gray#1,{%
+ \XC@ifxcase\tm{%
+ \XC@mod@rgb{%
+ \XC@calcN{#1}\@@tmp
+ \edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}%
+ }%
+ \XC@mod@gray{}%
+ \XC@mod@cmy{%
+ \XC@calcC{#1}\@@tmp
+ \edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}%
+ }%
+ \XC@mod@cmyk{%
+ \XC@calcC{#1}\@@tmp
+ \edef\@@tmp{0,0,0,\@@tmp}%
+ }%
+ \XC@mod@RGB{%
+ \edef\@@scl{\rangeRGB}%
+ \XC@calcM{#1}\@@tmp
+ \edef\@@tmp{\@@tmp,\@@tmp,\@@tmp}%
+ }%
+ \XC@mod@HTML{%
+ \edef\@@scl{\@cclv}%
+ \XC@calcM{#1}\@@tmp
+ \XC@calcH\@@tmp\@@tmp
+ \edef\@@tmp{\@@tmp\@@tmp\@@tmp}%
+ }%
+ \XC@mod@HSB{%
+ \edef\@@scl{\rangeHSB}%
+ \XC@calcM{#1}\@@tmp
+ \edef\@@tmp{0,0,\@@tmp}%
+ }%
+ \XC@mod@Gray{%
+ \edef\@@scl{\rangeGray}%
+ \XC@calcM{#1}\@@tmp
+ }%
+ }%
+ {%
+ \XC@calcN{#1}\@@tmp
+ \edef\@@tmp{0,0,\@@tmp}%
+ }%
+ }%
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Fix fragile \cs{@frameb@x}}
+%
+% \cs{fbox} becomes fragile, because the internal \cs{@frameb@x}
+% is redefined by package \xpackage{xcolor}. The redefinition is
+% no longer robust. Test file:
+%\begin{quote}
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{xcolor}
+%\makeatletter
+%\protected@edef\x{\fbox{abc}}
+%\@@end
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+ \@ifundefined{XC@frameb@x }{%
+ \expandafter\let\csname XC@frameb@x \endcsname\XC@frameb@x
+ \edef\XC@frameb@x{%
+ \noexpand\protect
+ \expandafter\noexpand\csname XC@frameb@x \endcsname
+ }%
+ \expandafter\ifx\csname XC@frameb@x \endcsname\@frameb@x
+ \let\@frameb@x\XC@frameb@x
+ \fi
+ }{}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</xcolor>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \begin{macrocode}
+%<*test1>
+\ProvidesFile{hycolor-test1.tex}[2016/05/16 test file 1]
+%</test1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test2>
+\ProvidesFile{hycolor-test2.tex}[2016/05/16 test file 2]
+\let\pdfmatch\relax
+%</test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<test3>\ProvidesFile{hycolor-test3.tex}[2016/05/16 test file 3]
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test>
+% \end{macrocode}
+% \begin{macrocode}
+\documentclass{article}
+
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\makeatletter
+
+\newcommand*{\TestPackageName}{test-package}
+\newcommand*{\TestOptionName}{test-option}
+
+\newcommand\Message{}
+\def\Message#1#{\immediate\write16}
+
+\newcommand*{\ExpectError}[2]{%
+ \begingroup
+ \global\let\saved@errhelp\errhelp
+ \global\let\saved@errmessage\errmessage
+ \let\errhelp\@gobble
+ \def\errmessage##1{%
+ \xdef\@ExpectErrorMessage{##1}%
+ }%
+ \PackageError\TestPackageName{#1}\@ehc
+ \def\errhelp##1{%
+ \global\let\errhelp\saved@errhelp
+ }%
+ \global\let\@ResultErrorMessage\@empty
+ \def\errmessage##1{%
+ \xdef\@ResultErrorMessage{##1}%
+ \global\let\errmessage\saved@errmessage
+ % \Message{[ ##1}%
+ % \Message{] (ignored error)}%
+ % \Message{}%
+ }%
+ #2%
+ \endgroup
+ \Expect*{\@ResultErrorMessage}*{\@ExpectErrorMessage}%
+}
+\usepackage{scrlfile}
+\usepackage{hycolor}[2016/05/16]
+%</test>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test1>
+\begin{qstest}{NumNormalize}{num, normalize}
+ \def\test#1#2{%
+ \HyColor@NormalizeNum{#1}\cmd
+ \Expect*{\cmd}{#2}%
+ }%
+ \test{0}{0}%
+ \test{000}{0}%
+ \test{-1}{0}%
+ \test{ 0 }{0}%
+ \test{1.1}{1}%
+ \test{100}{1}%
+ \test{00100}{1}%
+ \test{99.99}{1}%
+ \test{0.0}{0}%
+ \test{00.00}{0}%
+ \test{0.}{0}%
+ \test{.0}{0}%
+ \test{0.1}{.1}%
+ \test{0.10}{.1}%
+ \test{0.1000}{.1}%
+ \test{.1000}{.1}%
+ \test{0.01}{.01}%
+ \test{0.01010}{.0101}%
+ \test{.0000000001}{.0000000001}%
+ \test{.9999999999}{.9999999999}%
+\end{qstest}
+
+\begin{qstest}{BookmarkColor without xcolor}{bookmark, noxcolor}
+ \def\test#1#2{%
+ \HyColor@BookmarkColor{#1}\cmd\TestPackageName\TestOptionName
+ \Expect*{\cmd}{#2}%
+ }%
+ \test{[rgb]{1,0,0}}{1 0 0}%
+ \test{[gray]{0.10}}{.1 .1 .1}%
+ \test{}{}%
+ \test{[rgb]{ 1 , 1 , 0 }}{1 1 0}%
+ \def\errortest[#1]#2{%
+ \ExpectError{%
+ Color model `#1' is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `\TestOptionName=[#1]{#2}'% hash-ok
+ }{%
+ \test{[#1]{#2}}{}% hash-ok
+ }%
+ }%
+ \errortest[cmyk]{1,0,0,0}%
+ \errortest[empty]{}%
+ \def\errortest#1{%
+ \ExpectError{%
+ This color specification is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `\TestOptionName=#1'%
+ }{%
+ \test{#1}{}%
+ }%
+ }%
+\end{qstest}
+%</test1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test1|test2>
+\begin{qstest}{X0134 without xcolor}{X0134, noxcolor}
+ \def\test#1#2{%
+ \HyColor@XZeroOneThreeFour{#1}\cmd\TestPackageName\TestOptionName
+ \Expect*{\cmd}{#2}%
+ }%
+ \test{[empty]{}}{}%
+ \test{[rgb]{1,0,0}}{1 0 0}%
+ \test{[gray]{0.10}}{.1}%
+ \test{[cmyk]{0,1,0,0}}{0 1 0 0}%
+ \test{[rgb]{ 1 , 1 , 0 }}{1 1 0}%
+ \def\errortest[#1]#2{%
+ \ExpectError{%
+ Color model `#1' is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `test-option=[#1]{#2}'% hash-ok
+ }{%
+ \HyColor@XZeroOneThreeFour{[{#1}]{#2}}\cmd
+ \TestPackageName\TestOptionName
+ \Expect{true}*{\ifx\cmd\relax true\else false\fi}%
+ }%
+ }%
+ \errortest[Gray]{10}%
+ \errortest[cmy]{1,0,0}%
+ \def\errortest#1{%
+ \ExpectError{%
+ This color specification is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `test-option=#1'%
+ }{%
+ \HyColor@XZeroOneThreeFour{#1}\cmd\TestPackageName\TestOptionName
+ \Expect{true}*{\ifx\cmd\relax true\else false\fi}%
+ }%
+ }%
+ \errortest{yellow}%
+\end{qstest}
+
+\begin{qstest}{HyperrefBorderColor without xcolor}%
+ {hyperef bordercolor, noxcolor}%
+ \def\test#1#2{%
+ \HyColor@HyperrefBorderColor{#1}\cmd\TestPackageName\TestOptionName
+ \Expect*{\cmd}{#2}%
+ }%
+ \test{[rgb]{1,0,0}}{1 0 0}%
+ \test{[gray]{0.10}}{.1 .1 .1}%
+ \test{[rgb]{ 1 , 1 , 0 }}{1 1 0}%
+ \def\errortest[#1]#2{%
+ \ExpectError{%
+ Color model `#1' is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `test-option=[#1]{#2}'% hash-ok
+ }{%
+ \HyColor@HyperrefBorderColor{[{#1}]{#2}}\cmd
+ \TestPackageName\TestOptionName
+ \Expect{true}*{\ifx\cmd\relax true\else false\fi}%
+ }%
+ }%
+ \errortest[Gray]{10}%
+ \errortest[cmy]{1,0,0}%
+ \errortest[cmyk]{0,1,0,0}%
+ \def\errortest#1{%
+ \ExpectError{%
+ This color specification is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `test-option=#1'%
+ }{%
+ \HyColor@HyperrefBorderColor{#1}\cmd
+ \TestPackageName\TestOptionName
+ \Expect{true}*{\ifx\cmd\relax true\else false\fi}%
+ }%
+ }%
+ \errortest{yellow}%
+\end{qstest}
+%</test1|test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test1|test2>
+\usepackage{xcolor}
+\definecolor[named]{MyGreen}{rgb}{0,0.7,0}
+\definecolor{mygreen}{named}{MyGreen}
+%</test1|test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test1>
+\begin{qstest}{BookmarkColor with xcolor}{bookmark, xcolor}
+ \def\test#1#2{%
+ \HyColor@BookmarkColor{#1}\cmd\PackageName\OptionName
+ \Expect*{\cmd}{#2}%
+ }%
+ \test{[rgb]{1,0,0}}{1 0 0}%
+ \test{[gray]{0.10}}{.1 .1 .1}%
+ \test{}{}%
+ \test{[rgb]{ 1 , 1 , 0 }}{1 1 0}%
+ \test{[cmyk]{1,0,0,0}}{0 1 1}%
+ \test{red}{1 0 0}%
+ \test{cyan}{0 1 1}%
+ \test{red!40!blue}{.4 0 .6}%
+ \test{[Gray]{10}}{.66667 .66667 .66667}%
+ \test{[RGB]{100,200,50}}{.39217 .78432 .19609}%
+ \test{[wave]{363}}{.00316 0 .00316}%
+ \test{[wave]814}{.00797 0 0}%
+ \test{[HSB]{100,200,50}}{.03473 .20833 .12152}%
+ \test{[HTML]{A800FF}}{.65881 0 1}%
+ \test{[cmy]{.3,.5,.2}}{.7 .5 .8}%
+ \test{[cmyk]{.3,.5,.2,.1}}{.6 .4 .7}%
+ \test{[hsb]{.3,.5,.2}}{.12 .2 .1}%
+ \test{[Hsb]{120,.5,.2}}{.1 .2 .1}%
+ \test{[tHsb]{120,.5,.2}}{.2 .2 .1}%
+ \test{[named]{MyGreen}}{0 .7 0}%
+ \test{mygreen}{0 .7 0}%
+\end{qstest}
+
+\begin{qstest}{HyperrefColor}{hyperref, color}
+ \def\test#1#2{%
+ \HyColor@HyperrefColor{#1}\cmd
+ \Expect*{\cmd}{#2}%
+ }%
+ \test{red}{red}%
+ \test{[rgb]{1,0,0}}{[{rgb}]{1,0,0}}%
+ \HyColor@HyperrefColor{}\cmd
+ \Expect{true}*{\ifx\cmd\relax true\else false\fi}%
+\end{qstest}
+%</test1>
+% \end{macrocode}
+% \begin{macrocode}
+%<*test1|test2>
+\begin{qstest}{X0134 with xcolor}{hyperref, X0134, xcolor}
+ \def\test#1#2{%
+ \HyColor@XZeroOneThreeFour{#1}\cmd\PackageName\OptionName
+ \Expect*{\cmd}{#2}%
+ }%
+ \test{[empty]{}}{}%
+ \test{[gray]{0.1}}{.1}%
+ \test{[rgb]{1,0.5,0.0}}{1 .5 0}%
+ \test{[cmyk]{0,1,0,0.5}}{0 1 0 .5}%
+ \test{[Gray]{10}}{.66667}%
+ \test{red}{1 0 0}%
+ \test{1 0 0}{1 0 0}%
+ \test{001.0 .23 0}{1 .23 0}%
+ \test{[named]{MyGreen}}{0 .7 0}%
+ \test{mygreen}{0 .7 0}%
+ \HyColor@XZeroOneThreeFour{}\cmd\PackageName\OptionName
+ \Expect{true}*{\ifx\cmd\relax true\else false\fi}%
+\end{qstest}
+
+\begin{qstest}{FieldColor}{hyperref, field, FieldColor}
+ \def\test#1#2{%
+ \HyColor@FieldColor{#1}\cmd\PackageName\OptionName
+ \Expect*{\cmd}{#2}%
+ }%
+ \test{}{}%
+ \test{[gray]{0.7}}{.7 g}%
+ \test{[rgb]{1,0,0}}{1 0 0 rg}%
+ \test{[cmyk]{0,1,0,0}}{0 1 0 0 k}%
+ \test{[cmy]{.5,.4,.3}}{.5 .6 .7 rg}%
+\end{qstest}
+%</test1|test2>
+% \end{macrocode}
+%
+% \subsection{Test for package \xpackage{attachfile2}}
+%
+% \begin{macrocode}
+%<*test3>
+\def\atfi@SETRGBCOLORtest{set-rgb}
+\def\atfi@SETGRAYCOLORtest{set-gray}
+\def\atfi@SETCMYKCOLORtest{set-cmyk}
+\def\Test#1#2#3#4#5{%
+ \begingroup
+ \setbox0=\hbox{%
+ \begingroup
+ \chardef\HyColor@PdfVersion=6 %
+ \HyColor@AttachfileColor{#1}\spec\inlinemacro\annot
+ \TestPackageName\TestOptionName
+ \edef\inline{\inlinemacro{test}}%
+ \expandafter\Expect\expandafter{\spec}{#2}%
+ \expandafter\Expect\expandafter{\inline}{#3}%
+ \expandafter\Expect\expandafter{\annot}{#4}%
+ \endgroup
+ \begingroup
+ \chardef\HyColor@PdfVersion=7 %
+ \HyColor@AttachfileColor{#1}\spec\inlinemacro\annot
+ \TestPackageName\TestOptionName
+ \edef\inline{\inlinemacro{test}}%
+ \expandafter\Expect\expandafter{\spec}{#2}%
+ \expandafter\Expect\expandafter{\inline}{#3}%
+ \expandafter\Expect\expandafter{\annot}{#5}%
+ \endgroup
+ }%
+ \Expect*{\the\wd0}{0.0pt}%
+ \endgroup
+}
+\newif\ifError
+\def\TestError[#1]#2#3#4#5#6{%
+ \begingroup
+ \global\Errorfalse
+ \let\OrgPackageError\PackageError
+ \def\PackageError##1##2##3{%
+ \edef\TestTemp{##1}%
+ \ifx\TestTemp\TestPackageName
+ \Expect*{\ifError too many errors\else ok\fi}{ok}%
+ \Expect*{#6}*{##2}%
+ \global\Errortrue
+ \else
+ \OrgPackageError{##1}{##2}{##3}%
+ \fi
+ }%
+ \setbox0=\hbox{%
+ \begingroup
+ \chardef\HyColor@PdfVersion=#1 %
+ \HyColor@AttachfileColor{#2}\spec\inlinemacro\annot
+ \TestPackageName\TestOptionName
+ \edef\inline{\inlinemacro{test}}%
+ \expandafter\Expect\expandafter{\spec}{#3}%
+ \expandafter\Expect\expandafter{\inline}{#4}%
+ \expandafter\Expect\expandafter{\annot}{#5}%
+ \endgroup
+ \ifx\\#6\\%
+ \else
+ \Expect*{\ifError ok\else missing error\fi}{ok}%
+ \fi
+ }%
+ \Expect*{\the\wd0}{0.0pt}%
+ \endgroup
+}
+\def\NoEmptyModel{%
+ Color model `empty' is not permitted for option `\TestOptionName'%
+}
+\def\ModelNoXcolor#1#2{%
+ Color model `#1' is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `\TestOptionName=[#1]{#2}'% hash-ok
+}
+\def\SpecNoXColor#1{%
+ This color specification is not supported\MessageBreak
+ without package `xcolor' in\MessageBreak
+ `test-option=#1'%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begin{qstest}{AttachfileColor}{AttachfileColor}
+ \Test{}{}{}{}{}%
+ \Test{0.1 0.2 0.3}{[rgb]{.1,.2,.3}}{.1 .2 .3 set-rgb}%
+ {/C[.1 .2 .3]}{/C[.1 .2 .3]}%
+ \Test{[gray]{0.4}}{[gray]{0.4}}{.4 set-gray}%
+ {/C[.4 .4 .4]}{/C[.4]}%
+ \Test{[rgb]{0.3,.2,.1}}{[rgb]{0.3,.2,.1}}{.3 .2 .1 set-rgb}%
+ {/C[.3 .2 .1]}{/C[.3 .2 .1]}%
+ \Test{0.0 1.0 1}{[rgb]{0,1,1}}{0 1 1 set-rgb}%
+ {/C[0 1 1]}{/C[0 1 1]}%
+ \Test{[gray]1}{[gray]1}{1 set-gray}{/C[1 1 1]}{/C[1]}%
+ \TestError[6]{[empty]{}}{}{}{}\NoEmptyModel
+ \TestError[7]{[empty]{}}{}{}{}\NoEmptyModel
+ \TestError[6]{[cmyk]{.1,.2,.3,.4}}{[cmyk]{.1,.2,.3,.4}}%
+ {.1 .2 .3 .4 set-cmyk}{}%
+ {\ModelNoXcolor{cmyk}{.1,.2,.3,.4}}%
+ \TestError[7]{[cmyk]{.1,.2,.3,.4}}{[cmyk]{.1,.2,.3,.4}}%
+ {.1 .2 .3 .4 set-cmyk}{/C[.1 .2 .3 .4]}{}%
+ \TestError[6]{red}{red}{}{}{\SpecNoXColor{red}}%
+ \TestError[7]{red}{red}{}{}{\SpecNoXColor{red}}%
+\end{qstest}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\usepackage{xcolor}
+\definecolor[named]{MyGreen}{rgb}{0,0.7,0}
+\definecolor{mygreen}{named}{MyGreen}
+\definecolor{graynine}{gray}{0.9}
+\definecolor{GraySix}{Gray}{9}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begin{qstest}{AttachfileColorX}{AttachfileColorX}
+ \Test{}{}{}{}{}%
+ \Test{0.1 0.2 0.3}{[rgb]{.1,.2,.3}}{.1 .2 .3 set-rgb}%
+ {/C[.1 .2 .3]}{/C[.1 .2 .3]}%
+ \Test{[gray]{0.4}}{[gray]{0.4}}{.4 set-gray}%
+ {/C[.4 .4 .4]}{/C[.4]}%
+ \Test{[rgb]{0.3,.2,.1}}{[rgb]{0.3,.2,.1}}{.3 .2 .1 set-rgb}%
+ {/C[.3 .2 .1]}{/C[.3 .2 .1]}%
+ \Test{0.0 1.0 1}{[rgb]{0,1,1}}{0 1 1 set-rgb}%
+ {/C[0 1 1]}{/C[0 1 1]}%
+ \Test{[gray]1}{[gray]1}{1 set-gray}{/C[1 1 1]}{/C[1]}%
+ \Test{red}{red}{1 0 0 set-rgb}{/C[1 0 0]}{/C[1 0 0]}%
+ \Test{black}{black}{0 set-gray}{/C[0 0 0]}{/C[0]}%
+ \Test{cyan}{cyan}{1 0 0 0 set-cmyk}{/C[0 1 1]}{/C[1 0 0 0]}%
+ \Test{[named]{black}}{[named]{black}}{0 0 0 set-rgb}%
+ {/C[0 0 0]}{/C[0 0 0]}%
+ \Test{[Gray]{9}}{[Gray]{9}}{.6 set-gray}{/C[.6 .6 .6]}{/C[.6]}%
+ \Test{[HTML]{0080FF}}{[HTML]{0080FF}}{0 .50195 1 set-rgb}%
+ {/C[0 .50195 1]}{/C[0 .50195 1]}%
+ \Test{graynine}{graynine}{.9 set-gray}{/C[.9 .9 .9]}{/C[.9]}%
+ \Test{GraySix}{GraySix}{.6 set-gray}{/C[.6 .6 .6]}{/C[.6]}%
+ \Test{[wave]{500}}{[wave]{500}}{0 1 .49846 set-rgb}%
+ {/C[0 1 .49846]}{/C[0 1 .49846]}%
+ \TestError[6]{[empty]{}}{}{}{}\NoEmptyModel
+ \TestError[7]{[empty]{}}{}{}{}\NoEmptyModel
+\end{qstest}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</test3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test>
+\begin{document}
+\end{document}
+%</test>
+% \end{macrocode}
+%
+% \subsection{Test for package \xpackage{xcolor}}
+%
+% \begin{macrocode}
+%<*test-xcolor>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{minimal}
+%<*xcol1>
+\usepackage{xcolor}
+\usepackage{xcolor-patch}[2016/05/16]
+%</xcol1>
+%<*xcol2>
+\usepackage{scrlfile}
+\usepackage{xcolor-patch}[2016/05/16]
+\usepackage{xcolor}
+%</xcol2>
+%<*xcol3>
+\usepackage{xcolor-patch}[2016/05/16]
+\usepackage{xcolor}
+\begin{document}
+%</xcol3>
+\makeatletter
+\newcommand*{\ColModList}{%
+ rgb,%
+ cmy,%
+ cmyk,%
+ hsb,%
+ Hsb,%
+ tHsb,%
+ gray,%
+ RGB,%
+ HTML,%
+ HSB,%
+ Gray,%
+ % wave,
+}
+\newcommand*{\StartModel}{rgb}
+\newcommand*{\StartValues}{.1,.2,.3}
+\@for\x:=\ColModList\do{%
+ \ifx\x\@empty
+ \else
+ \convertcolorspec\StartModel\StartValues\x\y
+ \typeout{* [\StartModel]{\StartValues} ==> [\x]{\y}}%
+ \@for\xx:=\ColModList\do{%
+ \ifx\xx\@empty
+ \else
+ \convertcolorspec\x\y\xx\yy
+ \typeout{* [\x]{\y} ==> [\xx]{\yy}}%
+ \fi
+ }%
+ \fi
+}
+%<xcol3>\end{document}
+%<xcol1|xcol2>\@@end
+%</test-xcolor>
+% \end{macrocode}
+%
+% \subsubsection{Test for \cs{@frameb@x}/\cs{fbox}}
+%
+% \begin{macrocode}
+%<*test-xcolor-fbox>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{xcolor}
+\usepackage{xcolor-patch}[2016/05/16]
+\makeatletter
+\protected@edef\x{\fbox{abc}}
+\let\@tempa\@undefined
+\protected@edef\x{\fbox{abc}}
+\makeatother
+\begin{document}
+\MakeUppercase{\fbox{abc}}
+\end{document}
+%</test-xcolor-fbox>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hycolor}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hycolor.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hycolor.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[\CTAN{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 hycolor.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@{}}
+% hycolor.sty & tex/latex/oberdiek/hycolor.sty\\
+% xcolor-patch.sty & tex/latex/oberdiek/xcolor-patch.sty\\
+% hycolor.pdf & doc/latex/oberdiek/hycolor.pdf\\
+% test/hycolor-test1.tex & doc/latex/oberdiek/test/hycolor-test1.tex\\
+% test/hycolor-test2.tex & doc/latex/oberdiek/test/hycolor-test2.tex\\
+% test/hycolor-test3.tex & doc/latex/oberdiek/test/hycolor-test3.tex\\
+% test/hycolor-test-xcol1.tex & doc/latex/oberdiek/test/hycolor-test-xcol1.tex\\
+% test/hycolor-test-xcol2.tex & doc/latex/oberdiek/test/hycolor-test-xcol2.tex\\
+% test/hycolor-test-xcol3.tex & doc/latex/oberdiek/test/hycolor-test-xcol3.tex\\
+% test/hycolor-test-xcol4.tex & doc/latex/oberdiek/test/hycolor-test-xcol4.tex\\
+% hycolor.dtx & source/latex/oberdiek/hycolor.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hycolor.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hycolor.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 hycolor.dtx
+%makeindex -s gind.ist hycolor.idx
+%pdflatex hycolor.dtx
+%makeindex -s gind.ist hycolor.idx
+%pdflatex hycolor.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hycolor.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hycolor'>
+ <name>hycolor</name>
+ <caption>Implements colour for packages hyperref and bookmark.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.8'/>
+ <description>
+ This package provides the code for the color option
+ that is used by packages <xref refid='hyperref'>hyperref</xref>
+ and <xref refid='bookmark'>bookmark</xref>.
+ It is not intended as package for the user.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hycolor.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hycolor.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/04/09 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.1}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2008/07/29 v1.2}
+% \item
+% Support for package \xpackage{attachfile2} added.
+% \end{Version}
+% \begin{Version}{2008/08/01 v1.3}
+% \item
+% Patch package \xpackage{xcolor-patch} added that fixes bugs in
+% package \xpackage{xcolor} to get the test files running.
+% \end{Version}
+% \begin{Version}{2008/09/08 v1.4}
+% \item
+% Fix added to package \xpackage{xcolor-patch}:
+% Fragile \cs{@frameb@x} (used in \cs{fbox}) is made robust.
+% \end{Version}
+% \begin{Version}{2009/10/02 v1.5}
+% \item
+% Doku fixes (Herbert Voss).
+% \end{Version}
+% \begin{Version}{2009/12/12 v1.6}
+% \item
+% Short info shortened.
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.7}
+% \item
+% Package \xpackage{xcolor-patch} uses package \xpackage{hopatch}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.8}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hycolor.pdf b/macros/latex/contrib/oberdiek/hycolor.pdf
new file mode 100644
index 0000000000..46abb25d78
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hycolor.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hypbmsec.dtx b/macros/latex/contrib/oberdiek/hypbmsec.dtx
new file mode 100644
index 0000000000..5288140146
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypbmsec.dtx
@@ -0,0 +1,870 @@
+% \iffalse meta-comment
+%
+% File: hypbmsec.dtx
+% Version: 2016/05/16 v2.5
+% Info: Bookmarks in sectioning commands
+%
+% Copyright (C) 1998-2000, 2006, 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file hypbmsec.dtx
+% and the derived files
+% hypbmsec.sty, hypbmsec.pdf, hypbmsec.ins, hypbmsec.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hypbmsec.dtx
+% CTAN:macros/latex/contrib/oberdiek/hypbmsec.pdf
+%
+% Unpacking:
+% (a) If hypbmsec.ins is present:
+% tex hypbmsec.ins
+% (b) Without hypbmsec.ins:
+% tex hypbmsec.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hypbmsec.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hypbmsec.drv is present:
+% latex hypbmsec.drv
+% (b) Without hypbmsec.drv:
+% latex hypbmsec.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 hypbmsec.dtx
+% makeindex -s gind.ist hypbmsec.idx
+% pdflatex hypbmsec.dtx
+% makeindex -s gind.ist hypbmsec.idx
+% pdflatex hypbmsec.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/hypbmsec.sty
+% TDS:doc/latex/oberdiek/hypbmsec.pdf
+% TDS:source/latex/oberdiek/hypbmsec.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hypbmsec 2016/05/16 v2.5 Bookmarks in sectioning commands (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hypbmsec
+Version: 2016/05/16 v2.5
+
+Copyright (C) 1998-2000, 2006, 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file hypbmsec.dtx
+and the derived files
+ hypbmsec.sty, hypbmsec.pdf, hypbmsec.ins, hypbmsec.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hypbmsec.ins}{\from{hypbmsec.dtx}{install}}%
+ \file{hypbmsec.drv}{\from{hypbmsec.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{hypbmsec.sty}{\from{hypbmsec.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hypbmsec.xml}{\from{hypbmsec.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{* hypbmsec.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hypbmsec.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hypbmsec.drv}%
+ [2016/05/16 v2.5 Bookmarks in sectioning commands (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{hypbmsec.dtx}%
+\end{document}
+%</driver>
+% \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{hypbmsec.drv}
+%
+% \title{The \xpackage{hypbmsec} package}
+% \date{2016/05/16 v2.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package expands the syntax of the sectioning commands. If the
+% argument of the sectioning commands isn't usable as outline entry,
+% a replacement for the bookmarks can be given.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newcommand{\type}[1]{\textsf{#1}}
+%
+% ^^A No thread support.
+% \newenvironment{article}[1]{}{}
+%
+% \section{Usage}
+%
+% \subsection{Bookmarks restrictions}\label{sec:restrictions}
+% Outline entries (bookmarks) are written to a file and have
+% to obey the pdf specification.
+% Therefore they have several restrictions:
+% \begin{itemize}
+% \item Bookmarks have to be encoded in PDFDocEncoding^^A
+% \footnote{\Package{hyperref} doesn't support
+% Unicode.}.
+% \item They should only expand to letters and spaces.
+% \item The result of expansion have to be a valid pdf string.
+% \item Stomach commands like \cmd{\relax}, box commands, math,
+% assignments, or definitions aren't allowed.
+% \item Short entries are recommended, which allow a clear view.
+% \end{itemize}
+%
+% \subsection{\texorpdfstring{\cmd{\texorpdfstring}}{^^A
+% \textbackslash texorpdfstring}}
+% The generic way in package \Package{hyperref} is the use
+% of \cmd{\texorpdfstring}^^A
+% \footnote{In versions of \Package{hyperref} below 6.54 see
+% \cmd{\ifbookmark}.}:
+% \begin{quote}
+%\begin{verbatim}
+%\section{Pythagoras:
+% \texorpdfstring{$a^2+b^2=c^2}{%
+% a\texttwosuperior\ + b\texttwosuperior\ =
+% c\texttwosuperior}%
+%}
+%\end{verbatim}
+% \end{quote}
+%
+% \subsection{Sectioning commands}
+% The package \Package{hyperref} automatically generates
+% bookmarks from the sectioning commands,
+% unless it is suppressed by an option.
+% Commands that structure the text are here called
+% ``sectioning commands'':
+% \begin{quote}
+% \cmd{\part}, \cmd{\chapter},\\
+% \cmd{\section}, \cmd{\subsection}, \cmd{\subsubsection},\\
+% \cmd{\paragraph}, \cmd{\subparagraph}
+% \end{quote}
+%
+% \subsection{Places\texorpdfstring{ for sectioning strings}{}}
+% \label{sec:places}
+% The argument(s) of these commands are used on several places:
+% \begin{description}
+% \item[\type{text}]
+% The current text without restrictions.
+% \item[\type{toc}]
+% The headlines and the table of contents with the
+% restrictions of ``moving arguments''.
+% \item[\type{out}]
+% The outlines with many restrictions: The outline
+% have to expand to a valid pdf string with PDFDocEncoding
+% (see \ref{sec:restrictions}).
+% \end{description}
+%
+% \subsection{\texorpdfstring{Solution with o}{O}ptional arguments}
+% If the user wants to use a footnote within a sectioning command,
+% the \LaTeX{} solution is an optional argument:
+% \begin{quote}
+% |\section[Title]{Title\footnote{Footnote text}}|
+% \end{quote}
+% Now |Title| without the footnote is used in the headlines and
+% the table of contents. Also \Package{hyperref} uses it for the
+% bookmarks.
+%
+% This package \Package{\filename} offers two possibilities to
+% specify a separate outline entry:
+% \begin{itemize}
+% \item An additional second optional argument in square brackets.
+% \item An additional optional argument in parentheses (in
+% assoziation with a pdf string that is internally surrounded
+% by parentheses, too).
+% \end{itemize}
+% Because \Package{\filename} stores the original meaning of the
+% sectioning commands and uses them again, there should be no
+% problems with packages that redefine the sectioning commands, if
+% these packages doesn't change the syntax.
+%
+% \subsection{Syntax}
+% The following examples show the syntax of the sectioning
+% commands. For the places the strings appear the abbreviations
+% are used, that are introduced in \ref{sec:places}.
+%
+% \subsubsection{\texorpdfstring{Star form}{^^A
+% \textbackslash section*\{\}}}
+% The behaviour of the star form isn't changed. The string
+% appears only in the current text:
+% \begin{article}{Syntax}
+% \begin{quote}
+% |\section*{text}|
+% \end{quote}
+% \end{article}
+%
+% \subsubsection{\texorpdfstring{Without optional arguments}{^^A
+% \textbackslash section\{\}}}
+% The normal case, the string in the mandatory argument is
+% used for all places:
+% \begin{article}{Syntax}
+% \begin{quote}
+% |\section{text, toc, out}|
+% \end{quote}
+% \end{article}
+%
+% \subsubsection{\texorpdfstring{One optional argument}{^^A
+% \textbackslash section[]\{\}}}
+% Also the form with one optional parameter in square brackets isn't
+% new; for the bookmarks the optional parameter is used:
+% \begin{article}{Syntax}
+% \begin{quote}
+% |\section[toc, out]{text}|
+% \end{quote}
+% \end{article}
+%
+% \subsubsection{\texorpdfstring{Two optional arguments}{^^A
+% \textbackslash section[][out]\{\}}}\label{sec:two}
+% The second optional parameter in square brackets is introduced
+% by this package to specify an outline entry:
+% \begin{article}{Syntax}
+% \begin{quote}
+% |\section[toc][out]{text}|
+% \end{quote}
+% \end{article}
+%
+% \subsubsection{\texorpdfstring{Optional argument in parentheses}{^^A
+% \textbackslash section(out)\{\}}}
+% Often the \type{toc} and the \type{text} string would be the same.
+% With the method of the two optional arguments in square brackets
+% (see \ref{sec:two}) this string must be given twice,
+% if the user only wants to specify a different outline entry.
+% Therefore this package offers another possibility:
+% In association with the internal representation in the pdf file
+% an outline entry can be given in parentheses.
+% So the package can easily distinguish between
+% the two forms of optional arguments and the order does not matter:
+% \begin{article}{Syntax}
+% \begin{quote}
+% |\section(out){toc, text}|\\
+% |\section[toc](out){text}|\\
+% |\section(out)[toc]{text}|
+% \end{quote}
+% \end{article}
+%
+% \subsection{Without \Package{hyperref}}
+% Package \Package{\filename} uses \Package{hyperref} for support of
+% the bookmarks, but this package is not required.
+% If \Package{hyperref} isn't loaded, or
+% is called with a driver that doesn't support bookmarks,
+% package \Package{\filename} shouldn't be removed,
+% because this would lead to
+% a wrong syntax of the sectioning commands.
+% In any cases package \Package{\filename}
+% supports its syntax and ignores the outline entries,
+% if there are no code for bookmarks.
+% So it is possible to write texts,
+% that are processed with several drivers to get different output
+% formats.
+%
+% \subsection{Protecting parentheses}
+% If the string itself contains parentheses, they have to be hidden
+% from \TeX's argument parsing mechanism.
+% The argument should be surrounded
+% by curly braces:
+% \begin{quote}
+% |\section({outlines(bookmarks)}){text, toc}|
+% \end{quote}
+% With version 6.54 of \Package{hyperref} the other standard method
+% works, too: The closing parenthesis is protected:
+% \begin{quote}
+% |\section(outlines(bookmarks{)}){text, toc}|
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hypbmsec}%
+ [2016/05/16 v2.5 Bookmarks in sectioning commands (HO)]
+% \end{macrocode}
+%
+% Because of redifining the sectioning commands, it is dangerous
+% to reload the package several times.
+% \begin{macrocode}
+\@ifundefined{hbs@do}{}{%
+ \PackageInfo{hypbmsec}{Package 'hypbmsec' is already loaded}%
+ \endinput
+}
+% \end{macrocode}
+%
+% \begin{macro}{\hbs@do}
+% The redefined sectioning commands calls \cmd{\hbs@do}. It does
+% \begin{itemize}
+% \item handle the star case.
+% \item resets the macros that store the entries for the outlines
+% (\cmd{\hbs@bmstring}) and table of contents (\cmd{\hbs@tocstring}).
+% \item store the sectioning command |#1| in \cmd{\hbs@seccmd}
+% for later reuse.
+% \item at last call \cmd{\hbs@checkarg} that scans and interprets the
+% parameters of the redefined sectioning command.
+% \end{itemize}
+% \begin{macrocode}
+\def\hbs@do#1{%
+ \@ifstar{#1*}{%
+ \let\hbs@tocstring\relax
+ \let\hbs@bmstring\relax
+ \let\hbs@seccmd#1%
+ \hbs@checkarg
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hbs@checkarg}
+% \cmd{\hbs@checkarg} determines the type of the next argument:
+% \begin{itemize}
+% \item An optional argument in square brackets can be an entry
+% for the table of contents or the bookmarks. It will be
+% read by \cmd{\hbs@getsquare}
+% \item An optional argument in parentheses is an outline entry.
+% This is worked off by \cmd{\hbs@getbookmark}.
+% \item If there are no more optional arguments, \cmd{\hbs@process}
+% reads the mandatory argument and calls the original
+% sectioning commands.
+% \end{itemize}
+% \begin{macrocode}
+\def\hbs@checkarg{%
+ \@ifnextchar[\hbs@getsquare{%
+ \@ifnextchar(\hbs@getbookmark\hbs@process
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hbs@getsquare}
+% \cmd{\hbs@getsquare} reads an optional argument in square
+% brackets and determines, if this is an entry for the table
+% of contents or the bookmarks.
+% \begin{macrocode}
+\long\def\hbs@getsquare[#1]{%
+ \ifx\hbs@tocstring\relax
+ \def\hbs@tocstring{#1}%
+ \else
+ \hbs@bmdef{#1}%
+ \fi
+ \hbs@checkarg
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hbs@getbookmark}
+% \cmd{\hbs@getbookmark} reads an outline entry in parentheses.
+% \begin{macrocode}
+\def\hbs@getbookmark(#1){%
+ \hbs@bmdef{#1}%
+ \hbs@checkarg
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hbs@bmdef}
+% The command \cmd{\hbs@bmdef} save the bookmark entry in
+% parameter |#1| in the macro \cmd{\hbs@bmstring} and catches
+% the case, if the user has given several outline strings.
+% \begin{macrocode}
+\def\hbs@bmdef#1{%
+ \ifx\hbs@bmstring\relax
+ \def\hbs@bmstring{#1}%
+ \else
+ \PackageError{hypbmsec}{%
+ Sectioning command with too many parameters%
+ }{%
+ You can only give one outline entry.%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hbs@process}
+% The parameter |#1| is the mandatory argument of the sectioning
+% commands. \cmd{\hbs@process} calls the original sectioning command
+% stored in \cmd{\hbs@seccmd} with arguments that depend of which
+% optional argument are used previously.
+% \begin{macrocode}
+\long\def\hbs@process#1{%
+ \ifx\hbs@tocstring\relax
+ \ifx\hbs@bmstring\relax
+ \hbs@seccmd{#1}%
+ \else
+ \begingroup
+ \def\x##1{\endgroup
+ \hbs@seccmd{\texorpdfstring{#1}{##1}}%
+ }%
+ \expandafter\x\expandafter{\hbs@bmstring}%
+ \fi
+ \else
+ \ifx\hbs@bmstring\relax
+ \expandafter\hbs@seccmd\expandafter[%
+ \expandafter{\hbs@tocstring}%
+ ]{#1}%
+ \else
+ \expandafter\expandafter\expandafter
+ \hbs@seccmd\expandafter\expandafter\expandafter[%
+ \expandafter\expandafter\expandafter
+ \texorpdfstring
+ \expandafter\expandafter\expandafter{%
+ \expandafter\hbs@tocstring\expandafter
+ }\expandafter{%
+ \hbs@bmstring
+ }%
+ ]{#1}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We have to check, whether package \Package{hyperref} is loaded
+% and have to provide a definition for \cmd{\texorpdfstring}.
+% Because \Package{hyperref} can be loaded after this package,
+% we do the work later (\cmd{\AtBeginDocument}).
+%
+% This code only checks versions of \Package{hyperref} that
+% define \cmd{\ifbookmark} (v6.4x until v6.53) or
+% \cmd{\texorpdfstring} (v6.54 and above). Older versions aren't
+% supported.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifundefined{texorpdfstring}{%
+ \@ifundefined{ifbookmark}{%
+ \let\texorpdfstring\@firstoftwo
+ \@ifpackageloaded{hyperref}{%
+ \PackageInfo{hypbmsec}{%
+ \ifx\hy@driver\@empty
+ Default driver %
+ \else
+ '\hy@driver' %
+ \fi
+ of hyperref not supported,\MessageBreak
+ bookmark parameters will be ignored%
+ }%
+ }{%
+ \PackageInfo{hypbmsec}{%
+ Package hyperref not loaded,\MessageBreak
+ bookmark parameters will be ignored%
+ }%
+ }%
+ }%
+ {%
+ \newcommand\texorpdfstring[2]{\ifbookmark{#2}{#1}}%
+ \PackageWarningNoLine{hypbmsec}{%
+ Old hyperref version found,\MessageBreak
+ update of hyperref recommended%
+ }%
+ }%
+ }{}%
+% \end{macrocode}
+%
+% Other packages are allowed to redefine the sectioning commands,
+% if they does not change the syntax. Therefore the redefinitons
+% of this package should be done after the other packages.
+% \begin{macrocode}
+ \let\hbs@part \part
+ \let\hbs@section \section
+ \let\hbs@subsection \subsection
+ \let\hbs@subsubsection\subsubsection
+ \let\hbs@paragraph \paragraph
+ \let\hbs@subparagraph \subparagraph
+ \renewcommand\part {\hbs@do\hbs@part}%
+ \renewcommand\section {\hbs@do\hbs@section}%
+ \renewcommand\subsection {\hbs@do\hbs@subsection}%
+ \renewcommand\subsubsection{\hbs@do\hbs@subsubsection}%
+ \renewcommand\paragraph {\hbs@do\hbs@paragraph}%
+ \renewcommand\subparagraph {\hbs@do\hbs@subparagraph}%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname chapter\endcsname\relax\else
+ \let\hbs@chapter \chapter
+ \renewcommand\chapter {\hbs@do\hbs@chapter}%
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hypbmsec}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypbmsec.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypbmsec.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[\CTAN{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 hypbmsec.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@{}}
+% hypbmsec.sty & tex/latex/oberdiek/hypbmsec.sty\\
+% hypbmsec.pdf & doc/latex/oberdiek/hypbmsec.pdf\\
+% hypbmsec.dtx & source/latex/oberdiek/hypbmsec.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hypbmsec.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hypbmsec.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 hypbmsec.dtx
+%makeindex -s gind.ist hypbmsec.idx
+%pdflatex hypbmsec.dtx
+%makeindex -s gind.ist hypbmsec.idx
+%pdflatex hypbmsec.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hypbmsec.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hypbmsec'>
+ <name>hypbmsec</name>
+ <caption>Hypertext bookmarks in sectioning commands.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1998-2000,2006,2007'/>
+ <license type='lppl1.3'/>
+ <version number='2.5'/>
+ <description>
+ Bookmark entries can be given as another argument to the LaTeX
+ sectioning commands. The <xref refid='hyperref'>hyperref</xref>
+ package is required to get the bookmarks, but the syntax
+ works without it.
+ <p/>
+ This package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hypbmsec.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hypbmsec.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1998/11/20 v1.0}
+% \item
+% First version.
+% \item
+% It merges package \xpackage{hysecopt} and
+% \item
+% package \xpackage{hypbmpar}.
+% \item
+% Published for the DANTE'99 meeting^^A
+% \URL{}{http://dante99.cs.uni-dortmund.de/handouts/oberdiek/hypbmsec.sty}.
+% \end{Version}
+% \begin{Version}{1999/04/12 v2.0}
+% \item
+% Adaptation to \Package{hyperref} version 6.54.
+% \item
+% Documentation in dtx format.
+% \item
+% Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt})
+% \item
+% First CTAN release.
+% \end{Version}
+% \begin{Version}{2000/03/22 v2.1}
+% \item
+% Bug fix in redefinition of \cmd{\chapter}.
+% \item
+% Copyright: LPPL 1.2
+% \end{Version}
+% \begin{Version}{2006/02/20 v2.2}
+% \item
+% Code is not changed.
+% \item
+% New DTX framework.
+% \item
+% LPPL 1.3
+% \end{Version}
+% \begin{Version}{2007/03/05 v2.3}
+% \item
+% Bug fix: Expand \cs{hbs@tocstring} and \cs{hbs@bmstring} before
+% calling \cs{hbs@seccmd}.
+% \end{Version}
+% \begin{Version}{2007/04/11 v2.4}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2016/05/16 v2.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hypbmsec.pdf b/macros/latex/contrib/oberdiek/hypbmsec.pdf
new file mode 100644
index 0000000000..8609621495
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypbmsec.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hypcap.dtx b/macros/latex/contrib/oberdiek/hypcap.dtx
new file mode 100644
index 0000000000..e35d80e245
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypcap.dtx
@@ -0,0 +1,803 @@
+% \iffalse meta-comment
+%
+% File: hypcap.dtx
+% Version: 2016/05/16 v1.12
+% Info: Adjusting the anchors of captions
+%
+% Copyright (C) 1999-2001, 2006-2008, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file hypcap.dtx
+% and the derived files
+% hypcap.sty, hypcap.pdf, hypcap.ins, hypcap.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hypcap.dtx
+% CTAN:macros/latex/contrib/oberdiek/hypcap.pdf
+%
+% Unpacking:
+% (a) If hypcap.ins is present:
+% tex hypcap.ins
+% (b) Without hypcap.ins:
+% tex hypcap.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hypcap.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hypcap.drv is present:
+% latex hypcap.drv
+% (b) Without hypcap.drv:
+% latex hypcap.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 hypcap.dtx
+% makeindex -s gind.ist hypcap.idx
+% pdflatex hypcap.dtx
+% makeindex -s gind.ist hypcap.idx
+% pdflatex hypcap.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/hypcap.sty
+% TDS:doc/latex/oberdiek/hypcap.pdf
+% TDS:source/latex/oberdiek/hypcap.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hypcap 2016/05/16 v1.12 Adjusting the anchors of captions (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hypcap
+Version: 2016/05/16 v1.12
+
+Copyright (C) 1999-2001, 2006-2008, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file hypcap.dtx
+and the derived files
+ hypcap.sty, hypcap.pdf, hypcap.ins, hypcap.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hypcap.ins}{\from{hypcap.dtx}{install}}%
+ \file{hypcap.drv}{\from{hypcap.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{hypcap.sty}{\from{hypcap.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hypcap.xml}{\from{hypcap.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{* hypcap.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hypcap.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hypcap.drv}%
+ [2016/05/16 v1.12 Adjusting the anchors of captions (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{hypcap.dtx}%
+\end{document}
+%</driver>
+% \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{hypcap.drv}
+%
+% \title{The \xpackage{hypcap} package}
+% \date{2016/05/16 v1.12}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package tries a solution of the problem with
+% hyperref, that links to floats points below the
+% caption and not at the beginning of the float.
+% Therefore this package divides the task into two
+% part, the link setting with \cs{capstart} or
+% automatically at the beginning of a float and
+% the rest in the \cs{caption} command.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newpage
+% \section{Usage}
+% The package \Package{hypcap} requires that \Package{hyperref}
+% is loaded first:
+% \begin{quote}
+% |\usepackage[...]{hyperref}|\\
+% |\usepackage[...]{hypcap}|
+% \end{quote}
+%
+% \subsection{Package options}
+% The names of the four float environments |figure|, |figure*|,
+% |table|, or |table*| can be used as option. Then the package
+% redefines the environment in order to insert \cmd{\capstart}
+% (see below) in the beginning of the environment automatically.
+%
+% Option |all| enables the redefinitions of all four
+% float environments. For other environments see
+% the user command \cmd{\hypcapredef}.
+%
+% \subsection{User commands}
+% \begin{description}
+% \item[\cmd{\capstart}:]\DescribeMacro{\capstart}
+% First this command increments the counter (\cmd{\@captype}).
+% Then it makes an anchor for package \Package{hyperref}.
+% At last \cmd{\caption} is redefined to remove the
+% anchor setting part from \Package{hyperref}'s \cmd{\caption}.
+%
+% The package expects the following structure of a float
+% environment:
+% \begin{quote}
+% |\begin{|\textit{|float|}|}...|\\
+% |\capstart|\\
+% |...|\\
+% |\caption{...}|\\
+% |...|\\
+% |\end{|\textit{|float|}|}|
+% \end{quote}
+% There can be several \cmd{\caption} commands. For these
+% you need \cmd{\capstart} again:
+% \begin{quote}
+% |\capstart ... \caption... \capstart ... \caption...|
+% \end{quote}
+% And the \cmd{\caption} command itself can be put in a group.
+%
+% With the options, described above, the extra
+% writing of \cmd{\capstart} can be avoided.
+% Consequently, there must be a \cmd{\caption} in every
+% environment of this type, specified by the option.
+% If you want to use more than one \cmd{\caption} in this
+% environment, you have to state \cmd{\capstart} again.
+% \item[\cmd{\hypcapspace}:]\DescribeMacro{\hypcapspace}
+% Because it looks poor, if the link points exactly at top of
+% the figure, there is additional space: \cmd{\hypcapspace},
+% the default is |0.5\baselineskip|, examples:
+% \begin{quote}
+% |\renewcommand{\hypcapspace}{0pt}| removes the space\\
+% |\renewcommand{\hypcapspace}{1pt}| sets a fix value
+% \end{quote}
+% \item[\cmd{\hypcapredef}:]\DescribeMacro{\hypcapredef}
+% If there are other float environments, that
+% should automatically execute \cmd{\capstart}, then
+% a redefinition with \cmd{\hypcapredef} can be tried:
+% \begin{quote}
+% |\hypcapredef{myfloat}|
+% \end{quote}
+% Only environments with one optional parameter are
+% supported.
+% \item[\cs{capstartfalse}, \cs{capstarttrue}:]^^A
+% \DescribeMacro{\capstartfalse}^^A
+% \DescribeMacro{\capstarttrue}^^A
+% Since 2008/09/08 v1.10.\\
+% They disable and enable \cs{capstart}. They can be used to
+% cancel the effect of a redefined float environment.
+% Example:
+%\begin{quote}
+%\catcode`Y=\active
+%\def Y#1Z{\textit{\cs{#1}}}
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{hyperref}
+%\usepackage[figure]{hypcap}[2008/09/08]
+%
+%\begin{document}
+% \section{Hello World}
+% \begin{figure}
+% \caption{Figure with caption A}
+% \end{figure}
+% YcapstartfalseZ
+% \begin{figure}
+% Figure without caption
+% \end{figure}
+% YcapstarttrueZ
+% \begin{figure}
+% \caption{Figure with caption B}
+% \end{figure}
+%\end{document}
+%\end{verbatim}
+%\end{quote}
+% \end{description}
+%
+% \subsection{Limitations}
+% \begin{itemize}
+% \item Packages that redefine \cmd{\caption} or
+% \cmd{\@caption}.
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hypcap}%
+ [2016/05/16 v1.12 Adjusting the anchors of captions (HO)]
+% \end{macrocode}
+%
+% For unique command names this package uses |hc@| as prefix
+% for internal command names.
+%
+% First we check, if package \Package{hyperref} is loaded:
+% \begin{macrocode}
+\@ifundefined{hyper@@anchor}{%
+ \PackageError{hypcap}{You have to load 'hyperref' first}\@ehc
+ \endinput
+}{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{letltxmacro}[2008/06/24]
+% \end{macrocode}
+%
+% \begin{macro}{\hc@org@caption}
+% Save the original meaning of \cmd{\caption}:
+% \begin{macrocode}
+\newcommand*\hc@org@caption{}
+\let\hc@org@caption\caption
+% \end{macrocode}
+% \end{macro}
+%
+% \newcommand*{\BeginMacro}[1]{\expandafter\DoBeginMacro\csname#1\endcsname}
+% \newcommand*{\DoBeginMacro}[1]{\begin{macro}{#1}}
+% \newcommand*{\Cmd}[1]{\expandafter\cmd\csname#1\endcsname}
+% \BeginMacro{if@capstart}
+% The switch \Cmd{if@capstart} helps to detect
+% \cmd{\capstart} commands with missing \cmd{\caption} macros.
+% Because \cmd{\caption} can occur inside a group, assignments
+% to the switch have to be made global.
+% \begin{macrocode}
+\newif\if@capstart
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hypcapspace}
+% The anchor is raised.by \cmd{\hypcapspace}.
+% \begin{macrocode}
+\newcommand*\hypcapspace{.5\baselineskip}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifcapstart}
+% \begin{macrocode}
+\newif\ifcapstart
+\capstarttrue
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\capstart}
+% The macro \cmd{\capstart} contains the first part of
+% the \cmd{\caption} command: Incrementing the counter
+% and setting the anchor.
+% \begin{macrocode}
+\newcommand*\capstart{%
+ \ifcapstart
+ \H@refstepcounter\@captype % first part of caption
+ \hyper@makecurrent\@captype
+ \global\let\hc@currentHref\@currentHref
+ \vspace*{-\hypcapspace}%
+ \begingroup
+ \let\leavevmode\relax
+ \hyper@@anchor\@currentHref\relax
+ \endgroup
+ \vspace*{\hypcapspace}%
+ \hc@hyperref{\let\caption\hc@caption}%
+ \global\@capstarttrue
+ \global\advance\csname c@\@captype\endcsname\m@ne
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\@ifpackagelater{hyperref}{2007/04/09}{%
+ \let\hc@hyperref\@gobble
+}{%
+ \let\hc@hyperref\@firstofone
+}
+% \end{macrocode}
+%
+% \begin{macro}{\hc@caption}
+% The new \cmd{\caption} command without the first part
+% is defined in the macro \cmd{\hc@caption}.
+% \begin{macrocode}
+\def\hc@caption{%
+ \global\advance\csname c@\@captype\endcsname\@ne
+ \@dblarg{\hc@@caption\@captype}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hc@@caption}
+% This is a copy of package \Package{hyperref}'s \cmd{\@caption}
+% macro without making the anchor, because this is already done
+% in \cmd{\capstart}.
+% \begin{macrocode}
+\long\def\hc@@caption#1[#2]#3{%
+ \let\caption\hc@org@caption
+ \global\@capstartfalse
+ \ifHy@hypertexnames
+ \hyper@makecurrent\@captype
+ \else
+ \global\let\@currentHref\hc@currentHref
+ \fi
+ \par\addcontentsline{%
+ \csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{%
+ \csname the#1\endcsname
+ }{\ignorespaces #2}%
+ }%
+ \begingroup
+ \@parboxrestore
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{%
+ \ignorespaces#3%
+ }%
+ \par
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hypcapredef}
+% The macro \cmd{\hypcapredef} prepares the call of
+% \cmd{\hc@redef} that will redefine the environment
+% that is given in the argument.
+% \begin{macrocode}
+\def\hypcapredef#1{%
+ \expandafter\hc@redef\csname hc@org#1\expandafter\endcsname
+ \csname hc@orgend#1\expandafter\endcsname
+ \expandafter{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\hc@redef}
+% The old meaning of the environment is saved. Then
+% \cmd{\capstart} is appended in the begin part.
+% The end part contains a check
+% that produces an error message in case of \cmd{\capstart}
+% without \cmd{\capstart} (\cmd{\capstart} has incremented
+% the counter).
+% \begin{macrocode}
+\def\hc@redef#1#2#3{%
+ \newcommand#1{}%
+ \expandafter\LetLtxMacro\expandafter#1\csname#3\endcsname
+ \expandafter\LetLtxMacro\expandafter#2\csname end#3\endcsname
+ \renewenvironment*{#3}[1][]{%
+ \ifx\\##1\\%
+ #1\relax
+ \else
+ #1[##1]% hash-ok (compatibility for float)
+ \fi
+ \capstart
+ }{%
+ \if@capstart
+ \PackageError{hypcap}{You have forgotten to use \string\caption}%
+ \global\@capstartfalse
+ \else
+ \fi
+ #2%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% At last the options are defined and processed.
+% \begin{macrocode}
+\DeclareOption{figure}{\hypcapredef{\CurrentOption}}
+\DeclareOption{figure*}{\hypcapredef{\CurrentOption}}
+\DeclareOption{table}{\hypcapredef{\CurrentOption}}
+\DeclareOption{table*}{\hypcapredef{\CurrentOption}}
+\DeclareOption{all}{%
+ \hypcapredef{figure}%
+ \hypcapredef{figure*}%
+ \hypcapredef{table}%
+ \hypcapredef{table*}%
+}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hypcap}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypcap.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypcap.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[\CTAN{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 hypcap.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@{}}
+% hypcap.sty & tex/latex/oberdiek/hypcap.sty\\
+% hypcap.pdf & doc/latex/oberdiek/hypcap.pdf\\
+% hypcap.dtx & source/latex/oberdiek/hypcap.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hypcap.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hypcap.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 hypcap.dtx
+%makeindex -s gind.ist hypcap.idx
+%pdflatex hypcap.dtx
+%makeindex -s gind.ist hypcap.idx
+%pdflatex hypcap.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hypcap.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hypcap'>
+ <name>hypcap</name>
+ <caption>Adjusting the anchors of captions.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1999-2001,2006-2008,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.12'/>
+ <description>
+ The package offers a solution to the problem that when you link to
+ a float using <xref refid='hyperref'>hyperref</xref>, the link
+ anchors to below the float's caption, rather than the beginning of
+ the float.
+ <p/>
+ Hypcap defines a separate \capstart command, which you put where
+ you want links to end; you should have a \capstart command for each
+ \caption command. Package options can be used to auto-insert a
+ \capstart at the start of a float environment.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hypcap.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hypcap.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1999/02/13 v1.0}
+% \item
+% A beginning version, published in newsgroup \xnewsgroup{comp.text.tex}:\\
+% \URL{``\link{Re: \xpackage{hyperref} and figures}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/5c9b47b001a9379c}
+% \end{Version}
+% \begin{Version}{2000/08/14 v1.1}
+% \item
+% Global assignments of \cs{if@capstart}
+% in order to allow \cs{caption} in groups.
+% \item
+% Option \texttt{all} added.
+% \end{Version}
+% \begin{Version}{2000/09/07 v1.2}
+% \item
+% Package in dtx format.
+% \end{Version}
+% \begin{Version}{2001/08/27 v1.3}
+% \item
+% Bug fix with hyperref's pdfmark driver\\
+% (\cs{leavevmode} in
+% \cs{hyper@@anchor}/\cs{pdf@rect}).
+% \end{Version}
+% \begin{Version}{2001/09/06 v1.4}
+% \item
+% Small fixes in the dtx file.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.5}
+% \item
+% Code is not changed.
+% \item
+% New DTX framework.
+% \end{Version}
+% \begin{Version}{2007/02/19 v1.6}
+% \item
+% Fix for hypertexnames=false.
+% \end{Version}
+% \begin{Version}{2007/04/09 v1.7}
+% \item
+% Stuff in \cs{caption} moved to \xpackage{hyperref}.
+% This avoids redefinitions of \cs{caption} and \cs{@caption}
+% (idea of Axel Sommerfeldt).
+% \item
+% Fix for subfigure (Marco Kuhlmann, Amilcar do Carmo Lucas).
+% \end{Version}
+% \begin{Version}{2008/04/14 v1.8}
+% \item
+% \cs{hc@redef} fixed to get package \xpackage{float} work
+% (Axel Sommerfeldt).
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.9}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2008/09/08 v1.10}
+% \item
+% \cs{capstartfalse} and \cs{capstarttrue} added.
+% \end{Version}
+% \begin{Version}{2011/02/16 v1.11}
+% \item
+% \cs{hc@redef} fixed by using package \xpackage{letltxmacro}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.12}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hypcap.pdf b/macros/latex/contrib/oberdiek/hypcap.pdf
new file mode 100644
index 0000000000..a808d866f1
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypcap.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hypdestopt.dtx b/macros/latex/contrib/oberdiek/hypdestopt.dtx
new file mode 100644
index 0000000000..26ca80e459
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypdestopt.dtx
@@ -0,0 +1,1040 @@
+% \iffalse meta-comment
+%
+% File: hypdestopt.dtx
+% Version: 2016/05/21 v2.5
+% Info: Hyperref destination optimizer
+%
+% Copyright (C) 2006-2008, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file hypdestopt.dtx
+% and the derived files
+% hypdestopt.sty, hypdestopt.pdf, hypdestopt.ins, hypdestopt.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hypdestopt.dtx
+% CTAN:macros/latex/contrib/oberdiek/hypdestopt.pdf
+%
+% Unpacking:
+% (a) If hypdestopt.ins is present:
+% tex hypdestopt.ins
+% (b) Without hypdestopt.ins:
+% tex hypdestopt.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hypdestopt.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hypdestopt.drv is present:
+% latex hypdestopt.drv
+% (b) Without hypdestopt.drv:
+% latex hypdestopt.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 hypdestopt.dtx
+% makeindex -s gind.ist hypdestopt.idx
+% pdflatex hypdestopt.dtx
+% makeindex -s gind.ist hypdestopt.idx
+% pdflatex hypdestopt.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/hypdestopt.sty
+% TDS:doc/latex/oberdiek/hypdestopt.pdf
+% TDS:source/latex/oberdiek/hypdestopt.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hypdestopt 2016/05/21 v2.5 Hyperref destination optimizer (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hypdestopt
+Version: 2016/05/21 v2.5
+
+Copyright (C) 2006-2008, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file hypdestopt.dtx
+and the derived files
+ hypdestopt.sty, hypdestopt.pdf, hypdestopt.ins, hypdestopt.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hypdestopt.ins}{\from{hypdestopt.dtx}{install}}%
+ \file{hypdestopt.drv}{\from{hypdestopt.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{hypdestopt.sty}{\from{hypdestopt.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hypdestopt.xml}{\from{hypdestopt.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{* hypdestopt.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hypdestopt.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hypdestopt.drv}%
+ [2016/05/21 v2.5 Hyperref destination optimizer (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{hypdestopt.dtx}%
+\end{document}
+%</driver>
+% \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{hypdestopt.drv}
+%
+% \title{The \xpackage{hypdestopt} package}
+% \date{2016/05/21 v2.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{hypdestopt} supports \xpackage{hyperref}'s
+% \xoption{pdftex} driver. It removes unnecessary destinations
+% and shortens the destination names or uses numbered destinations
+% to get smaller PDF files.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% \subsection{Introduction}
+%
+% Before PDF-1.5 annotations and destinations cannot be compressed.
+% If the destination names are not needed for external use, the
+% file size can be decreased by the following means:
+% \begin{itemize}
+% \item Unused destinations are removed.
+% \item The destination names are shortened (option \xoption{name}).
+% \item Using numbered destinations (option \xoption{num}).
+% \end{itemize}
+%
+% \subsection{Requirements}
+%
+% \begin{itemize}
+% \item Package \xpackage{hyperref} 2006/06/01 v6.75a or newer
+% (\cite{hyperref}).
+% \item Package \xpackage{alphalph} 2006/05/30 v1.4 or newer
+% (\cite{alphalph}), if option \xoption{name} is used.
+% \item Package \xpackage{ifpdf} (\cite{ifpdf}).
+% \item \pdfTeX\ 1.30.0 or newer.
+% \item \pdfTeX\ in PDF mode.
+% \item \eTeX\ extensions enabled.
+% \item Probably an additional compile run of \pdfLaTeX\ is necessary.
+% \end{itemize}
+%
+% In the first compile runs you can get warnings such as:
+%\begin{quote}
+%\begin{verbatim}
+%! pdfTeX warning (dest): name{...} has been referenced ...
+%\end{verbatim}
+%\end{quote}
+% These warnings should vanish in later compile runs.
+% However these warnings also can occur without this package.
+% The package does not cure them, thus these warnings will remain,
+% but the destination name can be different. In such cases test
+% without package, too.
+%
+% \subsection{Use}
+%
+% If the requirements are met, load the package:
+%\begin{quote}
+%\verb|\usepackage{hypdestopt}|
+%\end{quote}
+%
+% The following options are supported:
+% \begin{description}
+% \item[\xoption{verbose}:] Verbose debug output is enabled and written
+% in the protocol file.
+% \item[\xoption{num}:] Numbered destinations are used. The file size
+% is smaller, because names are no longer used.
+% This is the default.
+% \item[\xoption{name}:] Destinations are identified by names.
+% \end{description}
+%
+% \subsection{Limitations}
+%
+% \begin{itemize}
+% \item Forget this package, if you need preserved destination names.
+% \item Destination name strings use all bytes (0..255) except
+% the carriage return (13), left parenthesis (40), right
+% parenthesis (41), and backslash (92), because they
+% must be quoted in general and therefore occupy two bytes
+% instead of one.
+%
+% Further the zero byte (0) is avoided for programs
+% that implement strings using zero terminated C strings.
+% And 255 (0xFF) is avoided to get rid of a possible
+% unicode marker at the begin.
+%
+% So far I have not seen problems with:
+% \begin{itemize}
+% \item AcrobatReader 5.08/Linux
+% \item AcrobatReader 7.0/Linux
+% \item xpdf 3.00
+% \item Ghostscript 8.50
+% \item gv 3.5.8
+% \item GSview 4.6
+% \end{itemize}
+% But I have not tested all and all possible PDF viewers.
+% \item Use of named destinations (\cs{pdfdest}, \cs{pdfoutline},
+% \cs{pdfstartlink}, \dots) that are not supported by this
+% package.
+% \item Currently only \xpackage{hyperref} with \pdfTeX\ in PDF
+% mode is supported.
+% \end{itemize}
+%
+% \subsection{Future}
+%
+% A more general approach is a PDF postprocessor that takes
+% a PDF file, performs some transformations and writes the
+% result in a more optimized PDF file. Then it does not depend,
+% how the original PDF file was generated and further improvements
+% are easier to apply. For example, the destination names could be sorted:
+% often used destination names would then be shorter than seldom used ones.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hypdestopt}%
+ [2016/05/21 v2.5 Hyperref destination optimizer (HO)]%
+% \end{macrocode}
+%
+% \subsection{Options}
+%
+% \subsubsection{Option \xoption{verbose}}
+%
+% \begin{macrocode}
+\newif\ifHypDest@Verbose
+\DeclareOption{verbose}{\HypDest@Verbosetrue}
+% \end{macrocode}
+%
+% \begin{macro}{\HypDest@VerboseInfo}
+% Wrapper for verbose messages.
+% \begin{macrocode}
+\def\HypDest@VerboseInfo#1{%
+ \ifHypDest@Verbose
+ \PackageInfo{hypdestopt}{#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Options \xoption{num} and \xoption{name}}
+%
+% The options \xoption{num} or \xoption{name} specify
+% the method, how destinations are referenced (by name or
+% number). Default is option \xoption{num}.
+% \begin{macrocode}
+\newif\ifHypDest@name
+\DeclareOption{num}{\HypDest@namefalse}
+\DeclareOption{name}{\HypDest@nametrue}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProcessOptions*\relax
+% \end{macrocode}
+%
+% \subsection{Check requirements}
+%
+% First \pdfTeX\ must running in PDF mode.
+% \begin{macrocode}
+\RequirePackage{ifpdf}[2007/09/09]
+\RequirePackage{pdftexcmds}[2007/11/11]
+\ifpdf
+\else
+ \PackageError{hypdestopt}{%
+ This package requires pdfTeX in PDF mode%
+ }\@ehc
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% The version of \pdfTeX\ must not be too old, because
+% \cs{pdfescapehex} and \cs{pdfunescapehex} are used.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@escapehex\endcsname\relax
+ \PackageError{hypdestopt}{%
+ This pdfTeX is too old, at least 1.30.0 is required%
+ }\@ehc
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% Features of \eTeX\ are used, e.g. \cs{numexpr}.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+ \PackageError{hypdestopt}{%
+ e-TeX features are missing%
+ }\@ehc
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% Package \xpackage{alphalph} provides \cs{newalphalph} since
+% version 2006/05/30 v1.4.
+% \begin{macrocode}
+\ifHypDest@name
+ \RequirePackage{alphalph}[2006/05/30]%
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{auxhook}[2009/12/14]
+\RequirePackage{pdfescape}[2007/04/21]
+% \end{macrocode}
+%
+% \subsection{Preamble for auxiliary file}
+%
+% Provide dummy definitions for the macros that are used in the
+% auxiliary files. If the package is used no longer, then these
+% commands will not generate errors.
+%
+% \begin{macro}{\HypDest@PrependDocument}
+% We add our stuff in front of the \cs{AtBeginDocument} hook
+% to ensure that we are before \xpackage{hyperref}'s stuff.
+% \begin{macrocode}
+\long\def\HypDest@PrependDocument#1{%
+ \begingroup
+ \toks\z@{#1}%
+ \toks\tw@\expandafter{\@begindocumenthook}%
+ \xdef\@begindocumenthook{\the\toks\z@\the\toks\tw@}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AddLineBeginAux{%
+ \string\providecommand{\string\HypDest@Use}[1]{}%
+}
+% \end{macrocode}
+%
+% \subsection{Generation of destination names}
+%
+% Counter |HypDest| is used for identifying destinations.
+% \begin{macrocode}
+\newcounter{HypDest}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifHypDest@name
+% \end{macrocode}
+%
+% \begin{macro}{\HypDest@HexChar}
+% Destination names are generated by automatically
+% numbering with the help of package \xpackage{alphalph}.
+% \cs{HypDest@HexChar} converts a number of the range 1 until 252
+% into the hexadecimal representation of the string character.
+% \begin{macrocode}
+ \def\HypDest@HexChar#1{%
+ \ifcase#1\or
+% \end{macrocode}
+% Avoid zero byte because of C strings in PDF viewer
+% applications.
+% \begin{macrocode}
+ 01\or 02\or 03\or 04\or 05\or 06\or 07\or
+% \end{macrocode}
+% Omit carriage return (13/\verb|^^0d|).
+% It needs quoting, otherwise it would be converted
+% to line feed (10/\verb|^^0a|).
+% \begin{macrocode}
+ 08\or 09\or 0A\or 0B\or 0C\or 0E\or 0F\or
+ 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or
+ 18\or 19\or 1A\or 1B\or 1C\or 1D\or 1E\or 1F\or
+ 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or
+% \end{macrocode}
+% Omit left and right parentheses (40/\verb|^^28|, 41/\verb|^^39|),
+% they need quoting in general.
+% \begin{macrocode}
+ 2A\or 2B\or 2C\or 2D\or 2E\or 2F\or
+ 30\or 31\or 32\or 33\or 34\or 35\or 36\or 37\or
+ 38\or 39\or 3A\or 3B\or 3C\or 3D\or 3E\or 3F\or
+ 40\or 41\or 42\or 43\or 44\or 45\or 46\or 47\or
+ 48\or 49\or 4A\or 4B\or 4C\or 4D\or 4E\or 4F\or
+ 50\or 51\or 52\or 53\or 54\or 55\or 56\or 57\or
+% \end{macrocode}
+% Omit backslash (92/\verb|^^5C|), it needs quoting.
+% \begin{macrocode}
+ 58\or 59\or 5A\or 5B\or 5D\or 5E\or 5F\or
+ 60\or 61\or 62\or 63\or 64\or 65\or 66\or 67\or
+ 68\or 69\or 6A\or 6B\or 6C\or 6D\or 6E\or 6F\or
+ 70\or 71\or 72\or 73\or 74\or 75\or 76\or 77\or
+ 78\or 79\or 7A\or 7B\or 7C\or 7D\or 7E\or 7F\or
+ 80\or 81\or 82\or 83\or 84\or 85\or 86\or 87\or
+ 88\or 89\or 8A\or 8B\or 8C\or 8D\or 8E\or 8F\or
+ 90\or 91\or 92\or 93\or 94\or 95\or 96\or 97\or
+ 98\or 99\or 9A\or 9B\or 9C\or 9D\or 9E\or 9F\or
+ A0\or A1\or A2\or A3\or A4\or A5\or A6\or A7\or
+ A8\or A9\or AA\or AB\or AC\or AD\or AE\or AF\or
+ B0\or B1\or B2\or B3\or B4\or B5\or B6\or B7\or
+ B8\or B9\or BA\or BB\or BC\or BD\or BE\or BF\or
+ C0\or C1\or C2\or C3\or C4\or C5\or C6\or C7\or
+ C8\or C9\or CA\or CB\or CC\or CD\or CE\or CF\or
+ D0\or D1\or D2\or D3\or D4\or D5\or D6\or D7\or
+ D8\or D9\or DA\or DB\or DC\or DD\or DE\or DF\or
+ E0\or E1\or E2\or E3\or E4\or E5\or E6\or E7\or
+ E8\or E9\or EA\or EB\or EC\or ED\or EE\or EF\or
+ F0\or F1\or F2\or F3\or F4\or F5\or F6\or F7\or
+% \end{macrocode}
+% Avoid 255 (0xFF) to get rid of a possible unicode
+% marker at the begin of the string.
+% \begin{macrocode}
+ F8\or F9\or FA\or FB\or FC\or FD\or FE%
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{HypDest@HexString}
+% Now package \xpackage{alphalph} comes into play.
+% \cs{HypDest@HexString} is defined and converts
+% a positive number into a string, given in hexadecimal
+% representation.
+% \begin{macrocode}
+ \newalphalph\HypDest@HexString\HypDest@HexChar{250}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\theHypDest}
+% For use, the hexadecimal string is converted back.
+% \begin{macrocode}
+ \renewcommand*{\theHypDest}{%
+ \pdf@unescapehex{\HypDest@HexString{\value{HypDest}}}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% With option \xoption{num} we use the number directly.
+% \begin{macrocode}
+\else
+ \renewcommand*{\theHypDest}{%
+ \number\value{HypDest}%
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsection{Assign destination names}
+%
+% \begin{macro}{\HypDest@Prefix}
+% The new destination names are remembered in macros whose names
+% start with prefix \cs{HypDest@Prefix}.
+% \begin{macrocode}
+\edef\HypDest@Prefix{HypDest\string:}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HypDest@Use}
+% During the first read of the auxiliary files, the used destinations
+% get fresh generated short destination names. Also for the old
+% destination names we use the hexadecimal representation. That
+% avoid problems with arbitrary names.
+% \begin{macrocode}
+\def\HypDest@Use#1{%
+ \begingroup
+ \edef\x{%
+ \expandafter\noexpand
+ \csname\HypDest@Prefix\pdf@unescapehex{#1}\endcsname
+ }%
+ \expandafter\ifx\x\relax
+ \stepcounter{HypDest}%
+ \expandafter\xdef\x{\theHypDest}%
+ \let\on@line\@empty
+ \ifHypDest@name
+ \HypDest@VerboseInfo{%
+ Use: (\pdf@unescapehex{#1}) -\string> %
+ 0x\pdf@escapehex{\x} (\number\value{HypDest})%
+ }%
+ \else
+ \HypDest@VerboseInfo{%
+ Use: (\pdf@unescapehex{#1}) -\string> num \x
+ }%
+ \fi
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% After the first \xfile{.aux} file processing the destination names
+% are assigned and we can disable \cs{HypDest@Use}.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \let\HypDest@Use\@gobble
+}
+% \end{macrocode}
+%
+% \begin{macro}{\HypDest@MarkUsed}
+% Destinations that are actually used are marked by \cs{HypDest@MarkUsed}.
+% \cs{nofiles} is respected.
+% \begin{macrocode}
+\def\HypDest@MarkUsed#1{%
+ \HypDest@VerboseInfo{%
+ MarkUsed: (#1)%
+ }%
+ \if@filesw
+ \immediate\write\@auxout{%
+ \string\HypDest@Use{\pdf@escapehex{#1}}%
+ }%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Redefinition of \xpackage{hyperref}'s hooks}
+%
+% Package \xpackage{hyperref} can be loaded later, therefore
+% we redefine \xpackage{hyperref}'s macros at |\begin{document}|.
+% \begin{macrocode}
+\HypDest@PrependDocument{%
+% \end{macrocode}
+%
+% Check hyperref version.
+% \begin{macrocode}
+ \@ifpackagelater{hyperref}{2006/06/01}{}{%
+ \PackageError{hypdestopt}{%
+ hyperref 2006/06/01 v6.75a or later is required%
+ }\@ehc
+ }%
+% \end{macrocode}
+%
+% \subsubsection{Destination setting}
+%
+% luatex compatibility
+% \begin{macrocode}
+\ifx\pdfextension\@undefined\else
+ \protected\def\pdfdest{\pdfextension dest }
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+ \ifHypDest@name
+ \let\HypDest@Org@DestName\Hy@DestName
+ \renewcommand*{\Hy@DestName}[2]{%
+ \EdefUnescapeString\HypDest@temp{#1}%
+ \@ifundefined{\HypDest@Prefix\HypDest@temp}{%
+ \HypDest@VerboseInfo{%
+ DestName: (\HypDest@temp) unused%
+ }%
+ }{%
+ \HypDest@Org@DestName{%
+ \csname\HypDest@Prefix\HypDest@temp\endcsname
+ }{#2}%
+ \HypDest@VerboseInfo{%
+ DestName: (\HypDest@temp) %
+ 0x\pdf@escapehex{%
+ \csname\HypDest@Prefix\HypDest@temp\endcsname
+ }%
+ }%
+ }%
+ }%
+ \else
+ \renewcommand*{\Hy@DestName}[2]{%
+ \EdefUnescapeString\HypDest@temp{#1}%
+ \@ifundefined{\HypDest@Prefix\HypDest@temp}{%
+ \HypDest@VerboseInfo{%
+ DestName: (\HypDest@temp) unused%
+ }%
+ }{%
+ \pdfdest num%
+ \csname\HypDest@Prefix\HypDest@temp\endcsname#2\relax
+ \HypDest@VerboseInfo{%
+ DestName: (\HypDest@temp) %
+ num \csname\HypDest@Prefix\HypDest@temp\endcsname
+ }%
+ }%
+ }%
+ \fi
+% \end{macrocode}
+%
+% \subsubsection{Links}
+%
+% \begin{macrocode}
+ \let\HypDest@Org@StartlinkName\Hy@StartlinkName
+ \ifHypDest@name
+ \renewcommand*{\Hy@StartlinkName}[2]{%
+ \HypDest@MarkUsed{#2}%
+ \HypDest@Org@StartlinkName{#1}{%
+ \@ifundefined{\HypDest@Prefix#2}{%
+ #2%
+ }{%
+ \csname\HypDest@Prefix#2\endcsname
+ }%
+ }%
+ }%
+ \else
+ \renewcommand*{\Hy@StartlinkName}[2]{%
+ \HypDest@MarkUsed{#2}%
+ \@ifundefined{\HypDest@Prefix#2}{%
+ \HypDest@Org@StartlinkName{#1}{#2}%
+ }{%
+ \pdfstartlink attr{#1}%
+ goto num\csname\HypDest@Prefix#2\endcsname
+ \relax
+ }%
+ }%
+ \fi
+% \end{macrocode}
+%
+% \subsubsection{Outlines of package \xpackage{hyperref}}
+%
+% \begin{macrocode}
+ \let\HypDest@Org@OutlineName\Hy@OutlineName
+ \ifHypDest@name
+ \renewcommand*{\Hy@OutlineName}[4]{%
+ \HypDest@Org@OutlineName{#1}{%
+ \@ifundefined{\HypDest@Prefix#2}{%
+ #2%
+ }{%
+ \csname\HypDest@Prefix#2\endcsname
+ }%
+ }{#3}{#4}%
+ }%
+ \else
+ \renewcommand*{\Hy@OutlineName}[4]{%
+ \@ifundefined{\HypDest@Prefix#2}{%
+ \HypDest@Org@OutlineName{#1}{#2}{#3}{#4}%
+ }{%
+ \pdfoutline goto num\csname\HypDest@Prefix#2\endcsname
+ count#3{#4}%
+ }%
+ }%
+ \fi
+% \end{macrocode}
+% Because \cs{Hy@OutlineName} is called after the \xfile{.out} file
+% is written in the previous run. Therefore we mark the destination
+% earlier in \cs{@@writetorep}.
+% \begin{macrocode}
+ \let\HypDest@Org@@writetorep\@@writetorep
+ \renewcommand*{\@@writetorep}[5]{%
+ \begingroup
+ \edef\Hy@tempa{#5}%
+ \ifx\Hy@tempa\Hy@bookmarkstype
+ \HypDest@MarkUsed{#3}%
+ \fi
+ \endgroup
+ \HypDest@Org@@writetorep{#1}{#2}{#3}{#4}{#5}%
+ }%
+% \end{macrocode}
+%
+% \subsubsection{Outlines of package \xpackage{bookmark}}
+%
+% \begin{macrocode}
+ \@ifpackageloaded{bookmark}{%
+ \@ifpackagelater{bookmark}{2008/08/08}{%
+ \renewcommand*{\BKM@DefGotoNameAction}[2]{%
+ \@ifundefined{\HypDest@Prefix#2}{%
+ \edef#1{goto name{hypdestopt\string :unknown}}%
+ }{%
+ \ifHypDest@name
+ \edef#1{goto name{\csname\HypDest@Prefix#2\endcsname}}%
+ \else
+ \edef#1{goto num\csname\HypDest@Prefix#2\endcsname}%
+ \fi
+ }%
+ }%
+ \def\BKM@HypDestOptHook{%
+ \ifx\BKM@dest\@empty
+ \else
+ \ifx\BKM@gotor\@empty
+ \HypDest@MarkUsed\BKM@dest
+ \fi
+ \fi
+ }%
+ }{%
+ \@PackageError{hypdestopt}{%
+ Package `bookmark' is too old.\MessageBreak
+ Version 2008/08/08 or later is needed%
+ }\@ehc
+ }%
+ }{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hypdestopt}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypdestopt.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypdestopt.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[\CTAN{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 hypdestopt.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@{}}
+% hypdestopt.sty & tex/latex/oberdiek/hypdestopt.sty\\
+% hypdestopt.pdf & doc/latex/oberdiek/hypdestopt.pdf\\
+% hypdestopt.dtx & source/latex/oberdiek/hypdestopt.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hypdestopt.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hypdestopt.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 hypdestopt.dtx
+%makeindex -s gind.ist hypdestopt.idx
+%pdflatex hypdestopt.dtx
+%makeindex -s gind.ist hypdestopt.idx
+%pdflatex hypdestopt.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hypdestopt.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hypdestopt'>
+ <name>hypdestopt</name>
+ <caption>Hyperref destination optimizer.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006-2008,2011'/>
+ <license type='lppl1.3'/>
+ <version number='2.5'/>
+ <description>
+ This package supports <xref refid='hyperref'>hyperref</xref>'s
+ pdftex driver. It removes unnecessary destinations
+ and shortens the destination names or uses numbered destinations
+ to get smaller PDF files.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hypdestopt.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hypdestopt.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{alphalph}
+% Heiko Oberdiek: \textit{The \xpackage{alphalph} package};
+% 2006/05/30 v1.4;
+% \CTAN{macros/latex/contrib/oberdiek/alphalph.pdf}.
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz, Heiko Oberdiek:
+% \textit{The \xpackage{hyperref} package};
+% 2006/06/01 v6.75a;
+% \CTAN{macros/latex/contrib/hyperref/}.
+%
+% \bibitem{ifpdf}
+% Heiko Oberdiek: \textit{The \xpackage{ifpdf} package};
+% 2006/02/20 v1.4;
+% \CTAN{macros/latex/contrib/oberdiek/ifpdf.pdf}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/06/01 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2006/06/01 v2.0}
+% \item
+% New method for referencing destinations by number; an idea
+% proposed by Lars Hellstr\"om in the mailing list LATEX-L.
+% \item
+% Options \xoption{name} and \xoption{num} added.
+% \end{Version}
+% \begin{Version}{2007/11/11 v2.1}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2008/08/08 v2.2}
+% \item
+% Support for package \xpackage{bookmark} added.
+% \end{Version}
+% \begin{Version}{2011/05/13 v2.3}
+% \item
+% Fix for \cs{Hy@DestName} if the destination name contains
+% special characters.
+% \item
+% Fix for option \xoption{name} and package \xpackage{bookmark}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v2.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/05/21 v2.5}
+% \item
+% LuaTeX compatibility
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hypdestopt.pdf b/macros/latex/contrib/oberdiek/hypdestopt.pdf
new file mode 100644
index 0000000000..1b60bc674c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypdestopt.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hypdoc.dtx b/macros/latex/contrib/oberdiek/hypdoc.dtx
new file mode 100644
index 0000000000..ba803c86e3
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypdoc.dtx
@@ -0,0 +1,1441 @@
+% \iffalse meta-comment
+%
+% File: hypdoc.dtx
+% Version: 2018/09/07 v1.14
+% Info: Hyper extensions for doc.sty
+%
+% Copyright (C) 2002, 2006, 2007, 2009-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file hypdoc.dtx
+% and the derived files
+% hypdoc.sty, hypdoc.pdf, hypdoc.ins, hypdoc.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hypdoc.dtx
+% CTAN:macros/latex/contrib/oberdiek/hypdoc.pdf
+%
+% Unpacking:
+% (a) If hypdoc.ins is present:
+% tex hypdoc.ins
+% (b) Without hypdoc.ins:
+% tex hypdoc.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hypdoc.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hypdoc.drv is present:
+% latex hypdoc.drv
+% (b) Without hypdoc.drv:
+% latex hypdoc.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 hypdoc.dtx
+% makeindex -s gind.ist hypdoc.idx
+% pdflatex hypdoc.dtx
+% makeindex -s gind.ist hypdoc.idx
+% pdflatex hypdoc.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/hypdoc.sty
+% TDS:doc/latex/oberdiek/hypdoc.pdf
+% TDS:source/latex/oberdiek/hypdoc.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hypdoc 2018/09/07 v1.14 Hyper extensions for doc.sty (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hypdoc
+Version: 2018/09/07 v1.14
+
+Copyright (C) 2002, 2006, 2007, 2009-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file hypdoc.dtx
+and the derived files
+ hypdoc.sty, hypdoc.pdf, hypdoc.ins, hypdoc.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hypdoc.ins}{\from{hypdoc.dtx}{install}}%
+ \file{hypdoc.drv}{\from{hypdoc.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{hypdoc.sty}{\from{hypdoc.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hypdoc.xml}{\from{hypdoc.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{* hypdoc.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hypdoc.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hypdoc.drv}%
+ [2018/09/07 v1.14 Hyper extensions for doc.sty (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{hypdoc.dtx}%
+\end{document}
+%</driver>
+% \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{hypdoc.drv}
+%
+% \title{The \xpackage{hypdoc} package}
+% \date{2018/09/07 v1.14}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package adds hyper features to the package
+% \xpackage{doc} that is used in the documentation
+% system of \LaTeXe. Bookmarks are added and references
+% are linked as far as possible.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Features}
+%
+% The package adds the following features:
+% \begin{description}
+% \item[Bookmarks:]
+% For supporting bookmarks package \verb|hyperref| is loaded.
+% Some \TeX\ code inside section titles can cause problems
+% during bookmark processing; these can be warnings, ugly
+% bookmark titles or even errors. With the help of
+% \verb|\pdfstringdefDisableCommands| or \verb|\texorpdfstring|
+% you can manage these things, see \verb|hyperref|'s package
+% documentation.
+% \item[Additional bookmarks:]
+% Unnumbered bookmark entries are generated for:
+% \begin{itemize}
+% \item Table of contents
+% \item List of figures
+% \item List of tables
+% \item Index
+% \item Glossary
+% \end{itemize}
+% Option \texttt{numbered} controls, whether these section or
+% chapters should be numbered. The exception is the table
+% of contents if this it would be the first numbered
+% section. Then just a bookmark is added.
+% \item[Metadata:]
+% The loaded package \verb|hyperref|, enforced by
+% option \verb|pdfusetitle|, tries to detect \verb|\title|
+% and \verb|\author| and sets the corresponding PDF
+% information fields. In case of problems see the previous
+% item about bookmarks.
+% These enries can be overwritten or new ones added by
+% \verb|\hypersetup| after the packages is loaded, see
+% documentation of package \verb|hyperref|.
+% \item[References, links:] Because of package \verb|\hyperref|
+% |\ref| become links, also \verb|\url|, footnote referencing
+% are supported.
+% \item[Index:]
+% The main part of this package deals with index links in order
+% to support the kind of index that package \verb|doc| provides.
+% \item[Thumbnails:]
+% Package \verb|thumbpdf| may additionally be loaded for the case that the
+% PDF file also should contain thumbnails, see the documentation
+% of this package. But thumbnail embedding is not really
+% necessary, because nowadays AcrobatReader is able to
+% generate and view thumbnails on the fly.
+% \end{description}
+%
+% \section{Usage}
+%
+% The purpose of this packages is to add PDF features to
+% the documentation of LaTeX packages. Thus just load
+% the package in the driver file that generates the
+% documentation:
+% \begin{quote}
+% \verb|\usepackage{hypdoc}|
+% \end{quote}
+% Package \verb|doc| is loaded by \verb|hypdoc|, thus you
+% also can replace a \verb|\usepackage{doc}| with this line.
+% At any case, the package must be loaded before macros of
+% package \verb|doc| such as \verb|\CodelineIndex| or
+% \verb|\PageIndex| are used.
+%
+% If the class \verb|ltxdoc| is used, you can also use
+% the configuration file for this class to add
+% package \verb|hypdoc|. Add the following line
+% to the file \verb|ltxdoc.cfg| (or create a new one):
+% \begin{quote}
+%\begin{verbatim}
+%\AtEndOfClass{\RequirePackage{hypdoc}}
+%\end{verbatim}
+% \end{quote}
+%
+% \subsection{Options}
+%
+% There is one option \texttt{numbered}. It controls,
+% whether the starred versions of section or chapter
+% inside \cs{tableofcontents}, \cs{listoffigures}, \dots
+% should be replaced by the non-star versions.
+%
+% \subsection{Simple example}
+% Example of a simple driver file \verb|foobar.drv|
+% of a package \verb|foobar|. Often the driver file
+% is packed in the file \verb|foobar.dtx| and can
+% be extracted by docstrip or if an instruction file
+% for docstrip is provided by:
+% \begin{quote}
+% \verb|tex foobar.ins|
+% \end{quote}
+% Note that although docstrip doesn't rely on \LaTeX,
+% sometimes you need to run the \verb|.ins| file through
+% \LaTeX. Oddly enough, often the only \LaTeX\ feature
+% in use is \verb|\NeedsTeXFormat{LaTeX2e}| in the first line.
+% \begin{quote}
+%\begin{verbatim}
+%\documentclass{ltxdoc}
+%\usepackage{hypdoc}
+%\RecordChanges
+%\EnableCrossrefs
+%\CodelineIndex
+%\begin{document}
+%\title{Title for package \texttt{foobar}}
+%\author{Author of package \texttt{foobar}}
+%\date{...}
+%\maketitle
+%\tableofcontents
+%\DocInput{foobar.dtx}
+%\PrintChanges
+%\PrintIndex
+%\end{document}
+%\end{verbatim}
+% \end{quote}
+%
+% Then compile it, for example with pdf\LaTeX.
+% \begin{quote}
+%\begin{verbatim}
+%pdflatex foobar.drv
+%makeindex -s gind.ist foobar.idx
+%makeindex -s gglo.ist -o foobar.gls foobar.glo
+%pdflatex foobar.drv
+%\end{verbatim}
+% \end{quote}
+% You will need several cycles until the cross references
+% and similar things are correct.
+%
+% \subsection{Example \texttt{source2e.tex}}
+%
+% The source code of the base of \LaTeX\ is available as
+% a bunch of \verb|.dtx| files. \LaTeX\ provides the file
+% \verb|source2e.tex| to merge them all together.
+%
+% Now you can either load package \verb|hypdoc| in a private copy
+% of this file (please, respect the LPPL) or use the configuration
+% file \verb|ltxdoc.cfg|. Example that also sets A4 paper size:
+% \begin{quote}
+%\begin{verbatim}
+%\PassOptionsToClass{a4paper}{article}
+%\AtEndOfClass{\RequirePackage{hypdoc}}
+%\end{verbatim}
+% \end{quote}
+%
+% Then \verb|source2e.tex| can be compiled by pdf\TeX, for example:
+% \begin{quote}
+%\begin{verbatim}
+%pdflatex source2e
+%makeindex -s gind.ist source2e.idx
+%makeindex -s gglo.ist -o source2e.glo source2e.gls
+%pdflatex source2e
+%makeindex -s gind.ist source2e.idx
+%makeindex -s gglo.ist -o source2e.glo source2e.gls
+%pdflatex source2e
+%\end{verbatim}
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hypdoc}%
+ [2018/09/07 v1.14 Hyper extensions for doc.sty (HO)]%
+% \end{macrocode}
+% The package identification is done at the top of the |.dtx| file
+% in order to use only one identification string.
+%
+% For unique command names this package uses |HD@| as prefix
+%
+% \subsection{Options}
+%
+% \begin{macro}{\ifHD@numbered}
+% \begin{macrocode}
+\newif\ifHD@numbered
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareOption{numbered}{\HD@numberedtrue}
+\ProcessOptions*\relax
+% \end{macrocode}
+%
+% \subsection{Package loading}
+%
+% \begin{macrocode}
+\RequirePackage{atveryend}[2010/03/24]
+\RequirePackage{doc}
+% \end{macrocode}
+% \begin{macrocode}
+\ifx\numexpr\@undefined
+ \RequirePackage{calc}%
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage[%
+ hyperindex=false,%
+ pdfusetitle,%
+ colorlinks,%
+ pdfpagelabels%
+]{hyperref}[2002/05/09]%
+\hypersetup{%
+ plainpages=false,%
+ bookmarksopen,%
+ bookmarksnumbered,%
+ bookmarksopenlevel=0,%
+ pdfstartview={FitBH \hypercalcbp{%
+ \paperheight-\topmargin-1in-\headheight-\headsep
+ }},%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcounter{HD@unique}
+% \end{macrocode}
+% \begin{macro}{\theHD@unique}
+% \begin{macrocode}
+\renewcommand{\theHD@unique}{%
+ \number\value{HD@unique}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\g@addto@macro\Hy@UseMaketitleInfos{%
+ \@ifundefined{fileinfo}{}{%
+ \ifx\@pdfsubject\@empty
+ \hypersetup{pdfsubject={\fileinfo}}%
+ \fi
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\pdfstringdefDisableCommands{%
+ \let\thanks\@gobble
+ \let\footnote\@gobble
+ \def\cs#1{\textbackslash #1}%
+ \let\normalfont\@empty
+ \let\scshape\@empty
+ \def\and{and }%
+}
+% \end{macrocode}
+%
+% \subsubsection{Patch for bug latex/4096}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname mod@math@codes\endcsname\relax
+\else
+ \def\HD@ModFix#1{%
+ \mathcode`#1=`#1\relax
+ }%
+ \g@addto@macro\mod@math@codes{%
+ \HD@ModFix\-%
+ \HD@ModFix\+%
+ \HD@ModFix\:%
+ \HD@ModFix\=%
+ \HD@ModFix\*%
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsection{Bookmarks}
+%
+% \begin{macro}{\HD@sectionpatch}
+% \begin{macrocode}
+\def\HD@sectionpatch{%
+ \ifHD@numbered
+ \HD@@sectionpatch{section}%
+ \HD@@sectionpatch{chapter}%
+ \else
+ \let\Hy@writebookmark\HD@disable@writebookmark
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@@sectionpatch}
+% \begin{macrocode}
+\def\HD@@sectionpatch#1{%
+ \expandafter\let\csname HDorg@@#1\expandafter\endcsname
+ \csname #1\endcsname
+ \@namedef{#1}{%
+ \@ifstar{\@nameuse{HDorg@@#1}}{\@nameuse{HDorg@@#1}}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@disable@writebookmark}
+% \begin{macrocode}
+\def\HD@disable@writebookmark#1#2#3#4#5{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HD@guesstoclevel}
+% A wild guessing of the toclevel. There is the hope, that
+% the macro |#1| starts with a sectioning command.
+% \begin{macrocode}
+\def\HD@guesstoclevel#1{%
+ \expandafter\HD@@guesstoclevel#1\section\HD@end
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@@guesstoclevel}
+% \begin{macrocode}
+\def\HD@@guesstoclevel#1#2\HD@end{%
+ \@ifundefined{toclevel@\expandafter\@gobble\string#1\@empty}{%
+ 1%
+ }{%
+ \@nameuse{toclevel@\expandafter\@gobble\string#1\@empty}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{tableofcontents}}
+%
+% \begin{macro}{\HDorg@tableofcontents}
+% \begin{macrocode}
+\let\HDorg@tableofcontents\tableofcontents
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tableofcontents}
+% As first section the table of contents shouldn't
+% go into the toc itself. Also a number looks too funny then.
+% Just a bookmark is enough in this case.
+% \begin{macrocode}
+\def\tableofcontents{%
+ \begingroup
+ \@ifundefined{c@section}{%
+ \def\c@section{0}%
+ }{}%
+ \expandafter\endgroup
+ \ifcase\c@section
+ \stepcounter{HD@unique}%
+ \pdfbookmark[\HD@guesstoclevel{\HDorg@tableofcontents}]%
+ {\contentsname}{toc\theHD@unique}%
+ \HDorg@tableofcontents
+ \else
+ \ifHD@numbered
+ \else
+ \stepcounter{HD@unique}%
+ \pdfbookmark[\HD@guesstoclevel{\HDorg@tableofcontents}]%
+ {\contentsname}{toc\theHD@unique}%
+ \fi
+ \begingroup
+ \HD@sectionpatch
+ \HDorg@tableofcontents
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{listoffigures}}
+%
+% \begin{macro}{\HDorg@listoffigures}
+% \begin{macrocode}
+\let\HDorg@listoffigures\listoffigures
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\listoffigures}
+% \begin{macrocode}
+\def\listoffigures{%
+ \ifHD@numbered
+ \else
+ \stepcounter{HD@unique}%
+ \pdfbookmark[\HD@guesstoclevel{\HDorg@listoffigures}]%
+ {\listfigurename}{toc\theHD@unique}%
+ \fi
+ \begingroup
+ \HD@sectionpatch
+ \HDorg@listoffigures
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{listoftables}}
+%
+% \begin{macro}{\HDorg@listoftables}
+% \begin{macrocode}
+\let\HDorg@listoftables\listoftables
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\listoftables}
+% \begin{macrocode}
+\def\listoftables{%
+ \ifHD@numbered
+ \else
+ \stepcounter{HD@unique}%
+ \pdfbookmark[\HD@guesstoclevel{\HDorg@listoftables}]%
+ {\listtablename}{toc\theHD@unique}%
+ \fi
+ \begingroup
+ \HD@sectionpatch
+ \HDorg@listoftables
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{thebibliography}}
+%
+% \begin{macro}{\HDorg@thebibliography}
+% \begin{macrocode}
+\let\HDorg@thebibliography\thebibliography
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\thebibliography}
+% \begin{macrocode}
+\def\thebibliography{%
+ \ifHD@numbered
+ \else
+ \stepcounter{HD@unique}%
+ \pdfbookmark[\HD@guesstoclevel{\HDorg@thebibliography}]%
+ {\@ifundefined{chapter}{\refname}{\bibname}}{bib\theHD@unique}%
+ \fi
+ \HD@sectionpatch
+ \HDorg@thebibliography
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{theindex}}
+%
+% \begin{macro}{\HDorg@theindex}
+% \begin{macrocode}
+\let\HDorg@theindex\theindex
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\theindex}
+% \begin{macrocode}
+\def\theindex{%
+ \let\HDorg@index@prologue\index@prologue
+ \let\HDorg@writebookmark\Hy@writebookmark
+ \HD@sectionpatch
+ \g@addto@macro\IndexParms{%
+ \ifHD@numbered
+ \else
+ \let\Hy@writebookmark\HDorg@writebookmark
+ \fi
+ \let\bfseries\HD@bfseries
+ }%
+ \edef\HD@toclevel@index{\HD@guesstoclevel{\index@prologue}}%
+ \begingroup
+ \count@=\HD@toclevel@index\relax
+ \advance\count@ by 1 %
+ \xdef\HD@toclevel@subindex{\the\count@}%
+ \endgroup
+ \def\index@prologue{%
+ \ifHD@numbered
+ \else
+ \begingroup
+ \stepcounter{HD@unique}%
+ \let\Hy@writebookmark\HDorg@writebookmark
+ \pdfbookmark[\HD@toclevel@index]%
+ {\indexname}{index\theHD@unique}%
+ \endgroup
+ \fi
+ \HDorg@index@prologue
+ }%
+ \HDorg@theindex
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HDorg@bfseries}
+% \begin{macrocode}
+\let\HDorg@bfseries\bfseries
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@bfseries}
+% \begin{macrocode}
+\def\HD@bfseries{\futurelet\HD@hfil\HD@@bfseries}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@@bfseries}
+% \begin{macrocode}
+\def\HD@@bfseries{%
+ \HDorg@bfseries
+ \ifx\HD@hfil\hfil
+ \expandafter\HD@@@bfseries
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@@@bfseries}
+% \begin{macrocode}
+\def\HD@@@bfseries\hfil#1\hfil{%
+ \ifx\\#1\\%
+ \else
+ \raisebox{\baselineskip}[0pt]{%
+ \kern-\HD@margin\relax
+ \pdfbookmark[\HD@toclevel@subindex]{#1}{HD.#1}%
+ \kern\HD@margin\relax
+ }%
+ \fi
+ \hfil#1\hfil
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@margin}
+% \begin{macrocode}
+\def\HD@margin{1mm}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{theglossary}}
+%
+% \begin{macro}{\HDorg@theglossary}
+% \begin{macrocode}
+\let\HDorg@theglossary\theglossary
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\theglossary}
+% \begin{macrocode}
+\def\theglossary{%
+ \let\HDorg@glossary@prologue\glossary@prologue
+ \let\HDorg@writebookmark\Hy@writebookmark
+ \HD@sectionpatch
+ \def\glossary@prologue{%
+ \ifHD@numbered
+ \else
+ \begingroup
+ \let\Hy@writebookmark\HDorg@writebookmark
+ \stepcounter{HD@unique}%
+ \pdfbookmark[\HD@guesstoclevel{\HDorg@glossary@prologue}]%
+ {\changehistoryname}{glossary\theHD@unique}%
+ \endgroup
+ \fi
+ \HDorg@glossary@prologue
+ }%
+ \HDorg@theglossary
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\glossaryname}
+% \begin{macrocode}
+\providecommand*{\glossaryname}{Change History}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\glossaryname}
+% \begin{macrocode}
+\providecommand*{\changehistoryname}{\glossaryname}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Index}
+%
+% \begin{macrocode}
+\newcounter{HD@hypercount}
+% \end{macrocode}
+% \begin{macro}{\HD@helplength}
+% \begin{macrocode}
+\newlength{\HD@helplength}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifHD@savedest}
+% \begin{macrocode}
+\newif\ifHD@savedest
+\HD@savedesttrue
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \HD@savedest@init
+}
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{rerunfilecheck}[2009/12/10]
+% \end{macrocode}
+% \begin{macro}{\HD@savedest@init}
+% \begin{macrocode}
+\begingroup
+ \catcode`\^^M=\active
+\@firstofone{\endgroup
+ \def\HD@savedest@init{%
+ \ifHD@savedest
+ \let\HDorg@tilde~%
+ \let~\HD@savedest@entry
+ \edef\HDorg@catcodeM{\the\catcode`\^^M}%
+ \catcode`\^^M=\active
+ \def^^M{}%
+ \InputIfFileExists{\jobname.hd}{}{}%
+ \let~\HDorg@tilde
+ \catcode`\^^M=\HDorg@catcodeM\relax
+ \newwrite\HD@savedest@out
+ \RerunFileCheck{\jobname.hd}{%
+ \immediate\closeout\HD@savedest@out
+ }{}%
+ \immediate\openout\HD@savedest@out=\jobname.hd\relax
+ \else
+ \let\HD@savedest@add\@gobble
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@savedest@entry}
+% \begin{macrocode}
+ \def\HD@savedest@entry#1^^M{%
+ \@namedef{HD.#1}{}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@savedest@add}
+% \begin{macrocode}
+\def\HD@savedest@add#1{%
+ \immediate\write\HD@savedest@out{\string~#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifHD@targetraise}
+% \begin{macrocode}
+\newif\ifHD@targetraise
+\HD@targetraisetrue
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@target}
+% \begin{macrocode}
+\def\HD@target{%
+ \ifHD@targetraise
+ \ifhmode
+ \settoheight{\HD@helplength}{[H]}%
+ \addtolength{\HD@helplength}{0.4ex}%
+ \raisebox{\HD@helplength}[0pt][0pt]{%
+ \HD@maketarget
+ }%
+ \else
+ \HD@maketarget
+ \fi
+ \else
+ \HD@maketarget
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@maketarget}
+% \begin{macrocode}
+\def\HD@maketarget{%
+ \stepcounter{HD@hypercount}%
+ \def\HD@next{%
+ \llap{\hypertarget{HD.\the\c@HD@hypercount}{}\,}%
+ }%
+ \ifHD@savedest
+ \expandafter\ifx\csname HD.\the\c@HD@hypercount\endcsname\@empty
+ \else
+ \let\HD@next\relax
+ \fi
+ \fi
+ \HD@next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CodelineIndex}
+% \begin{macrocode}
+\g@addto@macro\CodelineIndex{%
+ \let\special@index\HD@codeline@wrindex
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PageIndex}
+% \begin{macrocode}
+\g@addto@macro\PageIndex{%
+ \let\special@index\HD@page@wrindex
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HD@codeline@wrindex}
+% \begin{macrocode}
+\def\HD@codeline@wrindex#1{%
+ \begingroup
+ \let\HDorg@encapchar\encapchar
+ \def\encapchar##1\encapchar##2\@nil{%
+ \HDorg@encapchar
+ hdclindex{\the\c@HD@hypercount}{##1}%
+ }%
+ \codeline@wrindex{%
+ #1\encapchar\encapchar\@nil
+ }%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\HD@page@wrindex}
+% \begin{macrocode}
+\def\HD@page@wrindex#1{%
+ \begingroup
+ \let\HDorg@encapchar\encapchar
+ \def\encapchar##1\encapchar##2\@nil{%
+ \HDorg@encapchar
+ hdpindex{##1}%
+ }%
+ \HDorg@index{#1\encapchar\encapchar\@nil}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hdclindex}
+% \begin{macrocode}
+\def\hdclindex#1#2#3{%
+ \csname\ifx\\#2\\relax\else#2\fi\endcsname{%
+ \hyperlink{HD.#1}{#3}%
+ \HD@savedest@add{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\hdpindex}
+% \begin{macrocode}
+\def\hdpindex#1#2{%
+ \csname\ifx\\#1\\relax\else#1\fi\endcsname{%
+ \hyperpage{#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{PrintDescribeMacro}}
+%
+% \begin{macro}{\HDorg@PrintDescribeMacro}
+% \begin{macrocode}
+\let\HDorg@PrintDescribeMacro\PrintDescribeMacro
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PrintDescribeMacro}
+% \begin{macrocode}
+\renewcommand\PrintDescribeMacro[1]{%
+ \begingroup
+ \let\HDorg@MacroFont\MacroFont
+ \def\MacroFont{%
+ \HD@target
+ \HDorg@MacroFont
+ }%
+ \HDorg@PrintDescribeMacro{#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{PrintMacroName}}
+%
+% \begin{macro}{\HDorg@PrintMacroName}
+% \begin{macrocode}
+\let\HDorg@PrintMacroName\PrintMacroName
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PrintMacroName}
+% \begin{macrocode}
+\renewcommand\PrintMacroName[1]{%
+ \begingroup
+ \let\HDorg@MacroFont\MacroFont
+ \def\MacroFont{%
+ \HD@target
+ \HDorg@MacroFont
+ }%
+ \HDorg@PrintMacroName{#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{theCodelineNo}}
+%
+% \begin{macro}{\HDorg@theCodelineNo}
+% \begin{macrocode}
+\let\HDorg@theCodelineNo\theCodelineNo
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\theCodelineNo}
+% \begin{macrocode}
+\renewcommand*\theCodelineNo{%
+ \settowidth{\HD@helplength}{\HDorg@theCodelineNo\ }%
+ \ifdim\HD@helplength<\MacroIndent
+ \addtolength{\HD@helplength}{-\MacroIndent}%
+ \llap{%
+ \begingroup\HD@target\endgroup
+ \hspace*{-\HD@helplength}%
+ }%
+ \else
+ \HD@target
+ \fi
+ \HDorg@theCodelineNo
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HDorg@index}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \let\HDorg@index\index
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{SpecialUsageIndex}}
+%
+% \begin{macro}{\HDorg@SpecialUsageIndex}
+% \begin{macrocode}
+\let\HDorg@SpecialUsageIndex\SpecialUsageIndex
+\renewcommand*\SpecialUsageIndex[1]{%
+ \@bsphack
+ \begingroup
+ \HD@target
+ \let\index\HDorg@index
+ \let\HDorg@encapchar\encapchar
+ \edef\encapchar usage{%
+ \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
+ }%
+ \HDorg@SpecialUsageIndex{#1}%
+ \endgroup
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{autoindex}}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname autoindex\endcsname\relax
+\else
+% \end{macrocode}
+% \begin{macro}{\HDorg@autoindex}
+% \begin{macrocode}
+ \let\HDorg@autoindex\autoindex
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\autoindex}
+% \begin{macrocode}
+ \renewcommand*\autoindex[1]{%
+ \@bsphack
+ \begingroup
+ \HD@target
+ \let\index\HDorg@index
+ \let\HDorg@encapchar\encapchar
+ \edef\encapchar usage{%
+ \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
+ }%
+ \HDorg@autoindex{#1}%
+ \endgroup
+ \@esphack
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{SpecialEnvIndex}}
+%
+% \begin{macro}{\HDorg@SpecialEnvIndex}
+% \begin{macrocode}
+\let\HDorg@SpecialEnvIndex\SpecialEnvIndex
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SpecialEnvIndex}
+% \begin{macrocode}
+\renewcommand*\SpecialEnvIndex[1]{%
+ \@bsphack
+ \begingroup
+ \HD@target
+ \let\HDorg@encapchar\encapchar
+ \edef\encapchar usage{%
+ \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
+ }%
+ \HDorg@SpecialEnvIndex{#1}%
+ \endgroup
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{SortIndex}}
+%
+% \begin{macro}{\HDorg@SortIndex}
+% \begin{macrocode}
+\let\HDorg@SortIndex\SortIndex
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SortIndex}
+% \begin{macrocode}
+\renewcommand*{\SortIndex}[2]{%
+ \@bsphack
+ \begingroup
+ \let\index\HD@page@wrindex
+ \HDorg@SortIndex{#1}{#2}%
+ \endgroup
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{@wrglossary}}
+%
+% \begin{macro}{\HDorg@wrglossary}
+% \begin{macrocode}
+\let\HDorg@wrglossary\@wrglossary
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@wrglossary}
+% \begin{macrocode}
+\def\@wrglossary#1{%
+ \let\HDorg@encapchar\encapchar
+ \def\encapchar##1\encapchar##2\@nil{%
+ \HDorg@encapchar
+ hdpindex{##1}%
+ }%
+ \HDorg@wrglossary{#1\encapchar\encapchar\@nil}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{MacroIndent}}
+%
+% \cs{MacroIndent} automatically calculated.
+% \begin{macrocode}
+\AfterLastShipout{%
+ \if@filesw
+ \immediate\write\@auxout{%
+ \string\providecommand\string\HD@SetMacroIndent[1]{}%
+ }%
+ \immediate\write\@auxout{%
+ \string\HD@SetMacroIndent{\number\value{CodelineNo}}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\HD@SetMacroIndent}
+% \begin{macrocode}
+\def\HD@SetMacroIndent#1{%
+ \begingroup
+ \value{CodelineNo}=#1\relax
+ \settowidth{\MacroIndent}{\HDorg@theCodelineNo\ }%
+ \global\MacroIndent\MacroIndent
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hypdoc}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypdoc.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypdoc.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[\CTAN{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 hypdoc.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@{}}
+% hypdoc.sty & tex/latex/oberdiek/hypdoc.sty\\
+% hypdoc.pdf & doc/latex/oberdiek/hypdoc.pdf\\
+% hypdoc.dtx & source/latex/oberdiek/hypdoc.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hypdoc.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hypdoc.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 hypdoc.dtx
+%makeindex -s gind.ist hypdoc.idx
+%pdflatex hypdoc.dtx
+%makeindex -s gind.ist hypdoc.idx
+%pdflatex hypdoc.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hypdoc.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hypdoc'>
+ <name>hypdoc</name>
+ <caption>Hyper extensions for doc.sty.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2002,2006,2007,2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.14'/>
+ <description>
+ This package adds hypertext features to the package
+ <xref refid='doc'>doc</xref> that is used in the documentation
+ system of <xref refid='latex'>LaTeX2e</xref>. Bookmarks are added
+ and references are linked as far as possible.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hypdoc.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hypdoc.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2002/05/10 v1.0}
+% \item
+% First standalone version.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.1}
+% \item
+% Option \xoption{numbered} added.
+% \item
+% \cs{HD@savedest@init} fixed (empty \xext{hd} file triggered
+% first page with fl ligature).
+% \item
+% Bookmarks for \cs{listoffigures} and \cs{listoftables}.
+% \item
+% Documentation: features and usage added.
+% \item
+% LPPL 1.3.
+% \end{Version}
+% \begin{Version}{2006/04/27 v1.2}
+% \item
+% \cs{HD@target} fixed (\xfile{multicol.dtx}).
+% \end{Version}
+% \begin{Version}{2006/06/01 v1.3}
+% \item
+% Support for package \xpackage{amsdtx}'s \cs{autoindex} added.
+% \end{Version}
+% \begin{Version}{2006/06/02 v1.4}
+% \item
+% Bookmark fixed if there are several table of contents,
+% bibliographies, glossaries, \dots
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.5}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/11/12 v1.6}
+% \item
+% Bug fix in \cs{listoffigures} (Axel Sommerfeldt).
+% \item
+% Markup added in implementation section.
+% \end{Version}
+% \begin{Version}{2009/12/10 v1.7}
+% \item
+% Use of package \xpackage{rerunfilecheck}.
+% \end{Version}
+% \begin{Version}{2010/02/03 v1.8}
+% \item
+% Fix for bug latex/4096 added.
+% \end{Version}
+% \begin{Version}{2010/03/26 v1.9}
+% \item
+% Definition of \cs{HD@SetMacroIndex} is provided in the \xext{aux} file.
+% \end{Version}
+% \begin{Version}{2011/05/05 v1.10}
+% \item
+% \cs{raisebox} in \cs{HD@target} with height and depth of \texttt{0pt}
+% (request of GL).
+% \end{Version}
+% \begin{Version}{2011/08/19 v1.11}
+% \item
+% Latest comma in option list for hyperref removed to avoid option clash
+% because of \hologo{LaTeX} 2011/06/27 with the new \cs{in@}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.12}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/10/02 v1.13}
+% \item
+% Fixes to bookmarknames, also introduce \cs{changehistoryname}
+% \end{Version}
+% \begin{Version}{2018/09/07 v1.14}
+% \item
+% Do not load \xpackage{thumpdf}.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hypdoc.pdf b/macros/latex/contrib/oberdiek/hypdoc.pdf
new file mode 100644
index 0000000000..7d06e32171
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypdoc.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hypgotoe.dtx b/macros/latex/contrib/oberdiek/hypgotoe.dtx
new file mode 100644
index 0000000000..14ee6417c7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypgotoe.dtx
@@ -0,0 +1,727 @@
+% \iffalse meta-comment
+%
+% File: hypgotoe.dtx
+% Version: 2016/05/16 v0.2
+% Info: Links to embedded files
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file hypgotoe.dtx
+% and the derived files
+% hypgotoe.sty, hypgotoe.pdf, hypgotoe.ins, hypgotoe.drv,
+% hypgotoe-example.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hypgotoe.dtx
+% CTAN:macros/latex/contrib/oberdiek/hypgotoe.pdf
+%
+% Unpacking:
+% (a) If hypgotoe.ins is present:
+% tex hypgotoe.ins
+% (b) Without hypgotoe.ins:
+% tex hypgotoe.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hypgotoe.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hypgotoe.drv is present:
+% latex hypgotoe.drv
+% (b) Without hypgotoe.drv:
+% latex hypgotoe.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 hypgotoe.dtx
+% makeindex -s gind.ist hypgotoe.idx
+% pdflatex hypgotoe.dtx
+% makeindex -s gind.ist hypgotoe.idx
+% pdflatex hypgotoe.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/hypgotoe.sty
+% TDS:doc/latex/oberdiek/hypgotoe.pdf
+% TDS:doc/latex/oberdiek/hypgotoe-example.tex
+% TDS:source/latex/oberdiek/hypgotoe.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hypgotoe 2016/05/16 v0.2 Links to embedded files (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hypgotoe
+Version: 2016/05/16 v0.2
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file hypgotoe.dtx
+and the derived files
+ hypgotoe.sty, hypgotoe.pdf, hypgotoe.ins, hypgotoe.drv,
+ hypgotoe-example.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hypgotoe.ins}{\from{hypgotoe.dtx}{install}}%
+ \file{hypgotoe.drv}{\from{hypgotoe.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{hypgotoe.sty}{\from{hypgotoe.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{hypgotoe-example.tex}{\from{hypgotoe.dtx}{example}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hypgotoe.xml}{\from{hypgotoe.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{* hypgotoe.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hypgotoe.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hypgotoe.drv}%
+ [2016/05/16 v0.2 Links to embedded files (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{hypgotoe.dtx}%
+\end{document}
+%</driver>
+% \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{hypgotoe.drv}
+%
+% \title{The \xpackage{hypgotoe} package}
+% \date{2016/05/16 v0.2}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Experimental package for links to embedded files.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% This is a first experiment for links to embedded files.
+% The package \xpackage{hypgotoe} is named after the PDF action
+% name \texttt{/GoToE}.
+% Feedback is welcome, especially to the user interface.
+% \begin{itemize}
+% \item
+% Currently only embedded files and named destinations are supported.
+% \item
+% Missing are support for destination arrays and attachted files.
+% \item
+% Special characters aren't supported either.
+% \end{itemize}
+% In the future the package may be merged into package \xpackage{hyperref}.
+%
+% \subsection{User interface}
+%
+% \cs{href} is extended to detect the prefix `\texttt{gotoe:}'.
+% The part after the prefix is evaluated as key value list
+% from left to right.
+% For details, see ``8.5.3 Action Types, Embedded Go-To Actions''
+% \cite{pdfspec}.
+% \begin{description}
+% \item[\xoption{dest}:] The destination name. The destination name
+% can be set by \cs{hypertarget} in the target document. Or check
+% the \xfile{.aux} file for destination names of \cs{label} commands.
+% Also the target PDF file can be inspected, look for \texttt{/Dests}
+% in the /Names entry of the catalog for named destinations. (Required.)
+% \item[\xoption{root}:] The file name of the root document.
+% (Optional.)
+% \item[\xoption{parent}:] Go to the parent document. (No value, optional.)
+% \item[\xoption{embedded}:] Go to the embedded document. The
+% value is the file name as it appears in /EmbeddedFiles of the current
+% document.
+% \end{description}
+%
+% The colors are controlled by \xpackage{hyperref}'s options
+% \xoption{gotoecolor} and \xoption{gotoebordercolor}. They can
+% be set in \cs{hypersetup}, for example.
+% Default is the color of file links.
+%
+% \subsection{Example}
+%
+% \begin{macrocode}
+%<*example>
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{filecontents}
+\begin{filecontents}{hypgotoe-child.tex}
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{hypgotoe}[2016/05/16]
+\begin{document}
+\section{This is the child document.}
+\href{gotoe:%
+ dest={page.1},parent%
+}{Go to first page of main document}\\
+\href{gotoe:%
+ dest={page.2},parent%
+}{Go to second page of main document}
+\newpage
+\section{This is the second page of the child document.}
+\href{gotoe:%
+ dest={page.1},parent%
+}{Go to first page of main document}\\
+\href{gotoe:%
+ dest={page.2},parent%
+}{Go to second page of main document}
+
+\hypertarget{foobar}{}
+Anker foobar is here.
+\end{document}
+\end{filecontents}
+\documentclass{article}
+\usepackage{hypgotoe}[2016/05/16]
+\usepackage{embedfile}
+\IfFileExists{hypgotoe-child.pdf}{%
+ \embedfile{hypgotoe-child.pdf}%
+}{%
+ \typeout{}%
+ \typeout{--> Run hypgotoe-child.tex through pdflatex}%
+ \typeout{}%
+}
+\begin{document}
+\section{First page of main document}
+\href{gotoe:%
+ dest=page.1,embedded=hypgotoe-child.pdf%
+}{Go to first page of child document}\\
+\href{gotoe:%
+ dest=page.2,embedded=hypgotoe-child.pdf%
+}{Go to second page of child document}\\
+\href{gotoe:%
+ dest=foobar,embedded=hypgotoe-child.pdf%
+}{Go to foobar in child document}
+\newpage
+\section{Second page of main document}
+\href{gotoe:%
+ dest=section.1,embedded=hypgotoe-child.pdf%
+}{Go to first section of child document}\\
+\href{gotoe:%
+ dest=section.2,embedded=hypgotoe-child.pdf%
+}{Go to second section of child document}\\
+\href{gotoe:%
+ dest=foobar,embedded=hypgotoe-child.pdf%
+}{Go to foobar in child document}
+\end{document}
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hypgotoe}%
+ [2016/05/16 v0.2 Links to embedded files (HO)]%
+% \end{macrocode}
+%
+% \subsection{Load packages}
+%
+% \begin{macrocode}
+\RequirePackage{ifpdf}[2007/09/09]
+\ifpdf
+\else
+ \PackageError{hypgotoe}{%
+ Other drivers than pdfTeX in PDF mode are not supported.%
+ \MessageBreak
+ Package loading is aborted%
+ }\@ehc
+ \expandafter\endinput
+\fi
+\RequirePackage{pdfescape}[2007/10/27]
+\RequirePackage{hyperref}[2016/05/16]
+% \end{macrocode}
+%
+% \subsection{Color support}
+%
+% \begin{macrocode}
+\define@key{Hyp}{gotoebordercolor}{%
+ \HyColor@HyperrefBordercolor{#1}%
+ \@gotoebordercolor{hyperref}{gotoebordercolor}%
+}
+\providecommand*{\@gotoecolor}{\@filecolor}
+\providecommand*{\@gotoebordercolor}{\@filebordercolor}
+% \end{macrocode}
+%
+% \subsection{Extend \cs{href}}
+%
+% \begin{macro}{\@hyper@readexternallink}
+% \begin{macrocode}
+\def\@hyper@readexternallink#1#2#3#4:#5:#6\\#7{%
+ \ifx\\#6\\%
+ \expandafter\@hyper@linkfile file:#7\\{#3}{#2}%
+ \else
+ \ifx\\#4\\%
+ \expandafter\@hyper@linkfile file:#7\\{#3}{#2}%
+ \else
+ \def\@pdftempa{#4}%
+ \ifx\@pdftempa\@pdftempwordfile
+ \expandafter\@hyper@linkfile#7\\{#3}{#2}%
+ \else
+ \ifx\@pdftempa\@pdftempwordrun
+ \expandafter\@hyper@launch#7\\{#3}{#2}%
+ \else
+ \ifx\@pdftempa\@pdftempwordgotoe
+ \hyper@linkgotoe{#3}{#5}%
+ \else
+ \hyper@linkurl{#3}{#7\ifx\\#2\\\else\hyper@hash#2\fi}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@pdftempwordgotoe}
+% \begin{macrocode}
+\def\@pdftempwordgotoe{gotoe}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Implement gotoe action}
+%
+% \begin{macro}{\hyper@linkgotoe}
+% \begin{macrocode}
+\def\hyper@linkgotoe#1#2{%
+ \begingroup
+ \let\HyGoToE@Root\@empty
+ \let\HyGoToE@Dest\@empty
+ \let\HyGoToE@TBegin\@empty
+ \let\HyGoToE@TEnd\@empty
+ \setkeys{HyGoToE}{#2}%
+ \leavevmode
+ \pdfstartlink
+ attr{%
+ \Hy@setpdfborder
+ \ifx\@pdfhightlight\@empty
+ \else
+ /H\@pdfhighlight
+ \fi
+ \ifx\@urlbordercolor\relax
+ \else
+ /C[\@urlbordercolor]%
+ \fi
+ }%
+ user{%
+ /Subtype/Link%
+ /A<<%
+ /Type/Action%
+ /S/GoToE%
+ \Hy@SetNewWindow
+ \HyGoToE@Root
+ \HyGoToE@Dest
+ \HyGoToE@TBegin
+ \HyGoToE@TEnd
+ >>%
+ }%
+ \relax
+ \Hy@colorlink\@gotoecolor#1%
+ \close@pdflink
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Keys for gotoe action}
+%
+% \begin{macrocode}
+\define@key{HyGoToE}{root}{%
+ \EdefEscapeString\HyGoToE@temp{#1}%
+ \edef\HyGoToE@Root{%
+ /F<<%
+ /Type/Filespec%
+ /F(\HyGoToE@temp)%
+ >>%
+ }%
+}
+\define@key{HyGoToE}{dest}{%
+ \EdefEscapeString\HyGoToE@temp{#1}%
+ \edef\HyGoToE@Dest{%
+ /D(\HyGoToE@temp)%
+ }%
+}
+\define@key{HyGoToE}{parent}[]{%
+ \def\HyGoToE@temp{#1}%
+ \ifx\HyGoToE@temp\@empty
+ \else
+ \PackageWarning{hypgotoe}{Ignore value for `parent'}%
+ \fi
+ \edef\HyGoToE@TBegin{%
+ \HyGoToE@TBegin
+ /T<<%
+ /R/P%
+ }%
+ \edef\HyGoToE@TEnd{%
+ \HyGoToE@TEnd
+ >>%
+ }%
+}
+\define@key{HyGoToE}{embedded}{%
+ \EdefEscapeString\HyGoToE@temp{#1}%
+ \edef\HyGoToE@TBegin{%
+ \HyGoToE@TBegin
+ /T<<%
+ /R/C%
+ /N(\HyGoToE@temp)%
+ }%
+ \edef\HyGoToE@TEnd{%
+ \HyGoToE@TEnd
+ >>%
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hypgotoe}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypgotoe.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hypgotoe.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[\CTAN{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 hypgotoe.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@{}}
+% hypgotoe.sty & tex/latex/oberdiek/hypgotoe.sty\\
+% hypgotoe.pdf & doc/latex/oberdiek/hypgotoe.pdf\\
+% hypgotoe-example.tex & doc/latex/oberdiek/hypgotoe-example.tex\\
+% hypgotoe.dtx & source/latex/oberdiek/hypgotoe.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hypgotoe.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hypgotoe.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 hypgotoe.dtx
+%makeindex -s gind.ist hypgotoe.idx
+%pdflatex hypgotoe.dtx
+%makeindex -s gind.ist hypgotoe.idx
+%pdflatex hypgotoe.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hypgotoe.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hypgotoe'>
+ <name>hypgotoe</name>
+ <caption>Links to embedded files.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='0.2'/>
+ <description>
+ This experimental package is a first experiment for links to embedded
+ files. It is named after the PDF action name <tt>/GoToE</tt>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hypgotoe.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hypgotoe.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{pdfspec}
+% Adobe Systems Incorporated:
+% \href{http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference.pdf}%
+% {\textit{PDF Reference, Sixth Edition, Version 1.7}},%
+% Oktober 2006;
+% \url{http://www.adobe.com/devnet/pdf/pdf_reference.html}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/10/30 v0.1}
+% \item
+% First experimental version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v0.2}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hypgotoe.pdf b/macros/latex/contrib/oberdiek/hypgotoe.pdf
new file mode 100644
index 0000000000..f517c6f9ba
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hypgotoe.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/hyphsubst.dtx b/macros/latex/contrib/oberdiek/hyphsubst.dtx
new file mode 100644
index 0000000000..64121a5020
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hyphsubst.dtx
@@ -0,0 +1,969 @@
+% \iffalse meta-comment
+%
+% File: hyphsubst.dtx
+% Version: 2016/05/16 v0.3
+% Info: Substitute hyphenation patterns
+%
+% Copyright (C) 2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 hyphsubst.dtx
+% and the derived files
+% hyphsubst.sty, hyphsubst.pdf, hyphsubst.ins, hyphsubst.drv,
+% hyphsubst-test1.tex, hyphsubst-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/hyphsubst.dtx
+% CTAN:macros/latex/contrib/oberdiek/hyphsubst.pdf
+%
+% Unpacking:
+% (a) If hyphsubst.ins is present:
+% tex hyphsubst.ins
+% (b) Without hyphsubst.ins:
+% tex hyphsubst.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{hyphsubst.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If hyphsubst.drv is present:
+% latex hyphsubst.drv
+% (b) Without hyphsubst.drv:
+% latex hyphsubst.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 hyphsubst.dtx
+% makeindex -s gind.ist hyphsubst.idx
+% pdflatex hyphsubst.dtx
+% makeindex -s gind.ist hyphsubst.idx
+% pdflatex hyphsubst.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/hyphsubst.sty
+% TDS:doc/latex/oberdiek/hyphsubst.pdf
+% TDS:doc/latex/oberdiek/test/hyphsubst-test1.tex
+% TDS:doc/latex/oberdiek/test/hyphsubst-test2.tex
+% TDS:source/latex/oberdiek/hyphsubst.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: hyphsubst 2016/05/16 v0.3 Substitute hyphenation patterns (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: hyphsubst
+Version: 2016/05/16 v0.3
+
+Copyright (C) 2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 hyphsubst.dtx
+and the derived files
+ hyphsubst.sty, hyphsubst.pdf, hyphsubst.ins, hyphsubst.drv,
+ hyphsubst-test1.tex, hyphsubst-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{hyphsubst.ins}{\from{hyphsubst.dtx}{install}}%
+ \file{hyphsubst.drv}{\from{hyphsubst.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{hyphsubst.sty}{\from{hyphsubst.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{hyphsubst-test1.tex}{\from{hyphsubst.dtx}{test1}}%
+% \file{hyphsubst-test2.tex}{\from{hyphsubst.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{hyphsubst.xml}{\from{hyphsubst.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{* hyphsubst.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `hyphsubst.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{hyphsubst.drv}%
+ [2016/05/16 v0.3 Substitute hyphenation patterns (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{hyphsubst.dtx}%
+\end{document}
+%</driver>
+% \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{hyphsubst.drv}
+%
+% \title{The \xpackage{hyphsubst} package}
+% \date{2016/05/16 v0.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% A \TeX\ format file may include alternative hyphenation patterns
+% for a language with a different name. If the naming convention
+% follows \xpackage{babel's} rules, then the hyphenation patterns
+% for a language can be replaced by the alternative hyphenation patterns,
+% provided in the format file.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{In short}
+%
+% The package is an experimental package that allows the substitution
+% of hyphenation patterns, example:
+%\begin{quote}
+%\begin{verbatim}
+%\RequirePackage[ngerman=ngerman-x-20080601]{hyphsubst}
+%\documentclass{article}
+%\usepackage[ngerman]{babel}
+%\end{verbatim}
+%\end{quote}
+% The patterns \texttt{ngerman} are replaced
+% by the patterns \texttt{ngerman-x-20080601}. The format
+% must contain these patterns and should use the naming scheme
+% of either \xpackage{babel}'s \xfile{language.dat} or
+% \xfile{etex.src}'s \xfile{language.def}.
+%
+% \subsection{Longer version}
+%
+% Assume the format may contain the following hyphenation patterns
+% (excerpt from \xfile{language.dat}):
+%\begin{quote}
+%\begin{verbatim}
+%...
+%ngerman dehyphn.tex
+%ngerman-x-20071231 dehyphn-x-20071231
+%ngerman-x-20080601 dehyphn-x-20080601
+%=ngerman-x-latest % alias for ngerman-x-20080601
+%...
+%\end{verbatim}
+%\end{quote}
+% The patterns that contain \texttt{-x-} are experimental new patterns
+% for \texttt{ngerman}. However, package \xpackage{babel} does not provide
+% the use of patterns that do not have the same name as the used language
+% (dialect). The \xpackage{babel} system remembers patterns in
+% macros: \verb|\l@|\meta{name}. \eTeX's \xfile{etex.src} uses
+% \verb|\lang@|\meta{name} instead. In the following we use \xfile{babel}'s
+% naming scheme, but \xfile{etex.src}'s naming scheme is supported, too.
+%
+% This package \xpackage{hyphsubst} solves the problem by redefining
+% the macro \verb|\l@|\meta{name} to use other patterns.
+%
+% \begin{declcs}{HyphSubstLet} \M{nameA} \M{nameB}
+% \end{declcs}
+% \verb|\l@|\meta{nameA} now has the same meaning as
+% \verb|\l@|\meta{nameB}.
+% The patterns for \texttt{nameB} must exist. If the patterns for \texttt{nameA}
+% exist, then they will be overwritten to use the patterns for \texttt{nameB}.
+% Example:
+%\begin{quote}
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{hyphsubst}
+%\HyphSubstLet{ngerman}{ngerman-x-20080601}
+%\usepackage[ngerman]{babel}
+%\end{verbatim}
+%\end{quote}
+% Now the patterns \texttt{ngerman-x-20080601} are be used.
+%
+% Or if you want to compare hyphenations:
+%\begin{quote}
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{hyphsubst}
+% % save original patterns for ngerman in ngerman-saved
+%\HyphSubstLet{ngerman-saved}{ngerman}
+%\usepackage[ngerman]{babel}
+%\begin{document}
+% We start with the original patterns for ngerman.
+% \HyphSubstLet{ngerman}{ngerman-x-latest}%
+% Now we are using ngerman-x-latest.
+% \HyphSubstLet{ngerman}{ngerman-saved}%
+% Again we are using the original patterns.
+%\end{document}
+%\end{verbatim}
+%\end{quote}
+%
+% \begin{declcs}{HyphSubstIfExists} \M{name} \M{then} \M{else}
+% \end{declcs}
+% Tests if patterns with name \meta{name} exist and execute
+% \meta{then} in case of success and \meta{else} otherwise.
+%
+% \subsection{\LaTeX}
+%
+% The package can also be loaded before \cs{documentclass}:
+%\begin{quote}
+%\begin{verbatim}
+%\RequirePackage[ngerman=ngerman-x-20080601]{hyphsubst}
+%\documentclass{article}
+%...
+%\end{verbatim}
+%\end{quote}
+% This allows to put the package in a format file.
+%
+% Package options are interpreted as `let' assignments and passed
+% to macro \cs{HyphSubstLet}:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage[ngerman=ngerman-x-20080601]{hyphsubst}
+%\end{verbatim}
+%\end{quote}
+% The part before the equal sign is the first argument for
+% \cs{HyphSubstLet} and the part after the equal sign forms the
+% second argument:
+%\begin{quote}
+%\begin{verbatim}
+%\HyphSubstLet{ngerman}{ngerman-x-20080601}
+%\end{verbatim}
+%\end{quote}
+% Note, this only works for direct package options. Global options
+% are ignored.
+%
+% \subsection{\plainTeX}
+%
+% The package can be loaded and used with \plainTeX, e.g.:
+%\begin{quote}
+%\begin{verbatim}
+%\input hyphsubst.sty
+%\HyphSubstLet{ngerman}{ngerman-x-latest}
+%\end{verbatim}
+%\end{quote}
+%
+% \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@hyphsubst.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{hyphsubst}{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@hyphsubst.sty\endcsname
+\ProvidesPackage{hyphsubst}%
+ [2016/05/16 v0.3 Substitute hyphenation patterns (HO)]%
+% \end{macrocode}
+%
+% \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 HyphSubst@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\HyphSubst@AtEnd{%
+ \HyphSubst@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\HyphSubst@AtEnd{\HyphSubst@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Package}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\HyphSubst@l}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname et@xlang\endcsname\relax
+ \def\HyphSubst@l{l@}%
+\else
+ \def\HyphSubst@l{lang@}%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HyphSubstLet}
+% \begin{macrocode}
+\def\HyphSubstLet#1#2{%
+ \begingroup
+ \def\x{}%
+ \expandafter\ifx\csname\HyphSubst@l#2\endcsname\relax
+ \@PackageError{hyphsubst}{Unknown pattern `#2'}\@ehc
+ \else
+ \def\lmsg{}%
+ \expandafter\ifx\csname\HyphSubst@l#1\endcsname\relax
+ \edef\msg{%
+ New: \expandafter\string\csname\HyphSubst@l#1\endcsname
+ \noexpand\MessageBreak
+ }%
+ \else
+ \edef\msg{%
+ Redefined: \expandafter\string\csname\HyphSubst@l#1\endcsname
+ \noexpand\MessageBreak
+ old value: \number\csname\HyphSubst@l#1\endcsname
+ \noexpand\MessageBreak
+ }%
+ \ifnum\csname\HyphSubst@l#1\endcsname=\language
+ \edef\x{%
+ \noexpand\language=%
+ \number\csname\HyphSubst@l#2\endcsname\relax
+ }%
+ \edef\lmsg{%
+ \noexpand\MessageBreak
+ \string\language\noexpand\space updated%
+ }%
+ \fi
+ \fi
+ \expandafter\global\expandafter\let
+ \csname\HyphSubst@l#1\expandafter\endcsname
+ \csname\HyphSubst@l#2\endcsname
+ \@PackageInfo{hyphsubst}{%
+ \msg
+ new value: \number\csname\HyphSubst@l#1\endcsname
+ \lmsg
+ }%
+ \fi
+ \expandafter\endgroup\x
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HyphSubstIfExists}
+% \begin{macrocode}
+\def\HyphSubstIfExists#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname\HyphSubst@l#1\endcsname\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@firstoftwo}
+% \begin{macrocode}
+\expandafter\ifx\csname @firstoftwo\endcsname\relax
+ \long\def\@firstoftwo#1#2{#1}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@secondoftwo}
+% \begin{macrocode}
+\expandafter\ifx\csname @secondoftwo\endcsname\relax
+ \long\def\@secondoftwo#1#2{#2}%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \expandafter\HyphSubst@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareOption*{%
+ \expandafter\HyphSubst@Option\CurrentOption==\relax
+}
+\def\HyphSubst@Option#1=#2=#3\relax{%
+ \HyphSubstLet{#1}{#2}%
+}
+\ProcessOptions*\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+\HyphSubst@AtEnd%
+%</package>
+% \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 hyphsubst.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+%
+% \subsection{Main tests}
+%
+% \begin{macrocode}
+%<*test2>
+\input hyphsubst.sty\relax
+
+\catcode`\@=11\relax
+\ifx\et@xlang\@undefined
+ \def\l#1{\csname l@#1\endcsname}%
+\else
+ \def\l#1{\csname lang@#1\endcsname}%
+\fi
+\def\Check#1#2{%
+ \ifnum#1=#2\relax
+ \else
+ \@PackageError{test}{Wrong number: #1 <> #2}\@ehc
+ \fi
+}
+
+\language=0\relax
+\HyphSubstLet{ZeroSaved}{ngerman}
+\Check{\l{USenglish}}{0}%
+\HyphSubstLet{USenglish}{ngerman}
+\Check{\l{USenglish}}{\l{ngerman}}
+\ifnum\l{USenglish}>0 %
+\else
+ \@PackageError{test}{\string\language\space is not updated}\@ehc
+\fi
+\HyphSubstLet{german}{ngerman}
+\Check{\l{german}}{\l{ngerman}}
+\Check{\l{USenglish}}{\l{ngerman}}
+\csname @@end\endcsname\end
+%</test2>
+% \end{macrocode}
+%
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/hyphsubst}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/hyphsubst.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/hyphsubst.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[\CTAN{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 hyphsubst.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@{}}
+% hyphsubst.sty & tex/generic/oberdiek/hyphsubst.sty\\
+% hyphsubst.pdf & doc/latex/oberdiek/hyphsubst.pdf\\
+% test/hyphsubst-test1.tex & doc/latex/oberdiek/test/hyphsubst-test1.tex\\
+% test/hyphsubst-test2.tex & doc/latex/oberdiek/test/hyphsubst-test2.tex\\
+% hyphsubst.dtx & source/latex/oberdiek/hyphsubst.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk hyphsubst.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{hyphsubst.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 hyphsubst.dtx
+%makeindex -s gind.ist hyphsubst.idx
+%pdflatex hyphsubst.dtx
+%makeindex -s gind.ist hyphsubst.idx
+%pdflatex hyphsubst.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{hyphsubst.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='hyphsubst'>
+ <name>hyphsubst</name>
+ <caption>Substitute hyphenation patterns.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2008'/>
+ <license type='lppl1.3'/>
+ <version number='0.3'/>
+ <description>
+ A TeX format file may include alternative hyphenation patterns
+ for a language with a different name. If the naming convention
+ follows <xref refid='babel'>babel&#x2019;s</xref> rules, then the
+ hyphenation patterns
+ for a language can be replaced by the alternative hyphenation patterns,
+ provided in the format file.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/hyphsubst.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/hyphsubst.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2008/06/07 v0.1}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2008/06/09 v0.2}
+% \item
+% Support for \eTeX's \xfile{language.def} added.
+% \item
+% Fix for undefined \cs{lmsg}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v0.3}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/hyphsubst.pdf b/macros/latex/contrib/oberdiek/hyphsubst.pdf
new file mode 100644
index 0000000000..1f9a91fb36
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/hyphsubst.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/ifdraft.dtx b/macros/latex/contrib/oberdiek/ifdraft.dtx
new file mode 100644
index 0000000000..e16cdd7c78
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ifdraft.dtx
@@ -0,0 +1,599 @@
+% \iffalse meta-comment
+%
+% File: ifdraft.dtx
+% Version: 2016/05/16 v1.4
+% Info: Detect class options draft and final
+%
+% Copyright (C) 1999, 2005, 2006, 2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file ifdraft.dtx
+% and the derived files
+% ifdraft.sty, ifdraft.pdf, ifdraft.ins, ifdraft.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/ifdraft.dtx
+% CTAN:macros/latex/contrib/oberdiek/ifdraft.pdf
+%
+% Unpacking:
+% (a) If ifdraft.ins is present:
+% tex ifdraft.ins
+% (b) Without ifdraft.ins:
+% tex ifdraft.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{ifdraft.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If ifdraft.drv is present:
+% latex ifdraft.drv
+% (b) Without ifdraft.drv:
+% latex ifdraft.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 ifdraft.dtx
+% makeindex -s gind.ist ifdraft.idx
+% pdflatex ifdraft.dtx
+% makeindex -s gind.ist ifdraft.idx
+% pdflatex ifdraft.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/ifdraft.sty
+% TDS:doc/latex/oberdiek/ifdraft.pdf
+% TDS:source/latex/oberdiek/ifdraft.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: ifdraft 2016/05/16 v1.4 Detect class options draft and final (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: ifdraft
+Version: 2016/05/16 v1.4
+
+Copyright (C) 1999, 2005, 2006, 2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file ifdraft.dtx
+and the derived files
+ ifdraft.sty, ifdraft.pdf, ifdraft.ins, ifdraft.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{ifdraft.ins}{\from{ifdraft.dtx}{install}}%
+ \file{ifdraft.drv}{\from{ifdraft.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{ifdraft.sty}{\from{ifdraft.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{ifdraft.xml}{\from{ifdraft.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{* ifdraft.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `ifdraft.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{ifdraft.drv}%
+ [2016/05/16 v1.4 Detect class options draft and final (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{ifdraft.dtx}%
+\end{document}
+%</driver>
+% \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{ifdraft.drv}
+%
+% \title{The \xpackage{ifdraft} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package provides an interface for selecting code depending
+% on the options \xoption{draft} and \xoption{final}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \subsection{Package loading}
+%
+% In order to detect the global class options \xoption{draft}
+% and \xoption{final}, load this package somewhere after
+% \cs{documentclass} without options:
+% \begin{quote}
+% |\usepackage{ifdraft}|
+% \end{quote}
+%
+% \subsection{User macros}
+%
+% \begin{declcs}{ifdraft}\ \M{draft case} \M{final case}\\
+% \SpecialUsageIndex{\ifoptiondraft}^^A
+% \cs{ifoptiondraft}\ \M{option draft is given}\ ^^A
+% \M{option draft is not given}\\
+% \SpecialUsageIndex{\ifoptionfinal}^^A
+% \cs{ifoptionfinal}\ \M{option final is given}\ ^^A
+% \M{option final is not given}
+% \end{declcs}
+% If none of the options \xoption{draft} or \xoption{final} is used,
+% then this package assumes \xoption{final} as default setting
+% for \cs{ifdraft}. All classes that are known to me behave this way.
+% (Otherwise you can find out with
+% \cs{ifoptiondraft} and \cs{ifoptionfinal}, whether none of
+% the options is set.)
+%
+% If either \xoption{draft} or \xoption{final} is used, \cs{ifdraft} is
+% sufficient to distinguish between these cases.
+%
+% Both options \xoption{draft} and \xoption{final} should not be used
+% at the same time. This is contradictionary input.
+% Which option is more important? The result is
+% unpredictable in general:
+% \begin{itemize}
+% \item
+% \xclass{article}, \xclass{report}, \xclass{book},
+% \xclass{scrartcl}, \xclass{scrreprt}, \xclass{scrbook}:\\
+% \xoption{draft}, \xoption{final}
+% $\rightarrow$ \xoption{final} is effective.\\
+% \xoption{final}, \xoption{draft}
+% $\rightarrow$ \xoption{final} is effective.\\
+% $\Rightarrow$ \xoption{final} wins, if given.
+% \item
+% \xclass{memoir}:\\
+% \xoption{draft}, \xoption{final}
+% $\rightarrow$ \xoption{draft} is effective.\\
+% \xoption{final}, \xoption{draft}
+% $\rightarrow$ \xoption{draft} is effective.\\
+% $\Rightarrow$ \xoption{draft} wins if given.
+% \end{itemize}
+% These classes evaluates the options in declaration order.
+% Because the declaration order of these options in this
+% package is not really interesting, this packages evaluates
+% the options in the order specified in the calling commands:
+% \begin{itemize}
+% \item
+% \xpackage{ifdraft}:\\
+% \xoption{draft}, \xoption{final}
+% $\rightarrow$ \cs{ifdraft} selects \xoption{final} clause.\\
+% \xoption{final}, \xoption{draft}
+% $\rightarrow$ \cs{ifdraft} selects \xoption{draft} clause.\\
+% $\Rightarrow$ latest given option wins.
+% \end{itemize}
+% Thus you know with \cs{ifdraft} the latest given option
+% and you can emulate the behaviour of the different
+% classes with the help of \cs{ifoptiondraft} and
+% \cs{ifoptionfinal}.
+%
+% Summary: \cs{ifdraft} is sufficient to deal with the
+% normal use cases: one or none out of \xoption{draft} and \xoption{final}.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ifdraft}%
+ [2016/05/16 v1.4 Detect class options draft and final (HO)]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newif\if@draft
+\newif\if@option@draft
+\newif\if@option@final
+\DeclareOption{draft}{%
+ \@drafttrue
+ \@option@drafttrue
+}
+\DeclareOption{final}{%
+ \@draftfalse
+ \@option@finaltrue
+}
+\ProcessOptions*\relax
+% \end{macrocode}
+% \begin{macro}{\ifdraft}
+% \begin{macrocode}
+\newcommand*{\ifdraft}{%
+ \if@draft
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifoptiondraft}
+% \begin{macrocode}
+\newcommand*{\ifoptiondraft}{%
+ \if@option@draft
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifoptionfinal}
+% \begin{macrocode}
+\newcommand*{\ifoptionfinal}{%
+ \if@option@final
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/ifdraft}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/ifdraft.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/ifdraft.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[\CTAN{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 ifdraft.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@{}}
+% ifdraft.sty & tex/latex/oberdiek/ifdraft.sty\\
+% ifdraft.pdf & doc/latex/oberdiek/ifdraft.pdf\\
+% ifdraft.dtx & source/latex/oberdiek/ifdraft.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk ifdraft.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{ifdraft.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 ifdraft.dtx
+%makeindex -s gind.ist ifdraft.idx
+%pdflatex ifdraft.dtx
+%makeindex -s gind.ist ifdraft.idx
+%pdflatex ifdraft.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{ifdraft.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='ifdraft'>
+ <name>ifdraft</name>
+ <caption>Detect "draft" and "final" class options.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1999,2005,2006,2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ The package defines commands that switch according to the
+ prevailing &#x2018;draft&#x2019; or &#x2018;final&#x2019;
+ options; each command takes two arguments, the first for the
+ &#x2018;true&#x2019;, the second for the &#x2018;false&#x2019;
+ case. Commands are:<br/>
+ &#x2014; <tt>\ifdraft</tt> determines whether we're operating in
+ draft (&#x2018;true&#x2019;) or final mode;<br/>
+
+ &#x2014; <tt>\ifoptiondraft</tt> determines whether a
+ &#x2018;draft&#x2019; option has been given; and<br/>
+ &#x2014; <tt>\ifoptionfinal</tt> determines whether a
+ &#x2018;final&#x2019; option has been given.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/ifdraft.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/ifdraft.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1999/12/28 v1.0}
+% \item
+% First public release, published in newsgroup \xnewsgroup{de.comp.text.tex}:\\
+% \URL{``\link{Re: auf vorhandensein der option "draft" pruefen}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/ccc1ccc9a8c224e9}
+% \item
+% LPPL 1.1
+% \end{Version}
+% \begin{Version}{2005/10/05 v1.1}
+% \item
+% \cs{ifoptiondraft} and \cs{ifoptionfinal} added.
+% \item
+% \cs{ProcessOptions} changed to \cs{ProcessOptions*}.
+% (Order of given class options matters instead
+% of the order of option declaration in this
+% package.)
+% \item
+% LPPL 1.3
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.2}
+% \item
+% DTX framework.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.3}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/ifdraft.pdf b/macros/latex/contrib/oberdiek/ifdraft.pdf
new file mode 100644
index 0000000000..3b1f991991
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ifdraft.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/iflang.dtx b/macros/latex/contrib/oberdiek/iflang.dtx
new file mode 100644
index 0000000000..21a6825bd8
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/iflang.dtx
@@ -0,0 +1,1258 @@
+% \iffalse meta-comment
+%
+% File: iflang.dtx
+% Version: 2018/01/21 v1.7
+% Info: Checks for the current language
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 iflang.dtx
+% and the derived files
+% iflang.sty, iflang.pdf, iflang.ins, iflang.drv, iflang-test1.tex,
+% iflang-test2.tex, iflang-test3.tex, iflang-test4.tex,
+% iflang-test5.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/iflang.dtx
+% CTAN:macros/latex/contrib/oberdiek/iflang.pdf
+%
+% Unpacking:
+% (a) If iflang.ins is present:
+% tex iflang.ins
+% (b) Without iflang.ins:
+% tex iflang.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{iflang.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If iflang.drv is present:
+% latex iflang.drv
+% (b) Without iflang.drv:
+% latex iflang.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 iflang.dtx
+% makeindex -s gind.ist iflang.idx
+% pdflatex iflang.dtx
+% makeindex -s gind.ist iflang.idx
+% pdflatex iflang.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/iflang.sty
+% TDS:doc/latex/oberdiek/iflang.pdf
+% TDS:doc/latex/oberdiek/test/iflang-test1.tex
+% TDS:doc/latex/oberdiek/test/iflang-test2.tex
+% TDS:doc/latex/oberdiek/test/iflang-test3.tex
+% TDS:doc/latex/oberdiek/test/iflang-test4.tex
+% TDS:doc/latex/oberdiek/test/iflang-test5.tex
+% TDS:source/latex/oberdiek/iflang.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: iflang 2018/01/21 v1.7 Checks for the current language (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: iflang
+Version: 2018/01/21 v1.7
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 iflang.dtx
+and the derived files
+ iflang.sty, iflang.pdf, iflang.ins, iflang.drv, iflang-test1.tex,
+ iflang-test2.tex, iflang-test3.tex, iflang-test4.tex,
+ iflang-test5.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{iflang.ins}{\from{iflang.dtx}{install}}%
+ \file{iflang.drv}{\from{iflang.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{iflang.sty}{\from{iflang.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{iflang-test1.tex}{\from{iflang.dtx}{test1}}%
+% \file{iflang-test2.tex}{\from{iflang.dtx}{test2}}%
+% \file{iflang-test3.tex}{\from{iflang.dtx}{test3}}%
+% \file{iflang-test4.tex}{\from{iflang.dtx}{test4}}%
+% \file{iflang-test5.tex}{\from{iflang.dtx}{test5}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{iflang.xml}{\from{iflang.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{* iflang.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `iflang.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{iflang.drv}%
+ [2018/01/21 v1.7 Checks for the current language (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{iflang.dtx}%
+\end{document}
+%</driver>
+% \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{iflang.drv}
+%
+% \title{The \xpackage{iflang} package}
+% \date{2018/01/21 v1.7}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides expandible checks for the current language
+% based on macro \cs{languagename} or hyphenation patterns.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% Package \xpackage{babel} defines \cs{iflanguagename}. As first
+% argument it takes a language name and executes the second or
+% third argument depending on the current language. This
+% language test is based on hypenation patterns. However, it
+% is possible that different languages or dialects share the
+% same patterns. In such cases \cs{iflanguagename} fails.
+%
+% However, package \xpackage{babel} and some other packages
+% such as \xpackage{german} or \xpackage{ngerman} store
+% the language name in the macro \cs{languagename} if
+% \cs{selectlanguage} is called.
+%
+% \begin{declcs}{IfLanguageName} \M{lang} \M{then} \M{else}
+% \end{declcs}
+% Makro \cs{IfLanguageName} compares language \meta{lang} with
+% the current setting of macro \cs{languagename}. If both
+% contains the same name then the \meta{then} part is called,
+% otherwise the \meta{else} part.
+%
+% The macro is expandable. Thus it can be safely used inside \cs{edef}
+% or \cs{csname}. If case of errors like an undefined \cs{languagename}
+% the \meta{else} part is executed.
+%
+% Note: Macro \cs{IfLanguageName} relies on the fact, that
+% \cs{languagename} is set correctly:
+% \begin{description}
+% \item[Package \xpackage{babel}:]
+% \mbox{}\\
+% Full support of \cs{languagename} in its language switching commands.
+% \item[Format based on \xpackage{babel} (\xfile{language.dat}):]
+% \mbox{}\\
+% If package \xpackage{babel} is not used (or not yet loaded),
+% then \xpackage{babel}'s
+% \xfile{hyphen.cfg} has set \cs{languagename} to the last
+% language in \xfile{language.dat}, but \cs{language} (current
+% patterns) is zero and points to the first language.
+% Thus the value of \cs{languagename} is basically garbage.
+% Package \xpackage{iflang} warns if \cs{languagename} and
+% \cs{language} do not fit.
+% This can be fixed by loading package \xpackage{babel} previously.
+% \item[Format based on \eTeX's \xfile{etex.src} (\xfile{language.def}):]
+% \mbox{}\\
+% Unhappily it does not support
+% \cs{languagename}. Thus this package hooks into \cs{uselanguage}
+% to get \cs{languagename} defined and updated there.
+% At package loading time the changed \cs{uselanguage} has not
+% been called yet. Thus package \xpackage{iflang} tries
+% |USenglish|. This is the definite default language of \xfile{etex.src}.
+% If the current patterns suit this default language, an
+% undefined \cs{languagename} is set to this language. Otherwise
+% a \cs{languagename} remains undefined and a warning is given.
+% \end{description}
+%
+% \begin{declcs}{IfLanguagePatterns} \M{lang} \M{then} \M{else}
+% \end{declcs}
+% This macro behaves similar to \cs{IfLanguageName}. But the
+% language test is based on the current pattern in force (\cs{language}).
+% Also this macro is expandable, in case of errors the \meta{else} part
+% is called.
+%
+% The following naming convention for the pattern are supported:
+% \begin{description}
+% \item[\xpackage{babel}/\xfile{language.dat}]:
+% \cs{l@}\meta{language}
+% \item[\xpackage{etex.src}/\xfile{language.def}]:
+% \cs{lang@}\meta{language}
+% \end{description}
+% Package \xpackage{iflang} looks for \cs{et@xpatterns} (defined in
+% \xfile{etex.src}) to find out the naming convention in use.
+%
+% \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@iflang.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{iflang}{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@iflang.sty\endcsname
+\ProvidesPackage{iflang}%
+ [2018/01/21 v1.7 Checks for the current language (HO)]%
+% \end{macrocode}
+%
+% \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 IfLang@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\IfLang@AtEnd{%
+ \IfLang@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{44}{12}% ,
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\IfLang@AtEnd{\IfLang@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Tools}
+%
+% \subsubsection{Provide some basic macros of \LaTeX}
+%
+% \begin{macro}{\@firstoftwo}
+% \begin{macrocode}
+\expandafter\ifx\csname @firstoftwo\endcsname\relax
+ \long\def\@firstoftwo#1#2{#1}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@secondoftwo}
+% \begin{macrocode}
+\expandafter\ifx\csname @secondoftwo\endcsname\relax
+ \long\def\@secondoftwo#1#2{#2}%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Expandible existence check for macros}
+%
+% \begin{macro}{\IfLang@IfDefined}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ifcsname\endcsname\relax
+ \expandafter\@firstoftwo
+\else
+ \expandafter\@secondoftwo
+\fi
+{%
+ \def\IfLang@IfDefined#1{%
+ \expandafter\ifx\csname#1\endcsname\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi
+ }%
+}{%
+ \def\IfLang@IfDefined#1{%
+ \ifnum\ifcsname#1\endcsname
+ \expandafter\ifx\csname#1\endcsname\relax
+ 1%
+ \else
+ 0%
+ \fi
+ \else
+ 1%
+ \fi
+ =0 %
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Macros for messages}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+ \input pdftexcmds.sty\relax
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{pdftexcmds}[2016/05/16]%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Support for \xfile{etex.src}}
+%
+% \begin{macro}{\IfLang@prefix}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname et@xpatterns\endcsname\relax
+ \@PackageInfoNoLine{iflang}{%
+ Naming convention for patterns: babel%
+ }%
+ \def\IfLang@prefix{l@}%
+\else
+ \@PackageInfoNoLine{iflang}{%
+ Naming convention for patterns: etex.src%
+ }%
+ \def\IfLang@prefix{lang@}%
+ \let\IfLang@OrgUseLanguage\uselanguage
+ \def\uselanguage#1{%
+ \edef\languagename{#1}%
+ \IfLang@OrgUseLanguage{#1}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% The first \cs{uselanguage} that is executed as last
+% line in \xfile{language.def} cannot patched this way.
+% However, \xfile{language.def} is very strict. It forces
+% the first added and used language to be |USenglish|.
+% Thus, if \cs{languagename} is not defined, we can
+% quite safely assume |USenglish|. As additional
+% safety precaution the actual used patterns are checked.
+% \begin{macrocode}
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname languagename\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname lang@USenglish\endcsname\relax
+ \@PackageWarningNoLine{iflang}{%
+ \string\lang@USenglish\space is missing%
+ }%
+ \else
+ \ifnum\lang@USenglish=\language
+ \def\languagename{USenglish}%
+ \else
+ \@PackageWarningNoLine{iflang}{%
+ \string\languagename\space is not set,\MessageBreak
+ current language is unknown%
+ }%
+ \fi
+ \fi
+ \fi
+\fi
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname languagename\endcsname\relax
+ \@PackageInfoNoLine{iflang}{%
+ \string\languagename\space is not set%
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsection{\cs{IfLanguagePatterns}}
+%
+% \begin{macro}{\IfLanguagePatterns}
+% \begin{macrocode}
+\def\IfLanguagePatterns#1{%
+ \ifnum\IfLang@IfDefined{\IfLang@prefix#1}{%
+ \ifnum\csname\IfLang@prefix#1\endcsname=\language
+ 0%
+ \else
+ 1%
+ \fi
+ }{1}=0 %
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{IfLanguageName}}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@strcmp\endcsname\relax
+ \expandafter\@firstoftwo
+\else
+ \expandafter\@secondoftwo
+\fi
+{%
+% \end{macrocode}
+% We do not have \cs{pdf@strcmp} (and \cs{pdfstrcmp}).
+% Thus we must define
+% our own expandable string comparison. The following
+% implementation is based on a \TeX\ pearl from David Kastrup, presented
+% at the conference Bacho\TeX~2005:
+% \url{http://www-stary.gust.org.pl/pearls/2005/david-kastrup/bachotex2005-david-kastrup-pearl1.pdf}
+%
+% The orignal code allows macros inside the second string.
+% Because also \cs{languagename} might consists of further
+% macros, we need a variant that allows macros in the first
+% string, too.
+% \begin{macrocode}
+ \def\IfLang@StrNil{\relax}%
+ \def\IfLang@StrEqual#1{%
+ \number\IfLang@StrEqualStart{}{}#1\IfLang@StrNil
+ }%
+ \def\IfLang@StrEqualStart#1#2#3{%
+ \ifx#3\IfLang@StrNil
+ \IfLang@StrEqualStop
+ \fi
+ \ifcat\noexpand#3\relax
+ \IfLang@StrExpand{#1}{#2}#3%
+ \fi
+ \IfLang@StrEqualStart{\if#3#1}{#2\fi}%
+ }%
+ \def\IfLang@StrEqualStop\fi#1\IfLang@StrEqualStart#2#3#4{%
+ \fi
+ #2#4\relax'#313 %
+ }%
+ \def\IfLang@StrExpand#1#2#3\fi\IfLang@StrEqualStart#4#5{%
+ \fi
+ \IfLang@@StrExpand{#1}{#2}#3%
+ }%
+ \def\IfLang@@StrExpand#1#2#3\IfLang@StrNil{%
+ \expandafter\IfLang@@@StrExpand#3\IfLang@StrNil{#1}{#2}%
+ }%
+ \def\IfLang@@@StrExpand#1\IfLang@StrNil#2#3{%
+ \IfLang@StrEqualStart{#2}{#3}#1\IfLang@StrNil
+ }%
+% \end{macrocode}
+% \begin{macro}{\IfLanguageName}
+% \begin{macrocode}
+ \def\IfLanguageName#1{%
+ \ifnum\IfLang@IfDefined{languagename}{%
+ \if\expandafter\IfLang@StrEqual\expandafter%
+ {\languagename}{#1}%
+ 0%
+ \else
+ 1%
+ \fi
+ }{1}=0 %
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% \begin{macro}{\IfLanguageName}
+% \begin{macrocode}
+ \def\IfLanguageName#1{%
+ \ifnum\IfLang@IfDefined{languagename}{%
+ \pdf@strcmp{#1}{\languagename}%
+ }{1}=0 %
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Check plausibility of \cs{languagename}}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname languagename\endcsname\relax
+\else
+ \IfLanguagePatterns{\languagename}{}{%
+ \@PackageWarningNoLine{iflang}{%
+ Mismatch between \string\language\space
+ (patterns)\MessageBreak
+ and setting of \string\languagename
+ }%
+ }%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\IfLang@AtEnd%
+%</package>
+% \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 iflang.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test with \LaTeX}
+%
+% \begin{macrocode}
+%<*test2|test3>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+%<test3>\let\pdfstrcmp\relax
+\nofiles
+\documentclass{minimal}
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\usepackage[english,naustrian,ngerman]{babel}
+\usepackage{iflang}
+\begin{document}
+\begin{qstest}{IfLanguagePatterns}{language, pattern}
+ \def\test#1#2{%
+ \Expect*{\IfLanguagePatterns{#1}{true}{false}}{#2}%
+ }%
+ \test{ngerman}{true}%
+ \test{naustrian}{true}%
+ \test{english}{false}%
+ \test{foobar}{false}%
+\end{qstest}
+\begin{qstest}{IfLanguageName}{language, name}
+ \def\test#1#2{%
+ \Expect*{\IfLanguageName{#1}{true}{false}}{#2}%
+ }%
+ \test{ngerman}{true}%
+ \test{naustrian}{false}%
+ \selectlanguage{naustrian}%
+ \test{ngerman}{false}%
+ \test{naustrian}{true}%
+ \test{foobar}{false}%
+ %
+ \def\languagename{naustrian}%
+ \test{naustrian}{true}%
+ \test{ngerman}{false}%
+ %
+ \edef\languagename{\string naustrian}%
+ \test{naustrian}{true}%
+ \test{ngerman}{false}%
+ %
+ \def\languagename{naustrian}%
+ \makeatletter
+ \@onelevel@sanitize\languagename
+ \test{naustrian}{true}%
+ \test{ngerman}{false}%
+ %
+ \def\languagename{naustrian}%
+ \def\xaustrian{naustrian}%
+ \def\xgerman{ngerman}%
+ \test{\xaustrian}{true}%
+ \test{\xgerman}{false}%
+ %
+ \def\languagename{\xaustrian}%
+ \test{naustrian}{true}%
+ \test{ngerman}{false}%
+ \test{\xaustrian}{true}%
+ \test{\xgerman}{false}%
+ \test{\languagename}{true}%
+ \test{\languagename\space}{false}%
+ %
+ \def\languagename{\empty\xaustrian\empty}%
+ \test{naustrian}{true}%
+ \test{ngerman}{false}%
+ \test{\empty\xaustrian\empty}{true}%
+ \test{\empty\xgerman\empty}{false}%
+\end{qstest}
+\begin{qstest}{IfDefined}{defined}
+ \makeatletter
+ \let\foobar\relax
+ \Expect*{\IfLang@IfDefined{foobar}{true}{false}}{false}%
+ \Expect*{\ifx\foobar\relax true\else false\fi}{true}%
+ \let\foobar\UNDEFINED
+ \Expect*{\IfLang@IfDefined{foobar}{true}{false}}{false}%
+ \Expect*{\ifx\foobar\relax true\else false\fi}{false}%
+ \Expect*{\ifx\foobar\UNDEFINED true\else false\fi}{true}%
+\end{qstest}
+\end{document}
+% \end{macrocode}
+% \begin{macrocode}
+%</test2|test3>
+% \end{macrocode}
+%
+% \subsection{Test with \plainTeX\ and \eTeX}
+%
+% \begin{macrocode}
+%<*test4>
+% \end{macrocode}
+% \begin{macrocode}
+%% Format `etex' based on `language.def'
+\input iflang.sty
+\catcode64=12
+
+\def\TestGeneric#1#2#3{%
+ \begingroup
+ \edef\x{#1{#2}{true}{false}}%
+ \edef\y{#3}%
+ \ifx\x\y
+ \else
+ \errmessage{Failed test: \string#1{#2} <> #3}%
+ \fi
+ \endgroup
+}
+\def\TestPatterns{\TestGeneric\IfLanguagePatterns}
+\def\TestName{\TestGeneric\IfLanguageName}
+
+\TestPatterns{USenglish}{true}
+\TestPatterns{ngerman}{false}
+
+\TestName{USenglish}{true}
+\TestName{ngerman}{false}
+
+\uselanguage{ngerman}
+
+\TestPatterns{USenglish}{false}
+\TestPatterns{ngerman}{true}
+
+\TestName{USenglish}{false}
+\TestName{ngerman}{true}
+
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test4>
+% \end{macrocode}
+%
+% \subsection{Test with \plainTeX\ and without \eTeX/\pdfTeX}
+%
+% \begin{macrocode}
+%<*test5>
+% \end{macrocode}
+% \begin{macrocode}
+%% Format `tex' (vanilla plain-TeX)
+\let\ifcsname\UNDEFINED
+\let\pdfstrcmp\UNDEFINED
+\input iflang.sty
+\catcode64=11
+
+\def\TestDefined#1{%
+ \IfLang@IfDefined{foobar}{}{}%
+ \ifx\foobar#1%
+ \else
+ \errmessage{Failed test: \string\foobar <> \string#1}%
+ \fi
+}
+\let\foobar\relax
+\TestDefined\relax
+\let\foobar\UNDEFINED
+\TestDefined\relax
+
+\def\strip@prefix#1>{}
+\def\@onelevel@sanitize#1{%
+ \edef#1{\expandafter\strip@prefix\meaning#1}%
+}
+\def\TestCompare#1#2#3{%
+ \begingroup
+ \edef\x{%
+ \if\IfLang@StrEqual{#1}{#2}%
+ true%
+ \else
+ false%
+ \fi
+ }%
+ \def\expect{#3}%
+ \ifx\x\expect
+ \else
+ \def\a{#1}%
+ \@onelevel@sanitize\a
+ \def\b{#2}%
+ \@onelevel@sanitize\b
+ \errmessage{Failed test: `\a'='\b' <> \expect}%
+ \fi
+ \endgroup
+}
+\TestCompare{junk}{junk}{true}
+\TestCompare{}{}{true}
+\TestCompare{a}{b}{false}
+\TestCompare{aa}{bb}{false}
+\def\a{ax}
+\def\b{bx}
+\def\c{\a\b}
+\def\d{\c\b}
+\def\exch#1#2{#2#1}
+\def\gobble#1{}
+\TestCompare{\gobble a}{}{true}
+\TestCompare{}{\gobble a}{true}
+\TestCompare{a\exch xyb}{ayxb}{true}
+\TestCompare{\c}{\c}{true}
+\TestCompare{\d}{\c\b}{true}
+
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test5>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/iflang}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/iflang.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/iflang.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[\CTAN{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 iflang.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@{}}
+% iflang.sty & tex/generic/oberdiek/iflang.sty\\
+% iflang.pdf & doc/latex/oberdiek/iflang.pdf\\
+% test/iflang-test1.tex & doc/latex/oberdiek/test/iflang-test1.tex\\
+% test/iflang-test2.tex & doc/latex/oberdiek/test/iflang-test2.tex\\
+% test/iflang-test3.tex & doc/latex/oberdiek/test/iflang-test3.tex\\
+% test/iflang-test4.tex & doc/latex/oberdiek/test/iflang-test4.tex\\
+% test/iflang-test5.tex & doc/latex/oberdiek/test/iflang-test5.tex\\
+% iflang.dtx & source/latex/oberdiek/iflang.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk iflang.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{iflang.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 iflang.dtx
+%makeindex -s gind.ist iflang.idx
+%pdflatex iflang.dtx
+%makeindex -s gind.ist iflang.idx
+%pdflatex iflang.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{iflang.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='iflang'>
+ <name>iflang</name>
+ <caption>Expandable checks for the current language.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.7'/>
+ <description>
+ This package provides expandable checks for the current language
+ based on macro <tt>\languagename</tt> or hyphenation patterns.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/iflang.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/iflang.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \section{Acknowledgement}
+% I wish to thank:
+% \begin{description}
+% \item[Markus Kohm] Useful hints for version 1.2.
+% \end{description}
+%
+% \begin{History}
+% \begin{Version}{2007/04/10 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.1}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/04/12 v1.2}
+% \item
+% Initialization of \cs{languagename} in case of \xfile{etex.src}.
+% \item
+% Some sanity tests added.
+% \item
+% Documentation improved.
+% \end{Version}
+% \begin{Version}{2007/04/26 v1.3}
+% \item
+% Use of package \xpackage{infwarerr}.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.4}
+% \item
+% Bug fix: \cs{IfLang@StrEqual} $\rightarrow$ \cs{IfLangStrEqual}
+% (Gabriele Balducci).
+% \item
+% Catcode section rewritten.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.5}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.6}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2018/01/21 v1.7}
+% \item
+% Fix test for \texttt{etex.src}.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/iflang.pdf b/macros/latex/contrib/oberdiek/iflang.pdf
new file mode 100644
index 0000000000..b334edf0c2
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/iflang.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/ifluatex.dtx b/macros/latex/contrib/oberdiek/ifluatex.dtx
new file mode 100644
index 0000000000..556dbfaef4
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ifluatex.dtx
@@ -0,0 +1,920 @@
+% \iffalse meta-comment
+%
+% File: ifluatex.dtx
+% Version: 2016/05/16 v1.4
+% Info: Provides the ifluatex switch
+%
+% Copyright (C) 2007, 2009, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 ifluatex.dtx
+% and the derived files
+% ifluatex.sty, ifluatex.pdf, ifluatex.ins, ifluatex.drv,
+% ifluatex-test1.tex, ifluatex-test2.tex, ifluatex-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/ifluatex.dtx
+% CTAN:macros/latex/contrib/oberdiek/ifluatex.pdf
+%
+% Unpacking:
+% (a) If ifluatex.ins is present:
+% tex ifluatex.ins
+% (b) Without ifluatex.ins:
+% tex ifluatex.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{ifluatex.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If ifluatex.drv is present:
+% latex ifluatex.drv
+% (b) Without ifluatex.drv:
+% latex ifluatex.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 ifluatex.dtx
+% makeindex -s gind.ist ifluatex.idx
+% pdflatex ifluatex.dtx
+% makeindex -s gind.ist ifluatex.idx
+% pdflatex ifluatex.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/ifluatex.sty
+% TDS:doc/latex/oberdiek/ifluatex.pdf
+% TDS:doc/latex/oberdiek/test/ifluatex-test1.tex
+% TDS:doc/latex/oberdiek/test/ifluatex-test2.tex
+% TDS:doc/latex/oberdiek/test/ifluatex-test3.tex
+% TDS:source/latex/oberdiek/ifluatex.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: ifluatex
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2007, 2009, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 ifluatex.dtx
+and the derived files
+ ifluatex.sty, ifluatex.pdf, ifluatex.ins, ifluatex.drv,
+ ifluatex-test1.tex, ifluatex-test2.tex, ifluatex-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{ifluatex.ins}{\from{ifluatex.dtx}{install}}%
+ \file{ifluatex.drv}{\from{ifluatex.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{ifluatex.sty}{\from{ifluatex.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{ifluatex-test1.tex}{\from{ifluatex.dtx}{test1}}%
+% \file{ifluatex-test2.tex}{\from{ifluatex.dtx}{test-reload1}}%
+% \file{ifluatex-test3.tex}{\from{ifluatex.dtx}{test-reload2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{ifluatex.xml}{\from{ifluatex.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{* ifluatex.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `ifluatex.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{ifluatex.drv}%
+ [2016/05/16 v1.4 Provides the ifluatex switch (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{ifluatex.dtx}%
+\end{document}
+%</driver>
+% \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{ifluatex.drv}
+%
+% \title{The \xpackage{ifluatex} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package looks for \LuaTeX\ regardless of its mode
+% and provides the switch \cs{ifluatex}. Also it makes
+% \cs{luatexversion} available if it is not present.
+% It works with \plainTeX\ or \LaTeX.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% The package \xpackage{ifluatex} can be used with both \plainTeX\
+% and \LaTeX:
+% \begin{description}
+% \item[\plainTeX:] |\input ifluatex.sty|
+% \item[\LaTeXe:] |\usepackage{ifluatex}|
+% \end{description}
+%
+% \DescribeMacro{\ifluatex}
+% The package provides the switch \cs{ifluatex}:
+% \begin{quote}
+% |\ifluatex|\\
+% \hspace{1.5em}\LuaTeX\ is running\\
+% |\else|\\
+% \hspace{1.5em}Without \LuaTeX\\
+% |\fi|
+% \end{quote}
+%
+% Since version 0.39 \LuaTeX\ only provides \cs{directlua} at startup
+% time. Also the syntax of \cs{directlua} changed in version 0.36.
+% Thus the user might want to check the LuaTeX version.
+% Therefore this package also makes \cs{luatexversion} and
+% \cs{luatexrevision} available, if it is not yet done.
+%
+% If you want to detect the mode (DVI or PDF), then use package
+% \xpackage{ifpdf}. \LuaTeX\ has inherited \cs{pdfoutput} from \pdfTeX.
+%
+% \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@ifluatex.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{ifluatex}{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@ifluatex.sty\endcsname
+\ProvidesPackage{ifluatex}%
+ [2016/05/16 v1.4 Provides the ifluatex switch (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 ifluatex@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\ifluatex@AtEnd{%
+ \ifluatex@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{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{94}{7}% ^
+\TMP@EnsureCode{96}{12}% `
+\edef\ifluatex@AtEnd{\ifluatex@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Macro for error messages}
+%
+% \begin{macro}{\ifluatex@Error}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname PackageError\endcsname\relax
+ \def\ifluatex@Error#1#2{%
+ \begingroup
+ \newlinechar=10 %
+ \def\MessageBreak{^^J}%
+ \edef\x{\errhelp{#2}}%
+ \x
+ \errmessage{Package ifluatex Error: #1}%
+ \endgroup
+ }%
+\else
+ \def\ifluatex@Error{%
+ \PackageError{ifluatex}%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Check for previously defined \cs{ifluatex}}
+%
+% \begin{macrocode}
+\begingroup
+ \expandafter\ifx\csname ifluatex\endcsname\relax
+ \else
+ \edef\i/{\expandafter\string\csname ifluatex\endcsname}%
+ \ifluatex@Error{Name clash, \i/ is already defined}{%
+ Incompatible versions of \i/ can cause problems,\MessageBreak
+ therefore package loading is aborted.%
+ }%
+ \endgroup
+ \expandafter\ifluatex@AtEnd
+ \fi%
+\endgroup
+% \end{macrocode}
+%
+% \subsection{\cs{ifluatex}}
+%
+% \begin{macro}{\ifluatex}
+% \begin{macrocode}
+\let\ifluatex\iffalse
+% \end{macrocode}
+% \end{macro}
+%
+% Test \cs{luatexversion}. Is it defined and different from
+% \cs{relax}? Someone could have used \LaTeX\ internal
+% \cs{@ifundefined}, or something else involving.
+% Notice, \cs{csname} is executed inside a group for the test
+% to cancel the side effect of \cs{csname}.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname luatexversion\endcsname\relax
+\else
+ \expandafter\let\csname ifluatex\expandafter\endcsname
+ \csname iftrue\endcsname
+\fi
+% \end{macrocode}
+%
+% \subsection{Lua\TeX\ v0.39}
+%
+% Starting with version 0.39 \LuaTeX\ wants to provide \cs{directlua}
+% as only primitive at startup time beyond vanilla \TeX's primitives.
+% Then \cs{directlua} exists, but \cs{luatexversion} cannot be found.
+% Unhappily also the syntax of \cs{directlua} changed in v0.36,
+% thus the user would want to check \cs{luatexversion}.
+% Therefore we make \cs{luatexversion} available using
+% \LuaTeX's Lua function |tex.enableprimitives|.
+%
+% \begin{macrocode}
+\ifluatex
+\else
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname directlua\endcsname\relax
+ \else
+ \expandafter\let\csname ifluatex\expandafter\endcsname
+ \csname iftrue\endcsname
+ \begingroup
+ \newlinechar=10 %
+ \endlinechar=\newlinechar%
+ \ifnum0%
+ \directlua{%
+ if tex.enableprimitives then
+ tex.enableprimitives('ifluatex', {'luatexversion'})
+ tex.print('1')
+ end
+ }%
+ \ifx\ifluatexluatexversion\@undefined\else 1\fi %
+ =11 %
+ \global\let\luatexversion\ifluatexluatexversion%
+ \else%
+ \ifluatex@Error{%
+ Missing \string\luatexversion%
+ }{%
+ Update LuaTeX.%
+ }%
+ \fi%
+ \endgroup%
+ \fi
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\ifluatex
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname luatexrevision\endcsname\relax
+ \ifnum\luatexversion<36 %
+ \else
+ \begingroup
+ \ifx\luatexrevision\relax
+ \let\luatexrevision\@undefined
+ \fi
+ \newlinechar=10 %
+ \endlinechar=\newlinechar%
+ \ifcase0%
+ \directlua{%
+ if tex.enableprimitives then
+ tex.enableprimitives('ifluatex', {'luatexrevision'})
+ else
+ tex.print('1')
+ end
+ }%
+ \ifx\ifluatexluatexrevision\@undefined 1\fi%
+ \relax%
+ \global\let\luatexrevision\ifluatexluatexrevision%
+ \fi%
+ \endgroup%
+ \fi
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname luatexrevision\endcsname\relax
+ \ifluatex@Error{%
+ Missing \string\luatexrevision%
+ }{%
+ Update LuaTeX.%
+ }%
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsection{Protocol entry}
+%
+% Log comment:
+% \begin{macrocode}
+\begingroup
+ \expandafter\ifx\csname PackageInfo\endcsname\relax
+ \def\x#1#2{%
+ \immediate\write-1{Package #1 Info: #2.}%
+ }%
+ \else
+ \let\x\PackageInfo
+ \expandafter\let\csname on@line\endcsname\empty
+ \fi
+ \x{ifluatex}{LuaTeX \ifluatex\else not \fi detected}%
+\endgroup
+% \end{macrocode}
+% \begin{macrocode}
+\ifluatex@AtEnd%
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \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 ifluatex.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Reload check for plain}
+%
+% \begin{macrocode}
+%<*test-reload1>
+\input ifluatex.sty\relax
+\input ifluatex.sty\relax
+\csname @@end\endcsname\end
+%</test-reload1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test-reload2>
+\input miniltx.tex\relax
+\input ifluatex.sty\relax
+\input ifluatex.sty\relax
+\csname @@end\endcsname\end
+%</test-reload2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/ifluatex}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/ifluatex.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/ifluatex.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[\CTAN{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 ifluatex.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@{}}
+% ifluatex.sty & tex/generic/oberdiek/ifluatex.sty\\
+% ifluatex.pdf & doc/latex/oberdiek/ifluatex.pdf\\
+% test/ifluatex-test1.tex & doc/latex/oberdiek/test/ifluatex-test1.tex\\
+% test/ifluatex-test2.tex & doc/latex/oberdiek/test/ifluatex-test2.tex\\
+% test/ifluatex-test3.tex & doc/latex/oberdiek/test/ifluatex-test3.tex\\
+% ifluatex.dtx & source/latex/oberdiek/ifluatex.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk ifluatex.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{ifluatex.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 ifluatex.dtx
+%makeindex -s gind.ist ifluatex.idx
+%pdflatex ifluatex.dtx
+%makeindex -s gind.ist ifluatex.idx
+%pdflatex ifluatex.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{ifluatex.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='ifluatex'>
+ <name>ifluatex</name>
+ <caption>Provides the \ifluatex switch.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2009,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ The package looks for LuaTeX regardless of its mode and provides
+ the switch <tt>\ifluatex</tt>; it works with Plain TeX or LaTeX.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/ifluatex.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/ifluatex.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='ifluatex'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/12/12 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2009/04/10 v1.1}
+% \item
+% Test adopted for \LuaTeX\ 0.39.
+% \item
+% Makes \cs{luatexversion} available.
+% \end{Version}
+% \begin{Version}{2009/04/17 v1.2}
+% \item
+% Fixes (Manuel P\'egouri\'e-Gonnard).
+% \item
+% \cs{luatextrue} and \cs{luatexfalse} are no longer defined.
+% \item
+% Makes \cs{luatexrevision} available, too.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.3}
+% \item
+% Line ends fixed in case \cs{endlinechar} = \cs{newlinechar}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/ifluatex.pdf b/macros/latex/contrib/oberdiek/ifluatex.pdf
new file mode 100644
index 0000000000..fbf1f7d0c5
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ifluatex.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/ifpdf.dtx b/macros/latex/contrib/oberdiek/ifpdf.dtx
new file mode 100644
index 0000000000..1aa3502128
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ifpdf.dtx
@@ -0,0 +1,143 @@
+% \iffalse
+%% Source File: ifpdf.dtx
+%% Copyright 2016-2018 Heiko Oberdiek and LaTeX3 project
+%%
+%% This file may be distributed under the terms of the LPPL.
+%% https://www.latex-project.org/lppl/
+%
+%<*ignore>
+\ifx\ProvidesFile\undefined\let\install y\fi
+\ifx\install y\else
+\long\def\tmp#1\endbatchfile{}
+\expandafter\tmp
+\fi
+%</ignore>
+%<*install>
+\input docstrip
+\keepsilent
+\preamble
+\endpreamble
+
+\askforoverwritefalse
+
+\generate{
+%<*ignore>
+\file{ifpdf.ins}{\from{ifpdf.dtx}{install}}
+%</ignore>
+\file{ifpdf.sty}{\from{ifpdf.dtx}{package}}
+}
+
+\endbatchfile
+%</install>
+%<*dtx>
+ \ProvidesFile{ifpdf.dtx}
+%</dtx>
+%<*!install>
+%<package>\ifnum1=0\ifx\ProvidesPackage\undefined1\else\ifx\ProvidesPackage\relax1\fi\fi
+%<package>\def\next#1#2[#3]{\wlog{#2 #3}\expandafter\gdef
+%<package>\csname ver\string @ifpdf.sty\endcsname{#3}}
+%<package>\expandafter\next\fi
+%<package>\ProvidesPackage{ifpdf}%
+%<driver> \ProvidesFile{ifpdf.drv}
+% \fi
+% \ProvidesFile{ifpdf.dtx}
+[2018/09/07 v3.3 Provides the ifpdf switch]
+% \iffalse
+%</!install>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{hyperref}
+\begin{document}
+\tableofcontents
+\DocInput{ifpdf.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{ifpdf.dtx}
+%
+% \title{The \textsf{ifpdf} Package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.
+% Please report any issues at https://github.com/ho-tex/oberdiek/issues}}
+% \author{LaTeX3 project}
+% \date{\filedate}
+% \maketitle
+%
+% \section{Introduction}
+%
+% A re-implementation of Heiko Oberdiek's \textsf{ifpdf} package
+% with simplified structure and updated to work with current Lua\TeX.
+%
+% The package defines a new boolean, \verb|\ifpdf| which is true
+% for pdf\TeX\ and Lua\TeX\ in PDF mode, and false otherwise.
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% If \verb|\ifpdf| is not defined define it, taking care that it is
+% outer in plain \TeX.
+% \begin{macrocode}
+\expandafter\ifx\csname ifpdf\endcsname\relax
+ \csname newif\expandafter\endcsname\csname ifpdf\endcsname
+\else
+% \end{macrocode}
+% If \verb|\ifpdf| is already defined but \verb|\pdftrue| is not defined
+% give up.
+% \begin{macrocode}
+ \ifx\pdftrue\undefined
+ \ifx\PackageError\undefined
+ \begingroup\def\PackageError#1#2#3{\endgroup\errmessage{#2}}
+ \fi
+ \PackageError{ifpdf}{incompatible ifpdf definition}{}
+ \expandafter\expandafter\expandafter
+ \fi
+\fi
+% \end{macrocode}
+% Otherwise set the boolean to false unless pdfoutput (outputmode) is greater than zero.
+% For Lua\TeX, do the test in Lua as the tex primitivies may not be enabled, and
+% the primitive name may be \verb|\pdfoutput| or \verb|\outputmode| depending
+% on the Lua\TeX\ version number.
+% \begin{macrocode}
+\let\ifpdf\iffalse
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifx\directlua\undefined
+% \end{macrocode}
+% Not Lua\TeX.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfoutput\endcsname\relax
+\else
+ \ifnum\pdfoutput>0 %
+ \pdftrue
+ \fi
+\fi
+\else
+% \end{macrocode}
+% Lua\TeX.
+% \begin{macrocode}
+\directlua{%
+if (tex.outputmode or tex.pdfoutput or 0) > 0 then
+ tex.print('\string\\pdftrue')
+end
+}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \endinput
+% 2016/04/04 v3.0 rewrite to be self standing and work with new luatex/
+% 2016/05/14 v3.1 define ver@ifpdf.sty in plain tex.
+% 2017/03/15 v3.2 define ver\string@ifpdf.sty in amstex tex.
+% https://github.com/ho-tex/oberdiek/issues/23
+% 2018/09/07 v3.3 guard against \ProvidesPackage being \relax
+% https://github.com/ho-tex/oberdiek/issues/38
diff --git a/macros/latex/contrib/oberdiek/ifpdf.pdf b/macros/latex/contrib/oberdiek/ifpdf.pdf
new file mode 100644
index 0000000000..affb115e14
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ifpdf.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/ifvtex.dtx b/macros/latex/contrib/oberdiek/ifvtex.dtx
new file mode 100644
index 0000000000..dd405e6045
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ifvtex.dtx
@@ -0,0 +1,902 @@
+% \iffalse meta-comment
+%
+% File: ifvtex.dtx
+% Version: 2016/05/16 v1.6
+% Info: Detect VTeX and its facilities
+%
+% Copyright (C) 2001, 2006-2008, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 ifvtex.dtx
+% and the derived files
+% ifvtex.sty, ifvtex.pdf, ifvtex.ins, ifvtex.drv, ifvtex-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/ifvtex.dtx
+% CTAN:macros/latex/contrib/oberdiek/ifvtex.pdf
+%
+% Unpacking:
+% (a) If ifvtex.ins is present:
+% tex ifvtex.ins
+% (b) Without ifvtex.ins:
+% tex ifvtex.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{ifvtex.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If ifvtex.drv is present:
+% latex ifvtex.drv
+% (b) Without ifvtex.drv:
+% latex ifvtex.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 ifvtex.dtx
+% makeindex -s gind.ist ifvtex.idx
+% pdflatex ifvtex.dtx
+% makeindex -s gind.ist ifvtex.idx
+% pdflatex ifvtex.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/ifvtex.sty
+% TDS:doc/latex/oberdiek/ifvtex.pdf
+% TDS:doc/latex/oberdiek/test/ifvtex-test1.tex
+% TDS:source/latex/oberdiek/ifvtex.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: ifvtex 2016/05/16 v1.6 Detect VTeX and its facilities (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: ifvtex
+Version: 2016/05/16 v1.6
+
+Copyright (C) 2001, 2006-2008, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 ifvtex.dtx
+and the derived files
+ ifvtex.sty, ifvtex.pdf, ifvtex.ins, ifvtex.drv, ifvtex-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{ifvtex.ins}{\from{ifvtex.dtx}{install}}%
+ \file{ifvtex.drv}{\from{ifvtex.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{ifvtex.sty}{\from{ifvtex.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{ifvtex-test1.tex}{\from{ifvtex.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{ifvtex.xml}{\from{ifvtex.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{* ifvtex.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `ifvtex.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{ifvtex.drv}%
+ [2016/05/16 v1.6 Detect VTeX and its facilities (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{ifvtex.dtx}%
+\end{document}
+%</driver>
+% \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{ifvtex.drv}
+%
+% \title{The \xpackage{ifvtex} package}
+% \date{2016/05/16 v1.6}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package looks for \VTeX, implements
+% and sets the switches \cs{ifvtex}, \cs{ifvtex}\texttt{\meta{mode}},
+% \cs{ifvtexgex}. It works with plain or \LaTeX\ formats.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% The package \xpackage{ifvtex} can be used with both \plainTeX\
+% and \LaTeX:
+% \begin{description}
+% \item[\plainTeX:] |\input ifvtex.sty|
+% \item[\LaTeXe:] |\usepackage{ifvtex}|\\
+% \end{description}
+%
+% The package implements switches for \VTeX\ and its different
+% modes and interprets \cs{VTeXversion}, \cs{OpMode}, and \cs{gexmode}.
+%
+% \begin{declcs}{ifvtex}
+% \end{declcs}
+% The package provides the switch \cs{ifvtex}:
+% \begin{quote}
+% |\ifvtex|\\
+% \hspace{1.5em}\dots\ do things, if \VTeX\ is running \dots\\
+% |\else|\\
+% \hspace{1.5em}\dots\ other \TeX\ compiler \dots\\
+% |\fi|
+% \end{quote}
+% Users of the package \xpackage{ifthen} can use the switch as boolean:
+% \begin{quote}
+% |\boolean{ifvtex}|
+% \end{quote}
+%
+% \begin{declcs}{ifvtexdvi}\\
+% \cs{ifvtexpdf}\SpecialUsageIndex{\ifvtexpdf}\\
+% \cs{ifvtexps}\SpecialUsageIndex{\ifvtexps}\\
+% \cs{ifvtexhtml}\SpecialUsageIndex{\ifvtexhtml}
+% \end{declcs}
+% \VTeX\ knows different output modes that can be asked by these
+% switches.
+%
+% \begin{declcs}{ifvtexgex}
+% \end{declcs}
+% This switch shows, whether GeX is available.
+%
+% \StopEventually{
+% }
+%
+% \section{Implemenation}
+%
+% \subsection{Reload check and package identification}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@ifvtex.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{ifvtex}{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@ifvtex.sty\endcsname
+\ProvidesPackage{ifvtex}%
+ [2016/05/16 v1.6 Detect VTeX and its facilities (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 ifvtex@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\ifvtex@AtEnd{%
+ \ifvtex@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{94}{7}% ^
+\TMP@EnsureCode{96}{12}% `
+\edef\ifvtex@AtEnd{\ifvtex@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Check for previously defined \cs{ifvtex}}
+%
+% \begin{macrocode}
+\begingroup
+ \expandafter\ifx\csname ifvtex\endcsname\relax
+ \else
+ \edef\i/{\expandafter\string\csname ifvtex\endcsname}%
+ \expandafter\ifx\csname PackageError\endcsname\relax
+ \def\x#1#2{%
+ \edef\z{#2}%
+ \expandafter\errhelp\expandafter{\z}%
+ \errmessage{Package ifvtex Error: #1}%
+ }%
+ \def\y{^^J}%
+ \newlinechar=10 %
+ \else
+ \def\x#1#2{%
+ \PackageError{ifvtex}{#1}{#2}%
+ }%
+ \def\y{\MessageBreak}%
+ \fi
+ \x{Name clash, \i/ is already defined}{%
+ Incompatible versions of \i/ can cause problems,\y
+ therefore package loading is aborted.%
+ }%
+ \endgroup
+ \expandafter\ifvtex@AtEnd
+ \fi%
+\endgroup
+% \end{macrocode}
+%
+% \subsection{Provide \cs{newif}}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname newif\endcsname\relax
+% \end{macrocode}
+% \begin{macro}{\ifvtex@newif}
+% \begin{macrocode}
+ \def\ifvtex@newif#1{%
+ \begingroup
+ \escapechar=-1 %
+ \expandafter\endgroup
+ \expandafter\ifvtex@@newif\string#1\@nil
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifvtex@@newif}
+% \begin{macrocode}
+ \def\ifvtex@@newif#1#2#3\@nil{%
+ \expandafter\edef\csname#3true\endcsname{%
+ \let
+ \expandafter\noexpand\csname if#3\endcsname
+ \expandafter\noexpand\csname iftrue\endcsname
+ }%
+ \expandafter\edef\csname#3false\endcsname{%
+ \let
+ \expandafter\noexpand\csname if#3\endcsname
+ \expandafter\noexpand\csname iffalse\endcsname
+ }%
+ \csname#3false\endcsname
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\else
+% \end{macrocode}
+% \begin{macro}{\ifvtex@newif}
+% \begin{macrocode}
+ \expandafter\let\expandafter\ifvtex@newif\csname newif\endcsname
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{ifvtex}}
+%
+% \begin{macro}{\ifvtex}
+% Create and set the switch. \cs{newif} initializes the
+% switch with \cs{iffalse}.
+% \begin{macrocode}
+\ifvtex@newif\ifvtex
+% \end{macrocode}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname VTeXversion\endcsname\relax
+\else
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname OpMode\endcsname\relax
+ \else
+ \vtextrue
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Mode and GeX switches}
+%
+% \begin{macrocode}
+\ifvtex@newif\ifvtexdvi
+\ifvtex@newif\ifvtexpdf
+\ifvtex@newif\ifvtexps
+\ifvtex@newif\ifvtexhtml
+\ifvtex@newif\ifvtexgex
+\ifvtex
+ \ifcase\OpMode\relax
+ \vtexdvitrue
+ \or % 1
+ \vtexpdftrue
+ \or % 2
+ \vtexpstrue
+ \or % 3
+ \vtexpstrue
+ \or\or\or\or\or\or\or % 10
+ \vtexhtmltrue
+ \fi
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname gexmode\endcsname\relax
+ \else
+ \ifnum\gexmode>0 %
+ \vtexgextrue
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsection{Protocol entry}
+%
+% Log comment:
+% \begin{macrocode}
+\begingroup
+ \expandafter\ifx\csname PackageInfo\endcsname\relax
+ \def\x#1#2{%
+ \immediate\write-1{Package #1 Info: #2.}%
+ }%
+ \else
+ \let\x\PackageInfo
+ \expandafter\let\csname on@line\endcsname\empty
+ \fi
+ \x{ifvtex}{%
+ VTeX %
+ \ifvtex
+ in \ifvtexdvi DVI\fi
+ \ifvtexpdf PDF\fi
+ \ifvtexps PS\fi
+ \ifvtexhtml HTML\fi
+ \space mode %
+ with\ifvtexgex\else out\fi\space GeX %
+ \else
+ not %
+ \fi
+ detected%
+ }%
+\endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifvtex@AtEnd%
+%</package>
+% \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 ifvtex.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/ifvtex}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/ifvtex.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/ifvtex.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[\CTAN{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 ifvtex.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@{}}
+% ifvtex.sty & tex/generic/oberdiek/ifvtex.sty\\
+% ifvtex.pdf & doc/latex/oberdiek/ifvtex.pdf\\
+% test/ifvtex-test1.tex & doc/latex/oberdiek/test/ifvtex-test1.tex\\
+% ifvtex.dtx & source/latex/oberdiek/ifvtex.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk ifvtex.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{ifvtex.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 ifvtex.dtx
+%makeindex -s gind.ist ifvtex.idx
+%pdflatex ifvtex.dtx
+%makeindex -s gind.ist ifvtex.idx
+%pdflatex ifvtex.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{ifvtex.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='ifvtex'>
+ <name>ifvtex</name>
+ <caption>Detects use of VTeX and its facilities.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2001,2006-2008,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.6'/>
+ <description>
+ The package looks for VTeX and sets the switch <tt>\ifvtex</tt>.
+ In the presence of VTeX, the mode switches <tt>\ifvtexdvi</tt>,
+ <tt>\ifvtexpdf</tt> and <tt>\ifvtexps</tt> are set;
+ <tt>\ifvtexgex</tt> tells you whether GeX is operating.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/ifvtex.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/ifvtex.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2001/09/26 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.1}
+% \item
+% DTX framework.
+% \item
+% Undefined tests changed.
+% \end{Version}
+% \begin{Version}{2007/01/10 v1.2}
+% \item
+% Fix of the \cs{ProvidesPackage} description.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.3}
+% \item
+% Catcode section added.
+% \end{Version}
+% \begin{Version}{2008/11/04 v1.4}
+% \item
+% Bug fix: Mispelled \cs{OpMode} (found by Hideo Umeki).
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.5}
+% \item
+% Compatibility with ini\TeX.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.6}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/ifvtex.pdf b/macros/latex/contrib/oberdiek/ifvtex.pdf
new file mode 100644
index 0000000000..140b966b12
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ifvtex.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/infwarerr.dtx b/macros/latex/contrib/oberdiek/infwarerr.dtx
new file mode 100644
index 0000000000..ffc6c01b40
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/infwarerr.dtx
@@ -0,0 +1,1247 @@
+% \iffalse meta-comment
+%
+% File: infwarerr.dtx
+% Version: 2016/05/16 v1.4
+% Info: Providing info/warning/error messages
+%
+% Copyright (C) 2007, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 infwarerr.dtx
+% and the derived files
+% infwarerr.sty, infwarerr.pdf, infwarerr.ins, infwarerr.drv,
+% infwarerr-test1.tex, infwarerr-test2.tex,
+% infwarerr-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/infwarerr.dtx
+% CTAN:macros/latex/contrib/oberdiek/infwarerr.pdf
+%
+% Unpacking:
+% (a) If infwarerr.ins is present:
+% tex infwarerr.ins
+% (b) Without infwarerr.ins:
+% tex infwarerr.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{infwarerr.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If infwarerr.drv is present:
+% latex infwarerr.drv
+% (b) Without infwarerr.drv:
+% latex infwarerr.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 infwarerr.dtx
+% makeindex -s gind.ist infwarerr.idx
+% pdflatex infwarerr.dtx
+% makeindex -s gind.ist infwarerr.idx
+% pdflatex infwarerr.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/infwarerr.sty
+% TDS:doc/latex/oberdiek/infwarerr.pdf
+% TDS:doc/latex/oberdiek/test/infwarerr-test1.tex
+% TDS:doc/latex/oberdiek/test/infwarerr-test2.tex
+% TDS:doc/latex/oberdiek/test/infwarerr-test3.tex
+% TDS:source/latex/oberdiek/infwarerr.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: infwarerr
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2007, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 infwarerr.dtx
+and the derived files
+ infwarerr.sty, infwarerr.pdf, infwarerr.ins, infwarerr.drv,
+ infwarerr-test1.tex, infwarerr-test2.tex,
+ infwarerr-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{infwarerr.ins}{\from{infwarerr.dtx}{install}}%
+ \file{infwarerr.drv}{\from{infwarerr.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{infwarerr.sty}{\from{infwarerr.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{infwarerr-test1.tex}{\from{infwarerr.dtx}{test1}}%
+% \file{infwarerr-test2.tex}{\from{infwarerr.dtx}{test2}}%
+% \file{infwarerr-test3.tex}{\from{infwarerr.dtx}{test3}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{infwarerr.xml}{\from{infwarerr.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{* infwarerr.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `infwarerr.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{infwarerr.drv}%
+ [2016/05/16 v1.4 Providing info/warning/error messages (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{infwarerr.dtx}%
+\end{document}
+%</driver>
+% \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{infwarerr.drv}
+%
+% \title{The \xpackage{infwarerr} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides a complete set of macros for informations,
+% warnings and error messages with support for \plainTeX.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% Package \xpackage{infwarerr} defines the following set of commands,
+% given as pseudo regular expression:
+% \begin{quote}
+% \verb+\@(Package|Class)(Info|InfoNoLine|Warning|WarningNoLine|Error)+^^A
+% \kern-\rightmargin
+% \end{quote}
+% The first argument is the package or class in question. The second
+% argument contains the message text. \cs{MessageBreak} is supported.
+% In case of error messages, the third argument contains the help
+% text. Supported are \LaTeX's message texts \cs{@ehc}:
+% \begin{quote}
+% |Try typing <return> to proceed|\\
+% |If that doesn't work, type X <return> to quit.|
+% \end{quote}
+% and \cs{@ehd}:
+% \begin{quote}
+% |You're in trouble here. Try typing <return> to proceed|\\
+% |If that doesn't work, type X <return> to quit.|
+% \end{quote}
+%
+% The package is intended for macro writers that want to write
+% code that works for both \LaTeX\ and \plainTeX. If \LaTeX\ is
+% detected, then the macros of this package will only be wrappers
+% for \LaTeX's macros. Otherwise \LaTeX's macros will be mimicked
+% for use with \plainTeX.
+%
+% \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@infwarerr.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{infwarerr}{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@infwarerr.sty\endcsname
+\ProvidesPackage{infwarerr}%
+ [2016/05/16 v1.4 Providing info/warning/error messages (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 InfWarErr@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\InfWarErr@AtEnd{%
+ \InfWarErr@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{94}{7}% ^
+\edef\InfWarErr@AtEnd{\InfWarErr@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{\LaTeX\ detection}
+%
+% \begin{macrocode}
+\begingroup
+ \let\x=Y%
+ \def\check#1{%
+ \@check{Generic}{#1}%
+ \@check{Package}{#1}%
+ \@check{Class}{#1}%
+ }%
+ \def\@check#1#2{%
+ \expandafter\ifx\csname #1#2\endcsname\relax
+ \let\x=N%
+ \fi
+ }%
+ \check{Info}%
+ \check{Warning}%
+ \check{Error}%
+ \@check{Package}{WarningNoLine}%
+ \@check{Class}{WarningNoLine}%
+ \@check{}{@ehc}%
+ \@check{}{@ehd}%
+\expandafter\endgroup
+\ifx\x Y%
+% \end{macrocode}
+%
+% \subsection{Version for \LaTeX}
+%
+% \begin{macro}{\@PackageInfo}
+% \begin{macrocode}
+ \let\@PackageInfo\PackageInfo
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@PackageInfoNoLine}
+% \begin{macrocode}
+ \def\@PackageInfoNoLine#1#2{%
+ \PackageInfo{#1}{#2\@gobble}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassInfo}
+% \begin{macrocode}
+ \let\@ClassInfo\ClassInfo
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassInfoNoLine}
+% \begin{macrocode}
+ \def\@ClassInfoNoLine#1#2{%
+ \ClassInfo{#1}{#2\@gobble}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@PackageWarning}
+% \begin{macrocode}
+ \let\@PackageWarning\PackageWarning
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@PackageWarningNoLine}
+% \begin{macrocode}
+ \let\@PackageWarningNoLine\PackageWarningNoLine
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassWarning}
+% \begin{macrocode}
+ \let\@ClassWarning\ClassWarning
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassWarningNoLine}
+% \begin{macrocode}
+ \let\@ClassWarningNoLine\ClassWarningNoLine
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@PackageError}
+% \begin{macrocode}
+ \let\@PackageError\PackageError
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassError}
+% \begin{macrocode}
+ \let\@ClassError\ClassError
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \expandafter\InfWarErr@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Version for \plainTeX}
+%
+% \begin{macro}{\InfWarErr@online}
+% \begin{macrocode}
+\begingroup\expandafter\endgroup
+\ifcase\expandafter\ifx\csname inputlineno\endcsname\relax
+ 0 %
+ \else
+ \ifnum\inputlineno<0 %
+ 0 %
+ \else
+ 1 %
+ \fi
+ \fi
+ \def\InfWarErr@online{}%
+\else
+ \def\InfWarErr@online{ on input line \the\inputlineno}%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InfWarErr@protected}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname protected\endcsname\relax
+ \def\InfWarErr@protected{}%
+\else
+ \let\InfWarErr@protected\protected
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InfWarErr@unused}
+% \begin{macrocode}
+\chardef\InfWarErr@unused=16 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InfWarErr@ehc}
+% \begin{macrocode}
+\def\InfWarErr@ehc{%
+ Try typing \space <return> \space to proceed.\MessageBreak
+ If that doesn't work, type \space X <return> \space to quit.%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InfWarErr@ehd}
+% \begin{macrocode}
+\def\InfWarErr@ehd{%
+ You're in trouble here. \space\@ehc
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InfWarErr@GenericInfo}
+% \begin{macrocode}
+\InfWarErr@protected\def\InfWarErr@GenericInfo#1#2{%
+ \begingroup
+ \let\on@line\InfWarErr@online
+ \long\def\@gobble##1{}%
+ \def\space{ }%
+ \def\@spaces{\space\space\space\space}%
+ \def\MessageBreak{^^J#1}%
+ \newlinechar=10 %
+ \escapechar=92 %
+ \immediate\write-1{#2\on@line.}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InfWarErr@GenericWarning}
+% \begin{macrocode}
+\InfWarErr@protected\def\InfWarErr@GenericWarning#1#2{%
+ \begingroup
+ \let\on@line\InfWarErr@online
+ \long\def\@gobble##1{}%
+ \def\space{ }%
+ \def\@spaces{\space\space\space\space}%
+ \def\MessageBreak{^^J#1}%
+ \newlinechar=10 %
+ \escapechar=92 %
+ \immediate\write\InfWarErr@unused{^^J#2\on@line.^^J}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InfWarErr@GenericError}
+% Old \TeX\ versions below 3.141 where |^^J| is not working
+% as newline in error message and help texts are not supported.
+% \begin{macrocode}
+\InfWarErr@protected\def\InfWarErr@GenericError#1#2#3#4{%
+ \begingroup
+ \immediate\write\InfWarErr@unused{}%
+ \def\space{ }%
+ \def\@spaces{\space\space\space\space}%
+ \let\@ehc\InfWarErr@ehc
+ \let\@ehd\InfWarErr@ehd
+ \let\on@line\InfWarErr@online
+ \def\MessageBreak{^^J}%
+ \newlinechar=10 %
+ \escapechar=92 %
+ \edef\InfWarErr@help{\noexpand\errhelp{#4}}%
+ \InfWarErr@help
+ \def\MessageBreak{^^J#1}%
+ \errmessage{%
+ #2.^^J^^J%
+ #3^^J%
+ Type \space H <return> \space for immediate help.^^J ...^^J%
+ }%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@PackageInfo}
+% \begin{macrocode}
+\def\@PackageInfo#1#2{%
+ \InfWarErr@GenericInfo{%
+ (#1) \@spaces\@spaces\@spaces
+ }{%
+ Package #1 Info: #2%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@PackageInfoNoLine}
+% \begin{macrocode}
+\def\@PackageInfoNoLine#1#2{%
+ \@PackageInfo{#1}{#2\@gobble}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassInfo}
+% \begin{macrocode}
+\def\@ClassInfo#1#2{%
+ \InfWarErr@GenericInfo{%
+ (#1) \space\space\@spaces\@spaces
+ }{%
+ Class #1 Info: #2%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassInfoNoLine}
+% \begin{macrocode}
+\def\@ClassInfoNoLine#1#2{%
+ \@ClassInfo{#1}{#2\@gobble}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@PackageWarning}
+% \begin{macrocode}
+\def\@PackageWarning#1#2{%
+ \InfWarErr@GenericWarning{%
+ (#1)\@spaces\@spaces\@spaces\@spaces
+ }{%
+ Package #1 Warning: #2%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@PackageWarningNoLine}
+% \begin{macrocode}
+\def\@PackageWarningNoLine#1#2{%
+ \@PackageWarning{#1}{#2\@gobble}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassWarning}
+% \begin{macrocode}
+\def\@ClassWarning#1#2{%
+ \InfWarErr@GenericWarning{%
+ (#1) \space\@spaces\@spaces\@spaces
+ }{%
+ Class #1 Warning: #2%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassWarningNoLine}
+% \begin{macrocode}
+\def\@ClassWarningNoLine#1#2{%
+ \@ClassWarning{#1}{#2\@gobble}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@PackageError}
+% \begin{macrocode}
+\def\@PackageError#1#2#3{%
+ \InfWarErr@GenericError{%
+ (#1)\@spaces\@spaces\@spaces\@spaces
+ }{%
+ Package #1 Error: #2%
+ }{%
+ See the #1 package documentation for explanation.%
+ }{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ClassError}
+% \begin{macrocode}
+\def\@ClassError#1#2#3{%
+ \InfWarErr@GenericError{%
+ (#1) \space\@spaces\@spaces\@spaces
+ }{%
+ Class #1 Error: #2%
+ }{%
+ See the #1 class documentation for explanation.%
+ }{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\InfWarErr@AtEnd%
+%</package>
+% \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 infwarerr.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \begin{macrocode}
+%<*test2>
+\let\PackageInfo\relax
+\input infwarerr.sty\relax
+\let\OrgWrite\write
+\chardef\WriteUnused=16 %
+\def\msg#{\immediate\OrgWrite\WriteUnused}
+\msg{File: infwarerr-test2.tex 2016/05/16 v1.4 Test file for plain-TeX}
+\catcode64=11 %
+%</test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test3>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{infwarerr-test3.tex}[2016/05/16 v1.4 Test file for LaTeX]
+\RequirePackage{infwarerr}[2016/05/16]
+\makeatletter
+\let\OrgWrite\write
+\chardef\WriteUnused=\@unused
+\def\msg#{\immediate\OrgWrite\WriteUnused}
+%</test3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test2|test3>
+\def\pkgname{PACKAGE}
+\def\clsname{CLASS}
+\def\msgtext{MESSAGE\MessageBreak SECOND LINE}
+\def\hlptext{HELP\MessageBreak SECOND LINE}
+
+\let\OrgWrite\write
+\let\OrgErrMessage\errmessage
+
+\def\write#1#{%
+ \@write{#1}%
+}
+\def\@write#1#2{%
+ \OrgWrite#1{#2}%
+ \xdef\WriteNum{\number#1}%
+ \xdef\WriteText{#2}%
+}
+\def\TestFailed#1#2{%
+ \OrgErrMessage{Test (\string#1) failed: #2}%
+}
+\def\TestWrite#1#2#3{%
+ \ifnum\WriteNum=#2\relax
+ \else
+ \TestFailed#1{write stream number: \WriteNum <> #2}%
+ \fi
+ \begingroup
+ \let~\space
+ \edef\TestString{#3}%
+ \ifx\WriteText\TestString
+ \else
+ \msg{}%
+ \msg{[\WriteText]}%
+ \msg{<>}%
+ \msg{[#3]}% hash-ok
+ \TestFailed#1{write text}%
+ \fi
+ \endgroup
+}
+\newtoks\ErrHelpToks
+\def\errmessage#1{%
+ \global\ErrHelpToks=\expandafter{\the\errhelp}%
+ \msg{**************** error message ****************}%
+ \msg{! #1}%
+ \msg{**************** help message *****************}%
+ \msg{\the\errhelp}%
+ \msg{***********************************************}%
+ \xdef\ErrMessage{! #1}%
+}
+\def\TestInfo{%
+ \@PackageInfo\pkgname\msgtext
+ \TestWrite\@PackageInfo{-1}{%
+ Package PACKAGE Info: MESSAGE^^J%
+ (PACKAGE)~~~~~~~~~~~~~SECOND LINE on input line \the\inputlineno.%
+ }%
+ \@PackageInfoNoLine\pkgname\msgtext
+ \TestWrite\@PackageInfoNoLine{-1}{%
+ Package PACKAGE Info: MESSAGE^^J%
+ (PACKAGE)~~~~~~~~~~~~~SECOND LINE.%
+ }%
+ \@ClassInfo\clsname\msgtext
+ \TestWrite\@ClassInfo{-1}{%
+ Class CLASS Info: MESSAGE^^J%
+ (CLASS)~~~~~~~~~~~SECOND LINE on input line \the\inputlineno.%
+ }%
+ \@ClassInfoNoLine\clsname\msgtext
+ \TestWrite\@ClassInfoNoLine{-1}{%
+ Class CLASS Info: MESSAGE^^J%
+ (CLASS)~~~~~~~~~~~SECOND LINE.%
+ }%
+}
+\def\TestWarning{%
+ \@PackageWarning\pkgname\msgtext
+ \TestWrite\@PackageWarning\WriteUnused{%
+ ^^J%
+ Package PACKAGE Warning: MESSAGE^^J%
+ (PACKAGE)~~~~~~~~~~~~~~~~SECOND LINE on input line \the\inputlineno.%
+ ^^J%
+ }%
+ \@PackageWarningNoLine\pkgname\msgtext
+ \TestWrite\@PackageWarningNoLine\WriteUnused{%
+ ^^J%
+ Package PACKAGE Warning: MESSAGE^^J%
+ (PACKAGE)~~~~~~~~~~~~~~~~SECOND LINE.%
+ ^^J%
+ }%
+ \@ClassWarning\clsname\msgtext
+ \TestWrite\@ClassWarning\WriteUnused{%
+ ^^J%
+ Class CLASS Warning: MESSAGE^^J%
+ (CLASS)~~~~~~~~~~~~~~SECOND LINE on input line \the\inputlineno.%
+ ^^J%
+ }%
+ \@ClassWarningNoLine\clsname\msgtext
+ \TestWrite\@ClassWarningNoLine\WriteUnused{%
+ ^^J%
+ Class CLASS Warning: MESSAGE^^J%
+ (CLASS)~~~~~~~~~~~~~~SECOND LINE.%
+ ^^J%
+ }%
+}
+\def\TestError{%
+%<test3> \let\write\OrgWrite
+%<test3> \def\plaindots{}
+%<test2> \def\plaindots{.^^J ...^^J}
+ \@PackageError\pkgname\msgtext\hlptext
+ \@TestError\@PackageError{%
+ ! Package PACKAGE Error: MESSAGE^^J%
+ (PACKAGE)~~~~~~~~~~~~~~~~SECOND LINE.^^J%
+ ^^J%
+ See the PACKAGE package documentation for explanation.^^J%
+ Type~~H <return>~~for immediate help\plaindots
+ }{%
+ HELP^^J%
+ SECOND LINE%
+ }%
+ \@ClassError\clsname\msgtext\hlptext
+ \@TestError\@ClassError{%
+ ! Class CLASS Error: MESSAGE^^J%
+ (CLASS)~~~~~~~~~~~~~~SECOND LINE.^^J%
+ ^^J%
+ See the CLASS class documentation for explanation.^^J%
+ Type~~H <return>~~for immediate help\plaindots
+ }{%
+ HELP^^J%
+ SECOND LINE%
+ }%
+ \@PackageError\pkgname\msgtext\@ehc
+ \@TestError\@PackageError{%
+ ! Package PACKAGE Error: MESSAGE^^J%
+ (PACKAGE)~~~~~~~~~~~~~~~~SECOND LINE.^^J%
+ ^^J%
+ See the PACKAGE package documentation for explanation.^^J%
+ Type~~H <return>~~for immediate help\plaindots
+ }{%
+ Try typing~~<return>~~to proceed.^^J%
+ If that doesn't work, type~~X <return>~~to quit.%
+ }%
+ \@PackageError\pkgname\msgtext\@ehd
+ \@TestError\@PackageError{%
+ ! Package PACKAGE Error: MESSAGE^^J%
+ (PACKAGE)~~~~~~~~~~~~~~~~SECOND LINE.^^J%
+ ^^J%
+ See the PACKAGE package documentation for explanation.^^J%
+ Type~~H <return>~~for immediate help\plaindots
+ }{%
+ You're in trouble here.~~Try typing~~<return>~~to proceed.^^J%
+ If that doesn't work, type~~X <return>~~to quit.%
+ }%
+}
+\def\@TestError#1#2#3{%
+ \begingroup
+ \let~\space
+ \edef\x{#2}%
+%<test3> \@onelevel@sanitize\x
+%<test3> \@onelevel@sanitize\ErrMessage
+ \ifx\x\ErrMessage
+ \else
+ \msg{}%
+ \msg{[\ErrMessage]}%
+ \msg{<>}%
+ \msg{[\x]}%
+ \TestFailed#1{errmessage text}%
+ \fi
+ \edef\x{\the\ErrHelpToks}%
+ \edef\y{#3}%
+ \ifx\x\y
+ \else
+ \msg{}%
+ \msg{[\the\ErrHelpToks]}%
+ \msg{<>}%
+ \msg{[\y]}%
+ \TestFailed#1{errhelp text}%
+ \fi
+ \endgroup
+}
+\TestInfo
+\TestWarning
+\TestError
+%</test2|test3>
+%<test2>\end
+%<test3>\@@end
+% \end{macrocode}
+%
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/infwarerr}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/infwarerr.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/infwarerr.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[\CTAN{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 infwarerr.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@{}}
+% infwarerr.sty & tex/generic/oberdiek/infwarerr.sty\\
+% infwarerr.pdf & doc/latex/oberdiek/infwarerr.pdf\\
+% test/infwarerr-test1.tex & doc/latex/oberdiek/test/infwarerr-test1.tex\\
+% test/infwarerr-test2.tex & doc/latex/oberdiek/test/infwarerr-test2.tex\\
+% test/infwarerr-test3.tex & doc/latex/oberdiek/test/infwarerr-test3.tex\\
+% infwarerr.dtx & source/latex/oberdiek/infwarerr.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk infwarerr.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{infwarerr.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 infwarerr.dtx
+%makeindex -s gind.ist infwarerr.idx
+%pdflatex infwarerr.dtx
+%makeindex -s gind.ist infwarerr.idx
+%pdflatex infwarerr.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{infwarerr.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='infwarerr'>
+ <name>infwarerr</name>
+ <caption>Complete set of information/warning/error messages.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ This package provides a complete set of macros for information,
+ warning and error messages. Under LaTeX, the commands are
+ wrappers for the corresponding LaTeX commands; under Plain TeX
+ they are also available as complete implementations.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/infwarerr.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/infwarerr.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/04/26 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/06/14 v1.1}
+% \item
+% Small fixes.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.2}
+% \item
+% Catcode section extended.
+% \end{Version}
+% \begin{Version}{2010/04/08 v1.3}
+% \item
+% Ensure \cs{escapechar}=92 (backslash) for infos/warnings/errors.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/infwarerr.pdf b/macros/latex/contrib/oberdiek/infwarerr.pdf
new file mode 100644
index 0000000000..e61e4971f9
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/infwarerr.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/inputenx.dtx b/macros/latex/contrib/oberdiek/inputenx.dtx
new file mode 100644
index 0000000000..8f7f6ddfeb
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/inputenx.dtx
@@ -0,0 +1,12193 @@
+% \iffalse meta-comment
+%
+% File: inputenx.dtx
+% Version: 2016/05/16 v1.11
+% Info: Enhanced input encoding handling
+%
+% Copyright (C) 2006-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file inputenx.dtx
+% and the derived files
+% inputenx.sty, inputenx.pdf, inputenx.ins, inputenx.drv, ix-alias.def,
+% ix-math.def, ix-name.def, ix-slot.def, ix-uc.def,
+% ix-utf8enc.dfu, x-ascii.def, x-verbatim.def, x-atarist.def,
+% x-iso-8859-1.def, x-iso-8859-2.def, x-iso-8859-3.def,
+% x-iso-8859-4.def, x-iso-8859-5.def, x-iso-8859-8.def,
+% x-iso-8859-9.def, x-iso-8859-10.def, x-iso-8859-13.def,
+% x-iso-8859-14.def, x-iso-8859-15.def, x-iso-8859-16.def,
+% x-cp437.def, x-cp850.def, x-cp852.def, x-cp855.def,
+% x-cp858.def, x-cp865.def, x-cp866.def, x-cp1250.def,
+% x-cp1251.def, x-cp1252.def, x-cp1255.def, x-cp1257.def,
+% x-dec-mcs.def, x-koi8-r.def, x-mac-centeuro.def,
+% x-mac-cyrillic.def, x-mac-roman.def, x-nextstep.def,
+% inputenx-licrcmds.txt, inputenx-utf8enc.txt.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/inputenx.dtx
+% CTAN:macros/latex/contrib/oberdiek/inputenx.pdf
+%
+% Unpacking:
+% (a) If inputenx.ins is present:
+% tex inputenx.ins
+% (b) Without inputenx.ins:
+% tex inputenx.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{inputenx.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If inputenx.drv is present:
+% latex inputenx.drv
+% (b) Without inputenx.drv:
+% latex inputenx.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 inputenx.dtx
+% makeindex -s gind.ist inputenx.idx
+% pdflatex inputenx.dtx
+% makeindex -s gind.ist inputenx.idx
+% pdflatex inputenx.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/inputenx.sty
+% TDS:tex/latex/oberdiek/ix-alias.def
+% TDS:tex/latex/oberdiek/ix-math.def
+% TDS:tex/latex/oberdiek/ix-name.def
+% TDS:tex/latex/oberdiek/ix-slot.def
+% TDS:tex/latex/oberdiek/ix-uc.def
+% TDS:tex/latex/oberdiek/ix-utf8enc.dfu
+% TDS:tex/latex/oberdiek/x-ascii.def
+% TDS:tex/latex/oberdiek/x-verbatim.def
+% TDS:tex/latex/oberdiek/x-atarist.def
+% TDS:tex/latex/oberdiek/x-iso-8859-1.def
+% TDS:tex/latex/oberdiek/x-iso-8859-2.def
+% TDS:tex/latex/oberdiek/x-iso-8859-3.def
+% TDS:tex/latex/oberdiek/x-iso-8859-4.def
+% TDS:tex/latex/oberdiek/x-iso-8859-5.def
+% TDS:tex/latex/oberdiek/x-iso-8859-8.def
+% TDS:tex/latex/oberdiek/x-iso-8859-9.def
+% TDS:tex/latex/oberdiek/x-iso-8859-10.def
+% TDS:tex/latex/oberdiek/x-iso-8859-13.def
+% TDS:tex/latex/oberdiek/x-iso-8859-14.def
+% TDS:tex/latex/oberdiek/x-iso-8859-15.def
+% TDS:tex/latex/oberdiek/x-iso-8859-16.def
+% TDS:tex/latex/oberdiek/x-cp437.def
+% TDS:tex/latex/oberdiek/x-cp850.def
+% TDS:tex/latex/oberdiek/x-cp852.def
+% TDS:tex/latex/oberdiek/x-cp855.def
+% TDS:tex/latex/oberdiek/x-cp858.def
+% TDS:tex/latex/oberdiek/x-cp865.def
+% TDS:tex/latex/oberdiek/x-cp866.def
+% TDS:tex/latex/oberdiek/x-cp1250.def
+% TDS:tex/latex/oberdiek/x-cp1251.def
+% TDS:tex/latex/oberdiek/x-cp1252.def
+% TDS:tex/latex/oberdiek/x-cp1255.def
+% TDS:tex/latex/oberdiek/x-cp1257.def
+% TDS:tex/latex/oberdiek/x-dec-mcs.def
+% TDS:tex/latex/oberdiek/x-koi8-r.def
+% TDS:tex/latex/oberdiek/x-mac-centeuro.def
+% TDS:tex/latex/oberdiek/x-mac-cyrillic.def
+% TDS:tex/latex/oberdiek/x-mac-roman.def
+% TDS:tex/latex/oberdiek/x-nextstep.def
+% TDS:doc/latex/oberdiek/inputenx.pdf
+% TDS:doc/latex/oberdiek/inputenx-licrcmds.txt
+% TDS:doc/latex/oberdiek/inputenx-utf8enc.txt
+% TDS:source/latex/oberdiek/inputenx.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: inputenx 2016/05/16 v1.11 Enhanced input encoding handling (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: inputenx
+Version: 2016/05/16 v1.11
+
+Copyright (C) 2006-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file inputenx.dtx
+and the derived files
+ inputenx.sty, inputenx.pdf, inputenx.ins, inputenx.drv, ix-alias.def,
+ ix-math.def, ix-name.def, ix-slot.def, ix-uc.def,
+ ix-utf8enc.dfu, x-ascii.def, x-verbatim.def, x-atarist.def,
+ x-iso-8859-1.def, x-iso-8859-2.def, x-iso-8859-3.def,
+ x-iso-8859-4.def, x-iso-8859-5.def, x-iso-8859-8.def,
+ x-iso-8859-9.def, x-iso-8859-10.def, x-iso-8859-13.def,
+ x-iso-8859-14.def, x-iso-8859-15.def, x-iso-8859-16.def,
+ x-cp437.def, x-cp850.def, x-cp852.def, x-cp855.def,
+ x-cp858.def, x-cp865.def, x-cp866.def, x-cp1250.def,
+ x-cp1251.def, x-cp1252.def, x-cp1255.def, x-cp1257.def,
+ x-dec-mcs.def, x-koi8-r.def, x-mac-centeuro.def,
+ x-mac-cyrillic.def, x-mac-roman.def, x-nextstep.def,
+ inputenx-licrcmds.txt, inputenx-utf8enc.txt.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{inputenx.ins}{\from{inputenx.dtx}{install}}%
+ \file{inputenx.drv}{\from{inputenx.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{inputenx.sty}{\from{inputenx.dtx}{package}}%
+ \file{ix-alias.def}{\from{inputenx.dtx}{alias}}%
+ \file{ix-math.def}{\from{inputenx.dtx}{math}}%
+ \file{ix-name.def}{\from{inputenx.dtx}{name}}%
+ \file{ix-slot.def}{\from{inputenx.dtx}{slot}}%
+ \file{ix-uc.def}{\from{inputenx.dtx}{uc}}%
+ \file{ix-utf8enc.dfu}{\from{inputenx.dtx}{dfu}}%
+ \file{x-ascii.def}{\from{inputenx.dtx}{ascii}}%
+ \file{x-verbatim.def}{\from{inputenx.dtx}{verbatim}}%
+ \file{x-atarist.def}{\from{inputenx.dtx}{atarist}}%
+ \file{x-iso-8859-1.def}{\from{inputenx.dtx}{iso-8859-1}}%
+ \file{x-iso-8859-2.def}{\from{inputenx.dtx}{iso-8859-2}}%
+ \file{x-iso-8859-3.def}{\from{inputenx.dtx}{iso-8859-3}}%
+ \file{x-iso-8859-4.def}{\from{inputenx.dtx}{iso-8859-4}}%
+ \file{x-iso-8859-5.def}{\from{inputenx.dtx}{iso-8859-5}}%
+ \file{x-iso-8859-8.def}{\from{inputenx.dtx}{iso-8859-8}}%
+ \file{x-iso-8859-9.def}{\from{inputenx.dtx}{iso-8859-9}}%
+ \file{x-iso-8859-10.def}{\from{inputenx.dtx}{iso-8859-10}}%
+ \file{x-iso-8859-13.def}{\from{inputenx.dtx}{iso-8859-13}}%
+ \file{x-iso-8859-14.def}{\from{inputenx.dtx}{iso-8859-14}}%
+ \file{x-iso-8859-15.def}{\from{inputenx.dtx}{iso-8859-15}}%
+ \file{x-iso-8859-16.def}{\from{inputenx.dtx}{iso-8859-16}}%
+ \file{x-cp437.def}{\from{inputenx.dtx}{cp437}}%
+ \file{x-cp850.def}{\from{inputenx.dtx}{cp850}}%
+ \file{x-cp852.def}{\from{inputenx.dtx}{cp852}}%
+ \file{x-cp855.def}{\from{inputenx.dtx}{cp855}}%
+ \file{x-cp858.def}{\from{inputenx.dtx}{cp858}}%
+ \file{x-cp865.def}{\from{inputenx.dtx}{cp865}}%
+ \file{x-cp866.def}{\from{inputenx.dtx}{cp866}}%
+ \file{x-cp1250.def}{\from{inputenx.dtx}{cp1250}}%
+ \file{x-cp1251.def}{\from{inputenx.dtx}{cp1251}}%
+ \file{x-cp1252.def}{\from{inputenx.dtx}{cp1252}}%
+ \file{x-cp1255.def}{\from{inputenx.dtx}{cp1255}}%
+ \file{x-cp1257.def}{\from{inputenx.dtx}{cp1257}}%
+ \file{x-dec-mcs.def}{\from{inputenx.dtx}{dec-mcs}}%
+ \file{x-koi8-r.def}{\from{inputenx.dtx}{koi8-r}}%
+ \file{x-mac-centeuro.def}{\from{inputenx.dtx}{mac-centeuro}}%
+ \file{x-mac-cyrillic.def}{\from{inputenx.dtx}{mac-cyrillic}}%
+ \file{x-mac-roman.def}{\from{inputenx.dtx}{mac-roman}}%
+ \file{x-nextstep.def}{\from{inputenx.dtx}{nextstep}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{inputenx-licrcmds.txt}{\from{inputenx.dtx}{licrcmds}}%
+ \file{inputenx-utf8enc.txt}{\from{inputenx.dtx}{dfudoc}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{inputenx.xml}{\from{inputenx.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{* inputenx.sty, ix-alias.def, ix-math.def, ix-name.def,}
+\Msg{* ix-slot.def, ix-uc.def, ix-utf8enc.dfu, x-ascii.def,}
+\Msg{* x-verbatim.def, x-atarist.def, x-iso-8859-1.def,}
+\Msg{* x-iso-8859-2.def, x-iso-8859-3.def, x-iso-8859-4.def,}
+\Msg{* x-iso-8859-5.def, x-iso-8859-8.def, x-iso-8859-9.def,}
+\Msg{* x-iso-8859-10.def, x-iso-8859-13.def, x-iso-8859-14.def,}
+\Msg{* x-iso-8859-15.def, x-iso-8859-16.def, x-cp437.def,}
+\Msg{* x-cp850.def, x-cp852.def, x-cp855.def, x-cp858.def,}
+\Msg{* x-cp865.def, x-cp866.def, x-cp1250.def, x-cp1251.def,}
+\Msg{* x-cp1252.def, x-cp1255.def, x-cp1257.def, x-dec-mcs.def,}
+\Msg{* x-koi8-r.def, x-mac-centeuro.def, x-mac-cyrillic.def,}
+\Msg{* x-mac-roman.def, x-nextstep.def}
+\Msg{*}
+\Msg{* To produce the documentation run the file `inputenx.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{inputenx.drv}%
+ [2016/05/16 v1.11 Enhanced input encoding handling (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{longtable}
+\begin{document}
+ \DocInput{inputenx.dtx}%
+\end{document}
+%</driver>
+% \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{inputenx.drv}
+%
+% \title{The \xpackage{inputenx} package}
+% \date{2016/05/16 v1.11}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides input encodings using
+% standard mappings and covers nearly all slots. Thus it
+% serves as more uptodate replacement for package \xpackage{inputenc}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% The original goal was to have a package that allows the selection and
+% defining input encodings by the characters in question itself.
+%
+% The first stage with encoding definition files is implemented.
+% Encoding definition files are provided with the following properties
+% in comparison to \LaTeX's ones:
+% \begin{itemize}
+% \item More uptodate and closer to the standards.
+% Updating \LaTeX\ is difficult because of compatibility issues.
+% However this project uses fresh encoding file names, prefixed
+% with \xfile{x-}.
+% \item Consequent use of \cs{DeclareInputText} as suggested
+% by the second edition of ``The \LaTeX\ Companion'' \cite{ltc}.
+% That means that the deprecated \cs{DeclareInputMath} is not
+% longer used. Instead package \xpackage{inpmath} is supported by
+% providing declarations using \cs{DeclareMathMeaning}.
+% \item Encoding names can also be given by various alias names.
+% \end{itemize}
+%
+% The second stage that allows selection of input encoding
+% by mappings between the characters and their glyph names
+% is implemented by package \xpackage{selinput} \cite{selinput}.
+%
+% \subsection{Definition files}
+%
+% The input encoding definition files are prefixed with \verb|x-|
+% to distinguish them from the names package \xpackage{inputenc} uses.
+% The definition files of \xpackage{inputenx} may also be used
+% by package \xpackage{inputenc}, eg.:
+% \begin{quote}
+% \verb|\usepackage[x-iso-8859-1]{inputenc}|
+% \end{quote}
+% As option for package \xpackage{inputenx} the prefix may be dropped:
+% \begin{quote}
+% \verb|\usepackage[iso-8859-1]{inputenx}|
+% \end{quote}
+% The following definition files are available. The second column
+% lists alternative option names for \xpackage{inputenx}:
+% \begin{longtable}{@{}lll@{}}
+% \xfile{x-ascii.def} & \xoption{ascii}, \xoption{us-ascii}, & ASCII encoding,\\
+% & \xoption{clean7bit}, \xoption{ascii-print},
+% & 8bit characters disabled\\
+% & \xoption{ascii-printable} & \\
+% \xfile{x-atarist.def} & \xoption{atarist}, \xoption{atari} & AtariST encoding\\
+% \xfile{x-cp437.def} & \xoption{cp437}, \xoption{cp437de} & Code page 437\\
+% \xfile{x-cp850.def} & \xoption{cp850} & Code page 850\\
+% \xfile{x-cp852.def} & \xoption{cp852} & Code page 852\\
+% \xfile{x-cp855.def} & \xoption{cp855} & Code page 855\\
+% \xfile{x-cp858.def} & \xoption{cp858} & Code page 858\\
+% \xfile{x-cp865.def} & \xoption{cp865} & Code page 865\\
+% \xfile{x-cp866.def} & \xoption{cp866} & Code page 866\\
+% \xfile{x-cp1250.def} & \xoption{cp1250} & Code page 1250\\
+% \xfile{x-cp1251.def} & \xoption{cp1251} & Code page 1251\\
+% \xfile{x-cp1252.def} & \xoption{cp1252}, \xoption{ansinew} & Code page 1252\\
+% \xfile{x-cp1255.def} & \xoption{cp1255} & Code page 1255\\
+% \xfile{x-cp1257.def} & \xoption{cp1257} & Code page 1257\\
+% \xfile{x-dec-mcs.def} & \xoption{dec-mcs}, \xoption{decmulti} & DEC Multinational\\
+% \xfile{x-koi8-r.def} & \xoption{koi8-r} & KOI8-R (RFC1489)\\
+% \xfile{x-iso-8859-1.def} & \xoption{iso-8859-1}, \xoption{latin1} & ISO-8859-1\\
+% \xfile{x-iso-8859-2.def} & \xoption{iso-8859-2}, \xoption{latin2} & ISO-8859-2\\
+% \xfile{x-iso-8859-3.def} & \xoption{iso-8859-3}, \xoption{latin3} & ISO-8859-3\\
+% \xfile{x-iso-8859-4.def} & \xoption{iso-8859-4}, \xoption{latin4} & ISO-8859-4\\
+% \xfile{x-iso-8859-5.def} & \xoption{iso-8859-5}, \xoption{iso88595} & ISO-8859-5\\
+% \xfile{x-iso-8859-9.def} & \xoption{iso-8859-9}, \xoption{latin5} & ISO-8859-9\\
+% \xfile{x-iso-8859-10.def} & \xoption{iso-8859-10}, \xoption{latin6} & ISO-8859-10\\
+% \xfile{x-iso-8859-13.def} & \xoption{iso-8859-13}, \xoption{latin7} & ISO-8859-13\\
+% \xfile{x-iso-8859-14.def} & \xoption{iso-8859-14}, \xoption{latin8} & ISO-8859-14\\
+% \xfile{x-iso-8859-15.def} & \xoption{iso-8859-15}, \xoption{latin9} & ISO-8859-15\\
+% \xfile{x-iso-8859-16.def} & \xoption{iso-8859-16}, \xoption{latin10} & ISO-8859-16\\
+% \xfile{x-mac-centeuro.def} & \xoption{mac-centeuro}, \xoption{mac-ce}, & MAC OS Central European\\
+% & \xoption{macce} & \\
+% \xfile{x-mac-cyrillic.def} & \xoption{mac-cyrillic}, \xoption{maccyr}, & MAC OS Cyrillic\\
+% & \xoption{mac-ukrainian}, \xoption{macukr} &\\
+% \xfile{x-mac-roman.def} & \xoption{mac-roman}, \xoption{applemac} & MAC OS Roman\\
+% \xfile{x-nextstep} & \xoption{nextstep}, \xoption{next} & NextStep Encoding\\
+% \xfile{x-verbatim} & \xoption{verbatim} & Characters with verbatim catcodes\\
+% \end{longtable}
+%
+% Some characters need extra packages:
+% \begin{description}
+% \item[Box drawings characters] are provided by package \xpackage{pmboxdraw}.
+% They are used by some older DOS code pages
+% (cp437, cp850, cp852, cp858, cp865).
+% \item[Cyrillic characters] need some setup (probably font encoding/package).
+% They are mapped to names that start with \cs{CYR}
+% (\cs{CYRYO}, \cs{CYRDJE}, \dots).
+% \item[Hebrew characters] need some setup (probably font encoding/package).
+% They are mapped to \cs{hebalef}, \cs{hebbet}, \dots
+% \item[U+2310 REVERSED NOT SIGN] is provided as \cs{textrevlogicalnot}
+% that uses \cs{reflectbox} from package \xpackage{graphics}.
+% \end{description}
+%
+% For the following characters I didn't find suitable LICR (\LaTeX\ Internal
+% Character Representation):
+% \begin{quote}
+%\begin{verbatim}
+%\DeclareUnicodeCharacter{200E}{}
+% % LEFT-TO-RIGHT MARK
+% % iso-8859-8[0xFD/253]
+%
+%\DeclareUnicodeCharacter{200F}{}
+% % RIGHT-TO-LEFT MARK
+% % iso-8859-8[0xFE/254]
+%
+%\DeclareUnicodeCharacter{2320}{}
+% % TOP HALF INTEGRAL
+% % cp437[0xF4/244] cp865[0xF4/244]
+%
+%\DeclareUnicodeCharacter{2321}{}
+% % BOTTOM HALF INTEGRAL
+% % cp437[0xF5/245] cp865[0xF5/245]
+%
+%\DeclareUnicodeCharacter{F8FF}{}
+% % <Private Use, Last>
+% % mac-roman[0xF0/240]
+%\end{verbatim}
+% \end{quote}
+%
+% \subsection{Unicode}
+%
+% File \xfile{ix-utf8enc.dfu} provides additions to \xpackage{inputenc}'s
+% file \xfile{utf8enc.dfu}. It can be loaded after \xfile{utf8.def},
+% for example:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage[utf8]{inputenc}% or package `inputenx'
+%\input{ix-utf8enc.dfu}
+%\end{verbatim}
+%\end{quote}
+%
+% \subsection{Verbatim}
+%
+% Encoding \xoption{verbatim} or file \xfile{x-verbatim.def} is a
+% special input encoding file. All characters supported by package
+% inputenc are made inactive with catcode 12 (other) suitable
+% for verbatim stuff. Example:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage{inputenx}[2011/02/08]
+%\usepackage{fancyvrb}
+%...
+%\begin{VerbatimOut}[codes={\InputEncoding{verbatim}}]{\jobname.tmp}
+% Text with 8 bit characters.
+%\end{VerbatimOut}
+%\end{verbatim}
+%\end{quote}
+%
+% \subsection{Math}
+%
+% The current philosophy of \LaTeX/package \xpackage{inputenc} is not to
+% declare characters for math only. Instead there is a experimental
+% package \xpackage{inpmath} that extends package \xpackage{inputenc},
+% to change the behaviour of input characters if used in math mode.
+% File \xfile{ix-math.def} provides some definitions of math characters.
+% Package option `math' loads package \xpackage{inpmath} and loads
+% file \xfile{ix-math.cfg}. If \xfile{ix-math.cfg} does not exist,
+% \xfile{ix-math.def} is loaded instead. (The file \xfile{ix-math.cfg}
+% may contain |\input{ix-math.def}|.)
+%
+% \subsection{Setting the input encoding}
+%
+% \subsubsection{Encoding as package option}
+%
+% All other package options are treated as encoding options.
+% Global options are ignored. First
+% The encoding name or one of its aliases can be given as
+% package option. First an alias is dereferenced and then the
+% real encoding name (base name of the encoding definition
+% file is passed to package \xpackage{inputenc}.
+% \cs{CurrentInputEncodingName} and \cs{CurrentInputEncodingOption}
+% are set, see below.
+%
+% \subsubsection{\cs{InputEncoding}}
+%
+% \begin{declcs}{InputEncoding} \M{encoding}
+% \end{declcs}
+% After package \xpackage{inputenx} is loaded an encoding can be set
+% or changed using \cs{InputEncoding}. Its \meta{encoding}
+% can be an encoding or alias name. This is similar to \cs{inputencoding}
+% of package \xpackage{inputenc}. That remembers the current encoding
+% in macro \cs{inputencodingname}. However \cs{InputEncoding}
+% uses remembers the encoding in two macros because of the
+% alias support:
+%
+% \begin{declcs}{CurrentInputEncodingName}\\
+% \cs{CurrentInputEncodingOption}
+% \end{declcs}
+% \cs{CurrentInputEncodingName} is the name of the encoding given
+% as option to \cs{usepackage} or as argument for \cs{InputEncoding}.
+% This name can also be an alias name.
+% The real encoding name (base file name of the encoding file) is
+% remembered in \cs{CurrentInputEncodingOption} (option means option for package
+% \xpackage{inputenc}).
+%
+% \subsubsection{Hooks}
+%
+% \begin{declcs}{BeforeInputEncoding} \M{code}\\
+% \cs{AfterInputEncoding} \M{code}
+% \end{declcs}
+% \cs{InputEncoding} supports two hooks that are called at the beginning
+% and the end after the encoding is set. \meta{code} is added to the
+% hooks by \cs{BeforeInputEncoding} or \cs{AfterInputEncoding}.
+%
+% \begin{sloppypar}
+% \begin{declcs}{InputEncodingNameOld}\\
+% \cs{InputEncodingOptionOld}\\
+% \cs{InputEncodingNew}
+% \end{declcs}
+% In the hooks the old encoding names are available as macros
+% \cs{InputEncodingNameOld} and \cs{InputEncodingOptionOld}.
+% They store the meaning of \cs{CurrentInputEncodingName}
+% and \cs{CurrentInputEncodingOption} before \cs{InputEncoding}.
+% \cs{InputEncodingNew} contains the new input encoding given
+% as argument for \cs{InputEncoding}. In \cs{BeforeInputEncoding}
+% this macro \cs{InputEncodingNew} can even be changed to a
+% better encoding name that will then be used to set the input
+% encoding.
+% \end{sloppypar}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{inputenx}%
+ [2016/05/16 v1.11 Enhanced input encoding handling (HO)]%
+% \end{macrocode}
+%
+% \subsection{Encoding names}
+%
+% \subsubsection{Record current encoding names}
+%
+% \begin{macro}{\CurrentInputEncodingName}
+% \begin{macrocode}
+\providecommand*{\CurrentInputEncodingName}{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CurrentInputEncodingOption}
+% \begin{macrocode}
+\providecommand*{\CurrentInputEncodingOption}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Catcode settings for file reading}
+%
+% \begin{macro}{\IEX@SetFileCatcodes}
+% \begin{macrocode}
+\def\IEX@SetFileCatcodes{%
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\^=7 %
+ \catcode`\@=11 %
+ \catcode`\~=\active
+ \catcode`\%=14 %
+ \catcode`\`=12 %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IEX@SaveFileCatcodes}
+% \begin{macro}{\IEX@RestoreFileCatcodes}
+% \begin{macrocode}
+\def\IEX@SaveFileCatcodes{%
+ \edef\IEX@RestoreFileCatcodes{%
+ \catcode`\noexpand\\=\the\catcode`\\\relax
+ \catcode`\noexpand\{=\the\catcode`\{\relax
+ \catcode`\noexpand\}=\the\catcode`\}\relax
+ \catcode`\noexpand\#=\the\catcode`\#\relax
+ \catcode`\noexpand\^=\the\catcode`\^\relax
+ \catcode`\noexpand\@=\the\catcode`\@\relax
+ \catcode`\noexpand\~=\the\catcode`\~\relax
+ \catcode`\noexpand\%=\the\catcode`\%\relax
+ \catcode`\noexpand\`=\the\catcode`\`\relax
+ \catcode`\noexpand\<=\the\catcode`\<\relax
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Aliases for encoding names}
+%
+% \begin{macrocode}
+\def\IEX@LookupEncoding#1{%
+ \edef\CurrentInputEncodingName{#1}%
+ \@onelevel@sanitize\CurrentInputEncodingName
+ \let\CurrentInputEncodingOption\@empty
+ \@ifundefined{IEX@enc@\CurrentInputEncodingName}{%
+ \global\expandafter\let
+ \csname IEX@enc@\CurrentInputEncodingName\endcsname
+ \CurrentInputEncodingName
+ \IEX@DoLookup
+ }{}%
+ \edef\CurrentInputEncodingOption{%
+ \csname IEX@enc@\CurrentInputEncodingName\endcsname
+ }%
+ \ifx\CurrentInputEncodingOption\@empty
+ \PackageWarning{inputenx}{%
+ Encoding `\CurrentInputEncodingName' is not available%
+ \MessageBreak
+ and therefore ignored%
+ }%
+ \else
+ \IfFileExists{\CurrentInputEncodingOption.def}{%
+ \PackageInfo{inputenx}{%
+ Encoding name: \CurrentInputEncodingName\MessageBreak
+ Encoding file: \CurrentInputEncodingOption.def\MessageBreak
+ }%
+ }{%
+ \PackageError{inputenx}{%
+ Cannot load encoding `\CurrentInputEncodingName'.\MessageBreak
+ A valid encoding alias was not found and\MessageBreak
+ encoding file `\CurrentInputEncodingOption.def' does not exist%
+ }\@ehc
+ \global\expandafter\let
+ \csname IEX@enc@\CurrentInputEncodingName\endcsname\@empty
+ \let\CurrentInputEncodingName\@empty
+ \let\CurrentInputEncodingOption\@empty
+ }%
+ \fi
+}
+% \end{macrocode}
+% Encoding is in \cs{CurrentInputEncodingName}. Search the
+% alias file until an entry is found and define
+% |IEX@enc@\CurrentInputEncodingName|.
+% \begin{macrocode}
+\def\IEX@DoLookup{%
+ \begingroup
+ \IEX@SetFileCatcodes
+ \advance\endlinechar\@M
+ \IfFileExists{ix-alias.cfg}{%
+ \input{ix-alias.cfg}%
+ }{%
+ \input{ix-alias.def}%
+ }%
+ \advance\endlinechar-\@M
+ \endgroup
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\InputenxAlias#1#2{%
+ \edef\IEX@temp{#1}%
+ \@onelevel@sanitize\IEX@temp
+ \ifx\IEX@temp\CurrentInputEncodingName
+ \edef\IEX@temp{#2}%
+ \@onelevel@sanitize\IEX@temp
+ \IfFileExists{\IEX@temp.def}{%
+ \global\expandafter\let
+ \csname IEX@enc@\CurrentInputEncodingName\endcsname\IEX@temp
+ \expandafter\endinput
+ }{%
+ \PackageWarning{inputenx}{%
+ Missing encoding file `\IEX@temp.def'\MessageBreak
+ for encoding `\CurrentInputEncodingName', continuing%
+ \MessageBreak
+ with lookup search%
+ }%
+ }%
+ \fi
+}
+% \end{macrocode}
+%
+% \subsection{Package options}
+%
+% \subsubsection{Declare and process options}
+%
+% \begin{macrocode}
+\newif\ifIEX@math
+\DeclareOption{math}{\IEX@mathtrue}
+\let\IEX@enclist\@empty
+\DeclareOption*{%
+ \ifx\IEX@enclist\@empty
+ \let\IEX@enclist\CurrentOption
+ \else
+ \edef\IEX@enclist{\IEX@enclist,\CurrentOption}%
+ \fi
+}
+\ProcessOptions*
+% \end{macrocode}
+%
+% \subsubsection{Load \xpackage{inputenc} with encoding options}
+%
+% \begin{macrocode}
+\let\IEX@OptionList\@empty
+\@for\CurrentOption:=\IEX@enclist\do{%
+ \IEX@LookupEncoding\CurrentOption
+ \ifx\CurrentInputEncodingOption\@empty
+ \else
+ \edef\IEX@OptionList{%
+ \ifx\IEX@OptionList\@empty
+ \else
+ \IEX@OptionList,%
+ \fi
+ \CurrentInputEncodingOption
+ }%
+ \fi
+}
+\RequirePackage{inputenc}
+\@for\IEX@Option:=\IEX@OptionList\do{%
+ \inputencoding{\IEX@Option}%
+}
+% \end{macrocode}
+%
+% \subsubsection{\cs{InputEncoding}}
+%
+% \begin{macro}{\IEX@BeforeHook}
+% \begin{macrocode}
+\def\IEX@BeforeHook{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IEX@AfterHook}
+% \begin{macrocode}
+\def\IEX@AfterHook{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BeforeInputEncoding}
+% \begin{macrocode}
+\newcommand*{\BeforeInputEncoding}{%
+ \g@addto@macro\IEX@BeforeHook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AfterInputEncoding}
+% \begin{macrocode}
+\newcommand*{\AfterInputEncoding}{%
+ \g@addto@macro\IEX@AfterHook
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InputEncoding}
+% \cs{InputEncoding} is basically the same as \cs{inputencoding}
+% of package \xpackage{inputenc}. However aliases are supported.
+% \begin{macrocode}
+\newcommand*{\InputEncoding}[1]{%
+ \let\InputEncodingNameOld\CurrentInputEncodingName
+ \let\InputEncodingOptionOld\CurrentInputEncodingOption
+ \edef\InputEncodingNew{#1}%
+ \IEX@BeforeHook
+ \IEX@LookupEncoding\InputEncodingNew
+ \ifx\CurrentInputEncodingOption\@empty
+ \else
+ \IEX@SaveFileCatcodes
+ \IEX@SetFileCatcodes
+ \inputencoding{\CurrentInputEncodingOption}%
+ \IEX@RestoreFileCatcodes
+% \ifx\PassOptionsToPackage\@notprerr
+% \else
+% \expandafter\PassOptionsToPackage\expandafter{%
+% \CurrentInputEncodingOption
+% }{inputenc}%
+% \ifx\CurrentInputEncodingName\CurrentInputEncodingOption
+% \else
+% \expandafter\PassOptionsToPackage\expandafter{%
+% \CurrentInputEncodingName
+% }{inputenc}%
+% \fi
+% \fi
+ \fi
+ \IEX@AfterHook
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Option \xoption{math}}
+%
+% \begin{macrocode}
+\ifIEX@math
+ \RequirePackage{inpmath}%
+ \IfFileExists{ix-math.cfg}{%
+ \input{ix-math.cfg}%
+ }{%
+ \input{ix-math.def}%
+ }%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \subsection{Alias encoding file}
+%
+% \begin{macrocode}
+%<*alias>
+\ProvidesFile{ix-alias.def}[2016/05/16 v1.11 Alias list (inputenx)]
+% \end{macrocode}
+% The alias mechanism is also used to hide the prefix |x-|:
+% \begin{macrocode}
+\InputenxAlias{ascii}{x-ascii}
+\InputenxAlias{atarist}{x-atarist}
+\InputenxAlias{iso-8859-1}{x-iso-8859-1}
+\InputenxAlias{iso-8859-2}{x-iso-8859-2}
+\InputenxAlias{iso-8859-3}{x-iso-8859-3}
+\InputenxAlias{iso-8859-4}{x-iso-8859-4}
+\InputenxAlias{iso-8859-5}{x-iso-8859-5}
+\InputenxAlias{iso-8859-8}{x-iso-8859-8}
+\InputenxAlias{iso-8859-9}{x-iso-8859-9}
+\InputenxAlias{iso-8859-10}{x-iso-8859-10}
+\InputenxAlias{iso-8859-13}{x-iso-8859-13}
+\InputenxAlias{iso-8859-14}{x-iso-8859-14}
+\InputenxAlias{iso-8859-15}{x-iso-8859-15}
+\InputenxAlias{iso-8859-16}{x-iso-8859-16}
+\InputenxAlias{cp437}{x-cp437}
+\InputenxAlias{cp850}{x-cp850}
+\InputenxAlias{cp852}{x-cp852}
+\InputenxAlias{cp855}{x-cp855}
+\InputenxAlias{cp858}{x-cp858}
+\InputenxAlias{cp865}{x-cp865}
+\InputenxAlias{cp866}{x-cp866}
+\InputenxAlias{cp1250}{x-cp1250}
+\InputenxAlias{cp1251}{x-cp1251}
+\InputenxAlias{cp1252}{x-cp1252}
+\InputenxAlias{cp1255}{x-cp1255}
+\InputenxAlias{cp1257}{x-cp1257}
+\InputenxAlias{dec-mcs}{x-dec-mcs}
+\InputenxAlias{koi8-r}{x-koi8-r}
+\InputenxAlias{mac-centeuro}{x-mac-centeuro}
+\InputenxAlias{mac-cyrillic}{x-mac-cyrillic}
+\InputenxAlias{mac-roman}{x-mac-roman}
+\InputenxAlias{nextstep}{x-nextstep}
+% \end{macrocode}
+% Now the real aliases start:
+% \begin{macrocode}
+\InputenxAlias{ansinew}{x-cp1252}
+\InputenxAlias{applemac}{x-mac-roman}
+\InputenxAlias{ascii-print}{x-ascii}
+\InputenxAlias{ascii-printable}{x-ascii}
+\InputenxAlias{atari}{x-atarist}
+\InputenxAlias{clean7bit}{x-ascii}
+\InputenxAlias{cp437de}{x-cp437}
+\InputenxAlias{decmulti}{x-dec-mcs}
+\InputenxAlias{iso88595}{x-iso-8859-5}
+\InputenxAlias{latin1}{x-iso-8859-1}
+\InputenxAlias{latin10}{x-iso-8859-16}
+\InputenxAlias{latin2}{x-iso-8859-2}
+\InputenxAlias{latin3}{x-iso-8859-3}
+\InputenxAlias{latin4}{x-iso-8859-4}
+\InputenxAlias{latin5}{x-iso-8859-9}
+\InputenxAlias{latin6}{x-iso-8859-10}
+\InputenxAlias{latin7}{x-iso-8859-13}
+\InputenxAlias{latin8}{x-iso-8859-14}
+\InputenxAlias{latin9}{x-iso-8859-15}
+\InputenxAlias{mac-ce}{x-mac-centeuro}
+\InputenxAlias{mac-ukrainian}{x-mac-cyrillic}
+\InputenxAlias{macce}{x-mac-centeuro}
+\InputenxAlias{maccyr}{x-mac-cyrillic}
+\InputenxAlias{macukr}{x-mac-cyrillic}
+\InputenxAlias{next}{x-nextstep}
+\InputenxAlias{us-ascii}{x-ascii}
+% \end{macrocode}
+% \begin{macrocode}
+\InputenxAlias{verbatim}{x-verbatim}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</alias>
+% \end{macrocode}
+%
+% \subsection{Encoding files}
+%
+% \subsubsection{Encoding \xoption{ascii}}
+%
+% The encoding file \xfile{ascii.def} of package \xpackage{inputenc}
+% before 2006/03/04 v1.1b generate a unnecessary warning. Therefore
+% a separate variant is provided here.
+% \begin{macrocode}
+%<*ascii>
+\ProvidesFile{x-ascii.def}%
+ [2016/05/16 v1.11 Input encoding ascii (inputenx)]%
+\csname @inpenc@test\endcsname
+%</ascii>
+% \end{macrocode}
+% \subsubsection{Encoding \xoption{verbatim}}
+%
+% \begin{macrocode}
+%<*verbatim>
+\ProvidesFile{x-verbatim.def}%
+ [2016/05/16 v1.11 Input encoding verbatim (inputenx)]%
+\csname @inpenc@test\endcsname
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\def\IPX@VerbatimLoop#1#2{%
+ \@tempcnta#1\relax
+ \loop
+ \catcode\@tempcnta=12 %
+% \catcode\@tempcnta\active
+% \begingroup
+% \uccode`\~\@tempcnta
+% \uppercase{\endgroup
+% \edef~{\string~}%
+% }%
+ \ifnum\@tempcnta<#2\relax
+ \advance\@tempcnta\@ne
+ \repeat
+}
+\IPX@VerbatimLoop{1}{8}
+\IPX@VerbatimLoop{11}{11}
+\IPX@VerbatimLoop{14}{31}
+\IPX@VerbatimLoop{127}{255}
+\RestoreAtCatcode
+%</verbatim>
+% \end{macrocode}
+%
+% \subsubsection{Encoding atarist}
+%
+% \begin{macrocode}
+%<*atarist>
+\ProvidesFile{x-atarist.def}%
+ [2016/05/16 v1.11 Input encoding atarist (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textGamma}{%
+ \ensuremath\Gamma
+}
+\ProvideTextCommandDefault{\textOmega}{%
+ \ensuremath\Omega
+}
+\ProvideTextCommandDefault{\textPhi}{%
+ \ensuremath\Phi
+}
+\ProvideTextCommandDefault{\textSigma}{%
+ \ensuremath\Sigma
+}
+\ProvideTextCommandDefault{\textTheta}{%
+ \ensuremath\Theta
+}
+\ProvideTextCommandDefault{\textalpha}{%
+ \ensuremath\alpha
+}
+\ProvideTextCommandDefault{\textapproxequal}{%
+ \ensuremath\approx
+}
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textbeta}{%
+ \ensuremath\beta
+}
+\ProvideTextCommandDefault{\textcap}{%
+ \ensuremath\cap
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcontourintegral}{%
+ \ensuremath\oint
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdelta}{%
+ \ensuremath\delta
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textelement}{%
+ \ensuremath\in
+}
+\ProvideTextCommandDefault{\textequivalence}{%
+ \ensuremath\equiv
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textgreaterequal}{%
+ \ensuremath\geq
+}
+\ProvideTextCommandDefault{\textinfinity}{%
+ \ensuremath\infty
+}
+\ProvideTextCommandDefault{\textintersection}{%
+ \ensuremath\cap
+}
+\ProvideTextCommandDefault{\textlessequal}{%
+ \ensuremath\leq
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textnsuperior}{%
+ \ensuremath{{^n}}%
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textphi}{%
+ \ensuremath\phi
+}
+\ProvideTextCommandDefault{\textpi}{%
+ \ensuremath\pi
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textrevlogicalnot}{%
+ \begingroup
+ \@ifundefined{reflectbox}{%
+ \TextSymbolUnavailable\textrevlogicalnot
+ }{%
+ \def\@revlogicalnot##1##2{%
+ \reflectbox{$##1##2$}%
+ }%
+ \ensuremath{\mathpalette\@revlogicalnot\lnot}%
+ }%
+ \endgroup
+}
+\ProvideTextCommandDefault{\textsigma}{%
+ \ensuremath\sigma
+}
+\ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+}
+\ProvideTextCommandDefault{\texttau}{%
+ \ensuremath\tau
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{128}{\c C}
+\DeclareInputText{129}{\"u}
+\DeclareInputText{130}{\@tabacckludge'e}
+\DeclareInputText{131}{\^a}
+\DeclareInputText{132}{\"a}
+\DeclareInputText{133}{\@tabacckludge`a}
+\DeclareInputText{134}{\r a}
+\DeclareInputText{135}{\c c}
+\DeclareInputText{136}{\^e}
+\DeclareInputText{137}{\"e}
+\DeclareInputText{138}{\@tabacckludge`e}
+\DeclareInputText{139}{\"\i}
+\DeclareInputText{140}{\^\i}
+\DeclareInputText{141}{\@tabacckludge`\i}
+\DeclareInputText{142}{\"A}
+\DeclareInputText{143}{\r A}
+\DeclareInputText{144}{\@tabacckludge'E}
+\DeclareInputText{145}{\ae}
+\DeclareInputText{146}{\AE}
+\DeclareInputText{147}{\^o}
+\DeclareInputText{148}{\"o}
+\DeclareInputText{149}{\@tabacckludge`o}
+\DeclareInputText{150}{\^u}
+\DeclareInputText{151}{\@tabacckludge`u}
+\DeclareInputText{152}{\"y}
+\DeclareInputText{153}{\"O}
+\DeclareInputText{154}{\"U}
+\DeclareInputText{155}{\textcent}
+\DeclareInputText{156}{\textsterling}
+\DeclareInputText{157}{\textyen}
+\DeclareInputText{158}{\ss}
+\DeclareInputText{159}{\textflorin}
+\DeclareInputText{160}{\@tabacckludge'a}
+\DeclareInputText{161}{\@tabacckludge'\i}
+\DeclareInputText{162}{\@tabacckludge'o}
+\DeclareInputText{163}{\@tabacckludge'u}
+\DeclareInputText{164}{\~n}
+\DeclareInputText{165}{\~N}
+\DeclareInputText{166}{\textordfeminine}
+\DeclareInputText{167}{\textordmasculine}
+\DeclareInputText{168}{\textquestiondown}
+\DeclareInputText{169}{\textrevlogicalnot}
+\DeclareInputText{170}{\textlnot}
+\DeclareInputText{171}{\textonehalf}
+\DeclareInputText{172}{\textonequarter}
+\DeclareInputText{173}{\textexclamdown}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\guillemotright}
+\DeclareInputText{176}{\~a}
+\DeclareInputText{177}{\~o}
+\DeclareInputText{178}{\O}
+\DeclareInputText{179}{\o}
+\DeclareInputText{180}{\oe}
+\DeclareInputText{181}{\OE}
+\DeclareInputText{182}{\@tabacckludge`A}
+\DeclareInputText{183}{\~A}
+\DeclareInputText{184}{\~O}
+\DeclareInputText{185}{\textasciidieresis}
+\DeclareInputText{186}{\textasciiacute}
+\DeclareInputText{187}{\textdagger}
+\DeclareInputText{188}{\textparagraph}
+\DeclareInputText{189}{\textcopyright}
+\DeclareInputText{190}{\textregistered}
+\DeclareInputText{191}{\texttrademark}
+\DeclareInputText{192}{\ij}
+\DeclareInputText{193}{\IJ}
+\DeclareInputText{194}{\hebalef}
+\DeclareInputText{195}{\hebbet}
+\DeclareInputText{196}{\hebgimel}
+\DeclareInputText{197}{\hebdalet}
+\DeclareInputText{198}{\hebhe}
+\DeclareInputText{199}{\hebvav}
+\DeclareInputText{200}{\hebzayin}
+\DeclareInputText{201}{\hebhet}
+\DeclareInputText{202}{\hebtet}
+\DeclareInputText{203}{\hebyod}
+\DeclareInputText{204}{\hebkaf}
+\DeclareInputText{205}{\heblamed}
+\DeclareInputText{206}{\hebmem}
+\DeclareInputText{207}{\hebnun}
+\DeclareInputText{208}{\hebsamekh}
+\DeclareInputText{209}{\hebayin}
+\DeclareInputText{210}{\hebpe}
+\DeclareInputText{211}{\hebtsadi}
+\DeclareInputText{212}{\hebqof}
+\DeclareInputText{213}{\hebresh}
+\DeclareInputText{214}{\hebshin}
+\DeclareInputText{215}{\hebtav}
+\DeclareInputText{216}{\hebfinalnun}
+\DeclareInputText{217}{\hebfinalkaf}
+\DeclareInputText{218}{\hebfinalmem}
+\DeclareInputText{219}{\hebfinalpe}
+\DeclareInputText{220}{\hebfinaltsadi}
+\DeclareInputText{221}{\textsection}
+\DeclareInputText{222}{\textcap}
+\DeclareInputText{223}{\textinfinity}
+\DeclareInputText{224}{\textalpha}
+\DeclareInputText{225}{\textbeta}
+\DeclareInputText{226}{\textGamma}
+\DeclareInputText{227}{\textpi}
+\DeclareInputText{228}{\textSigma}
+\DeclareInputText{229}{\textsigma}
+\DeclareInputText{230}{\textmu}
+\DeclareInputText{231}{\texttau}
+\DeclareInputText{232}{\textPhi}
+\DeclareInputText{233}{\textTheta}
+\DeclareInputText{234}{\textOmega}
+\DeclareInputText{235}{\textdelta}
+\DeclareInputText{236}{\textcontourintegral}
+\DeclareInputText{237}{\textphi}
+\DeclareInputText{238}{\textelement}
+\DeclareInputText{239}{\textintersection}
+\DeclareInputText{240}{\textequivalence}
+\DeclareInputText{241}{\textpm}
+\DeclareInputText{242}{\textgreaterequal}
+\DeclareInputText{243}{\textlessequal}
+\DeclareInputText{246}{\textdiv}
+\DeclareInputText{247}{\textapproxequal}
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textbullet}
+\DeclareInputText{250}{\textperiodcentered}
+\DeclareInputText{251}{\textsurd}
+\DeclareInputText{252}{\textnsuperior}
+\DeclareInputText{253}{\texttwosuperior}
+\DeclareInputText{254}{\textthreesuperior}
+\DeclareInputText{255}{\textasciimacron}
+\RestoreAtCatcode
+%</atarist>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-1}
+%
+% \begin{macrocode}
+%<*iso-8859-1>
+\ProvidesFile{x-iso-8859-1.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-1 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\textexclamdown}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\textordfeminine}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\textasciimacron}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\textordmasculine}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+\DeclareInputText{191}{\textquestiondown}
+\DeclareInputText{192}{\@tabacckludge`A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\~A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\@tabacckludge`E}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\^E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\@tabacckludge`I}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{208}{\DH}
+\DeclareInputText{209}{\~N}
+\DeclareInputText{210}{\@tabacckludge`O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\O}
+\DeclareInputText{217}{\@tabacckludge`U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\@tabacckludge'Y}
+\DeclareInputText{222}{\TH}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge`a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\~a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\@tabacckludge`e}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\^e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\@tabacckludge`\i}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{240}{\dh}
+\DeclareInputText{241}{\~n}
+\DeclareInputText{242}{\@tabacckludge`o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\o}
+\DeclareInputText{249}{\@tabacckludge`u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\@tabacckludge'y}
+\DeclareInputText{254}{\th}
+\DeclareInputText{255}{\"y}
+\RestoreAtCatcode
+%</iso-8859-1>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-2}
+%
+% \begin{macrocode}
+%<*iso-8859-2>
+\ProvidesFile{x-iso-8859-2.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-2 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textacutedbl}{%
+ \H{}%
+}
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciibreve}{%
+ \u{}%
+}
+\ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\k A}
+\DeclareInputText{162}{\textasciibreve}
+\DeclareInputText{163}{\L}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\v L}
+\DeclareInputText{166}{\@tabacckludge'S}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\v S}
+\DeclareInputText{170}{\c S}
+\DeclareInputText{171}{\v T}
+\DeclareInputText{172}{\@tabacckludge'Z}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\v Z}
+\DeclareInputText{175}{\.Z}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\k a}
+\DeclareInputText{178}{\k{}}
+\DeclareInputText{179}{\l}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\v l}
+\DeclareInputText{182}{\@tabacckludge's}
+\DeclareInputText{183}{\textasciicaron}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\v s}
+\DeclareInputText{186}{\c s}
+\DeclareInputText{187}{\v t}
+\DeclareInputText{188}{\@tabacckludge'z}
+\DeclareInputText{189}{\textacutedbl}
+\DeclareInputText{190}{\v z}
+\DeclareInputText{191}{\.z}
+\DeclareInputText{192}{\@tabacckludge'R}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\u A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\@tabacckludge'L}
+\DeclareInputText{198}{\@tabacckludge'C}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\v C}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\k E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\v E}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\v D}
+\DeclareInputText{208}{\DJ}
+\DeclareInputText{209}{\@tabacckludge'N}
+\DeclareInputText{210}{\v N}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\H O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\v R}
+\DeclareInputText{217}{\r U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\H U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\@tabacckludge'Y}
+\DeclareInputText{222}{\c T}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge'r}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\u a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\@tabacckludge'l}
+\DeclareInputText{230}{\@tabacckludge'c}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\v c}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\k e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\v e}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\v d}
+\DeclareInputText{240}{\dj}
+\DeclareInputText{241}{\@tabacckludge'n}
+\DeclareInputText{242}{\v n}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\H o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\v r}
+\DeclareInputText{249}{\r u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\H u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\@tabacckludge'y}
+\DeclareInputText{254}{\c t}
+\DeclareInputText{255}{\.{}}
+\RestoreAtCatcode
+%</iso-8859-2>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-3}
+%
+% \begin{macrocode}
+%<*iso-8859-3>
+\ProvidesFile{x-iso-8859-3.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-3 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciibreve}{%
+ \u{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textmalteseH}{%
+ \TextSymbolUnavailable\textmalteseH
+}
+\ProvideTextCommandDefault{\textmalteseh}{%
+ \TextSymbolUnavailable\textmalteseh
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\textmalteseH}
+\DeclareInputText{162}{\textasciibreve}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{166}{\^H}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\.I}
+\DeclareInputText{170}{\c S}
+\DeclareInputText{171}{\u G}
+\DeclareInputText{172}{\^J}
+\DeclareInputText{173}{\-}
+\DeclareInputText{175}{\.Z}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textmalteseh}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\^h}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\i}
+\DeclareInputText{186}{\c s}
+\DeclareInputText{187}{\u g}
+\DeclareInputText{188}{\^\j}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{191}{\.z}
+\DeclareInputText{192}{\@tabacckludge`A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\.C}
+\DeclareInputText{198}{\^C}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\@tabacckludge`E}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\^E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\@tabacckludge`I}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{209}{\~N}
+\DeclareInputText{210}{\@tabacckludge`O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\.G}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\^G}
+\DeclareInputText{217}{\@tabacckludge`U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\u U}
+\DeclareInputText{222}{\^S}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge`a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\.c}
+\DeclareInputText{230}{\^c}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\@tabacckludge`e}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\^e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\@tabacckludge`\i}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{241}{\~n}
+\DeclareInputText{242}{\@tabacckludge`o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\.g}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\^g}
+\DeclareInputText{249}{\@tabacckludge`u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\u u}
+\DeclareInputText{254}{\^s}
+\DeclareInputText{255}{\.{}}
+\RestoreAtCatcode
+%</iso-8859-3>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-4}
+%
+% \begin{macrocode}
+%<*iso-8859-4>
+\ProvidesFile{x-iso-8859-4.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-4 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textTstroke}{%
+ \TextSymbolUnavailable\textTstroke
+}
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textkra}{%
+ \TextSymbolUnavailable\textkra
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttstroke}{%
+ \TextSymbolUnavailable\texttstroke
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\k A}
+\DeclareInputText{162}{\textkra}
+\DeclareInputText{163}{\c R}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\~I}
+\DeclareInputText{166}{\c L}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\v S}
+\DeclareInputText{170}{\@tabacckludge=E}
+\DeclareInputText{171}{\c G}
+\DeclareInputText{172}{\textTstroke}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\v Z}
+\DeclareInputText{175}{\textasciimacron}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\k a}
+\DeclareInputText{178}{\k{}}
+\DeclareInputText{179}{\c r}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\~\i}
+\DeclareInputText{182}{\c l}
+\DeclareInputText{183}{\textasciicaron}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\v s}
+\DeclareInputText{186}{\@tabacckludge=e}
+\DeclareInputText{187}{\c g}
+\DeclareInputText{188}{\texttstroke}
+\DeclareInputText{189}{\NG}
+\DeclareInputText{190}{\v z}
+\DeclareInputText{191}{\ng}
+\DeclareInputText{192}{\@tabacckludge=A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\~A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\k I}
+\DeclareInputText{200}{\v C}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\k E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\.E}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\@tabacckludge=I}
+\DeclareInputText{208}{\DJ}
+\DeclareInputText{209}{\c N}
+\DeclareInputText{210}{\@tabacckludge=O}
+\DeclareInputText{211}{\c K}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\O}
+\DeclareInputText{217}{\k U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\~U}
+\DeclareInputText{222}{\@tabacckludge=U}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge=a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\~a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\k i}
+\DeclareInputText{232}{\v c}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\k e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\.e}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\@tabacckludge=\i}
+\DeclareInputText{240}{\dj}
+\DeclareInputText{241}{\c n}
+\DeclareInputText{242}{\@tabacckludge=o}
+\DeclareInputText{243}{\c k}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\o}
+\DeclareInputText{249}{\k u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\~u}
+\DeclareInputText{254}{\@tabacckludge=u}
+\DeclareInputText{255}{\.{}}
+\RestoreAtCatcode
+%</iso-8859-4>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-5}
+%
+% \begin{macrocode}
+%<*iso-8859-5>
+\ProvidesFile{x-iso-8859-5.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-5 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textnumero}{%
+ N%
+ \bgroup
+ \check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse
+ \selectfont
+ \ooalign{%
+ \raise0.5ex\hbox{o}%
+ \crcr
+ \hline
+ }%
+ \egroup
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\CYRYO}
+\DeclareInputText{162}{\CYRDJE}
+\DeclareInputText{163}{\@tabacckludge'\CYRG}
+\DeclareInputText{164}{\CYRIE}
+\DeclareInputText{165}{\CYRDZE}
+\DeclareInputText{166}{\CYRII}
+\DeclareInputText{167}{\CYRYI}
+\DeclareInputText{168}{\CYRJE}
+\DeclareInputText{169}{\CYRLJE}
+\DeclareInputText{170}{\CYRNJE}
+\DeclareInputText{171}{\CYRTSHE}
+\DeclareInputText{172}{\@tabacckludge'\CYRK}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\CYRUSHRT}
+\DeclareInputText{175}{\CYRDZHE}
+\DeclareInputText{176}{\CYRA}
+\DeclareInputText{177}{\CYRB}
+\DeclareInputText{178}{\CYRV}
+\DeclareInputText{179}{\CYRG}
+\DeclareInputText{180}{\CYRD}
+\DeclareInputText{181}{\CYRE}
+\DeclareInputText{182}{\CYRZH}
+\DeclareInputText{183}{\CYRZ}
+\DeclareInputText{184}{\CYRI}
+\DeclareInputText{185}{\CYRISHRT}
+\DeclareInputText{186}{\CYRK}
+\DeclareInputText{187}{\CYRL}
+\DeclareInputText{188}{\CYRM}
+\DeclareInputText{189}{\CYRN}
+\DeclareInputText{190}{\CYRO}
+\DeclareInputText{191}{\CYRP}
+\DeclareInputText{192}{\CYRR}
+\DeclareInputText{193}{\CYRS}
+\DeclareInputText{194}{\CYRT}
+\DeclareInputText{195}{\CYRU}
+\DeclareInputText{196}{\CYRF}
+\DeclareInputText{197}{\CYRH}
+\DeclareInputText{198}{\CYRC}
+\DeclareInputText{199}{\CYRCH}
+\DeclareInputText{200}{\CYRSH}
+\DeclareInputText{201}{\CYRSHCH}
+\DeclareInputText{202}{\CYRHRDSN}
+\DeclareInputText{203}{\CYRERY}
+\DeclareInputText{204}{\CYRSFTSN}
+\DeclareInputText{205}{\CYREREV}
+\DeclareInputText{206}{\CYRYU}
+\DeclareInputText{207}{\CYRYA}
+\DeclareInputText{208}{\cyra}
+\DeclareInputText{209}{\cyrb}
+\DeclareInputText{210}{\cyrv}
+\DeclareInputText{211}{\cyrg}
+\DeclareInputText{212}{\cyrd}
+\DeclareInputText{213}{\cyre}
+\DeclareInputText{214}{\cyrzh}
+\DeclareInputText{215}{\cyrz}
+\DeclareInputText{216}{\cyri}
+\DeclareInputText{217}{\cyrishrt}
+\DeclareInputText{218}{\cyrk}
+\DeclareInputText{219}{\cyrl}
+\DeclareInputText{220}{\cyrm}
+\DeclareInputText{221}{\cyrn}
+\DeclareInputText{222}{\cyro}
+\DeclareInputText{223}{\cyrp}
+\DeclareInputText{224}{\cyrr}
+\DeclareInputText{225}{\cyrs}
+\DeclareInputText{226}{\cyrt}
+\DeclareInputText{227}{\cyru}
+\DeclareInputText{228}{\cyrf}
+\DeclareInputText{229}{\cyrh}
+\DeclareInputText{230}{\cyrc}
+\DeclareInputText{231}{\cyrch}
+\DeclareInputText{232}{\cyrsh}
+\DeclareInputText{233}{\cyrshch}
+\DeclareInputText{234}{\cyrhrdsn}
+\DeclareInputText{235}{\cyrery}
+\DeclareInputText{236}{\cyrsftsn}
+\DeclareInputText{237}{\cyrerev}
+\DeclareInputText{238}{\cyryu}
+\DeclareInputText{239}{\cyrya}
+\DeclareInputText{240}{\textnumero}
+\DeclareInputText{241}{\cyryo}
+\DeclareInputText{242}{\cyrdje}
+\DeclareInputText{243}{\@tabacckludge'\cyrg}
+\DeclareInputText{244}{\cyrie}
+\DeclareInputText{245}{\cyrdze}
+\DeclareInputText{246}{\cyrii}
+\DeclareInputText{247}{\cyryi}
+\DeclareInputText{248}{\cyrje}
+\DeclareInputText{249}{\cyrlje}
+\DeclareInputText{250}{\cyrnje}
+\DeclareInputText{251}{\cyrtshe}
+\DeclareInputText{252}{\@tabacckludge'\cyrk}
+\DeclareInputText{253}{\textsection}
+\DeclareInputText{254}{\cyrushrt}
+\DeclareInputText{255}{\cyrdzhe}
+\RestoreAtCatcode
+%</iso-8859-5>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-8}
+%
+% \begin{macrocode}
+%<*iso-8859-8>
+\ProvidesFile{x-iso-8859-8.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-8 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdbllowline}{%
+ \begingroup
+ \sbox0{\textunderscore}%
+ \leavevmode
+ \ifdim\dp0<.2ex\relax
+ \rlap{\raisebox{-.2ex}[0pt]{\textunderscore}}%
+ \else
+ \rlap{\raisebox{.2ex}[0pt]{\textunderscore}}%
+ \fi
+ \textunderscore
+ \endgroup
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\texttimes}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\textasciimacron}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\textdiv}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+\DeclareInputText{223}{\textdbllowline}
+\DeclareInputText{224}{\hebalef}
+\DeclareInputText{225}{\hebbet}
+\DeclareInputText{226}{\hebgimel}
+\DeclareInputText{227}{\hebdalet}
+\DeclareInputText{228}{\hebhe}
+\DeclareInputText{229}{\hebvav}
+\DeclareInputText{230}{\hebzayin}
+\DeclareInputText{231}{\hebhet}
+\DeclareInputText{232}{\hebtet}
+\DeclareInputText{233}{\hebyod}
+\DeclareInputText{234}{\hebfinalkaf}
+\DeclareInputText{235}{\hebkaf}
+\DeclareInputText{236}{\heblamed}
+\DeclareInputText{237}{\hebfinalmem}
+\DeclareInputText{238}{\hebmem}
+\DeclareInputText{239}{\hebfinalnun}
+\DeclareInputText{240}{\hebnun}
+\DeclareInputText{241}{\hebsamekh}
+\DeclareInputText{242}{\hebayin}
+\DeclareInputText{243}{\hebfinalpe}
+\DeclareInputText{244}{\hebpe}
+\DeclareInputText{245}{\hebfinaltsadi}
+\DeclareInputText{246}{\hebtsadi}
+\DeclareInputText{247}{\hebqof}
+\DeclareInputText{248}{\hebresh}
+\DeclareInputText{249}{\hebshin}
+\DeclareInputText{250}{\hebtav}
+\RestoreAtCatcode
+%</iso-8859-8>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-9}
+%
+% \begin{macrocode}
+%<*iso-8859-9>
+\ProvidesFile{x-iso-8859-9.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-9 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\textexclamdown}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\textordfeminine}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\textasciimacron}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\textordmasculine}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+\DeclareInputText{191}{\textquestiondown}
+\DeclareInputText{192}{\@tabacckludge`A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\~A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\@tabacckludge`E}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\^E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\@tabacckludge`I}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{208}{\u G}
+\DeclareInputText{209}{\~N}
+\DeclareInputText{210}{\@tabacckludge`O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\O}
+\DeclareInputText{217}{\@tabacckludge`U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\.I}
+\DeclareInputText{222}{\c S}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge`a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\~a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\@tabacckludge`e}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\^e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\@tabacckludge`\i}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{240}{\u g}
+\DeclareInputText{241}{\~n}
+\DeclareInputText{242}{\@tabacckludge`o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\o}
+\DeclareInputText{249}{\@tabacckludge`u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\i}
+\DeclareInputText{254}{\c s}
+\DeclareInputText{255}{\"y}
+\RestoreAtCatcode
+%</iso-8859-9>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-10}
+%
+% \begin{macrocode}
+%<*iso-8859-10>
+\ProvidesFile{x-iso-8859-10.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-10 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textTstroke}{%
+ \TextSymbolUnavailable\textTstroke
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\texthorizontalbar}{%
+ \mbox{---}\kern-.5em---%
+}
+\ProvideTextCommandDefault{\textkra}{%
+ \TextSymbolUnavailable\textkra
+}
+\ProvideTextCommandDefault{\texttstroke}{%
+ \TextSymbolUnavailable\texttstroke
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\k A}
+\DeclareInputText{162}{\@tabacckludge=E}
+\DeclareInputText{163}{\c G}
+\DeclareInputText{164}{\@tabacckludge=I}
+\DeclareInputText{165}{\~I}
+\DeclareInputText{166}{\c K}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\c L}
+\DeclareInputText{169}{\DJ}
+\DeclareInputText{170}{\v S}
+\DeclareInputText{171}{\textTstroke}
+\DeclareInputText{172}{\v Z}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\@tabacckludge=U}
+\DeclareInputText{175}{\NG}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\k a}
+\DeclareInputText{178}{\@tabacckludge=e}
+\DeclareInputText{179}{\c g}
+\DeclareInputText{180}{\@tabacckludge=\i}
+\DeclareInputText{181}{\~\i}
+\DeclareInputText{182}{\c k}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\c l}
+\DeclareInputText{185}{\dj}
+\DeclareInputText{186}{\v s}
+\DeclareInputText{187}{\texttstroke}
+\DeclareInputText{188}{\v z}
+\DeclareInputText{189}{\texthorizontalbar}
+\DeclareInputText{190}{\@tabacckludge=u}
+\DeclareInputText{191}{\ng}
+\DeclareInputText{192}{\@tabacckludge=A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\~A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\k I}
+\DeclareInputText{200}{\v C}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\k E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\.E}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{208}{\DH}
+\DeclareInputText{209}{\c N}
+\DeclareInputText{210}{\@tabacckludge=O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\~U}
+\DeclareInputText{216}{\O}
+\DeclareInputText{217}{\k U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\@tabacckludge'Y}
+\DeclareInputText{222}{\TH}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge=a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\~a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\k i}
+\DeclareInputText{232}{\v c}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\k e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\.e}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{240}{\dh}
+\DeclareInputText{241}{\c n}
+\DeclareInputText{242}{\@tabacckludge=o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\~u}
+\DeclareInputText{248}{\o}
+\DeclareInputText{249}{\k u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\@tabacckludge'y}
+\DeclareInputText{254}{\th}
+\DeclareInputText{255}{\textkra}
+\RestoreAtCatcode
+%</iso-8859-10>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-13}
+%
+% \begin{macrocode}
+%<*iso-8859-13>
+\ProvidesFile{x-iso-8859-13.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-13 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\textquotedblright}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\quotedblbase}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\O}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\c R}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\AE}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\textquotedblleft}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\o}
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\c r}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+\DeclareInputText{191}{\ae}
+\DeclareInputText{192}{\k A}
+\DeclareInputText{193}{\k I}
+\DeclareInputText{194}{\@tabacckludge=A}
+\DeclareInputText{195}{\@tabacckludge'C}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\k E}
+\DeclareInputText{199}{\@tabacckludge=E}
+\DeclareInputText{200}{\v C}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\@tabacckludge'Z}
+\DeclareInputText{203}{\.E}
+\DeclareInputText{204}{\c G}
+\DeclareInputText{205}{\c K}
+\DeclareInputText{206}{\@tabacckludge=I}
+\DeclareInputText{207}{\c L}
+\DeclareInputText{208}{\v S}
+\DeclareInputText{209}{\@tabacckludge'N}
+\DeclareInputText{210}{\c N}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\@tabacckludge=O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\k U}
+\DeclareInputText{217}{\L}
+\DeclareInputText{218}{\@tabacckludge'S}
+\DeclareInputText{219}{\@tabacckludge=U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\.Z}
+\DeclareInputText{222}{\v Z}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\k a}
+\DeclareInputText{225}{\k i}
+\DeclareInputText{226}{\@tabacckludge=a}
+\DeclareInputText{227}{\@tabacckludge'c}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\k e}
+\DeclareInputText{231}{\@tabacckludge=e}
+\DeclareInputText{232}{\v c}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\@tabacckludge'z}
+\DeclareInputText{235}{\.e}
+\DeclareInputText{236}{\c g}
+\DeclareInputText{237}{\c k}
+\DeclareInputText{238}{\@tabacckludge=\i}
+\DeclareInputText{239}{\c l}
+\DeclareInputText{240}{\v s}
+\DeclareInputText{241}{\@tabacckludge'n}
+\DeclareInputText{242}{\c n}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\@tabacckludge=o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\k u}
+\DeclareInputText{249}{\l}
+\DeclareInputText{250}{\@tabacckludge's}
+\DeclareInputText{251}{\@tabacckludge=u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\.z}
+\DeclareInputText{254}{\v z}
+\DeclareInputText{255}{\textquoteright}
+\RestoreAtCatcode
+%</iso-8859-13>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-14}
+%
+% \begin{macrocode}
+%<*iso-8859-14>
+\ProvidesFile{x-iso-8859-14.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-14 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\.B}
+\DeclareInputText{162}{\.b}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\.C}
+\DeclareInputText{165}{\.c}
+\DeclareInputText{166}{\.D}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\@tabacckludge`W}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\@tabacckludge'W}
+\DeclareInputText{171}{\.d}
+\DeclareInputText{172}{\@tabacckludge`Y}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\"Y}
+\DeclareInputText{176}{\.F}
+\DeclareInputText{177}{\.f}
+\DeclareInputText{178}{\.G}
+\DeclareInputText{179}{\.g}
+\DeclareInputText{180}{\.M}
+\DeclareInputText{181}{\.m}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\.P}
+\DeclareInputText{184}{\@tabacckludge`w}
+\DeclareInputText{185}{\.p}
+\DeclareInputText{186}{\@tabacckludge'w}
+\DeclareInputText{187}{\.S}
+\DeclareInputText{188}{\@tabacckludge`y}
+\DeclareInputText{189}{\"W}
+\DeclareInputText{190}{\"w}
+\DeclareInputText{191}{\.s}
+\DeclareInputText{192}{\@tabacckludge`A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\~A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\@tabacckludge`E}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\^E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\@tabacckludge`I}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{208}{\^W}
+\DeclareInputText{209}{\~N}
+\DeclareInputText{210}{\@tabacckludge`O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\.T}
+\DeclareInputText{216}{\O}
+\DeclareInputText{217}{\@tabacckludge`U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\@tabacckludge'Y}
+\DeclareInputText{222}{\^Y}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge`a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\~a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\@tabacckludge`e}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\^e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\@tabacckludge`\i}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{240}{\^w}
+\DeclareInputText{241}{\~n}
+\DeclareInputText{242}{\@tabacckludge`o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\.t}
+\DeclareInputText{248}{\o}
+\DeclareInputText{249}{\@tabacckludge`u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\@tabacckludge'y}
+\DeclareInputText{254}{\^y}
+\DeclareInputText{255}{\"y}
+\RestoreAtCatcode
+%</iso-8859-14>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-15}
+%
+% \begin{macrocode}
+%<*iso-8859-15>
+\ProvidesFile{x-iso-8859-15.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-15 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\textexclamdown}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\texteuro}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\v S}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\v s}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\textordfeminine}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\textasciimacron}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\v Z}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\v z}
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\textordmasculine}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\OE}
+\DeclareInputText{189}{\oe}
+\DeclareInputText{190}{\"Y}
+\DeclareInputText{191}{\textquestiondown}
+\DeclareInputText{192}{\@tabacckludge`A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\~A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\@tabacckludge`E}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\^E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\@tabacckludge`I}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{208}{\DH}
+\DeclareInputText{209}{\~N}
+\DeclareInputText{210}{\@tabacckludge`O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\O}
+\DeclareInputText{217}{\@tabacckludge`U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\@tabacckludge'Y}
+\DeclareInputText{222}{\TH}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge`a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\~a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\@tabacckludge`e}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\^e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\@tabacckludge`\i}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{240}{\dh}
+\DeclareInputText{241}{\~n}
+\DeclareInputText{242}{\@tabacckludge`o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\o}
+\DeclareInputText{249}{\@tabacckludge`u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\@tabacckludge'y}
+\DeclareInputText{254}{\th}
+\DeclareInputText{255}{\"y}
+\RestoreAtCatcode
+%</iso-8859-15>
+% \end{macrocode}
+%
+% \subsubsection{Encoding iso-8859-16}
+%
+% \begin{macrocode}
+%<*iso-8859-16>
+\ProvidesFile{x-iso-8859-16.def}%
+ [2016/05/16 v1.11 Input encoding iso-8859-16 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textcommabelow}[1]{%
+ \hmode@bgroup
+ \ooalign{%
+ \null#1\crcr
+ \hidewidth
+ \raise-.31ex\hbox{%
+ \check@mathfonts
+ \fontsize\ssf@size\z@
+ \math@fontsfalse\selectfont,%
+ }%
+ \hidewidth
+ }%
+ \egroup
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\k A}
+\DeclareInputText{162}{\k a}
+\DeclareInputText{163}{\L}
+\DeclareInputText{164}{\texteuro}
+\DeclareInputText{165}{\quotedblbase}
+\DeclareInputText{166}{\v S}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\v s}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\textcommabelow S}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\@tabacckludge'Z}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\@tabacckludge'z}
+\DeclareInputText{175}{\.Z}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\v C}
+\DeclareInputText{179}{\l}
+\DeclareInputText{180}{\v Z}
+\DeclareInputText{181}{\textquotedblright}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\v z}
+\DeclareInputText{185}{\v c}
+\DeclareInputText{186}{\textcommabelow s}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\OE}
+\DeclareInputText{189}{\oe}
+\DeclareInputText{190}{\"Y}
+\DeclareInputText{191}{\.z}
+\DeclareInputText{192}{\@tabacckludge`A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\u A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\@tabacckludge'C}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\@tabacckludge`E}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\^E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\@tabacckludge`I}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{208}{\DJ}
+\DeclareInputText{209}{\@tabacckludge'N}
+\DeclareInputText{210}{\@tabacckludge`O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\H O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\@tabacckludge'S}
+\DeclareInputText{216}{\H U}
+\DeclareInputText{217}{\@tabacckludge`U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\k E}
+\DeclareInputText{222}{\textcommabelow T}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge`a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\u a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\@tabacckludge'c}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\@tabacckludge`e}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\^e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\@tabacckludge`\i}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{240}{\dj}
+\DeclareInputText{241}{\@tabacckludge'n}
+\DeclareInputText{242}{\@tabacckludge`o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\H o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\@tabacckludge's}
+\DeclareInputText{248}{\H u}
+\DeclareInputText{249}{\@tabacckludge`u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\k e}
+\DeclareInputText{254}{\textcommabelow t}
+\DeclareInputText{255}{\"y}
+\RestoreAtCatcode
+%</iso-8859-16>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp437}
+%
+% \begin{macrocode}
+%<*cp437>
+\ProvidesFile{x-cp437.def}%
+ [2016/05/16 v1.11 Input encoding cp437 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textGamma}{%
+ \ensuremath\Gamma
+}
+\ProvideTextCommandDefault{\textOmega}{%
+ \ensuremath\Omega
+}
+\ProvideTextCommandDefault{\textPhi}{%
+ \ensuremath\Phi
+}
+\ProvideTextCommandDefault{\textSigma}{%
+ \ensuremath\Sigma
+}
+\ProvideTextCommandDefault{\textTheta}{%
+ \ensuremath\Theta
+}
+\ProvideTextCommandDefault{\textalpha}{%
+ \ensuremath\alpha
+}
+\ProvideTextCommandDefault{\textapproxequal}{%
+ \ensuremath\approx
+}
+\ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdelta}{%
+ \ensuremath\delta
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textepsilon}{%
+ \ensuremath\varepsilon
+}
+\ProvideTextCommandDefault{\textequivalence}{%
+ \ensuremath\equiv
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textgreaterequal}{%
+ \ensuremath\geq
+}
+\ProvideTextCommandDefault{\textinfinity}{%
+ \ensuremath\infty
+}
+\ProvideTextCommandDefault{\textintersection}{%
+ \ensuremath\cap
+}
+\ProvideTextCommandDefault{\textlessequal}{%
+ \ensuremath\leq
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textnsuperior}{%
+ \ensuremath{{^n}}%
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textpeseta}{%
+ Pt%
+}
+\ProvideTextCommandDefault{\textphi}{%
+ \ensuremath\phi
+}
+\ProvideTextCommandDefault{\textpi}{%
+ \ensuremath\pi
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textrevlogicalnot}{%
+ \begingroup
+ \@ifundefined{reflectbox}{%
+ \TextSymbolUnavailable\textrevlogicalnot
+ }{%
+ \def\@revlogicalnot##1##2{%
+ \reflectbox{$##1##2$}%
+ }%
+ \ensuremath{\mathpalette\@revlogicalnot\lnot}%
+ }%
+ \endgroup
+}
+\ProvideTextCommandDefault{\textsigma}{%
+ \ensuremath\sigma
+}
+\ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+}
+\ProvideTextCommandDefault{\texttau}{%
+ \ensuremath\tau
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{128}{\c C}
+\DeclareInputText{129}{\"u}
+\DeclareInputText{130}{\@tabacckludge'e}
+\DeclareInputText{131}{\^a}
+\DeclareInputText{132}{\"a}
+\DeclareInputText{133}{\@tabacckludge`a}
+\DeclareInputText{134}{\r a}
+\DeclareInputText{135}{\c c}
+\DeclareInputText{136}{\^e}
+\DeclareInputText{137}{\"e}
+\DeclareInputText{138}{\@tabacckludge`e}
+\DeclareInputText{139}{\"\i}
+\DeclareInputText{140}{\^\i}
+\DeclareInputText{141}{\@tabacckludge`\i}
+\DeclareInputText{142}{\"A}
+\DeclareInputText{143}{\r A}
+\DeclareInputText{144}{\@tabacckludge'E}
+\DeclareInputText{145}{\ae}
+\DeclareInputText{146}{\AE}
+\DeclareInputText{147}{\^o}
+\DeclareInputText{148}{\"o}
+\DeclareInputText{149}{\@tabacckludge`o}
+\DeclareInputText{150}{\^u}
+\DeclareInputText{151}{\@tabacckludge`u}
+\DeclareInputText{152}{\"y}
+\DeclareInputText{153}{\"O}
+\DeclareInputText{154}{\"U}
+\DeclareInputText{155}{\textcent}
+\DeclareInputText{156}{\textsterling}
+\DeclareInputText{157}{\textyen}
+\DeclareInputText{158}{\textpeseta}
+\DeclareInputText{159}{\textflorin}
+\DeclareInputText{160}{\@tabacckludge'a}
+\DeclareInputText{161}{\@tabacckludge'\i}
+\DeclareInputText{162}{\@tabacckludge'o}
+\DeclareInputText{163}{\@tabacckludge'u}
+\DeclareInputText{164}{\~n}
+\DeclareInputText{165}{\~N}
+\DeclareInputText{166}{\textordfeminine}
+\DeclareInputText{167}{\textordmasculine}
+\DeclareInputText{168}{\textquestiondown}
+\DeclareInputText{169}{\textrevlogicalnot}
+\DeclareInputText{170}{\textlnot}
+\DeclareInputText{171}{\textonehalf}
+\DeclareInputText{172}{\textonequarter}
+\DeclareInputText{173}{\textexclamdown}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\guillemotright}
+\DeclareInputText{176}{\textltshade}
+\DeclareInputText{177}{\textshade}
+\DeclareInputText{178}{\textdkshade}
+\DeclareInputText{179}{\textSFxi}
+\DeclareInputText{180}{\textSFix}
+\DeclareInputText{181}{\textSFxix}
+\DeclareInputText{182}{\textSFxx}
+\DeclareInputText{183}{\textSFxxi}
+\DeclareInputText{184}{\textSFxxii}
+\DeclareInputText{185}{\textSFxxiii}
+\DeclareInputText{186}{\textSFxxiv}
+\DeclareInputText{187}{\textSFxxv}
+\DeclareInputText{188}{\textSFxxvi}
+\DeclareInputText{189}{\textSFxxvii}
+\DeclareInputText{190}{\textSFxxviii}
+\DeclareInputText{191}{\textSFiii}
+\DeclareInputText{192}{\textSFii}
+\DeclareInputText{193}{\textSFvii}
+\DeclareInputText{194}{\textSFvi}
+\DeclareInputText{195}{\textSFviii}
+\DeclareInputText{196}{\textSFx}
+\DeclareInputText{197}{\textSFv}
+\DeclareInputText{198}{\textSFxxxvi}
+\DeclareInputText{199}{\textSFxxxvii}
+\DeclareInputText{200}{\textSFxxxviii}
+\DeclareInputText{201}{\textSFxxxix}
+\DeclareInputText{202}{\textSFxl}
+\DeclareInputText{203}{\textSFxli}
+\DeclareInputText{204}{\textSFxlii}
+\DeclareInputText{205}{\textSFxliii}
+\DeclareInputText{206}{\textSFxliv}
+\DeclareInputText{207}{\textSFxlv}
+\DeclareInputText{208}{\textSFxlvi}
+\DeclareInputText{209}{\textSFxlvii}
+\DeclareInputText{210}{\textSFxlviii}
+\DeclareInputText{211}{\textSFxlix}
+\DeclareInputText{212}{\textSFl}
+\DeclareInputText{213}{\textSFli}
+\DeclareInputText{214}{\textSFlii}
+\DeclareInputText{215}{\textSFliii}
+\DeclareInputText{216}{\textSFliv}
+\DeclareInputText{217}{\textSFiv}
+\DeclareInputText{218}{\textSFi}
+\DeclareInputText{219}{\textblock}
+\DeclareInputText{220}{\textdnblock}
+\DeclareInputText{221}{\textlfblock}
+\DeclareInputText{222}{\textrtblock}
+\DeclareInputText{223}{\textupblock}
+\DeclareInputText{224}{\textalpha}
+\DeclareInputText{225}{\ss}
+\DeclareInputText{226}{\textGamma}
+\DeclareInputText{227}{\textpi}
+\DeclareInputText{228}{\textSigma}
+\DeclareInputText{229}{\textsigma}
+\DeclareInputText{230}{\textmu}
+\DeclareInputText{231}{\texttau}
+\DeclareInputText{232}{\textPhi}
+\DeclareInputText{233}{\textTheta}
+\DeclareInputText{234}{\textOmega}
+\DeclareInputText{235}{\textdelta}
+\DeclareInputText{236}{\textinfinity}
+\DeclareInputText{237}{\textphi}
+\DeclareInputText{238}{\textepsilon}
+\DeclareInputText{239}{\textintersection}
+\DeclareInputText{240}{\textequivalence}
+\DeclareInputText{241}{\textpm}
+\DeclareInputText{242}{\textgreaterequal}
+\DeclareInputText{243}{\textlessequal}
+\DeclareInputText{246}{\textdiv}
+\DeclareInputText{247}{\textapproxequal}
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textbullet}
+\DeclareInputText{250}{\textperiodcentered}
+\DeclareInputText{251}{\textsurd}
+\DeclareInputText{252}{\textnsuperior}
+\DeclareInputText{253}{\texttwosuperior}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+\RestoreAtCatcode
+%</cp437>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp850}
+%
+% \begin{macrocode}
+%<*cp850>
+\ProvidesFile{x-cp850.def}%
+ [2016/05/16 v1.11 Input encoding cp850 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdbllowline}{%
+ \begingroup
+ \sbox0{\textunderscore}%
+ \leavevmode
+ \ifdim\dp0<.2ex\relax
+ \rlap{\raisebox{-.2ex}[0pt]{\textunderscore}}%
+ \else
+ \rlap{\raisebox{.2ex}[0pt]{\textunderscore}}%
+ \fi
+ \textunderscore
+ \endgroup
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{128}{\c C}
+\DeclareInputText{129}{\"u}
+\DeclareInputText{130}{\@tabacckludge'e}
+\DeclareInputText{131}{\^a}
+\DeclareInputText{132}{\"a}
+\DeclareInputText{133}{\@tabacckludge`a}
+\DeclareInputText{134}{\r a}
+\DeclareInputText{135}{\c c}
+\DeclareInputText{136}{\^e}
+\DeclareInputText{137}{\"e}
+\DeclareInputText{138}{\@tabacckludge`e}
+\DeclareInputText{139}{\"\i}
+\DeclareInputText{140}{\^\i}
+\DeclareInputText{141}{\@tabacckludge`\i}
+\DeclareInputText{142}{\"A}
+\DeclareInputText{143}{\r A}
+\DeclareInputText{144}{\@tabacckludge'E}
+\DeclareInputText{145}{\ae}
+\DeclareInputText{146}{\AE}
+\DeclareInputText{147}{\^o}
+\DeclareInputText{148}{\"o}
+\DeclareInputText{149}{\@tabacckludge`o}
+\DeclareInputText{150}{\^u}
+\DeclareInputText{151}{\@tabacckludge`u}
+\DeclareInputText{152}{\"y}
+\DeclareInputText{153}{\"O}
+\DeclareInputText{154}{\"U}
+\DeclareInputText{155}{\o}
+\DeclareInputText{156}{\textsterling}
+\DeclareInputText{157}{\O}
+\DeclareInputText{158}{\texttimes}
+\DeclareInputText{159}{\textflorin}
+\DeclareInputText{160}{\@tabacckludge'a}
+\DeclareInputText{161}{\@tabacckludge'\i}
+\DeclareInputText{162}{\@tabacckludge'o}
+\DeclareInputText{163}{\@tabacckludge'u}
+\DeclareInputText{164}{\~n}
+\DeclareInputText{165}{\~N}
+\DeclareInputText{166}{\textordfeminine}
+\DeclareInputText{167}{\textordmasculine}
+\DeclareInputText{168}{\textquestiondown}
+\DeclareInputText{169}{\textregistered}
+\DeclareInputText{170}{\textlnot}
+\DeclareInputText{171}{\textonehalf}
+\DeclareInputText{172}{\textonequarter}
+\DeclareInputText{173}{\textexclamdown}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\guillemotright}
+\DeclareInputText{176}{\textltshade}
+\DeclareInputText{177}{\textshade}
+\DeclareInputText{178}{\textdkshade}
+\DeclareInputText{179}{\textSFxi}
+\DeclareInputText{180}{\textSFix}
+\DeclareInputText{181}{\@tabacckludge'A}
+\DeclareInputText{182}{\^A}
+\DeclareInputText{183}{\@tabacckludge`A}
+\DeclareInputText{184}{\textcopyright}
+\DeclareInputText{185}{\textSFxxiii}
+\DeclareInputText{186}{\textSFxxiv}
+\DeclareInputText{187}{\textSFxxv}
+\DeclareInputText{188}{\textSFxxvi}
+\DeclareInputText{189}{\textcent}
+\DeclareInputText{190}{\textyen}
+\DeclareInputText{191}{\textSFiii}
+\DeclareInputText{192}{\textSFii}
+\DeclareInputText{193}{\textSFvii}
+\DeclareInputText{194}{\textSFvi}
+\DeclareInputText{195}{\textSFviii}
+\DeclareInputText{196}{\textSFx}
+\DeclareInputText{197}{\textSFv}
+\DeclareInputText{198}{\~a}
+\DeclareInputText{199}{\~A}
+\DeclareInputText{200}{\textSFxxxviii}
+\DeclareInputText{201}{\textSFxxxix}
+\DeclareInputText{202}{\textSFxl}
+\DeclareInputText{203}{\textSFxli}
+\DeclareInputText{204}{\textSFxlii}
+\DeclareInputText{205}{\textSFxliii}
+\DeclareInputText{206}{\textSFxliv}
+\DeclareInputText{207}{\textcurrency}
+\DeclareInputText{208}{\dh}
+\DeclareInputText{209}{\DH}
+\DeclareInputText{210}{\^E}
+\DeclareInputText{211}{\"E}
+\DeclareInputText{212}{\@tabacckludge`E}
+\DeclareInputText{213}{\i}
+\DeclareInputText{214}{\@tabacckludge'I}
+\DeclareInputText{215}{\^I}
+\DeclareInputText{216}{\"I}
+\DeclareInputText{217}{\textSFiv}
+\DeclareInputText{218}{\textSFi}
+\DeclareInputText{219}{\textblock}
+\DeclareInputText{220}{\textdnblock}
+\DeclareInputText{221}{\textbrokenbar}
+\DeclareInputText{222}{\@tabacckludge`I}
+\DeclareInputText{223}{\textupblock}
+\DeclareInputText{224}{\@tabacckludge'O}
+\DeclareInputText{225}{\ss}
+\DeclareInputText{226}{\^O}
+\DeclareInputText{227}{\@tabacckludge`O}
+\DeclareInputText{228}{\~o}
+\DeclareInputText{229}{\~O}
+\DeclareInputText{230}{\textmu}
+\DeclareInputText{231}{\th}
+\DeclareInputText{232}{\TH}
+\DeclareInputText{233}{\@tabacckludge'U}
+\DeclareInputText{234}{\^U}
+\DeclareInputText{235}{\@tabacckludge`U}
+\DeclareInputText{236}{\@tabacckludge'y}
+\DeclareInputText{237}{\@tabacckludge'Y}
+\DeclareInputText{238}{\textasciimacron}
+\DeclareInputText{239}{\textasciiacute}
+\DeclareInputText{240}{\-}
+\DeclareInputText{241}{\textpm}
+\DeclareInputText{242}{\textdbllowline}
+\DeclareInputText{243}{\textthreequarters}
+\DeclareInputText{244}{\textparagraph}
+\DeclareInputText{245}{\textsection}
+\DeclareInputText{246}{\textdiv}
+\DeclareInputText{247}{\c\ }
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textasciidieresis}
+\DeclareInputText{250}{\textperiodcentered}
+\DeclareInputText{251}{\textonesuperior}
+\DeclareInputText{252}{\textthreesuperior}
+\DeclareInputText{253}{\texttwosuperior}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+\RestoreAtCatcode
+%</cp850>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp852}
+%
+% \begin{macrocode}
+%<*cp852>
+\ProvidesFile{x-cp852.def}%
+ [2016/05/16 v1.11 Input encoding cp852 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textacutedbl}{%
+ \H{}%
+}
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciibreve}{%
+ \u{}%
+}
+\ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\DeclareInputText{128}{\c C}
+\DeclareInputText{129}{\"u}
+\DeclareInputText{130}{\@tabacckludge'e}
+\DeclareInputText{131}{\^a}
+\DeclareInputText{132}{\"a}
+\DeclareInputText{133}{\r u}
+\DeclareInputText{134}{\@tabacckludge'c}
+\DeclareInputText{135}{\c c}
+\DeclareInputText{136}{\l}
+\DeclareInputText{137}{\"e}
+\DeclareInputText{138}{\H O}
+\DeclareInputText{139}{\H o}
+\DeclareInputText{140}{\^\i}
+\DeclareInputText{141}{\@tabacckludge'Z}
+\DeclareInputText{142}{\"A}
+\DeclareInputText{143}{\@tabacckludge'C}
+\DeclareInputText{144}{\@tabacckludge'E}
+\DeclareInputText{145}{\@tabacckludge'L}
+\DeclareInputText{146}{\@tabacckludge'l}
+\DeclareInputText{147}{\^o}
+\DeclareInputText{148}{\"o}
+\DeclareInputText{149}{\v L}
+\DeclareInputText{150}{\v l}
+\DeclareInputText{151}{\@tabacckludge'S}
+\DeclareInputText{152}{\@tabacckludge's}
+\DeclareInputText{153}{\"O}
+\DeclareInputText{154}{\"U}
+\DeclareInputText{155}{\v T}
+\DeclareInputText{156}{\v t}
+\DeclareInputText{157}{\L}
+\DeclareInputText{158}{\texttimes}
+\DeclareInputText{159}{\v c}
+\DeclareInputText{160}{\@tabacckludge'a}
+\DeclareInputText{161}{\@tabacckludge'\i}
+\DeclareInputText{162}{\@tabacckludge'o}
+\DeclareInputText{163}{\@tabacckludge'u}
+\DeclareInputText{164}{\k A}
+\DeclareInputText{165}{\k a}
+\DeclareInputText{166}{\v Z}
+\DeclareInputText{167}{\v z}
+\DeclareInputText{168}{\k E}
+\DeclareInputText{169}{\k e}
+\DeclareInputText{170}{\textlnot}
+\DeclareInputText{171}{\@tabacckludge'z}
+\DeclareInputText{172}{\v C}
+\DeclareInputText{173}{\c s}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\guillemotright}
+\DeclareInputText{176}{\textltshade}
+\DeclareInputText{177}{\textshade}
+\DeclareInputText{178}{\textdkshade}
+\DeclareInputText{179}{\textSFxi}
+\DeclareInputText{180}{\textSFix}
+\DeclareInputText{181}{\@tabacckludge'A}
+\DeclareInputText{182}{\^A}
+\DeclareInputText{183}{\v E}
+\DeclareInputText{184}{\c S}
+\DeclareInputText{185}{\textSFxxiii}
+\DeclareInputText{186}{\textSFxxiv}
+\DeclareInputText{187}{\textSFxxv}
+\DeclareInputText{188}{\textSFxxvi}
+\DeclareInputText{189}{\.Z}
+\DeclareInputText{190}{\.z}
+\DeclareInputText{191}{\textSFiii}
+\DeclareInputText{192}{\textSFii}
+\DeclareInputText{193}{\textSFvii}
+\DeclareInputText{194}{\textSFvi}
+\DeclareInputText{195}{\textSFviii}
+\DeclareInputText{196}{\textSFx}
+\DeclareInputText{197}{\textSFv}
+\DeclareInputText{198}{\u A}
+\DeclareInputText{199}{\u a}
+\DeclareInputText{200}{\textSFxxxviii}
+\DeclareInputText{201}{\textSFxxxix}
+\DeclareInputText{202}{\textSFxl}
+\DeclareInputText{203}{\textSFxli}
+\DeclareInputText{204}{\textSFxlii}
+\DeclareInputText{205}{\textSFxliii}
+\DeclareInputText{206}{\textSFxliv}
+\DeclareInputText{207}{\textcurrency}
+\DeclareInputText{208}{\dj}
+\DeclareInputText{209}{\DJ}
+\DeclareInputText{210}{\v D}
+\DeclareInputText{211}{\"E}
+\DeclareInputText{212}{\v d}
+\DeclareInputText{213}{\v N}
+\DeclareInputText{214}{\@tabacckludge'I}
+\DeclareInputText{215}{\^I}
+\DeclareInputText{216}{\v e}
+\DeclareInputText{217}{\textSFiv}
+\DeclareInputText{218}{\textSFi}
+\DeclareInputText{219}{\textblock}
+\DeclareInputText{220}{\textdnblock}
+\DeclareInputText{221}{\c T}
+\DeclareInputText{222}{\r U}
+\DeclareInputText{223}{\textupblock}
+\DeclareInputText{224}{\@tabacckludge'O}
+\DeclareInputText{225}{\ss}
+\DeclareInputText{226}{\^O}
+\DeclareInputText{227}{\@tabacckludge'N}
+\DeclareInputText{228}{\@tabacckludge'n}
+\DeclareInputText{229}{\v n}
+\DeclareInputText{230}{\v S}
+\DeclareInputText{231}{\v s}
+\DeclareInputText{232}{\@tabacckludge'R}
+\DeclareInputText{233}{\@tabacckludge'U}
+\DeclareInputText{234}{\@tabacckludge'r}
+\DeclareInputText{235}{\H U}
+\DeclareInputText{236}{\@tabacckludge'y}
+\DeclareInputText{237}{\@tabacckludge'Y}
+\DeclareInputText{238}{\c t}
+\DeclareInputText{239}{\textasciiacute}
+\DeclareInputText{240}{\-}
+\DeclareInputText{241}{\textacutedbl}
+\DeclareInputText{242}{\k{}}
+\DeclareInputText{243}{\textasciicaron}
+\DeclareInputText{244}{\textasciibreve}
+\DeclareInputText{245}{\textsection}
+\DeclareInputText{246}{\textdiv}
+\DeclareInputText{247}{\c\ }
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textasciidieresis}
+\DeclareInputText{250}{\.{}}
+\DeclareInputText{251}{\H u}
+\DeclareInputText{252}{\v R}
+\DeclareInputText{253}{\v r}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+\RestoreAtCatcode
+%</cp852>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp855}
+%
+% \begin{macrocode}
+%<*cp855>
+\ProvidesFile{x-cp855.def}%
+ [2016/05/16 v1.11 Input encoding cp855 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textnumero}{%
+ N%
+ \bgroup
+ \check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse
+ \selectfont
+ \ooalign{%
+ \raise0.5ex\hbox{o}%
+ \crcr
+ \hline
+ }%
+ \egroup
+}
+\DeclareInputText{128}{\cyrdje}
+\DeclareInputText{129}{\CYRDJE}
+\DeclareInputText{130}{\@tabacckludge'\cyrg}
+\DeclareInputText{131}{\@tabacckludge'\CYRG}
+\DeclareInputText{132}{\cyryo}
+\DeclareInputText{133}{\CYRYO}
+\DeclareInputText{134}{\cyrie}
+\DeclareInputText{135}{\CYRIE}
+\DeclareInputText{136}{\cyrdze}
+\DeclareInputText{137}{\CYRDZE}
+\DeclareInputText{138}{\cyrii}
+\DeclareInputText{139}{\CYRII}
+\DeclareInputText{140}{\cyryi}
+\DeclareInputText{141}{\CYRYI}
+\DeclareInputText{142}{\cyrje}
+\DeclareInputText{143}{\CYRJE}
+\DeclareInputText{144}{\cyrlje}
+\DeclareInputText{145}{\CYRLJE}
+\DeclareInputText{146}{\cyrnje}
+\DeclareInputText{147}{\CYRNJE}
+\DeclareInputText{148}{\cyrtshe}
+\DeclareInputText{149}{\CYRTSHE}
+\DeclareInputText{150}{\@tabacckludge'\cyrk}
+\DeclareInputText{151}{\@tabacckludge'\CYRK}
+\DeclareInputText{152}{\cyrushrt}
+\DeclareInputText{153}{\CYRUSHRT}
+\DeclareInputText{154}{\cyrdzhe}
+\DeclareInputText{155}{\CYRDZHE}
+\DeclareInputText{156}{\cyryu}
+\DeclareInputText{157}{\CYRYU}
+\DeclareInputText{158}{\cyrhrdsn}
+\DeclareInputText{159}{\CYRHRDSN}
+\DeclareInputText{160}{\cyra}
+\DeclareInputText{161}{\CYRA}
+\DeclareInputText{162}{\cyrb}
+\DeclareInputText{163}{\CYRB}
+\DeclareInputText{164}{\cyrc}
+\DeclareInputText{165}{\CYRC}
+\DeclareInputText{166}{\cyrd}
+\DeclareInputText{167}{\CYRD}
+\DeclareInputText{168}{\cyre}
+\DeclareInputText{169}{\CYRE}
+\DeclareInputText{170}{\cyrf}
+\DeclareInputText{171}{\CYRF}
+\DeclareInputText{172}{\cyrg}
+\DeclareInputText{173}{\CYRG}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\guillemotright}
+\DeclareInputText{176}{\textltshade}
+\DeclareInputText{177}{\textshade}
+\DeclareInputText{178}{\textdkshade}
+\DeclareInputText{179}{\textSFxi}
+\DeclareInputText{180}{\textSFix}
+\DeclareInputText{181}{\cyrh}
+\DeclareInputText{182}{\CYRH}
+\DeclareInputText{183}{\cyri}
+\DeclareInputText{184}{\CYRI}
+\DeclareInputText{185}{\textSFxxiii}
+\DeclareInputText{186}{\textSFxxiv}
+\DeclareInputText{187}{\textSFxxv}
+\DeclareInputText{188}{\textSFxxvi}
+\DeclareInputText{189}{\cyrishrt}
+\DeclareInputText{190}{\CYRISHRT}
+\DeclareInputText{191}{\textSFiii}
+\DeclareInputText{192}{\textSFii}
+\DeclareInputText{193}{\textSFvii}
+\DeclareInputText{194}{\textSFvi}
+\DeclareInputText{195}{\textSFviii}
+\DeclareInputText{196}{\textSFx}
+\DeclareInputText{197}{\textSFv}
+\DeclareInputText{198}{\cyrk}
+\DeclareInputText{199}{\CYRK}
+\DeclareInputText{200}{\textSFxxxviii}
+\DeclareInputText{201}{\textSFxxxix}
+\DeclareInputText{202}{\textSFxl}
+\DeclareInputText{203}{\textSFxli}
+\DeclareInputText{204}{\textSFxlii}
+\DeclareInputText{205}{\textSFxliii}
+\DeclareInputText{206}{\textSFxliv}
+\DeclareInputText{207}{\textcurrency}
+\DeclareInputText{208}{\cyrl}
+\DeclareInputText{209}{\CYRL}
+\DeclareInputText{210}{\cyrm}
+\DeclareInputText{211}{\CYRM}
+\DeclareInputText{212}{\cyrn}
+\DeclareInputText{213}{\CYRN}
+\DeclareInputText{214}{\cyro}
+\DeclareInputText{215}{\CYRO}
+\DeclareInputText{216}{\cyrp}
+\DeclareInputText{217}{\textSFiv}
+\DeclareInputText{218}{\textSFi}
+\DeclareInputText{219}{\textblock}
+\DeclareInputText{220}{\textdnblock}
+\DeclareInputText{221}{\CYRP}
+\DeclareInputText{222}{\cyrya}
+\DeclareInputText{223}{\textupblock}
+\DeclareInputText{224}{\CYRYA}
+\DeclareInputText{225}{\cyrr}
+\DeclareInputText{226}{\CYRR}
+\DeclareInputText{227}{\cyrs}
+\DeclareInputText{228}{\CYRS}
+\DeclareInputText{229}{\cyrt}
+\DeclareInputText{230}{\CYRT}
+\DeclareInputText{231}{\cyru}
+\DeclareInputText{232}{\CYRU}
+\DeclareInputText{233}{\cyrzh}
+\DeclareInputText{234}{\CYRZH}
+\DeclareInputText{235}{\cyrv}
+\DeclareInputText{236}{\CYRV}
+\DeclareInputText{237}{\cyrsftsn}
+\DeclareInputText{238}{\CYRSFTSN}
+\DeclareInputText{239}{\textnumero}
+\DeclareInputText{240}{\-}
+\DeclareInputText{241}{\cyrery}
+\DeclareInputText{242}{\CYRERY}
+\DeclareInputText{243}{\cyrz}
+\DeclareInputText{244}{\CYRZ}
+\DeclareInputText{245}{\cyrsh}
+\DeclareInputText{246}{\CYRSH}
+\DeclareInputText{247}{\cyrerev}
+\DeclareInputText{248}{\CYREREV}
+\DeclareInputText{249}{\cyrshch}
+\DeclareInputText{250}{\CYRSHCH}
+\DeclareInputText{251}{\cyrch}
+\DeclareInputText{252}{\CYRCH}
+\DeclareInputText{253}{\textsection}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+\RestoreAtCatcode
+%</cp855>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp858}
+%
+% \begin{macrocode}
+%<*cp858>
+\ProvidesFile{x-cp858.def}%
+ [2016/05/16 v1.11 Input encoding cp858 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdbllowline}{%
+ \begingroup
+ \sbox0{\textunderscore}%
+ \leavevmode
+ \ifdim\dp0<.2ex\relax
+ \rlap{\raisebox{-.2ex}[0pt]{\textunderscore}}%
+ \else
+ \rlap{\raisebox{.2ex}[0pt]{\textunderscore}}%
+ \fi
+ \textunderscore
+ \endgroup
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{128}{\c C}
+\DeclareInputText{129}{\"u}
+\DeclareInputText{130}{\@tabacckludge'e}
+\DeclareInputText{131}{\^a}
+\DeclareInputText{132}{\"a}
+\DeclareInputText{133}{\@tabacckludge`a}
+\DeclareInputText{134}{\r a}
+\DeclareInputText{135}{\c c}
+\DeclareInputText{136}{\^e}
+\DeclareInputText{137}{\"e}
+\DeclareInputText{138}{\@tabacckludge`e}
+\DeclareInputText{139}{\"\i}
+\DeclareInputText{140}{\^\i}
+\DeclareInputText{141}{\@tabacckludge`\i}
+\DeclareInputText{142}{\"A}
+\DeclareInputText{143}{\r A}
+\DeclareInputText{144}{\@tabacckludge'E}
+\DeclareInputText{145}{\ae}
+\DeclareInputText{146}{\AE}
+\DeclareInputText{147}{\^o}
+\DeclareInputText{148}{\"o}
+\DeclareInputText{149}{\@tabacckludge`o}
+\DeclareInputText{150}{\^u}
+\DeclareInputText{151}{\@tabacckludge`u}
+\DeclareInputText{152}{\"y}
+\DeclareInputText{153}{\"O}
+\DeclareInputText{154}{\"U}
+\DeclareInputText{155}{\o}
+\DeclareInputText{156}{\textsterling}
+\DeclareInputText{157}{\O}
+\DeclareInputText{158}{\texttimes}
+\DeclareInputText{159}{\textflorin}
+\DeclareInputText{160}{\@tabacckludge'a}
+\DeclareInputText{161}{\@tabacckludge'\i}
+\DeclareInputText{162}{\@tabacckludge'o}
+\DeclareInputText{163}{\@tabacckludge'u}
+\DeclareInputText{164}{\~n}
+\DeclareInputText{165}{\~N}
+\DeclareInputText{166}{\textordfeminine}
+\DeclareInputText{167}{\textordmasculine}
+\DeclareInputText{168}{\textquestiondown}
+\DeclareInputText{169}{\textregistered}
+\DeclareInputText{170}{\textlnot}
+\DeclareInputText{171}{\textonehalf}
+\DeclareInputText{172}{\textonequarter}
+\DeclareInputText{173}{\textexclamdown}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\guillemotright}
+\DeclareInputText{176}{\textltshade}
+\DeclareInputText{177}{\textshade}
+\DeclareInputText{178}{\textdkshade}
+\DeclareInputText{179}{\textSFxi}
+\DeclareInputText{180}{\textSFix}
+\DeclareInputText{181}{\@tabacckludge'A}
+\DeclareInputText{182}{\^A}
+\DeclareInputText{183}{\@tabacckludge`A}
+\DeclareInputText{184}{\textcopyright}
+\DeclareInputText{185}{\textSFxxiii}
+\DeclareInputText{186}{\textSFxxiv}
+\DeclareInputText{187}{\textSFxxv}
+\DeclareInputText{188}{\textSFxxvi}
+\DeclareInputText{189}{\textcent}
+\DeclareInputText{190}{\textyen}
+\DeclareInputText{191}{\textSFiii}
+\DeclareInputText{192}{\textSFii}
+\DeclareInputText{193}{\textSFvii}
+\DeclareInputText{194}{\textSFvi}
+\DeclareInputText{195}{\textSFviii}
+\DeclareInputText{196}{\textSFx}
+\DeclareInputText{197}{\textSFv}
+\DeclareInputText{198}{\~a}
+\DeclareInputText{199}{\~A}
+\DeclareInputText{200}{\textSFxxxviii}
+\DeclareInputText{201}{\textSFxxxix}
+\DeclareInputText{202}{\textSFxl}
+\DeclareInputText{203}{\textSFxli}
+\DeclareInputText{204}{\textSFxlii}
+\DeclareInputText{205}{\textSFxliii}
+\DeclareInputText{206}{\textSFxliv}
+\DeclareInputText{207}{\textcurrency}
+\DeclareInputText{208}{\dh}
+\DeclareInputText{209}{\DH}
+\DeclareInputText{210}{\^E}
+\DeclareInputText{211}{\"E}
+\DeclareInputText{212}{\@tabacckludge`E}
+\DeclareInputText{213}{\texteuro}
+\DeclareInputText{214}{\@tabacckludge'I}
+\DeclareInputText{215}{\^I}
+\DeclareInputText{216}{\"I}
+\DeclareInputText{217}{\textSFiv}
+\DeclareInputText{218}{\textSFi}
+\DeclareInputText{219}{\textblock}
+\DeclareInputText{220}{\textdnblock}
+\DeclareInputText{221}{\textbrokenbar}
+\DeclareInputText{222}{\@tabacckludge`I}
+\DeclareInputText{223}{\textupblock}
+\DeclareInputText{224}{\@tabacckludge'O}
+\DeclareInputText{225}{\ss}
+\DeclareInputText{226}{\^O}
+\DeclareInputText{227}{\@tabacckludge`O}
+\DeclareInputText{228}{\~o}
+\DeclareInputText{229}{\~O}
+\DeclareInputText{230}{\textmu}
+\DeclareInputText{231}{\th}
+\DeclareInputText{232}{\TH}
+\DeclareInputText{233}{\@tabacckludge'U}
+\DeclareInputText{234}{\^U}
+\DeclareInputText{235}{\@tabacckludge`U}
+\DeclareInputText{236}{\@tabacckludge'y}
+\DeclareInputText{237}{\@tabacckludge'Y}
+\DeclareInputText{238}{\textasciimacron}
+\DeclareInputText{239}{\textasciiacute}
+\DeclareInputText{240}{\-}
+\DeclareInputText{241}{\textpm}
+\DeclareInputText{242}{\textdbllowline}
+\DeclareInputText{243}{\textthreequarters}
+\DeclareInputText{244}{\textparagraph}
+\DeclareInputText{245}{\textsection}
+\DeclareInputText{246}{\textdiv}
+\DeclareInputText{247}{\c\ }
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textasciidieresis}
+\DeclareInputText{250}{\textperiodcentered}
+\DeclareInputText{251}{\textonesuperior}
+\DeclareInputText{252}{\textthreesuperior}
+\DeclareInputText{253}{\texttwosuperior}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+\RestoreAtCatcode
+%</cp858>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp865}
+%
+% \begin{macrocode}
+%<*cp865>
+\ProvidesFile{x-cp865.def}%
+ [2016/05/16 v1.11 Input encoding cp865 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textGamma}{%
+ \ensuremath\Gamma
+}
+\ProvideTextCommandDefault{\textOmega}{%
+ \ensuremath\Omega
+}
+\ProvideTextCommandDefault{\textPhi}{%
+ \ensuremath\Phi
+}
+\ProvideTextCommandDefault{\textSigma}{%
+ \ensuremath\Sigma
+}
+\ProvideTextCommandDefault{\textTheta}{%
+ \ensuremath\Theta
+}
+\ProvideTextCommandDefault{\textalpha}{%
+ \ensuremath\alpha
+}
+\ProvideTextCommandDefault{\textapproxequal}{%
+ \ensuremath\approx
+}
+\ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdelta}{%
+ \ensuremath\delta
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textepsilon}{%
+ \ensuremath\varepsilon
+}
+\ProvideTextCommandDefault{\textequivalence}{%
+ \ensuremath\equiv
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textgreaterequal}{%
+ \ensuremath\geq
+}
+\ProvideTextCommandDefault{\textinfinity}{%
+ \ensuremath\infty
+}
+\ProvideTextCommandDefault{\textintersection}{%
+ \ensuremath\cap
+}
+\ProvideTextCommandDefault{\textlessequal}{%
+ \ensuremath\leq
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textnsuperior}{%
+ \ensuremath{{^n}}%
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textpeseta}{%
+ Pt%
+}
+\ProvideTextCommandDefault{\textphi}{%
+ \ensuremath\phi
+}
+\ProvideTextCommandDefault{\textpi}{%
+ \ensuremath\pi
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textrevlogicalnot}{%
+ \begingroup
+ \@ifundefined{reflectbox}{%
+ \TextSymbolUnavailable\textrevlogicalnot
+ }{%
+ \def\@revlogicalnot##1##2{%
+ \reflectbox{$##1##2$}%
+ }%
+ \ensuremath{\mathpalette\@revlogicalnot\lnot}%
+ }%
+ \endgroup
+}
+\ProvideTextCommandDefault{\textsigma}{%
+ \ensuremath\sigma
+}
+\ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+}
+\ProvideTextCommandDefault{\texttau}{%
+ \ensuremath\tau
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\DeclareInputText{128}{\c C}
+\DeclareInputText{129}{\"u}
+\DeclareInputText{130}{\@tabacckludge'e}
+\DeclareInputText{131}{\^a}
+\DeclareInputText{132}{\"a}
+\DeclareInputText{133}{\@tabacckludge`a}
+\DeclareInputText{134}{\r a}
+\DeclareInputText{135}{\c c}
+\DeclareInputText{136}{\^e}
+\DeclareInputText{137}{\"e}
+\DeclareInputText{138}{\@tabacckludge`e}
+\DeclareInputText{139}{\"\i}
+\DeclareInputText{140}{\^\i}
+\DeclareInputText{141}{\@tabacckludge`\i}
+\DeclareInputText{142}{\"A}
+\DeclareInputText{143}{\r A}
+\DeclareInputText{144}{\@tabacckludge'E}
+\DeclareInputText{145}{\ae}
+\DeclareInputText{146}{\AE}
+\DeclareInputText{147}{\^o}
+\DeclareInputText{148}{\"o}
+\DeclareInputText{149}{\@tabacckludge`o}
+\DeclareInputText{150}{\^u}
+\DeclareInputText{151}{\@tabacckludge`u}
+\DeclareInputText{152}{\"y}
+\DeclareInputText{153}{\"O}
+\DeclareInputText{154}{\"U}
+\DeclareInputText{155}{\o}
+\DeclareInputText{156}{\textsterling}
+\DeclareInputText{157}{\O}
+\DeclareInputText{158}{\textpeseta}
+\DeclareInputText{159}{\textflorin}
+\DeclareInputText{160}{\@tabacckludge'a}
+\DeclareInputText{161}{\@tabacckludge'\i}
+\DeclareInputText{162}{\@tabacckludge'o}
+\DeclareInputText{163}{\@tabacckludge'u}
+\DeclareInputText{164}{\~n}
+\DeclareInputText{165}{\~N}
+\DeclareInputText{166}{\textordfeminine}
+\DeclareInputText{167}{\textordmasculine}
+\DeclareInputText{168}{\textquestiondown}
+\DeclareInputText{169}{\textrevlogicalnot}
+\DeclareInputText{170}{\textlnot}
+\DeclareInputText{171}{\textonehalf}
+\DeclareInputText{172}{\textonequarter}
+\DeclareInputText{173}{\textexclamdown}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\textcurrency}
+\DeclareInputText{176}{\textltshade}
+\DeclareInputText{177}{\textshade}
+\DeclareInputText{178}{\textdkshade}
+\DeclareInputText{179}{\textSFxi}
+\DeclareInputText{180}{\textSFix}
+\DeclareInputText{181}{\textSFxix}
+\DeclareInputText{182}{\textSFxx}
+\DeclareInputText{183}{\textSFxxi}
+\DeclareInputText{184}{\textSFxxii}
+\DeclareInputText{185}{\textSFxxiii}
+\DeclareInputText{186}{\textSFxxiv}
+\DeclareInputText{187}{\textSFxxv}
+\DeclareInputText{188}{\textSFxxvi}
+\DeclareInputText{189}{\textSFxxvii}
+\DeclareInputText{190}{\textSFxxviii}
+\DeclareInputText{191}{\textSFiii}
+\DeclareInputText{192}{\textSFii}
+\DeclareInputText{193}{\textSFvii}
+\DeclareInputText{194}{\textSFvi}
+\DeclareInputText{195}{\textSFviii}
+\DeclareInputText{196}{\textSFx}
+\DeclareInputText{197}{\textSFv}
+\DeclareInputText{198}{\textSFxxxvi}
+\DeclareInputText{199}{\textSFxxxvii}
+\DeclareInputText{200}{\textSFxxxviii}
+\DeclareInputText{201}{\textSFxxxix}
+\DeclareInputText{202}{\textSFxl}
+\DeclareInputText{203}{\textSFxli}
+\DeclareInputText{204}{\textSFxlii}
+\DeclareInputText{205}{\textSFxliii}
+\DeclareInputText{206}{\textSFxliv}
+\DeclareInputText{207}{\textSFxlv}
+\DeclareInputText{208}{\textSFxlvi}
+\DeclareInputText{209}{\textSFxlvii}
+\DeclareInputText{210}{\textSFxlviii}
+\DeclareInputText{211}{\textSFxlix}
+\DeclareInputText{212}{\textSFl}
+\DeclareInputText{213}{\textSFli}
+\DeclareInputText{214}{\textSFlii}
+\DeclareInputText{215}{\textSFliii}
+\DeclareInputText{216}{\textSFliv}
+\DeclareInputText{217}{\textSFiv}
+\DeclareInputText{218}{\textSFi}
+\DeclareInputText{219}{\textblock}
+\DeclareInputText{220}{\textdnblock}
+\DeclareInputText{221}{\textlfblock}
+\DeclareInputText{222}{\textrtblock}
+\DeclareInputText{223}{\textupblock}
+\DeclareInputText{224}{\textalpha}
+\DeclareInputText{225}{\ss}
+\DeclareInputText{226}{\textGamma}
+\DeclareInputText{227}{\textpi}
+\DeclareInputText{228}{\textSigma}
+\DeclareInputText{229}{\textsigma}
+\DeclareInputText{230}{\textmu}
+\DeclareInputText{231}{\texttau}
+\DeclareInputText{232}{\textPhi}
+\DeclareInputText{233}{\textTheta}
+\DeclareInputText{234}{\textOmega}
+\DeclareInputText{235}{\textdelta}
+\DeclareInputText{236}{\textinfinity}
+\DeclareInputText{237}{\textphi}
+\DeclareInputText{238}{\textepsilon}
+\DeclareInputText{239}{\textintersection}
+\DeclareInputText{240}{\textequivalence}
+\DeclareInputText{241}{\textpm}
+\DeclareInputText{242}{\textgreaterequal}
+\DeclareInputText{243}{\textlessequal}
+\DeclareInputText{246}{\textdiv}
+\DeclareInputText{247}{\textapproxequal}
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textbullet}
+\DeclareInputText{250}{\textperiodcentered}
+\DeclareInputText{251}{\textsurd}
+\DeclareInputText{252}{\textnsuperior}
+\DeclareInputText{253}{\texttwosuperior}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+\RestoreAtCatcode
+%</cp865>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp866}
+%
+% \begin{macrocode}
+%<*cp866>
+\ProvidesFile{x-cp866.def}%
+ [2016/05/16 v1.11 Input encoding cp866 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textnumero}{%
+ N%
+ \bgroup
+ \check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse
+ \selectfont
+ \ooalign{%
+ \raise0.5ex\hbox{o}%
+ \crcr
+ \hline
+ }%
+ \egroup
+}
+\ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+}
+\DeclareInputText{128}{\CYRA}
+\DeclareInputText{129}{\CYRB}
+\DeclareInputText{130}{\CYRV}
+\DeclareInputText{131}{\CYRG}
+\DeclareInputText{132}{\CYRD}
+\DeclareInputText{133}{\CYRE}
+\DeclareInputText{134}{\CYRZH}
+\DeclareInputText{135}{\CYRZ}
+\DeclareInputText{136}{\CYRI}
+\DeclareInputText{137}{\CYRISHRT}
+\DeclareInputText{138}{\CYRK}
+\DeclareInputText{139}{\CYRL}
+\DeclareInputText{140}{\CYRM}
+\DeclareInputText{141}{\CYRN}
+\DeclareInputText{142}{\CYRO}
+\DeclareInputText{143}{\CYRP}
+\DeclareInputText{144}{\CYRR}
+\DeclareInputText{145}{\CYRS}
+\DeclareInputText{146}{\CYRT}
+\DeclareInputText{147}{\CYRU}
+\DeclareInputText{148}{\CYRF}
+\DeclareInputText{149}{\CYRH}
+\DeclareInputText{150}{\CYRC}
+\DeclareInputText{151}{\CYRCH}
+\DeclareInputText{152}{\CYRSH}
+\DeclareInputText{153}{\CYRSHCH}
+\DeclareInputText{154}{\CYRHRDSN}
+\DeclareInputText{155}{\CYRERY}
+\DeclareInputText{156}{\CYRSFTSN}
+\DeclareInputText{157}{\CYREREV}
+\DeclareInputText{158}{\CYRYU}
+\DeclareInputText{159}{\CYRYA}
+\DeclareInputText{160}{\cyra}
+\DeclareInputText{161}{\cyrb}
+\DeclareInputText{162}{\cyrv}
+\DeclareInputText{163}{\cyrg}
+\DeclareInputText{164}{\cyrd}
+\DeclareInputText{165}{\cyre}
+\DeclareInputText{166}{\cyrzh}
+\DeclareInputText{167}{\cyrz}
+\DeclareInputText{168}{\cyri}
+\DeclareInputText{169}{\cyrishrt}
+\DeclareInputText{170}{\cyrk}
+\DeclareInputText{171}{\cyrl}
+\DeclareInputText{172}{\cyrm}
+\DeclareInputText{173}{\cyrn}
+\DeclareInputText{174}{\cyro}
+\DeclareInputText{175}{\cyrp}
+\DeclareInputText{176}{\textltshade}
+\DeclareInputText{177}{\textshade}
+\DeclareInputText{178}{\textdkshade}
+\DeclareInputText{179}{\textSFxi}
+\DeclareInputText{180}{\textSFix}
+\DeclareInputText{181}{\textSFxix}
+\DeclareInputText{182}{\textSFxx}
+\DeclareInputText{183}{\textSFxxi}
+\DeclareInputText{184}{\textSFxxii}
+\DeclareInputText{185}{\textSFxxiii}
+\DeclareInputText{186}{\textSFxxiv}
+\DeclareInputText{187}{\textSFxxv}
+\DeclareInputText{188}{\textSFxxvi}
+\DeclareInputText{189}{\textSFxxvii}
+\DeclareInputText{190}{\textSFxxviii}
+\DeclareInputText{191}{\textSFiii}
+\DeclareInputText{192}{\textSFii}
+\DeclareInputText{193}{\textSFvii}
+\DeclareInputText{194}{\textSFvi}
+\DeclareInputText{195}{\textSFviii}
+\DeclareInputText{196}{\textSFx}
+\DeclareInputText{197}{\textSFv}
+\DeclareInputText{198}{\textSFxxxvi}
+\DeclareInputText{199}{\textSFxxxvii}
+\DeclareInputText{200}{\textSFxxxviii}
+\DeclareInputText{201}{\textSFxxxix}
+\DeclareInputText{202}{\textSFxl}
+\DeclareInputText{203}{\textSFxli}
+\DeclareInputText{204}{\textSFxlii}
+\DeclareInputText{205}{\textSFxliii}
+\DeclareInputText{206}{\textSFxliv}
+\DeclareInputText{207}{\textSFxlv}
+\DeclareInputText{208}{\textSFxlvi}
+\DeclareInputText{209}{\textSFxlvii}
+\DeclareInputText{210}{\textSFxlviii}
+\DeclareInputText{211}{\textSFxlix}
+\DeclareInputText{212}{\textSFl}
+\DeclareInputText{213}{\textSFli}
+\DeclareInputText{214}{\textSFlii}
+\DeclareInputText{215}{\textSFliii}
+\DeclareInputText{216}{\textSFliv}
+\DeclareInputText{217}{\textSFiv}
+\DeclareInputText{218}{\textSFi}
+\DeclareInputText{219}{\textblock}
+\DeclareInputText{220}{\textdnblock}
+\DeclareInputText{221}{\textlfblock}
+\DeclareInputText{222}{\textrtblock}
+\DeclareInputText{223}{\textupblock}
+\DeclareInputText{224}{\cyrr}
+\DeclareInputText{225}{\cyrs}
+\DeclareInputText{226}{\cyrt}
+\DeclareInputText{227}{\cyru}
+\DeclareInputText{228}{\cyrf}
+\DeclareInputText{229}{\cyrh}
+\DeclareInputText{230}{\cyrc}
+\DeclareInputText{231}{\cyrch}
+\DeclareInputText{232}{\cyrsh}
+\DeclareInputText{233}{\cyrshch}
+\DeclareInputText{234}{\cyrhrdsn}
+\DeclareInputText{235}{\cyrery}
+\DeclareInputText{236}{\cyrsftsn}
+\DeclareInputText{237}{\cyrerev}
+\DeclareInputText{238}{\cyryu}
+\DeclareInputText{239}{\cyrya}
+\DeclareInputText{240}{\CYRYO}
+\DeclareInputText{241}{\cyryo}
+\DeclareInputText{242}{\CYRIE}
+\DeclareInputText{243}{\cyrie}
+\DeclareInputText{244}{\CYRYI}
+\DeclareInputText{245}{\cyryi}
+\DeclareInputText{246}{\CYRUSHRT}
+\DeclareInputText{247}{\cyrushrt}
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textbullet}
+\DeclareInputText{250}{\textperiodcentered}
+\DeclareInputText{251}{\textsurd}
+\DeclareInputText{252}{\textnumero}
+\DeclareInputText{253}{\textcurrency}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+\RestoreAtCatcode
+%</cp866>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp1250}
+%
+% \begin{macrocode}
+%<*cp1250>
+\ProvidesFile{x-cp1250.def}%
+ [2016/05/16 v1.11 Input encoding cp1250 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textacutedbl}{%
+ \H{}%
+}
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciibreve}{%
+ \u{}%
+}
+\ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\DeclareInputText{128}{\texteuro}
+\DeclareInputText{130}{\quotesinglbase}
+\DeclareInputText{132}{\quotedblbase}
+\DeclareInputText{133}{\textellipsis}
+\DeclareInputText{134}{\textdagger}
+\DeclareInputText{135}{\textdaggerdbl}
+\DeclareInputText{137}{\textperthousand}
+\DeclareInputText{138}{\v S}
+\DeclareInputText{139}{\guilsinglleft}
+\DeclareInputText{140}{\@tabacckludge'S}
+\DeclareInputText{141}{\v T}
+\DeclareInputText{142}{\v Z}
+\DeclareInputText{143}{\@tabacckludge'Z}
+\DeclareInputText{145}{\textquoteleft}
+\DeclareInputText{146}{\textquoteright}
+\DeclareInputText{147}{\textquotedblleft}
+\DeclareInputText{148}{\textquotedblright}
+\DeclareInputText{149}{\textbullet}
+\DeclareInputText{150}{\textendash}
+\DeclareInputText{151}{\textemdash}
+\DeclareInputText{153}{\texttrademark}
+\DeclareInputText{154}{\v s}
+\DeclareInputText{155}{\guilsinglright}
+\DeclareInputText{156}{\@tabacckludge's}
+\DeclareInputText{157}{\v t}
+\DeclareInputText{158}{\v z}
+\DeclareInputText{159}{\@tabacckludge'z}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\textasciicaron}
+\DeclareInputText{162}{\textasciibreve}
+\DeclareInputText{163}{\L}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\k A}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\c S}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\.Z}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\k{}}
+\DeclareInputText{179}{\l}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\k a}
+\DeclareInputText{186}{\c s}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\v L}
+\DeclareInputText{189}{\textacutedbl}
+\DeclareInputText{190}{\v l}
+\DeclareInputText{191}{\.z}
+\DeclareInputText{192}{\@tabacckludge'R}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\u A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\@tabacckludge'L}
+\DeclareInputText{198}{\@tabacckludge'C}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\v C}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\k E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\v E}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\v D}
+\DeclareInputText{208}{\DJ}
+\DeclareInputText{209}{\@tabacckludge'N}
+\DeclareInputText{210}{\v N}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\H O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\v R}
+\DeclareInputText{217}{\r U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\H U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\@tabacckludge'Y}
+\DeclareInputText{222}{\c T}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge'r}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\u a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\@tabacckludge'l}
+\DeclareInputText{230}{\@tabacckludge'c}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\v c}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\k e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\v e}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\v d}
+\DeclareInputText{240}{\dj}
+\DeclareInputText{241}{\@tabacckludge'n}
+\DeclareInputText{242}{\v n}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\H o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\v r}
+\DeclareInputText{249}{\r u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\H u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\@tabacckludge'y}
+\DeclareInputText{254}{\c t}
+\DeclareInputText{255}{\.{}}
+\RestoreAtCatcode
+%</cp1250>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp1251}
+%
+% \begin{macrocode}
+%<*cp1251>
+\ProvidesFile{x-cp1251.def}%
+ [2016/05/16 v1.11 Input encoding cp1251 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textnumero}{%
+ N%
+ \bgroup
+ \check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse
+ \selectfont
+ \ooalign{%
+ \raise0.5ex\hbox{o}%
+ \crcr
+ \hline
+ }%
+ \egroup
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\DeclareInputText{128}{\CYRDJE}
+\DeclareInputText{129}{\@tabacckludge'\CYRG}
+\DeclareInputText{130}{\quotesinglbase}
+\DeclareInputText{131}{\@tabacckludge'\cyrg}
+\DeclareInputText{132}{\quotedblbase}
+\DeclareInputText{133}{\textellipsis}
+\DeclareInputText{134}{\textdagger}
+\DeclareInputText{135}{\textdaggerdbl}
+\DeclareInputText{136}{\texteuro}
+\DeclareInputText{137}{\textperthousand}
+\DeclareInputText{138}{\CYRLJE}
+\DeclareInputText{139}{\guilsinglleft}
+\DeclareInputText{140}{\CYRNJE}
+\DeclareInputText{141}{\@tabacckludge'\CYRK}
+\DeclareInputText{142}{\CYRTSHE}
+\DeclareInputText{143}{\CYRDZHE}
+\DeclareInputText{144}{\cyrdje}
+\DeclareInputText{145}{\textquoteleft}
+\DeclareInputText{146}{\textquoteright}
+\DeclareInputText{147}{\textquotedblleft}
+\DeclareInputText{148}{\textquotedblright}
+\DeclareInputText{149}{\textbullet}
+\DeclareInputText{150}{\textendash}
+\DeclareInputText{151}{\textemdash}
+\DeclareInputText{153}{\texttrademark}
+\DeclareInputText{154}{\cyrlje}
+\DeclareInputText{155}{\guilsinglright}
+\DeclareInputText{156}{\cyrnje}
+\DeclareInputText{157}{\@tabacckludge'\cyrk}
+\DeclareInputText{158}{\cyrtshe}
+\DeclareInputText{159}{\cyrdzhe}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\CYRUSHRT}
+\DeclareInputText{162}{\cyrushrt}
+\DeclareInputText{163}{\CYRJE}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\CYRGUP}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\CYRYO}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\CYRIE}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\CYRYI}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\CYRII}
+\DeclareInputText{179}{\cyrii}
+\DeclareInputText{180}{\cyrgup}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\cyryo}
+\DeclareInputText{185}{\textnumero}
+\DeclareInputText{186}{\cyrie}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\cyrje}
+\DeclareInputText{189}{\CYRDZE}
+\DeclareInputText{190}{\cyrdze}
+\DeclareInputText{191}{\cyryi}
+\DeclareInputText{192}{\CYRA}
+\DeclareInputText{193}{\CYRB}
+\DeclareInputText{194}{\CYRV}
+\DeclareInputText{195}{\CYRG}
+\DeclareInputText{196}{\CYRD}
+\DeclareInputText{197}{\CYRE}
+\DeclareInputText{198}{\CYRZH}
+\DeclareInputText{199}{\CYRZ}
+\DeclareInputText{200}{\CYRI}
+\DeclareInputText{201}{\CYRISHRT}
+\DeclareInputText{202}{\CYRK}
+\DeclareInputText{203}{\CYRL}
+\DeclareInputText{204}{\CYRM}
+\DeclareInputText{205}{\CYRN}
+\DeclareInputText{206}{\CYRO}
+\DeclareInputText{207}{\CYRP}
+\DeclareInputText{208}{\CYRR}
+\DeclareInputText{209}{\CYRS}
+\DeclareInputText{210}{\CYRT}
+\DeclareInputText{211}{\CYRU}
+\DeclareInputText{212}{\CYRF}
+\DeclareInputText{213}{\CYRH}
+\DeclareInputText{214}{\CYRC}
+\DeclareInputText{215}{\CYRCH}
+\DeclareInputText{216}{\CYRSH}
+\DeclareInputText{217}{\CYRSHCH}
+\DeclareInputText{218}{\CYRHRDSN}
+\DeclareInputText{219}{\CYRERY}
+\DeclareInputText{220}{\CYRSFTSN}
+\DeclareInputText{221}{\CYREREV}
+\DeclareInputText{222}{\CYRYU}
+\DeclareInputText{223}{\CYRYA}
+\DeclareInputText{224}{\cyra}
+\DeclareInputText{225}{\cyrb}
+\DeclareInputText{226}{\cyrv}
+\DeclareInputText{227}{\cyrg}
+\DeclareInputText{228}{\cyrd}
+\DeclareInputText{229}{\cyre}
+\DeclareInputText{230}{\cyrzh}
+\DeclareInputText{231}{\cyrz}
+\DeclareInputText{232}{\cyri}
+\DeclareInputText{233}{\cyrishrt}
+\DeclareInputText{234}{\cyrk}
+\DeclareInputText{235}{\cyrl}
+\DeclareInputText{236}{\cyrm}
+\DeclareInputText{237}{\cyrn}
+\DeclareInputText{238}{\cyro}
+\DeclareInputText{239}{\cyrp}
+\DeclareInputText{240}{\cyrr}
+\DeclareInputText{241}{\cyrs}
+\DeclareInputText{242}{\cyrt}
+\DeclareInputText{243}{\cyru}
+\DeclareInputText{244}{\cyrf}
+\DeclareInputText{245}{\cyrh}
+\DeclareInputText{246}{\cyrc}
+\DeclareInputText{247}{\cyrch}
+\DeclareInputText{248}{\cyrsh}
+\DeclareInputText{249}{\cyrshch}
+\DeclareInputText{250}{\cyrhrdsn}
+\DeclareInputText{251}{\cyrery}
+\DeclareInputText{252}{\cyrsftsn}
+\DeclareInputText{253}{\cyrerev}
+\DeclareInputText{254}{\cyryu}
+\DeclareInputText{255}{\cyrya}
+\RestoreAtCatcode
+%</cp1251>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp1252}
+%
+% \begin{macrocode}
+%<*cp1252>
+\ProvidesFile{x-cp1252.def}%
+ [2016/05/16 v1.11 Input encoding cp1252 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{128}{\texteuro}
+\DeclareInputText{130}{\quotesinglbase}
+\DeclareInputText{131}{\textflorin}
+\DeclareInputText{132}{\quotedblbase}
+\DeclareInputText{133}{\textellipsis}
+\DeclareInputText{134}{\textdagger}
+\DeclareInputText{135}{\textdaggerdbl}
+\DeclareInputText{136}{\textasciicircum}
+\DeclareInputText{137}{\textperthousand}
+\DeclareInputText{138}{\v S}
+\DeclareInputText{139}{\guilsinglleft}
+\DeclareInputText{140}{\OE}
+\DeclareInputText{142}{\v Z}
+\DeclareInputText{145}{\textquoteleft}
+\DeclareInputText{146}{\textquoteright}
+\DeclareInputText{147}{\textquotedblleft}
+\DeclareInputText{148}{\textquotedblright}
+\DeclareInputText{149}{\textbullet}
+\DeclareInputText{150}{\textendash}
+\DeclareInputText{151}{\textemdash}
+\DeclareInputText{152}{\textasciitilde}
+\DeclareInputText{153}{\texttrademark}
+\DeclareInputText{154}{\v s}
+\DeclareInputText{155}{\guilsinglright}
+\DeclareInputText{156}{\oe}
+\DeclareInputText{158}{\v z}
+\DeclareInputText{159}{\"Y}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\textexclamdown}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\textordfeminine}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\textasciimacron}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\textordmasculine}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+\DeclareInputText{191}{\textquestiondown}
+\DeclareInputText{192}{\@tabacckludge`A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\~A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\@tabacckludge`E}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\^E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\@tabacckludge`I}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{208}{\DH}
+\DeclareInputText{209}{\~N}
+\DeclareInputText{210}{\@tabacckludge`O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\O}
+\DeclareInputText{217}{\@tabacckludge`U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\@tabacckludge'Y}
+\DeclareInputText{222}{\TH}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge`a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\~a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\@tabacckludge`e}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\^e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\@tabacckludge`\i}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{240}{\dh}
+\DeclareInputText{241}{\~n}
+\DeclareInputText{242}{\@tabacckludge`o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\o}
+\DeclareInputText{249}{\@tabacckludge`u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\@tabacckludge'y}
+\DeclareInputText{254}{\th}
+\DeclareInputText{255}{\"y}
+\RestoreAtCatcode
+%</cp1252>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp1255}
+%
+% \begin{macrocode}
+%<*cp1255>
+\ProvidesFile{x-cp1255.def}%
+ [2016/05/16 v1.11 Input encoding cp1255 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{128}{\texteuro}
+\DeclareInputText{130}{\quotesinglbase}
+\DeclareInputText{131}{\textflorin}
+\DeclareInputText{132}{\quotedblbase}
+\DeclareInputText{133}{\textellipsis}
+\DeclareInputText{134}{\textdagger}
+\DeclareInputText{135}{\textdaggerdbl}
+\DeclareInputText{136}{\textasciicircum}
+\DeclareInputText{137}{\textperthousand}
+\DeclareInputText{139}{\guilsinglleft}
+\DeclareInputText{145}{\textquoteleft}
+\DeclareInputText{146}{\textquoteright}
+\DeclareInputText{147}{\textquotedblleft}
+\DeclareInputText{148}{\textquotedblright}
+\DeclareInputText{149}{\textbullet}
+\DeclareInputText{150}{\textendash}
+\DeclareInputText{151}{\textemdash}
+\DeclareInputText{152}{\textasciitilde}
+\DeclareInputText{153}{\texttrademark}
+\DeclareInputText{155}{\guilsinglright}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{161}{\textexclamdown}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textasciidieresis}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\texttimes}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\textasciimacron}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\c\ }
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\textdiv}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+\DeclareInputText{191}{\textquestiondown}
+\DeclareInputText{224}{\hebalef}
+\DeclareInputText{225}{\hebbet}
+\DeclareInputText{226}{\hebgimel}
+\DeclareInputText{227}{\hebdalet}
+\DeclareInputText{228}{\hebhe}
+\DeclareInputText{229}{\hebvav}
+\DeclareInputText{230}{\hebzayin}
+\DeclareInputText{231}{\hebhet}
+\DeclareInputText{232}{\hebtet}
+\DeclareInputText{233}{\hebyod}
+\DeclareInputText{234}{\hebfinalkaf}
+\DeclareInputText{235}{\hebkaf}
+\DeclareInputText{236}{\heblamed}
+\DeclareInputText{237}{\hebfinalmem}
+\DeclareInputText{238}{\hebmem}
+\DeclareInputText{239}{\hebfinalnun}
+\DeclareInputText{240}{\hebnun}
+\DeclareInputText{241}{\hebsamekh}
+\DeclareInputText{242}{\hebayin}
+\DeclareInputText{243}{\hebfinalpe}
+\DeclareInputText{244}{\hebpe}
+\DeclareInputText{245}{\hebfinaltsadi}
+\DeclareInputText{246}{\hebtsadi}
+\DeclareInputText{247}{\hebqof}
+\DeclareInputText{248}{\hebresh}
+\DeclareInputText{249}{\hebshin}
+\DeclareInputText{250}{\hebtav}
+\RestoreAtCatcode
+%</cp1255>
+% \end{macrocode}
+%
+% \subsubsection{Encoding cp1257}
+%
+% \begin{macrocode}
+%<*cp1257>
+\ProvidesFile{x-cp1257.def}%
+ [2016/05/16 v1.11 Input encoding cp1257 (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\DeclareInputText{128}{\texteuro}
+\DeclareInputText{130}{\quotesinglbase}
+\DeclareInputText{132}{\quotedblbase}
+\DeclareInputText{133}{\textellipsis}
+\DeclareInputText{134}{\textdagger}
+\DeclareInputText{135}{\textdaggerdbl}
+\DeclareInputText{137}{\textperthousand}
+\DeclareInputText{139}{\guilsinglleft}
+\DeclareInputText{141}{\textasciidieresis}
+\DeclareInputText{142}{\textasciicaron}
+\DeclareInputText{143}{\c\ }
+\DeclareInputText{145}{\textquoteleft}
+\DeclareInputText{146}{\textquoteright}
+\DeclareInputText{147}{\textquotedblleft}
+\DeclareInputText{148}{\textquotedblright}
+\DeclareInputText{149}{\textbullet}
+\DeclareInputText{150}{\textendash}
+\DeclareInputText{151}{\textemdash}
+\DeclareInputText{153}{\texttrademark}
+\DeclareInputText{155}{\guilsinglright}
+\DeclareInputText{157}{\textasciimacron}
+\DeclareInputText{158}{\k{}}
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textcurrency}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\O}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\c R}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\textlnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\AE}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{180}{\textasciiacute}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{184}{\o}
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\c r}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+\DeclareInputText{191}{\ae}
+\DeclareInputText{192}{\k A}
+\DeclareInputText{193}{\k I}
+\DeclareInputText{194}{\@tabacckludge=A}
+\DeclareInputText{195}{\@tabacckludge'C}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\k E}
+\DeclareInputText{199}{\@tabacckludge=E}
+\DeclareInputText{200}{\v C}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\@tabacckludge'Z}
+\DeclareInputText{203}{\.E}
+\DeclareInputText{204}{\c G}
+\DeclareInputText{205}{\c K}
+\DeclareInputText{206}{\@tabacckludge=I}
+\DeclareInputText{207}{\c L}
+\DeclareInputText{208}{\v S}
+\DeclareInputText{209}{\@tabacckludge'N}
+\DeclareInputText{210}{\c N}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\@tabacckludge=O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\texttimes}
+\DeclareInputText{216}{\k U}
+\DeclareInputText{217}{\L}
+\DeclareInputText{218}{\@tabacckludge'S}
+\DeclareInputText{219}{\@tabacckludge=U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\.Z}
+\DeclareInputText{222}{\v Z}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\k a}
+\DeclareInputText{225}{\k i}
+\DeclareInputText{226}{\@tabacckludge=a}
+\DeclareInputText{227}{\@tabacckludge'c}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\k e}
+\DeclareInputText{231}{\@tabacckludge=e}
+\DeclareInputText{232}{\v c}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\@tabacckludge'z}
+\DeclareInputText{235}{\.e}
+\DeclareInputText{236}{\c g}
+\DeclareInputText{237}{\c k}
+\DeclareInputText{238}{\@tabacckludge=\i}
+\DeclareInputText{239}{\c l}
+\DeclareInputText{240}{\v s}
+\DeclareInputText{241}{\@tabacckludge'n}
+\DeclareInputText{242}{\c n}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\@tabacckludge=o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\textdiv}
+\DeclareInputText{248}{\k u}
+\DeclareInputText{249}{\l}
+\DeclareInputText{250}{\@tabacckludge's}
+\DeclareInputText{251}{\@tabacckludge=u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\.z}
+\DeclareInputText{254}{\v z}
+\DeclareInputText{255}{\.{}}
+\RestoreAtCatcode
+%</cp1257>
+% \end{macrocode}
+%
+% \subsubsection{Encoding dec-mcs}
+%
+% \begin{macrocode}
+%<*dec-mcs>
+\ProvidesFile{x-dec-mcs.def}%
+ [2016/05/16 v1.11 Input encoding dec-mcs (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{161}{\textexclamdown}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textcurrency}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\textordfeminine}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\texttwosuperior}
+\DeclareInputText{179}{\textthreesuperior}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textperiodcentered}
+\DeclareInputText{185}{\textonesuperior}
+\DeclareInputText{186}{\textordmasculine}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{191}{\textquestiondown}
+\DeclareInputText{192}{\@tabacckludge`A}
+\DeclareInputText{193}{\@tabacckludge'A}
+\DeclareInputText{194}{\^A}
+\DeclareInputText{195}{\~A}
+\DeclareInputText{196}{\"A}
+\DeclareInputText{197}{\r A}
+\DeclareInputText{198}{\AE}
+\DeclareInputText{199}{\c C}
+\DeclareInputText{200}{\@tabacckludge`E}
+\DeclareInputText{201}{\@tabacckludge'E}
+\DeclareInputText{202}{\^E}
+\DeclareInputText{203}{\"E}
+\DeclareInputText{204}{\@tabacckludge`I}
+\DeclareInputText{205}{\@tabacckludge'I}
+\DeclareInputText{206}{\^I}
+\DeclareInputText{207}{\"I}
+\DeclareInputText{209}{\~N}
+\DeclareInputText{210}{\@tabacckludge`O}
+\DeclareInputText{211}{\@tabacckludge'O}
+\DeclareInputText{212}{\^O}
+\DeclareInputText{213}{\~O}
+\DeclareInputText{214}{\"O}
+\DeclareInputText{215}{\OE}
+\DeclareInputText{216}{\O}
+\DeclareInputText{217}{\@tabacckludge`U}
+\DeclareInputText{218}{\@tabacckludge'U}
+\DeclareInputText{219}{\^U}
+\DeclareInputText{220}{\"U}
+\DeclareInputText{221}{\"Y}
+\DeclareInputText{223}{\ss}
+\DeclareInputText{224}{\@tabacckludge`a}
+\DeclareInputText{225}{\@tabacckludge'a}
+\DeclareInputText{226}{\^a}
+\DeclareInputText{227}{\~a}
+\DeclareInputText{228}{\"a}
+\DeclareInputText{229}{\r a}
+\DeclareInputText{230}{\ae}
+\DeclareInputText{231}{\c c}
+\DeclareInputText{232}{\@tabacckludge`e}
+\DeclareInputText{233}{\@tabacckludge'e}
+\DeclareInputText{234}{\^e}
+\DeclareInputText{235}{\"e}
+\DeclareInputText{236}{\@tabacckludge`\i}
+\DeclareInputText{237}{\@tabacckludge'\i}
+\DeclareInputText{238}{\^\i}
+\DeclareInputText{239}{\"\i}
+\DeclareInputText{241}{\~n}
+\DeclareInputText{242}{\@tabacckludge`o}
+\DeclareInputText{243}{\@tabacckludge'o}
+\DeclareInputText{244}{\^o}
+\DeclareInputText{245}{\~o}
+\DeclareInputText{246}{\"o}
+\DeclareInputText{247}{\oe}
+\DeclareInputText{248}{\o}
+\DeclareInputText{249}{\@tabacckludge`u}
+\DeclareInputText{250}{\@tabacckludge'u}
+\DeclareInputText{251}{\^u}
+\DeclareInputText{252}{\"u}
+\DeclareInputText{253}{\"y}
+\RestoreAtCatcode
+%</dec-mcs>
+% \end{macrocode}
+%
+% \subsubsection{Encoding koi8-r}
+%
+% \begin{macrocode}
+%<*koi8-r>
+\ProvidesFile{x-koi8-r.def}%
+ [2016/05/16 v1.11 Input encoding koi8-r (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textapproxequal}{%
+ \ensuremath\approx
+}
+\ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textgreaterequal}{%
+ \ensuremath\geq
+}
+\ProvideTextCommandDefault{\textlessequal}{%
+ \ensuremath\leq
+}
+\ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\DeclareInputText{128}{\textSFx}
+\DeclareInputText{129}{\textSFxi}
+\DeclareInputText{130}{\textSFi}
+\DeclareInputText{131}{\textSFiii}
+\DeclareInputText{132}{\textSFii}
+\DeclareInputText{133}{\textSFiv}
+\DeclareInputText{134}{\textSFviii}
+\DeclareInputText{135}{\textSFix}
+\DeclareInputText{136}{\textSFvi}
+\DeclareInputText{137}{\textSFvii}
+\DeclareInputText{138}{\textSFv}
+\DeclareInputText{139}{\textupblock}
+\DeclareInputText{140}{\textdnblock}
+\DeclareInputText{141}{\textblock}
+\DeclareInputText{142}{\textlfblock}
+\DeclareInputText{143}{\textrtblock}
+\DeclareInputText{144}{\textltshade}
+\DeclareInputText{145}{\textshade}
+\DeclareInputText{146}{\textdkshade}
+\DeclareInputText{148}{\textblacksquare}
+\DeclareInputText{149}{\textbullet}
+\DeclareInputText{150}{\textsurd}
+\DeclareInputText{151}{\textapproxequal}
+\DeclareInputText{152}{\textlessequal}
+\DeclareInputText{153}{\textgreaterequal}
+\DeclareInputText{154}{\nobreakspace}
+\DeclareInputText{156}{\textdegree}
+\DeclareInputText{157}{\texttwosuperior}
+\DeclareInputText{158}{\textperiodcentered}
+\DeclareInputText{159}{\textdiv}
+\DeclareInputText{160}{\textSFxliii}
+\DeclareInputText{161}{\textSFxxiv}
+\DeclareInputText{162}{\textSFli}
+\DeclareInputText{163}{\cyryo}
+\DeclareInputText{164}{\textSFlii}
+\DeclareInputText{165}{\textSFxxxix}
+\DeclareInputText{166}{\textSFxxii}
+\DeclareInputText{167}{\textSFxxi}
+\DeclareInputText{168}{\textSFxxv}
+\DeclareInputText{169}{\textSFl}
+\DeclareInputText{170}{\textSFxlix}
+\DeclareInputText{171}{\textSFxxxviii}
+\DeclareInputText{172}{\textSFxxviii}
+\DeclareInputText{173}{\textSFxxvii}
+\DeclareInputText{174}{\textSFxxvi}
+\DeclareInputText{175}{\textSFxxxvi}
+\DeclareInputText{176}{\textSFxxxvii}
+\DeclareInputText{177}{\textSFxlii}
+\DeclareInputText{178}{\textSFxix}
+\DeclareInputText{179}{\CYRYO}
+\DeclareInputText{180}{\textSFxx}
+\DeclareInputText{181}{\textSFxxiii}
+\DeclareInputText{182}{\textSFxlvii}
+\DeclareInputText{183}{\textSFxlviii}
+\DeclareInputText{184}{\textSFxli}
+\DeclareInputText{185}{\textSFxlv}
+\DeclareInputText{186}{\textSFxlvi}
+\DeclareInputText{187}{\textSFxl}
+\DeclareInputText{188}{\textSFliv}
+\DeclareInputText{189}{\textSFliii}
+\DeclareInputText{190}{\textSFxliv}
+\DeclareInputText{191}{\textcopyright}
+\DeclareInputText{192}{\cyryu}
+\DeclareInputText{193}{\cyra}
+\DeclareInputText{194}{\cyrb}
+\DeclareInputText{195}{\cyrc}
+\DeclareInputText{196}{\cyrd}
+\DeclareInputText{197}{\cyre}
+\DeclareInputText{198}{\cyrf}
+\DeclareInputText{199}{\cyrg}
+\DeclareInputText{200}{\cyrh}
+\DeclareInputText{201}{\cyri}
+\DeclareInputText{202}{\cyrishrt}
+\DeclareInputText{203}{\cyrk}
+\DeclareInputText{204}{\cyrl}
+\DeclareInputText{205}{\cyrm}
+\DeclareInputText{206}{\cyrn}
+\DeclareInputText{207}{\cyro}
+\DeclareInputText{208}{\cyrp}
+\DeclareInputText{209}{\cyrya}
+\DeclareInputText{210}{\cyrr}
+\DeclareInputText{211}{\cyrs}
+\DeclareInputText{212}{\cyrt}
+\DeclareInputText{213}{\cyru}
+\DeclareInputText{214}{\cyrzh}
+\DeclareInputText{215}{\cyrv}
+\DeclareInputText{216}{\cyrsftsn}
+\DeclareInputText{217}{\cyrery}
+\DeclareInputText{218}{\cyrz}
+\DeclareInputText{219}{\cyrsh}
+\DeclareInputText{220}{\cyrerev}
+\DeclareInputText{221}{\cyrshch}
+\DeclareInputText{222}{\cyrch}
+\DeclareInputText{223}{\cyrhrdsn}
+\DeclareInputText{224}{\CYRYU}
+\DeclareInputText{225}{\CYRA}
+\DeclareInputText{226}{\CYRB}
+\DeclareInputText{227}{\CYRC}
+\DeclareInputText{228}{\CYRD}
+\DeclareInputText{229}{\CYRE}
+\DeclareInputText{230}{\CYRF}
+\DeclareInputText{231}{\CYRG}
+\DeclareInputText{232}{\CYRH}
+\DeclareInputText{233}{\CYRI}
+\DeclareInputText{234}{\CYRISHRT}
+\DeclareInputText{235}{\CYRK}
+\DeclareInputText{236}{\CYRL}
+\DeclareInputText{237}{\CYRM}
+\DeclareInputText{238}{\CYRN}
+\DeclareInputText{239}{\CYRO}
+\DeclareInputText{240}{\CYRP}
+\DeclareInputText{241}{\CYRYA}
+\DeclareInputText{242}{\CYRR}
+\DeclareInputText{243}{\CYRS}
+\DeclareInputText{244}{\CYRT}
+\DeclareInputText{245}{\CYRU}
+\DeclareInputText{246}{\CYRZH}
+\DeclareInputText{247}{\CYRV}
+\DeclareInputText{248}{\CYRSFTSN}
+\DeclareInputText{249}{\CYRERY}
+\DeclareInputText{250}{\CYRZ}
+\DeclareInputText{251}{\CYRSH}
+\DeclareInputText{252}{\CYREREV}
+\DeclareInputText{253}{\CYRSHCH}
+\DeclareInputText{254}{\CYRCH}
+\DeclareInputText{255}{\CYRHRDSN}
+\RestoreAtCatcode
+%</koi8-r>
+% \end{macrocode}
+%
+% \subsubsection{Encoding mac-centeuro}
+%
+% \begin{macrocode}
+%<*mac-centeuro>
+\ProvidesFile{x-mac-centeuro.def}%
+ [2016/05/16 v1.11 Input encoding mac-centeuro (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textgreaterequal}{%
+ \ensuremath\geq
+}
+\ProvideTextCommandDefault{\textincrement}{%
+ \ensuremath\Delta
+}
+\ProvideTextCommandDefault{\textlessequal}{%
+ \ensuremath\leq
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textlozenge}{%
+ \ensuremath\diamond
+}
+\ProvideTextCommandDefault{\textnotequal}{%
+ \ensuremath\neq
+}
+\ProvideTextCommandDefault{\textpartial}{%
+ \ensuremath\partial
+}
+\ProvideTextCommandDefault{\textsummation}{%
+ \ensuremath\Sigma
+}
+\ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+}
+\DeclareInputText{128}{\"A}
+\DeclareInputText{129}{\@tabacckludge=A}
+\DeclareInputText{130}{\@tabacckludge=a}
+\DeclareInputText{131}{\@tabacckludge'E}
+\DeclareInputText{132}{\k A}
+\DeclareInputText{133}{\"O}
+\DeclareInputText{134}{\"U}
+\DeclareInputText{135}{\@tabacckludge'a}
+\DeclareInputText{136}{\k a}
+\DeclareInputText{137}{\v C}
+\DeclareInputText{138}{\"a}
+\DeclareInputText{139}{\v c}
+\DeclareInputText{140}{\@tabacckludge'C}
+\DeclareInputText{141}{\@tabacckludge'c}
+\DeclareInputText{142}{\@tabacckludge'e}
+\DeclareInputText{143}{\@tabacckludge'Z}
+\DeclareInputText{144}{\@tabacckludge'z}
+\DeclareInputText{145}{\v D}
+\DeclareInputText{146}{\@tabacckludge'\i}
+\DeclareInputText{147}{\v d}
+\DeclareInputText{148}{\@tabacckludge=E}
+\DeclareInputText{149}{\@tabacckludge=e}
+\DeclareInputText{150}{\.E}
+\DeclareInputText{151}{\@tabacckludge'o}
+\DeclareInputText{152}{\.e}
+\DeclareInputText{153}{\^o}
+\DeclareInputText{154}{\"o}
+\DeclareInputText{155}{\~o}
+\DeclareInputText{156}{\@tabacckludge'u}
+\DeclareInputText{157}{\v E}
+\DeclareInputText{158}{\v e}
+\DeclareInputText{159}{\"u}
+\DeclareInputText{160}{\textdagger}
+\DeclareInputText{161}{\textdegree}
+\DeclareInputText{162}{\k E}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textsection}
+\DeclareInputText{165}{\textbullet}
+\DeclareInputText{166}{\textparagraph}
+\DeclareInputText{167}{\ss}
+\DeclareInputText{168}{\textregistered}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\texttrademark}
+\DeclareInputText{171}{\k e}
+\DeclareInputText{172}{\textasciidieresis}
+\DeclareInputText{173}{\textnotequal}
+\DeclareInputText{174}{\c g}
+\DeclareInputText{175}{\k I}
+\DeclareInputText{176}{\k i}
+\DeclareInputText{177}{\@tabacckludge=I}
+\DeclareInputText{178}{\textlessequal}
+\DeclareInputText{179}{\textgreaterequal}
+\DeclareInputText{180}{\@tabacckludge=\i}
+\DeclareInputText{181}{\c K}
+\DeclareInputText{182}{\textpartial}
+\DeclareInputText{183}{\textsummation}
+\DeclareInputText{184}{\l}
+\DeclareInputText{185}{\c L}
+\DeclareInputText{186}{\c l}
+\DeclareInputText{187}{\v L}
+\DeclareInputText{188}{\v l}
+\DeclareInputText{189}{\@tabacckludge'L}
+\DeclareInputText{190}{\@tabacckludge'l}
+\DeclareInputText{191}{\c N}
+\DeclareInputText{192}{\c n}
+\DeclareInputText{193}{\@tabacckludge'N}
+\DeclareInputText{194}{\textlnot}
+\DeclareInputText{195}{\textsurd}
+\DeclareInputText{196}{\@tabacckludge'n}
+\DeclareInputText{197}{\v N}
+\DeclareInputText{198}{\textincrement}
+\DeclareInputText{199}{\guillemotleft}
+\DeclareInputText{200}{\guillemotright}
+\DeclareInputText{201}{\textellipsis}
+\DeclareInputText{202}{\nobreakspace}
+\DeclareInputText{203}{\v n}
+\DeclareInputText{204}{\H O}
+\DeclareInputText{205}{\~O}
+\DeclareInputText{206}{\H o}
+\DeclareInputText{207}{\@tabacckludge=O}
+\DeclareInputText{208}{\textendash}
+\DeclareInputText{209}{\textemdash}
+\DeclareInputText{210}{\textquotedblleft}
+\DeclareInputText{211}{\textquotedblright}
+\DeclareInputText{212}{\textquoteleft}
+\DeclareInputText{213}{\textquoteright}
+\DeclareInputText{214}{\textdiv}
+\DeclareInputText{215}{\textlozenge}
+\DeclareInputText{216}{\@tabacckludge=o}
+\DeclareInputText{217}{\@tabacckludge'R}
+\DeclareInputText{218}{\@tabacckludge'r}
+\DeclareInputText{219}{\v R}
+\DeclareInputText{220}{\guilsinglleft}
+\DeclareInputText{221}{\guilsinglright}
+\DeclareInputText{222}{\v r}
+\DeclareInputText{223}{\c R}
+\DeclareInputText{224}{\c r}
+\DeclareInputText{225}{\v S}
+\DeclareInputText{226}{\quotesinglbase}
+\DeclareInputText{227}{\quotedblbase}
+\DeclareInputText{228}{\v s}
+\DeclareInputText{229}{\@tabacckludge'S}
+\DeclareInputText{230}{\@tabacckludge's}
+\DeclareInputText{231}{\@tabacckludge'A}
+\DeclareInputText{232}{\v T}
+\DeclareInputText{233}{\v t}
+\DeclareInputText{234}{\@tabacckludge'I}
+\DeclareInputText{235}{\v Z}
+\DeclareInputText{236}{\v z}
+\DeclareInputText{237}{\@tabacckludge=U}
+\DeclareInputText{238}{\@tabacckludge'O}
+\DeclareInputText{239}{\^O}
+\DeclareInputText{240}{\@tabacckludge=u}
+\DeclareInputText{241}{\r U}
+\DeclareInputText{242}{\@tabacckludge'U}
+\DeclareInputText{243}{\r u}
+\DeclareInputText{244}{\H U}
+\DeclareInputText{245}{\H u}
+\DeclareInputText{246}{\k U}
+\DeclareInputText{247}{\k u}
+\DeclareInputText{248}{\@tabacckludge'Y}
+\DeclareInputText{249}{\@tabacckludge'y}
+\DeclareInputText{250}{\c k}
+\DeclareInputText{251}{\.Z}
+\DeclareInputText{252}{\L}
+\DeclareInputText{253}{\.z}
+\DeclareInputText{254}{\c G}
+\DeclareInputText{255}{\textasciicaron}
+\RestoreAtCatcode
+%</mac-centeuro>
+% \end{macrocode}
+%
+% \subsubsection{Encoding mac-cyrillic}
+%
+% \begin{macrocode}
+%<*mac-cyrillic>
+\ProvidesFile{x-mac-cyrillic.def}%
+ [2016/05/16 v1.11 Input encoding mac-cyrillic (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textapproxequal}{%
+ \ensuremath\approx
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textgreaterequal}{%
+ \ensuremath\geq
+}
+\ProvideTextCommandDefault{\textincrement}{%
+ \ensuremath\Delta
+}
+\ProvideTextCommandDefault{\textinfinity}{%
+ \ensuremath\infty
+}
+\ProvideTextCommandDefault{\textlessequal}{%
+ \ensuremath\leq
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textnotequal}{%
+ \ensuremath\neq
+}
+\ProvideTextCommandDefault{\textnumero}{%
+ N%
+ \bgroup
+ \check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse
+ \selectfont
+ \ooalign{%
+ \raise0.5ex\hbox{o}%
+ \crcr
+ \hline
+ }%
+ \egroup
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+}
+\DeclareInputText{128}{\CYRA}
+\DeclareInputText{129}{\CYRB}
+\DeclareInputText{130}{\CYRV}
+\DeclareInputText{131}{\CYRG}
+\DeclareInputText{132}{\CYRD}
+\DeclareInputText{133}{\CYRE}
+\DeclareInputText{134}{\CYRZH}
+\DeclareInputText{135}{\CYRZ}
+\DeclareInputText{136}{\CYRI}
+\DeclareInputText{137}{\CYRISHRT}
+\DeclareInputText{138}{\CYRK}
+\DeclareInputText{139}{\CYRL}
+\DeclareInputText{140}{\CYRM}
+\DeclareInputText{141}{\CYRN}
+\DeclareInputText{142}{\CYRO}
+\DeclareInputText{143}{\CYRP}
+\DeclareInputText{144}{\CYRR}
+\DeclareInputText{145}{\CYRS}
+\DeclareInputText{146}{\CYRT}
+\DeclareInputText{147}{\CYRU}
+\DeclareInputText{148}{\CYRF}
+\DeclareInputText{149}{\CYRH}
+\DeclareInputText{150}{\CYRC}
+\DeclareInputText{151}{\CYRCH}
+\DeclareInputText{152}{\CYRSH}
+\DeclareInputText{153}{\CYRSHCH}
+\DeclareInputText{154}{\CYRHRDSN}
+\DeclareInputText{155}{\CYRERY}
+\DeclareInputText{156}{\CYRSFTSN}
+\DeclareInputText{157}{\CYREREV}
+\DeclareInputText{158}{\CYRYU}
+\DeclareInputText{159}{\CYRYA}
+\DeclareInputText{160}{\textdagger}
+\DeclareInputText{161}{\textdegree}
+\DeclareInputText{162}{\CYRGUP}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textsection}
+\DeclareInputText{165}{\textbullet}
+\DeclareInputText{166}{\textparagraph}
+\DeclareInputText{167}{\CYRII}
+\DeclareInputText{168}{\textregistered}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\texttrademark}
+\DeclareInputText{171}{\CYRDJE}
+\DeclareInputText{172}{\cyrdje}
+\DeclareInputText{173}{\textnotequal}
+\DeclareInputText{174}{\@tabacckludge'\CYRG}
+\DeclareInputText{175}{\@tabacckludge'\cyrg}
+\DeclareInputText{176}{\textinfinity}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\textlessequal}
+\DeclareInputText{179}{\textgreaterequal}
+\DeclareInputText{180}{\cyrii}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\cyrgup}
+\DeclareInputText{183}{\CYRJE}
+\DeclareInputText{184}{\CYRIE}
+\DeclareInputText{185}{\cyrie}
+\DeclareInputText{186}{\CYRYI}
+\DeclareInputText{187}{\cyryi}
+\DeclareInputText{188}{\CYRLJE}
+\DeclareInputText{189}{\cyrlje}
+\DeclareInputText{190}{\CYRNJE}
+\DeclareInputText{191}{\cyrnje}
+\DeclareInputText{192}{\cyrje}
+\DeclareInputText{193}{\CYRDZE}
+\DeclareInputText{194}{\textlnot}
+\DeclareInputText{195}{\textsurd}
+\DeclareInputText{196}{\textflorin}
+\DeclareInputText{197}{\textapproxequal}
+\DeclareInputText{198}{\textincrement}
+\DeclareInputText{199}{\guillemotleft}
+\DeclareInputText{200}{\guillemotright}
+\DeclareInputText{201}{\textellipsis}
+\DeclareInputText{202}{\nobreakspace}
+\DeclareInputText{203}{\CYRTSHE}
+\DeclareInputText{204}{\cyrtshe}
+\DeclareInputText{205}{\@tabacckludge'\CYRK}
+\DeclareInputText{206}{\@tabacckludge'\cyrk}
+\DeclareInputText{207}{\cyrdze}
+\DeclareInputText{208}{\textendash}
+\DeclareInputText{209}{\textemdash}
+\DeclareInputText{210}{\textquotedblleft}
+\DeclareInputText{211}{\textquotedblright}
+\DeclareInputText{212}{\textquoteleft}
+\DeclareInputText{213}{\textquoteright}
+\DeclareInputText{214}{\textdiv}
+\DeclareInputText{215}{\quotedblbase}
+\DeclareInputText{216}{\CYRUSHRT}
+\DeclareInputText{217}{\cyrushrt}
+\DeclareInputText{218}{\CYRDZHE}
+\DeclareInputText{219}{\cyrdzhe}
+\DeclareInputText{220}{\textnumero}
+\DeclareInputText{221}{\CYRYO}
+\DeclareInputText{222}{\cyryo}
+\DeclareInputText{223}{\cyrya}
+\DeclareInputText{224}{\cyra}
+\DeclareInputText{225}{\cyrb}
+\DeclareInputText{226}{\cyrv}
+\DeclareInputText{227}{\cyrg}
+\DeclareInputText{228}{\cyrd}
+\DeclareInputText{229}{\cyre}
+\DeclareInputText{230}{\cyrzh}
+\DeclareInputText{231}{\cyrz}
+\DeclareInputText{232}{\cyri}
+\DeclareInputText{233}{\cyrishrt}
+\DeclareInputText{234}{\cyrk}
+\DeclareInputText{235}{\cyrl}
+\DeclareInputText{236}{\cyrm}
+\DeclareInputText{237}{\cyrn}
+\DeclareInputText{238}{\cyro}
+\DeclareInputText{239}{\cyrp}
+\DeclareInputText{240}{\cyrr}
+\DeclareInputText{241}{\cyrs}
+\DeclareInputText{242}{\cyrt}
+\DeclareInputText{243}{\cyru}
+\DeclareInputText{244}{\cyrf}
+\DeclareInputText{245}{\cyrh}
+\DeclareInputText{246}{\cyrc}
+\DeclareInputText{247}{\cyrch}
+\DeclareInputText{248}{\cyrsh}
+\DeclareInputText{249}{\cyrshch}
+\DeclareInputText{250}{\cyrhrdsn}
+\DeclareInputText{251}{\cyrery}
+\DeclareInputText{252}{\cyrsftsn}
+\DeclareInputText{253}{\cyrerev}
+\DeclareInputText{254}{\cyryu}
+\DeclareInputText{255}{\texteuro}
+\RestoreAtCatcode
+%</mac-cyrillic>
+% \end{macrocode}
+%
+% \subsubsection{Encoding mac-roman}
+%
+% \begin{macrocode}
+%<*mac-roman>
+\ProvidesFile{x-mac-roman.def}%
+ [2016/05/16 v1.11 Input encoding mac-roman (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textOmega}{%
+ \ensuremath\Omega
+}
+\ProvideTextCommandDefault{\textacutedbl}{%
+ \H{}%
+}
+\ProvideTextCommandDefault{\textapproxequal}{%
+ \ensuremath\approx
+}
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciibreve}{%
+ \u{}%
+}
+\ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textfractionsolidus}{%
+ /%
+}
+\ProvideTextCommandDefault{\textgreaterequal}{%
+ \ensuremath\geq
+}
+\ProvideTextCommandDefault{\textincrement}{%
+ \ensuremath\Delta
+}
+\ProvideTextCommandDefault{\textinfinity}{%
+ \ensuremath\infty
+}
+\ProvideTextCommandDefault{\textintegral}{%
+ \ensuremath\int
+}
+\ProvideTextCommandDefault{\textlessequal}{%
+ \ensuremath\leq
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textlozenge}{%
+ \ensuremath\diamond
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textnotequal}{%
+ \ensuremath\neq
+}
+\ProvideTextCommandDefault{\textpartial}{%
+ \ensuremath\partial
+}
+\ProvideTextCommandDefault{\textpi}{%
+ \ensuremath\pi
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textproduct}{%
+ \ensuremath\Pi
+}
+\ProvideTextCommandDefault{\textsummation}{%
+ \ensuremath\Sigma
+}
+\ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{128}{\"A}
+\DeclareInputText{129}{\r A}
+\DeclareInputText{130}{\c C}
+\DeclareInputText{131}{\@tabacckludge'E}
+\DeclareInputText{132}{\~N}
+\DeclareInputText{133}{\"O}
+\DeclareInputText{134}{\"U}
+\DeclareInputText{135}{\@tabacckludge'a}
+\DeclareInputText{136}{\@tabacckludge`a}
+\DeclareInputText{137}{\^a}
+\DeclareInputText{138}{\"a}
+\DeclareInputText{139}{\~a}
+\DeclareInputText{140}{\r a}
+\DeclareInputText{141}{\c c}
+\DeclareInputText{142}{\@tabacckludge'e}
+\DeclareInputText{143}{\@tabacckludge`e}
+\DeclareInputText{144}{\^e}
+\DeclareInputText{145}{\"e}
+\DeclareInputText{146}{\@tabacckludge'\i}
+\DeclareInputText{147}{\@tabacckludge`\i}
+\DeclareInputText{148}{\^\i}
+\DeclareInputText{149}{\"\i}
+\DeclareInputText{150}{\~n}
+\DeclareInputText{151}{\@tabacckludge'o}
+\DeclareInputText{152}{\@tabacckludge`o}
+\DeclareInputText{153}{\^o}
+\DeclareInputText{154}{\"o}
+\DeclareInputText{155}{\~o}
+\DeclareInputText{156}{\@tabacckludge'u}
+\DeclareInputText{157}{\@tabacckludge`u}
+\DeclareInputText{158}{\^u}
+\DeclareInputText{159}{\"u}
+\DeclareInputText{160}{\textdagger}
+\DeclareInputText{161}{\textdegree}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textsection}
+\DeclareInputText{165}{\textbullet}
+\DeclareInputText{166}{\textparagraph}
+\DeclareInputText{167}{\ss}
+\DeclareInputText{168}{\textregistered}
+\DeclareInputText{169}{\textcopyright}
+\DeclareInputText{170}{\texttrademark}
+\DeclareInputText{171}{\textasciiacute}
+\DeclareInputText{172}{\textasciidieresis}
+\DeclareInputText{173}{\textnotequal}
+\DeclareInputText{174}{\AE}
+\DeclareInputText{175}{\O}
+\DeclareInputText{176}{\textinfinity}
+\DeclareInputText{177}{\textpm}
+\DeclareInputText{178}{\textlessequal}
+\DeclareInputText{179}{\textgreaterequal}
+\DeclareInputText{180}{\textyen}
+\DeclareInputText{181}{\textmu}
+\DeclareInputText{182}{\textpartial}
+\DeclareInputText{183}{\textsummation}
+\DeclareInputText{184}{\textproduct}
+\DeclareInputText{185}{\textpi}
+\DeclareInputText{186}{\textintegral}
+\DeclareInputText{187}{\textordfeminine}
+\DeclareInputText{188}{\textordmasculine}
+\DeclareInputText{189}{\textOmega}
+\DeclareInputText{190}{\ae}
+\DeclareInputText{191}{\o}
+\DeclareInputText{192}{\textquestiondown}
+\DeclareInputText{193}{\textexclamdown}
+\DeclareInputText{194}{\textlnot}
+\DeclareInputText{195}{\textsurd}
+\DeclareInputText{196}{\textflorin}
+\DeclareInputText{197}{\textapproxequal}
+\DeclareInputText{198}{\textincrement}
+\DeclareInputText{199}{\guillemotleft}
+\DeclareInputText{200}{\guillemotright}
+\DeclareInputText{201}{\textellipsis}
+\DeclareInputText{202}{\nobreakspace}
+\DeclareInputText{203}{\@tabacckludge`A}
+\DeclareInputText{204}{\~A}
+\DeclareInputText{205}{\~O}
+\DeclareInputText{206}{\OE}
+\DeclareInputText{207}{\oe}
+\DeclareInputText{208}{\textendash}
+\DeclareInputText{209}{\textemdash}
+\DeclareInputText{210}{\textquotedblleft}
+\DeclareInputText{211}{\textquotedblright}
+\DeclareInputText{212}{\textquoteleft}
+\DeclareInputText{213}{\textquoteright}
+\DeclareInputText{214}{\textdiv}
+\DeclareInputText{215}{\textlozenge}
+\DeclareInputText{216}{\"y}
+\DeclareInputText{217}{\"Y}
+\DeclareInputText{218}{\textfractionsolidus}
+\DeclareInputText{219}{\texteuro}
+\DeclareInputText{220}{\guilsinglleft}
+\DeclareInputText{221}{\guilsinglright}
+\DeclareInputText{222}{fi}
+\DeclareInputText{223}{fl}
+\DeclareInputText{224}{\textdaggerdbl}
+\DeclareInputText{225}{\textperiodcentered}
+\DeclareInputText{226}{\quotesinglbase}
+\DeclareInputText{227}{\quotedblbase}
+\DeclareInputText{228}{\textperthousand}
+\DeclareInputText{229}{\^A}
+\DeclareInputText{230}{\^E}
+\DeclareInputText{231}{\@tabacckludge'A}
+\DeclareInputText{232}{\"E}
+\DeclareInputText{233}{\@tabacckludge`E}
+\DeclareInputText{234}{\@tabacckludge'I}
+\DeclareInputText{235}{\^I}
+\DeclareInputText{236}{\"I}
+\DeclareInputText{237}{\@tabacckludge`I}
+\DeclareInputText{238}{\@tabacckludge'O}
+\DeclareInputText{239}{\^O}
+\DeclareInputText{241}{\@tabacckludge`O}
+\DeclareInputText{242}{\@tabacckludge'U}
+\DeclareInputText{243}{\^U}
+\DeclareInputText{244}{\@tabacckludge`U}
+\DeclareInputText{245}{\i}
+\DeclareInputText{246}{\textasciicircum}
+\DeclareInputText{247}{\textasciitilde}
+\DeclareInputText{248}{\textasciimacron}
+\DeclareInputText{249}{\textasciibreve}
+\DeclareInputText{250}{\.{}}
+\DeclareInputText{251}{\r{}}
+\DeclareInputText{252}{\c\ }
+\DeclareInputText{253}{\textacutedbl}
+\DeclareInputText{254}{\k{}}
+\DeclareInputText{255}{\textasciicaron}
+\RestoreAtCatcode
+%</mac-roman>
+% \end{macrocode}
+%
+% \subsubsection{Encoding nextstep}
+%
+% \begin{macrocode}
+%<*nextstep>
+\ProvidesFile{x-nextstep.def}%
+ [2016/05/16 v1.11 Input encoding nextstep (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+\ProvideTextCommandDefault{\textacutedbl}{%
+ \H{}%
+}
+\ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+}
+\ProvideTextCommandDefault{\textasciibreve}{%
+ \u{}%
+}
+\ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+}
+\ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+}
+\ProvideTextCommandDefault{\textasciigrave}{%
+ \@tabacckludge`{}%
+}
+\ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+}
+\ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+}
+\ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+}
+\ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+}
+\ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+}
+\ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+}
+\ProvideTextCommandDefault{\textfractionsolidus}{%
+ /%
+}
+\ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+}
+\ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+}
+\ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+}
+\ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+}
+\ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+}
+\ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+}
+\ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+}
+\ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+}
+\ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+}
+\ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+}
+\ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+}
+\DeclareInputText{128}{\nobreakspace}
+\DeclareInputText{129}{\@tabacckludge`A}
+\DeclareInputText{130}{\@tabacckludge'A}
+\DeclareInputText{131}{\^A}
+\DeclareInputText{132}{\~A}
+\DeclareInputText{133}{\"A}
+\DeclareInputText{134}{\r A}
+\DeclareInputText{135}{\c C}
+\DeclareInputText{136}{\@tabacckludge`E}
+\DeclareInputText{137}{\@tabacckludge'E}
+\DeclareInputText{138}{\^E}
+\DeclareInputText{139}{\"E}
+\DeclareInputText{140}{\@tabacckludge`I}
+\DeclareInputText{141}{\@tabacckludge'I}
+\DeclareInputText{142}{\^I}
+\DeclareInputText{143}{\"I}
+\DeclareInputText{144}{\DH}
+\DeclareInputText{145}{\~N}
+\DeclareInputText{146}{\@tabacckludge`O}
+\DeclareInputText{147}{\@tabacckludge'O}
+\DeclareInputText{148}{\^O}
+\DeclareInputText{149}{\~O}
+\DeclareInputText{150}{\"O}
+\DeclareInputText{151}{\@tabacckludge`U}
+\DeclareInputText{152}{\@tabacckludge'U}
+\DeclareInputText{153}{\^U}
+\DeclareInputText{154}{\"U}
+\DeclareInputText{155}{\@tabacckludge'Y}
+\DeclareInputText{156}{\TH}
+\DeclareInputText{157}{\textmu}
+\DeclareInputText{158}{\texttimes}
+\DeclareInputText{159}{\textdiv}
+\DeclareInputText{160}{\textcopyright}
+\DeclareInputText{161}{\textexclamdown}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\textsterling}
+\DeclareInputText{164}{\textfractionsolidus}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\textflorin}
+\DeclareInputText{167}{\textsection}
+\DeclareInputText{168}{\textcurrency}
+\DeclareInputText{169}{\textquoteright}
+\DeclareInputText{170}{\textquotedblleft}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputText{172}{\guilsinglleft}
+\DeclareInputText{173}{\guilsinglright}
+\DeclareInputText{174}{fi}
+\DeclareInputText{175}{fl}
+\DeclareInputText{176}{\textregistered}
+\DeclareInputText{177}{\textendash}
+\DeclareInputText{178}{\textdagger}
+\DeclareInputText{179}{\textdaggerdbl}
+\DeclareInputText{180}{\textperiodcentered}
+\DeclareInputText{181}{\textbrokenbar}
+\DeclareInputText{182}{\textparagraph}
+\DeclareInputText{183}{\textbullet}
+\DeclareInputText{184}{\quotesinglbase}
+\DeclareInputText{185}{\quotedblbase}
+\DeclareInputText{186}{\textquotedblright}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textellipsis}
+\DeclareInputText{189}{\textperthousand}
+\DeclareInputText{190}{\textlnot}
+\DeclareInputText{191}{\textquestiondown}
+\DeclareInputText{192}{\textonesuperior}
+\DeclareInputText{193}{\textasciigrave}
+\DeclareInputText{194}{\textasciiacute}
+\DeclareInputText{195}{\textasciicircum}
+\DeclareInputText{196}{\textasciitilde}
+\DeclareInputText{197}{\textasciimacron}
+\DeclareInputText{198}{\textasciibreve}
+\DeclareInputText{199}{\.{}}
+\DeclareInputText{200}{\textasciidieresis}
+\DeclareInputText{201}{\texttwosuperior}
+\DeclareInputText{202}{\r{}}
+\DeclareInputText{203}{\c\ }
+\DeclareInputText{204}{\textthreesuperior}
+\DeclareInputText{205}{\textacutedbl}
+\DeclareInputText{206}{\k{}}
+\DeclareInputText{207}{\textasciicaron}
+\DeclareInputText{208}{\textemdash}
+\DeclareInputText{209}{\textpm}
+\DeclareInputText{210}{\textonequarter}
+\DeclareInputText{211}{\textonehalf}
+\DeclareInputText{212}{\textthreequarters}
+\DeclareInputText{213}{\@tabacckludge`a}
+\DeclareInputText{214}{\@tabacckludge'a}
+\DeclareInputText{215}{\^a}
+\DeclareInputText{216}{\~a}
+\DeclareInputText{217}{\"a}
+\DeclareInputText{218}{\r a}
+\DeclareInputText{219}{\c c}
+\DeclareInputText{220}{\@tabacckludge`e}
+\DeclareInputText{221}{\@tabacckludge'e}
+\DeclareInputText{222}{\^e}
+\DeclareInputText{223}{\"e}
+\DeclareInputText{224}{\@tabacckludge`\i}
+\DeclareInputText{225}{\AE}
+\DeclareInputText{226}{\@tabacckludge'\i}
+\DeclareInputText{227}{\textordfeminine}
+\DeclareInputText{228}{\^\i}
+\DeclareInputText{229}{\"\i}
+\DeclareInputText{230}{\dh}
+\DeclareInputText{231}{\~n}
+\DeclareInputText{232}{\L}
+\DeclareInputText{233}{\O}
+\DeclareInputText{234}{\OE}
+\DeclareInputText{235}{\textordmasculine}
+\DeclareInputText{236}{\@tabacckludge`o}
+\DeclareInputText{237}{\@tabacckludge'o}
+\DeclareInputText{238}{\^o}
+\DeclareInputText{239}{\~o}
+\DeclareInputText{240}{\"o}
+\DeclareInputText{241}{\ae}
+\DeclareInputText{242}{\@tabacckludge`u}
+\DeclareInputText{243}{\@tabacckludge'u}
+\DeclareInputText{244}{\^u}
+\DeclareInputText{245}{\i}
+\DeclareInputText{246}{\"u}
+\DeclareInputText{247}{\@tabacckludge'y}
+\DeclareInputText{248}{\l}
+\DeclareInputText{249}{\o}
+\DeclareInputText{250}{\oe}
+\DeclareInputText{251}{\ss}
+\DeclareInputText{252}{\th}
+\DeclareInputText{253}{\"y}
+\RestoreAtCatcode
+%</nextstep>
+% \end{macrocode}
+%
+% \subsubsection{Non-Unicode additions}
+%
+% \begin{macrocode}
+%<*mac-roman>
+\ProvideTextCommandDefault{\textapplelogo}{%
+ \TextSymbolUnavailable\textapplelogo
+}
+\DeclareInputText{240}{\textapplelogo}
+%</mac-roman>
+% \end{macrocode}
+%
+% \subsection{Additions for \xfile{utf8enc.dfu}}
+%
+% \begin{macrocode}
+%<*dfu>
+\ProvidesFile{ix-utf8enc.dfu}%
+ [2016/05/16 v1.11 Additions of inputenx for utf8enc.dfu]%
+\DeclareUnicodeCharacter{00A0}{\nobreakspace}
+\DeclareUnicodeCharacter{00AD}{\-}
+\DeclareUnicodeCharacter{0100}{\@tabacckludge=A}
+\DeclareUnicodeCharacter{0101}{\@tabacckludge=a}
+\DeclareUnicodeCharacter{0108}{\^C}
+\DeclareUnicodeCharacter{0109}{\^c}
+\DeclareUnicodeCharacter{010A}{\.C}
+\DeclareUnicodeCharacter{010B}{\.c}
+\DeclareUnicodeCharacter{0112}{\@tabacckludge=E}
+\DeclareUnicodeCharacter{0113}{\@tabacckludge=e}
+\DeclareUnicodeCharacter{0116}{\.E}
+\DeclareUnicodeCharacter{0117}{\.e}
+\DeclareUnicodeCharacter{011C}{\^G}
+\DeclareUnicodeCharacter{011D}{\^g}
+\DeclareUnicodeCharacter{0120}{\.G}
+\DeclareUnicodeCharacter{0121}{\.g}
+\DeclareUnicodeCharacter{0122}{\c G}
+\DeclareUnicodeCharacter{0123}{\c g}
+\DeclareUnicodeCharacter{0124}{\^H}
+\DeclareUnicodeCharacter{0125}{\^h}
+\DeclareUnicodeCharacter{0126}{\textmalteseH}
+\DeclareUnicodeCharacter{0127}{\textmalteseh}
+\DeclareUnicodeCharacter{0128}{\~I}
+\DeclareUnicodeCharacter{0129}{\~\i}
+\DeclareUnicodeCharacter{012A}{\@tabacckludge=I}
+\DeclareUnicodeCharacter{012B}{\@tabacckludge=\i}
+\DeclareUnicodeCharacter{012E}{\k I}
+\DeclareUnicodeCharacter{012F}{\k i}
+\DeclareUnicodeCharacter{0134}{\^J}
+\DeclareUnicodeCharacter{0135}{\^\j}
+\DeclareUnicodeCharacter{0136}{\c K}
+\DeclareUnicodeCharacter{0137}{\c k}
+\DeclareUnicodeCharacter{0138}{\textkra}
+\DeclareUnicodeCharacter{013B}{\c L}
+\DeclareUnicodeCharacter{013C}{\c l}
+\DeclareUnicodeCharacter{0145}{\c N}
+\DeclareUnicodeCharacter{0146}{\c n}
+\DeclareUnicodeCharacter{014C}{\@tabacckludge=O}
+\DeclareUnicodeCharacter{014D}{\@tabacckludge=o}
+\DeclareUnicodeCharacter{0156}{\c R}
+\DeclareUnicodeCharacter{0157}{\c r}
+\DeclareUnicodeCharacter{015C}{\^S}
+\DeclareUnicodeCharacter{015D}{\^s}
+\DeclareUnicodeCharacter{0166}{\textTstroke}
+\DeclareUnicodeCharacter{0167}{\texttstroke}
+\DeclareUnicodeCharacter{0168}{\~U}
+\DeclareUnicodeCharacter{0169}{\~u}
+\DeclareUnicodeCharacter{016A}{\@tabacckludge=U}
+\DeclareUnicodeCharacter{016B}{\@tabacckludge=u}
+\DeclareUnicodeCharacter{016C}{\u U}
+\DeclareUnicodeCharacter{016D}{\u u}
+\DeclareUnicodeCharacter{0172}{\k U}
+\DeclareUnicodeCharacter{0173}{\k u}
+\DeclareUnicodeCharacter{0174}{\^W}
+\DeclareUnicodeCharacter{0175}{\^w}
+\DeclareUnicodeCharacter{0176}{\^Y}
+\DeclareUnicodeCharacter{0177}{\^y}
+\DeclareUnicodeCharacter{01CD}{\v A}
+\DeclareUnicodeCharacter{01CE}{\v a}
+\DeclareUnicodeCharacter{01CF}{\v I}
+\DeclareUnicodeCharacter{01D0}{\v\i}
+\DeclareUnicodeCharacter{01D1}{\v O}
+\DeclareUnicodeCharacter{01D2}{\v o}
+\DeclareUnicodeCharacter{01D3}{\v U}
+\DeclareUnicodeCharacter{01D4}{\v u}
+\DeclareUnicodeCharacter{01E2}{\@tabacckludge=\AE}
+\DeclareUnicodeCharacter{01E3}{\@tabacckludge=\ae}
+\DeclareUnicodeCharacter{01E6}{\v G}
+\DeclareUnicodeCharacter{01E7}{\v g}
+\DeclareUnicodeCharacter{01E8}{\v K}
+\DeclareUnicodeCharacter{01E9}{\v k}
+\DeclareUnicodeCharacter{01F0}{\v\j}
+\DeclareUnicodeCharacter{01F4}{\@tabacckludge'G}
+\DeclareUnicodeCharacter{01F5}{\@tabacckludge'g}
+\DeclareUnicodeCharacter{01F8}{\@tabacckludge`N}
+\DeclareUnicodeCharacter{01F9}{\@tabacckludge`n}
+\DeclareUnicodeCharacter{01FC}{\@tabacckludge'\AE}
+\DeclareUnicodeCharacter{01FD}{\@tabacckludge'\ae}
+\DeclareUnicodeCharacter{0226}{\.A}
+\DeclareUnicodeCharacter{0227}{\.a}
+\DeclareUnicodeCharacter{0228}{\c E}
+\DeclareUnicodeCharacter{0229}{\c e}
+\DeclareUnicodeCharacter{022E}{\.O}
+\DeclareUnicodeCharacter{022F}{\.o}
+\DeclareUnicodeCharacter{0232}{\@tabacckludge=Y}
+\DeclareUnicodeCharacter{0232}{\@tabacckludge=y}
+\DeclareUnicodeCharacter{0232}{\@tabacckludge=y}
+\DeclareUnicodeCharacter{0237}{\j}
+\DeclareUnicodeCharacter{1E02}{\.B}
+\DeclareUnicodeCharacter{1E03}{\.b}
+\DeclareUnicodeCharacter{1E0A}{\.D}
+\DeclareUnicodeCharacter{1E0B}{\.d}
+\DeclareUnicodeCharacter{1E1E}{\.F}
+\DeclareUnicodeCharacter{1E1F}{\.f}
+\DeclareUnicodeCharacter{1E40}{\.M}
+\DeclareUnicodeCharacter{1E41}{\.m}
+\DeclareUnicodeCharacter{1E56}{\.P}
+\DeclareUnicodeCharacter{1E57}{\.p}
+\DeclareUnicodeCharacter{1E60}{\.S}
+\DeclareUnicodeCharacter{1E61}{\.s}
+\DeclareUnicodeCharacter{1E6A}{\.T}
+\DeclareUnicodeCharacter{1E6B}{\.t}
+\DeclareUnicodeCharacter{1E80}{\@tabacckludge`W}
+\DeclareUnicodeCharacter{1E81}{\@tabacckludge`w}
+\DeclareUnicodeCharacter{1E82}{\@tabacckludge'W}
+\DeclareUnicodeCharacter{1E83}{\@tabacckludge'w}
+\DeclareUnicodeCharacter{1E84}{\"W}
+\DeclareUnicodeCharacter{1E85}{\"w}
+\DeclareUnicodeCharacter{1EF2}{\@tabacckludge`Y}
+\DeclareUnicodeCharacter{1EF3}{\@tabacckludge`y}
+\DeclareUnicodeCharacter{0218}{\textcommabelow S}
+\DeclareUnicodeCharacter{0219}{\textcommabelow s}
+\DeclareUnicodeCharacter{021A}{\textcommabelow T}
+\DeclareUnicodeCharacter{021B}{\textcommabelow t}
+\DeclareUnicodeCharacter{02CB}{\textasciigrave}
+\DeclareUnicodeCharacter{02D9}{\.{}}
+\DeclareUnicodeCharacter{02DA}{\r{}}
+\DeclareUnicodeCharacter{02DB}{\k{}}
+\DeclareUnicodeCharacter{0393}{\textGamma}
+\DeclareUnicodeCharacter{0398}{\textTheta}
+\DeclareUnicodeCharacter{03A3}{\textSigma}
+\DeclareUnicodeCharacter{03A6}{\textPhi}
+\DeclareUnicodeCharacter{03A9}{\textOmega}
+\DeclareUnicodeCharacter{03B1}{\textalpha}
+\DeclareUnicodeCharacter{03B2}{\textbeta}
+\DeclareUnicodeCharacter{03B4}{\textdelta}
+\DeclareUnicodeCharacter{03B5}{\textepsilon}
+\DeclareUnicodeCharacter{03C0}{\textpi}
+\DeclareUnicodeCharacter{03C3}{\textsigma}
+\DeclareUnicodeCharacter{03C4}{\texttau}
+\DeclareUnicodeCharacter{03C6}{\textphi}
+\DeclareUnicodeCharacter{0403}{\@tabacckludge'\CYRG}
+\DeclareUnicodeCharacter{040C}{\@tabacckludge'\CYRK}
+\DeclareUnicodeCharacter{0453}{\@tabacckludge'\cyrg}
+\DeclareUnicodeCharacter{045C}{\@tabacckludge'\cyrk}
+\DeclareUnicodeCharacter{05D0}{\hebalef}
+\DeclareUnicodeCharacter{05D1}{\hebbet}
+\DeclareUnicodeCharacter{05D2}{\hebgimel}
+\DeclareUnicodeCharacter{05D3}{\hebdalet}
+\DeclareUnicodeCharacter{05D4}{\hebhe}
+\DeclareUnicodeCharacter{05D5}{\hebvav}
+\DeclareUnicodeCharacter{05D6}{\hebzayin}
+\DeclareUnicodeCharacter{05D7}{\hebhet}
+\DeclareUnicodeCharacter{05D8}{\hebtet}
+\DeclareUnicodeCharacter{05D9}{\hebyod}
+\DeclareUnicodeCharacter{05DA}{\hebfinalkaf}
+\DeclareUnicodeCharacter{05DB}{\hebkaf}
+\DeclareUnicodeCharacter{05DC}{\heblamed}
+\DeclareUnicodeCharacter{05DD}{\hebfinalmem}
+\DeclareUnicodeCharacter{05DE}{\hebmem}
+\DeclareUnicodeCharacter{05DF}{\hebfinalnun}
+\DeclareUnicodeCharacter{05E0}{\hebnun}
+\DeclareUnicodeCharacter{05E1}{\hebsamekh}
+\DeclareUnicodeCharacter{05E2}{\hebayin}
+\DeclareUnicodeCharacter{05E3}{\hebfinalpe}
+\DeclareUnicodeCharacter{05E4}{\hebpe}
+\DeclareUnicodeCharacter{05E5}{\hebfinaltsadi}
+\DeclareUnicodeCharacter{05E6}{\hebtsadi}
+\DeclareUnicodeCharacter{05E7}{\hebqof}
+\DeclareUnicodeCharacter{05E8}{\hebresh}
+\DeclareUnicodeCharacter{05E9}{\hebshin}
+\DeclareUnicodeCharacter{05EA}{\hebtav}
+\DeclareUnicodeCharacter{2015}{\texthorizontalbar}
+\DeclareUnicodeCharacter{2017}{\textdbllowline}
+\DeclareUnicodeCharacter{207F}{\textnsuperior}
+\DeclareUnicodeCharacter{20A7}{\textpeseta}
+\DeclareUnicodeCharacter{2202}{\textpartial}
+\DeclareUnicodeCharacter{2206}{\textincrement}
+\DeclareUnicodeCharacter{2208}{\textelement}
+\DeclareUnicodeCharacter{220F}{\textproduct}
+\DeclareUnicodeCharacter{2211}{\textsummation}
+\DeclareUnicodeCharacter{2219}{\textbullet}
+\DeclareUnicodeCharacter{221A}{\textsurd}
+\DeclareUnicodeCharacter{221E}{\textinfinity}
+\DeclareUnicodeCharacter{2227}{\textcap}
+\DeclareUnicodeCharacter{2229}{\textintersection}
+\DeclareUnicodeCharacter{222B}{\textintegral}
+\DeclareUnicodeCharacter{222E}{\textcontourintegral}
+\DeclareUnicodeCharacter{2248}{\textapproxequal}
+\DeclareUnicodeCharacter{2260}{\textnotequal}
+\DeclareUnicodeCharacter{2261}{\textequivalence}
+\DeclareUnicodeCharacter{2264}{\textlessequal}
+\DeclareUnicodeCharacter{2265}{\textgreaterequal}
+\DeclareUnicodeCharacter{2310}{\textrevlogicalnot}
+\DeclareUnicodeCharacter{25A0}{\textblacksquare}
+\DeclareUnicodeCharacter{25CA}{\textlozenge}
+\DeclareUnicodeCharacter{FB01}{fi}
+\DeclareUnicodeCharacter{FB02}{fl}
+\DeclareUnicodeCharacter{2500}{\textSFx}
+\DeclareUnicodeCharacter{2502}{\textSFxi}
+\DeclareUnicodeCharacter{250C}{\textSFi}
+\DeclareUnicodeCharacter{2510}{\textSFiii}
+\DeclareUnicodeCharacter{2514}{\textSFii}
+\DeclareUnicodeCharacter{2518}{\textSFiv}
+\DeclareUnicodeCharacter{251C}{\textSFviii}
+\DeclareUnicodeCharacter{2524}{\textSFix}
+\DeclareUnicodeCharacter{252C}{\textSFvi}
+\DeclareUnicodeCharacter{2534}{\textSFvii}
+\DeclareUnicodeCharacter{253C}{\textSFv}
+\DeclareUnicodeCharacter{2550}{\textSFxliii}
+\DeclareUnicodeCharacter{2551}{\textSFxxiv}
+\DeclareUnicodeCharacter{2552}{\textSFli}
+\DeclareUnicodeCharacter{2553}{\textSFlii}
+\DeclareUnicodeCharacter{2554}{\textSFxxxix}
+\DeclareUnicodeCharacter{2555}{\textSFxxii}
+\DeclareUnicodeCharacter{2556}{\textSFxxi}
+\DeclareUnicodeCharacter{2557}{\textSFxxv}
+\DeclareUnicodeCharacter{2558}{\textSFl}
+\DeclareUnicodeCharacter{2559}{\textSFxlix}
+\DeclareUnicodeCharacter{255A}{\textSFxxxviii}
+\DeclareUnicodeCharacter{255B}{\textSFxxviii}
+\DeclareUnicodeCharacter{255C}{\textSFxxvii}
+\DeclareUnicodeCharacter{255D}{\textSFxxvi}
+\DeclareUnicodeCharacter{255E}{\textSFxxxvi}
+\DeclareUnicodeCharacter{255F}{\textSFxxxvii}
+\DeclareUnicodeCharacter{2560}{\textSFxlii}
+\DeclareUnicodeCharacter{2561}{\textSFxix}
+\DeclareUnicodeCharacter{2562}{\textSFxx}
+\DeclareUnicodeCharacter{2563}{\textSFxxiii}
+\DeclareUnicodeCharacter{2564}{\textSFxlvii}
+\DeclareUnicodeCharacter{2565}{\textSFxlviii}
+\DeclareUnicodeCharacter{2566}{\textSFxli}
+\DeclareUnicodeCharacter{2567}{\textSFxlv}
+\DeclareUnicodeCharacter{2568}{\textSFxlvi}
+\DeclareUnicodeCharacter{2569}{\textSFxl}
+\DeclareUnicodeCharacter{256A}{\textSFliv}
+\DeclareUnicodeCharacter{256B}{\textSFliii}
+\DeclareUnicodeCharacter{256C}{\textSFxliv}
+\DeclareUnicodeCharacter{2580}{\textupblock}
+\DeclareUnicodeCharacter{2584}{\textdnblock}
+\DeclareUnicodeCharacter{2588}{\textblock}
+\DeclareUnicodeCharacter{258C}{\textlfblock}
+\DeclareUnicodeCharacter{2590}{\textrtblock}
+\DeclareUnicodeCharacter{2591}{\textltshade}
+\DeclareUnicodeCharacter{2592}{\textshade}
+\DeclareUnicodeCharacter{2593}{\textdkshade}
+%</dfu>
+% \end{macrocode}
+%
+% \subsection{Name list}
+%
+% \begin{macrocode}
+%<*name>
+\ProvidesFile{ix-name.def}%
+ [2016/05/16 v1.11 Name list (inputenx)]%
+% \end{macrocode}
+%
+% \textit{List omitted here, see \xfile{ix-name.def}.}
+% \iffalse
+% \begin{macrocode}
+\InputenxName{AE}{00C6}% LATIN CAPITAL LETTER AE
+\InputenxName{Aacute}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\InputenxName{Abreve}{0102}% LATIN CAPITAL LETTER A WITH BREVE
+\InputenxName{Acircumflex}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\InputenxName{Acyrillic}{0410}% CYRILLIC CAPITAL LETTER A
+\InputenxName{Adieresis}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\InputenxName{Agrave}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\InputenxName{Amacron}{0100}% LATIN CAPITAL LETTER A WITH MACRON
+\InputenxName{Aogonek}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\InputenxName{Aring}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\InputenxName{Atilde}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\InputenxName{Bdotaccent}{1E02}% LATIN CAPITAL LETTER B WITH DOT ABOVE
+\InputenxName{Becyrillic}{0411}% CYRILLIC CAPITAL LETTER BE
+\InputenxName{CYRA}{0410}% CYRILLIC CAPITAL LETTER A
+\InputenxName{CYRB}{0411}% CYRILLIC CAPITAL LETTER BE
+\InputenxName{CYRC}{0426}% CYRILLIC CAPITAL LETTER TSE
+\InputenxName{CYRCH}{0427}% CYRILLIC CAPITAL LETTER CHE
+\InputenxName{CYRD}{0414}% CYRILLIC CAPITAL LETTER DE
+\InputenxName{CYRDJE}{0402}% CYRILLIC CAPITAL LETTER DJE
+\InputenxName{CYRDZE}{0405}% CYRILLIC CAPITAL LETTER DZE
+\InputenxName{CYRDZHE}{040F}% CYRILLIC CAPITAL LETTER DZHE
+\InputenxName{CYRE}{0415}% CYRILLIC CAPITAL LETTER IE
+\InputenxName{CYREREV}{042D}% CYRILLIC CAPITAL LETTER E
+\InputenxName{CYRERY}{042B}% CYRILLIC CAPITAL LETTER YERU
+\InputenxName{CYRF}{0424}% CYRILLIC CAPITAL LETTER EF
+\InputenxName{CYRG}{0413}% CYRILLIC CAPITAL LETTER GHE
+\InputenxName{CYRGUP}{0490}% CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+\InputenxName{CYRH}{0425}% CYRILLIC CAPITAL LETTER HA
+\InputenxName{CYRHRDSN}{042A}% CYRILLIC CAPITAL LETTER HARD SIGN
+\InputenxName{CYRI}{0418}% CYRILLIC CAPITAL LETTER I
+\InputenxName{CYRIE}{0404}% CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\InputenxName{CYRII}{0406}% CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+\InputenxName{CYRISHRT}{0419}% CYRILLIC CAPITAL LETTER SHORT I
+\InputenxName{CYRJE}{0408}% CYRILLIC CAPITAL LETTER JE
+\InputenxName{CYRK}{041A}% CYRILLIC CAPITAL LETTER KA
+\InputenxName{CYRL}{041B}% CYRILLIC CAPITAL LETTER EL
+\InputenxName{CYRLJE}{0409}% CYRILLIC CAPITAL LETTER LJE
+\InputenxName{CYRM}{041C}% CYRILLIC CAPITAL LETTER EM
+\InputenxName{CYRN}{041D}% CYRILLIC CAPITAL LETTER EN
+\InputenxName{CYRNJE}{040A}% CYRILLIC CAPITAL LETTER NJE
+\InputenxName{CYRO}{041E}% CYRILLIC CAPITAL LETTER O
+\InputenxName{CYRP}{041F}% CYRILLIC CAPITAL LETTER PE
+\InputenxName{CYRR}{0420}% CYRILLIC CAPITAL LETTER ER
+\InputenxName{CYRS}{0421}% CYRILLIC CAPITAL LETTER ES
+\InputenxName{CYRSFTSN}{042C}% CYRILLIC CAPITAL LETTER SOFT SIGN
+\InputenxName{CYRSH}{0428}% CYRILLIC CAPITAL LETTER SHA
+\InputenxName{CYRSHCH}{0429}% CYRILLIC CAPITAL LETTER SHCHA
+\InputenxName{CYRT}{0422}% CYRILLIC CAPITAL LETTER TE
+\InputenxName{CYRTSHE}{040B}% CYRILLIC CAPITAL LETTER TSHE
+\InputenxName{CYRU}{0423}% CYRILLIC CAPITAL LETTER U
+\InputenxName{CYRUSHRT}{040E}% CYRILLIC CAPITAL LETTER SHORT U
+\InputenxName{CYRV}{0412}% CYRILLIC CAPITAL LETTER VE
+\InputenxName{CYRYA}{042F}% CYRILLIC CAPITAL LETTER YA
+\InputenxName{CYRYI}{0407}% CYRILLIC CAPITAL LETTER YI
+\InputenxName{CYRYO}{0401}% CYRILLIC CAPITAL LETTER IO
+\InputenxName{CYRYU}{042E}% CYRILLIC CAPITAL LETTER YU
+\InputenxName{CYRZ}{0417}% CYRILLIC CAPITAL LETTER ZE
+\InputenxName{CYRZH}{0416}% CYRILLIC CAPITAL LETTER ZHE
+\InputenxName{Cacute}{0106}% LATIN CAPITAL LETTER C WITH ACUTE
+\InputenxName{Ccaron}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\InputenxName{Ccedilla}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\InputenxName{Ccircumflex}{0108}% LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+\InputenxName{Cdot}{010A}% LATIN CAPITAL LETTER C WITH DOT ABOVE
+\InputenxName{Cdotaccent}{010A}% LATIN CAPITAL LETTER C WITH DOT ABOVE
+\InputenxName{Checyrillic}{0427}% CYRILLIC CAPITAL LETTER CHE
+\InputenxName{DH}{00D0}% LATIN CAPITAL LETTER ETH
+\InputenxName{DJ}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\InputenxName{Dcaron}{010E}% LATIN CAPITAL LETTER D WITH CARON
+\InputenxName{Dcroat}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\InputenxName{Ddotaccent}{1E0A}% LATIN CAPITAL LETTER D WITH DOT ABOVE
+\InputenxName{Decyrillic}{0414}% CYRILLIC CAPITAL LETTER DE
+\InputenxName{Delta}{2206}% INCREMENT
+\InputenxName{Djecyrillic}{0402}% CYRILLIC CAPITAL LETTER DJE
+\InputenxName{Dslash}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\InputenxName{Dzecyrillic}{0405}% CYRILLIC CAPITAL LETTER DZE
+\InputenxName{Dzhecyrillic}{040F}% CYRILLIC CAPITAL LETTER DZHE
+\InputenxName{Eacute}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\InputenxName{Ecaron}{011A}% LATIN CAPITAL LETTER E WITH CARON
+\InputenxName{Ecircumflex}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\InputenxName{Ecyrillic}{0404}% CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\InputenxName{Edieresis}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\InputenxName{Edot}{0116}% LATIN CAPITAL LETTER E WITH DOT ABOVE
+\InputenxName{Edotaccent}{0116}% LATIN CAPITAL LETTER E WITH DOT ABOVE
+\InputenxName{Efcyrillic}{0424}% CYRILLIC CAPITAL LETTER EF
+\InputenxName{Egrave}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\InputenxName{Elcyrillic}{041B}% CYRILLIC CAPITAL LETTER EL
+\InputenxName{Emacron}{0112}% LATIN CAPITAL LETTER E WITH MACRON
+\InputenxName{Emcyrillic}{041C}% CYRILLIC CAPITAL LETTER EM
+\InputenxName{Encyrillic}{041D}% CYRILLIC CAPITAL LETTER EN
+\InputenxName{Eng}{014A}% LATIN CAPITAL LETTER ENG
+\InputenxName{Eogonek}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\InputenxName{Ercyrillic}{0420}% CYRILLIC CAPITAL LETTER ER
+\InputenxName{Ereversedcyrillic}{042D}% CYRILLIC CAPITAL LETTER E
+\InputenxName{Escyrillic}{0421}% CYRILLIC CAPITAL LETTER ES
+\InputenxName{Eth}{00D0}% LATIN CAPITAL LETTER ETH
+\InputenxName{Euro}{20AC}% EURO SIGN
+\InputenxName{Fdotaccent}{1E1E}% LATIN CAPITAL LETTER F WITH DOT ABOVE
+\InputenxName{Gamma}{0393}% GREEK CAPITAL LETTER GAMMA
+\InputenxName{Gbreve}{011E}% LATIN CAPITAL LETTER G WITH BREVE
+\InputenxName{Gcedilla}{0122}% LATIN CAPITAL LETTER G WITH CEDILLA
+\InputenxName{Gcircumflex}{011C}% LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+\InputenxName{Gcommaaccent}{0122}% LATIN CAPITAL LETTER G WITH CEDILLA
+\InputenxName{Gdot}{0120}% LATIN CAPITAL LETTER G WITH DOT ABOVE
+\InputenxName{Gdotaccent}{0120}% LATIN CAPITAL LETTER G WITH DOT ABOVE
+\InputenxName{Gecyrillic}{0413}% CYRILLIC CAPITAL LETTER GHE
+\InputenxName{Gheupturncyrillic}{0490}% CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+\InputenxName{Gjecyrillic}{0403}% CYRILLIC CAPITAL LETTER GJE
+\InputenxName{Hardsigncyrillic}{042A}% CYRILLIC CAPITAL LETTER HARD SIGN
+\InputenxName{Hbar}{0126}% LATIN CAPITAL LETTER H WITH STROKE
+\InputenxName{Hcircumflex}{0124}% LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+\InputenxName{IAcyrillic}{042F}% CYRILLIC CAPITAL LETTER YA
+\InputenxName{IJ}{0132}% LATIN CAPITAL LIGATURE IJ
+\InputenxName{IUcyrillic}{042E}% CYRILLIC CAPITAL LETTER YU
+\InputenxName{Iacute}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\InputenxName{Icircumflex}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\InputenxName{Icyrillic}{0406}% CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+\InputenxName{Idieresis}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\InputenxName{Idot}{0130}% LATIN CAPITAL LETTER I WITH DOT ABOVE
+\InputenxName{Idotaccent}{0130}% LATIN CAPITAL LETTER I WITH DOT ABOVE
+\InputenxName{Iecyrillic}{0415}% CYRILLIC CAPITAL LETTER IE
+\InputenxName{Igrave}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\InputenxName{Iicyrillic}{0418}% CYRILLIC CAPITAL LETTER I
+\InputenxName{Iishortcyrillic}{0419}% CYRILLIC CAPITAL LETTER SHORT I
+\InputenxName{Imacron}{012A}% LATIN CAPITAL LETTER I WITH MACRON
+\InputenxName{Iocyrillic}{0401}% CYRILLIC CAPITAL LETTER IO
+\InputenxName{Iogonek}{012E}% LATIN CAPITAL LETTER I WITH OGONEK
+\InputenxName{Itilde}{0128}% LATIN CAPITAL LETTER I WITH TILDE
+\InputenxName{Jcircumflex}{0134}% LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+\InputenxName{Jecyrillic}{0408}% CYRILLIC CAPITAL LETTER JE
+\InputenxName{Kacyrillic}{041A}% CYRILLIC CAPITAL LETTER KA
+\InputenxName{Kcedilla}{0136}% LATIN CAPITAL LETTER K WITH CEDILLA
+\InputenxName{Kcommaaccent}{0136}% LATIN CAPITAL LETTER K WITH CEDILLA
+\InputenxName{Khacyrillic}{0425}% CYRILLIC CAPITAL LETTER HA
+\InputenxName{Kjecyrillic}{040C}% CYRILLIC CAPITAL LETTER KJE
+\InputenxName{Lacute}{0139}% LATIN CAPITAL LETTER L WITH ACUTE
+\InputenxName{Lcaron}{013D}% LATIN CAPITAL LETTER L WITH CARON
+\InputenxName{Lcedilla}{013B}% LATIN CAPITAL LETTER L WITH CEDILLA
+\InputenxName{Lcommaaccent}{013B}% LATIN CAPITAL LETTER L WITH CEDILLA
+\InputenxName{Ljecyrillic}{0409}% CYRILLIC CAPITAL LETTER LJE
+\InputenxName{Lslash}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\InputenxName{Mdotaccent}{1E40}% LATIN CAPITAL LETTER M WITH DOT ABOVE
+\InputenxName{NG}{014A}% LATIN CAPITAL LETTER ENG
+\InputenxName{Nacute}{0143}% LATIN CAPITAL LETTER N WITH ACUTE
+\InputenxName{Ncaron}{0147}% LATIN CAPITAL LETTER N WITH CARON
+\InputenxName{Ncedilla}{0145}% LATIN CAPITAL LETTER N WITH CEDILLA
+\InputenxName{Ncommaaccent}{0145}% LATIN CAPITAL LETTER N WITH CEDILLA
+\InputenxName{Njecyrillic}{040A}% CYRILLIC CAPITAL LETTER NJE
+\InputenxName{Ntilde}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\InputenxName{OE}{0152}% LATIN CAPITAL LIGATURE OE
+\InputenxName{Oacute}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\InputenxName{Ocircumflex}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\InputenxName{Ocyrillic}{041E}% CYRILLIC CAPITAL LETTER O
+\InputenxName{Odblacute}{0150}% LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\InputenxName{Odieresis}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\InputenxName{Ograve}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\InputenxName{Ohungarumlaut}{0150}% LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\InputenxName{Omacron}{014C}% LATIN CAPITAL LETTER O WITH MACRON
+\InputenxName{Omega}{03A9}% GREEK CAPITAL LETTER OMEGA
+\InputenxName{Omegagreek}{03A9}% GREEK CAPITAL LETTER OMEGA
+\InputenxName{Oslash}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\InputenxName{Otilde}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\InputenxName{Pdotaccent}{1E56}% LATIN CAPITAL LETTER P WITH DOT ABOVE
+\InputenxName{Pecyrillic}{041F}% CYRILLIC CAPITAL LETTER PE
+\InputenxName{Phi}{03A6}% GREEK CAPITAL LETTER PHI
+\InputenxName{Racute}{0154}% LATIN CAPITAL LETTER R WITH ACUTE
+\InputenxName{Rcaron}{0158}% LATIN CAPITAL LETTER R WITH CARON
+\InputenxName{Rcedilla}{0156}% LATIN CAPITAL LETTER R WITH CEDILLA
+\InputenxName{Rcommaaccent}{0156}% LATIN CAPITAL LETTER R WITH CEDILLA
+\InputenxName{SFi}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\InputenxName{SFii}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\InputenxName{SFiii}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\InputenxName{SFiv}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\InputenxName{SFix}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\InputenxName{SFl}{2558}% BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+\InputenxName{SFli}{2552}% BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+\InputenxName{SFlii}{2553}% BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+\InputenxName{SFliii}{256B}% BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+\InputenxName{SFliv}{256A}% BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+\InputenxName{SFv}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\InputenxName{SFvi}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\InputenxName{SFvii}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\InputenxName{SFviii}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\InputenxName{SFx}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\InputenxName{SFxi}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\InputenxName{SFxix}{2561}% BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+\InputenxName{SFxl}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\InputenxName{SFxli}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\InputenxName{SFxlii}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\InputenxName{SFxliii}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\InputenxName{SFxliv}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\InputenxName{SFxlix}{2559}% BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+\InputenxName{SFxlv}{2567}% BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+\InputenxName{SFxlvi}{2568}% BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+\InputenxName{SFxlvii}{2564}% BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+\InputenxName{SFxlviii}{2565}% BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+\InputenxName{SFxx}{2562}% BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+\InputenxName{SFxxi}{2556}% BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+\InputenxName{SFxxii}{2555}% BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+\InputenxName{SFxxiii}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\InputenxName{SFxxiv}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\InputenxName{SFxxv}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\InputenxName{SFxxvi}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\InputenxName{SFxxvii}{255C}% BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+\InputenxName{SFxxviii}{255B}% BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+\InputenxName{SFxxxix}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\InputenxName{SFxxxvi}{255E}% BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+\InputenxName{SFxxxvii}{255F}% BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+\InputenxName{SFxxxviii}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\InputenxName{Sacute}{015A}% LATIN CAPITAL LETTER S WITH ACUTE
+\InputenxName{Scaron}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\InputenxName{Scedilla}{015E}% LATIN CAPITAL LETTER S WITH CEDILLA
+\InputenxName{Scircumflex}{015C}% LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+\InputenxName{Scommaaccent}{0218}% LATIN CAPITAL LETTER S WITH COMMA BELOW
+\InputenxName{Sdotaccent}{1E60}% LATIN CAPITAL LETTER S WITH DOT ABOVE
+\InputenxName{Shacyrillic}{0428}% CYRILLIC CAPITAL LETTER SHA
+\InputenxName{Shchacyrillic}{0429}% CYRILLIC CAPITAL LETTER SHCHA
+\InputenxName{Sigma}{03A3}% GREEK CAPITAL LETTER SIGMA
+\InputenxName{Softsigncyrillic}{042C}% CYRILLIC CAPITAL LETTER SOFT SIGN
+\InputenxName{TH}{00DE}% LATIN CAPITAL LETTER THORN
+\InputenxName{Tbar}{0166}% LATIN CAPITAL LETTER T WITH STROKE
+\InputenxName{Tcaron}{0164}% LATIN CAPITAL LETTER T WITH CARON
+\InputenxName{Tcedilla}{0162}% LATIN CAPITAL LETTER T WITH CEDILLA
+\InputenxName{Tcommaaccent}{0162}% LATIN CAPITAL LETTER T WITH CEDILLA
+\InputenxName{Tdotaccent}{1E6A}% LATIN CAPITAL LETTER T WITH DOT ABOVE
+\InputenxName{Tecyrillic}{0422}% CYRILLIC CAPITAL LETTER TE
+\InputenxName{Theta}{0398}% GREEK CAPITAL LETTER THETA
+\InputenxName{Thorn}{00DE}% LATIN CAPITAL LETTER THORN
+\InputenxName{Tsecyrillic}{0426}% CYRILLIC CAPITAL LETTER TSE
+\InputenxName{Tshecyrillic}{040B}% CYRILLIC CAPITAL LETTER TSHE
+\InputenxName{Tstroke}{0166}% LATIN CAPITAL LETTER T WITH STROKE
+\InputenxName{Uacute}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\InputenxName{Ubreve}{016C}% LATIN CAPITAL LETTER U WITH BREVE
+\InputenxName{Ucircumflex}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\InputenxName{Ucyrillic}{0423}% CYRILLIC CAPITAL LETTER U
+\InputenxName{Udblacute}{0170}% LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\InputenxName{Udieresis}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\InputenxName{Ugrave}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\InputenxName{Uhungarumlaut}{0170}% LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\InputenxName{Umacron}{016A}% LATIN CAPITAL LETTER U WITH MACRON
+\InputenxName{Uogonek}{0172}% LATIN CAPITAL LETTER U WITH OGONEK
+\InputenxName{Uring}{016E}% LATIN CAPITAL LETTER U WITH RING ABOVE
+\InputenxName{Ushortcyrillic}{040E}% CYRILLIC CAPITAL LETTER SHORT U
+\InputenxName{Utilde}{0168}% LATIN CAPITAL LETTER U WITH TILDE
+\InputenxName{Vecyrillic}{0412}% CYRILLIC CAPITAL LETTER VE
+\InputenxName{Wacute}{1E82}% LATIN CAPITAL LETTER W WITH ACUTE
+\InputenxName{Wcircumflex}{0174}% LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+\InputenxName{Wdieresis}{1E84}% LATIN CAPITAL LETTER W WITH DIAERESIS
+\InputenxName{Wgrave}{1E80}% LATIN CAPITAL LETTER W WITH GRAVE
+\InputenxName{Yacute}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\InputenxName{Ycircumflex}{0176}% LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+\InputenxName{Ydieresis}{0178}% LATIN CAPITAL LETTER Y WITH DIAERESIS
+\InputenxName{Yericyrillic}{042B}% CYRILLIC CAPITAL LETTER YERU
+\InputenxName{Ygrave}{1EF2}% LATIN CAPITAL LETTER Y WITH GRAVE
+\InputenxName{Yicyrillic}{0407}% CYRILLIC CAPITAL LETTER YI
+\InputenxName{Zacute}{0179}% LATIN CAPITAL LETTER Z WITH ACUTE
+\InputenxName{Zcaron}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\InputenxName{Zdot}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\InputenxName{Zdotaccent}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\InputenxName{Zecyrillic}{0417}% CYRILLIC CAPITAL LETTER ZE
+\InputenxName{Zhecyrillic}{0416}% CYRILLIC CAPITAL LETTER ZHE
+\InputenxName{aacute}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\InputenxName{abreve}{0103}% LATIN SMALL LETTER A WITH BREVE
+\InputenxName{acircumflex}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\InputenxName{acute}{00B4}% ACUTE ACCENT
+\InputenxName{acutedbl}{02DD}% DOUBLE ACUTE ACCENT
+\InputenxName{acyrillic}{0430}% CYRILLIC SMALL LETTER A
+\InputenxName{adieresis}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\InputenxName{ae}{00E6}% LATIN SMALL LETTER AE
+\InputenxName{agrave}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\InputenxName{alef}{05D0}% HEBREW LETTER ALEF
+\InputenxName{alefhebrew}{05D0}% HEBREW LETTER ALEF
+\InputenxName{alpha}{03B1}% GREEK SMALL LETTER ALPHA
+\InputenxName{amacron}{0101}% LATIN SMALL LETTER A WITH MACRON
+\InputenxName{aogonek}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\InputenxName{approxequal}{2248}% ALMOST EQUAL TO
+\InputenxName{aring}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\InputenxName{asciiacute}{00B4}% ACUTE ACCENT
+\InputenxName{asciibreve}{02D8}% BREVE
+\InputenxName{asciicaron}{02C7}% CARON
+\InputenxName{asciicircum}{02C6}% MODIFIER LETTER CIRCUMFLEX ACCENT
+\InputenxName{asciidieresis}{00A8}% DIAERESIS
+\InputenxName{asciigrave}{02CB}% MODIFIER LETTER GRAVE ACCENT
+\InputenxName{asciimacron}{00AF}% MACRON
+\InputenxName{asciitilde}{02DC}% SMALL TILDE
+\InputenxName{atilde}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\InputenxName{ayin}{05E2}% HEBREW LETTER AYIN
+\InputenxName{ayinhebrew}{05E2}% HEBREW LETTER AYIN
+\InputenxName{bdotaccent}{1E03}% LATIN SMALL LETTER B WITH DOT ABOVE
+\InputenxName{becyrillic}{0431}% CYRILLIC SMALL LETTER BE
+\InputenxName{bet}{05D1}% HEBREW LETTER BET
+\InputenxName{beta}{03B2}% GREEK SMALL LETTER BETA
+\InputenxName{bethebrew}{05D1}% HEBREW LETTER BET
+\InputenxName{blacksquare}{25A0}% BLACK SQUARE
+\InputenxName{block}{2588}% FULL BLOCK
+\InputenxName{breve}{02D8}% BREVE
+\InputenxName{brokenbar}{00A6}% BROKEN BAR
+\InputenxName{bullet}{2022}% BULLET
+\InputenxName{bulletoperator}{2219}% BULLET OPERATOR
+\InputenxName{cacute}{0107}% LATIN SMALL LETTER C WITH ACUTE
+\InputenxName{cap}{2227}% LOGICAL AND
+\InputenxName{caron}{02C7}% CARON
+\InputenxName{ccaron}{010D}% LATIN SMALL LETTER C WITH CARON
+\InputenxName{ccedilla}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\InputenxName{ccircumflex}{0109}% LATIN SMALL LETTER C WITH CIRCUMFLEX
+\InputenxName{cdot}{010B}% LATIN SMALL LETTER C WITH DOT ABOVE
+\InputenxName{cdotaccent}{010B}% LATIN SMALL LETTER C WITH DOT ABOVE
+\InputenxName{cedilla}{00B8}% CEDILLA
+\InputenxName{cent}{00A2}% CENT SIGN
+\InputenxName{checyrillic}{0447}% CYRILLIC SMALL LETTER CHE
+\InputenxName{circumflex}{02C6}% MODIFIER LETTER CIRCUMFLEX ACCENT
+\InputenxName{contourintegral}{222E}% CONTOUR INTEGRAL
+\InputenxName{copyright}{00A9}% COPYRIGHT SIGN
+\InputenxName{currency}{00A4}% CURRENCY SIGN
+\InputenxName{cyra}{0430}% CYRILLIC SMALL LETTER A
+\InputenxName{cyrb}{0431}% CYRILLIC SMALL LETTER BE
+\InputenxName{cyrc}{0446}% CYRILLIC SMALL LETTER TSE
+\InputenxName{cyrch}{0447}% CYRILLIC SMALL LETTER CHE
+\InputenxName{cyrd}{0434}% CYRILLIC SMALL LETTER DE
+\InputenxName{cyrdje}{0452}% CYRILLIC SMALL LETTER DJE
+\InputenxName{cyrdze}{0455}% CYRILLIC SMALL LETTER DZE
+\InputenxName{cyrdzhe}{045F}% CYRILLIC SMALL LETTER DZHE
+\InputenxName{cyre}{0435}% CYRILLIC SMALL LETTER IE
+\InputenxName{cyrerev}{044D}% CYRILLIC SMALL LETTER E
+\InputenxName{cyrery}{044B}% CYRILLIC SMALL LETTER YERU
+\InputenxName{cyrf}{0444}% CYRILLIC SMALL LETTER EF
+\InputenxName{cyrg}{0433}% CYRILLIC SMALL LETTER GHE
+\InputenxName{cyrgup}{0491}% CYRILLIC SMALL LETTER GHE WITH UPTURN
+\InputenxName{cyrh}{0445}% CYRILLIC SMALL LETTER HA
+\InputenxName{cyrhrdsn}{044A}% CYRILLIC SMALL LETTER HARD SIGN
+\InputenxName{cyri}{0438}% CYRILLIC SMALL LETTER I
+\InputenxName{cyrie}{0454}% CYRILLIC SMALL LETTER UKRAINIAN IE
+\InputenxName{cyrii}{0456}% CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+\InputenxName{cyrishrt}{0439}% CYRILLIC SMALL LETTER SHORT I
+\InputenxName{cyrje}{0458}% CYRILLIC SMALL LETTER JE
+\InputenxName{cyrk}{043A}% CYRILLIC SMALL LETTER KA
+\InputenxName{cyrl}{043B}% CYRILLIC SMALL LETTER EL
+\InputenxName{cyrlje}{0459}% CYRILLIC SMALL LETTER LJE
+\InputenxName{cyrm}{043C}% CYRILLIC SMALL LETTER EM
+\InputenxName{cyrn}{043D}% CYRILLIC SMALL LETTER EN
+\InputenxName{cyrnje}{045A}% CYRILLIC SMALL LETTER NJE
+\InputenxName{cyro}{043E}% CYRILLIC SMALL LETTER O
+\InputenxName{cyrp}{043F}% CYRILLIC SMALL LETTER PE
+\InputenxName{cyrr}{0440}% CYRILLIC SMALL LETTER ER
+\InputenxName{cyrs}{0441}% CYRILLIC SMALL LETTER ES
+\InputenxName{cyrsftsn}{044C}% CYRILLIC SMALL LETTER SOFT SIGN
+\InputenxName{cyrsh}{0448}% CYRILLIC SMALL LETTER SHA
+\InputenxName{cyrshch}{0449}% CYRILLIC SMALL LETTER SHCHA
+\InputenxName{cyrt}{0442}% CYRILLIC SMALL LETTER TE
+\InputenxName{cyrtshe}{045B}% CYRILLIC SMALL LETTER TSHE
+\InputenxName{cyru}{0443}% CYRILLIC SMALL LETTER U
+\InputenxName{cyrushrt}{045E}% CYRILLIC SMALL LETTER SHORT U
+\InputenxName{cyrv}{0432}% CYRILLIC SMALL LETTER VE
+\InputenxName{cyrya}{044F}% CYRILLIC SMALL LETTER YA
+\InputenxName{cyryi}{0457}% CYRILLIC SMALL LETTER YI
+\InputenxName{cyryo}{0451}% CYRILLIC SMALL LETTER IO
+\InputenxName{cyryu}{044E}% CYRILLIC SMALL LETTER YU
+\InputenxName{cyrz}{0437}% CYRILLIC SMALL LETTER ZE
+\InputenxName{cyrzh}{0436}% CYRILLIC SMALL LETTER ZHE
+\InputenxName{dagger}{2020}% DAGGER
+\InputenxName{daggerdbl}{2021}% DOUBLE DAGGER
+\InputenxName{dalet}{05D3}% HEBREW LETTER DALET
+\InputenxName{dalethebrew}{05D3}% HEBREW LETTER DALET
+\InputenxName{dbllowline}{2017}% DOUBLE LOW LINE
+\InputenxName{dcaron}{010F}% LATIN SMALL LETTER D WITH CARON
+\InputenxName{dcroat}{0111}% LATIN SMALL LETTER D WITH STROKE
+\InputenxName{ddotaccent}{1E0B}% LATIN SMALL LETTER D WITH DOT ABOVE
+\InputenxName{decyrillic}{0434}% CYRILLIC SMALL LETTER DE
+\InputenxName{degree}{00B0}% DEGREE SIGN
+\InputenxName{delta}{03B4}% GREEK SMALL LETTER DELTA
+\InputenxName{dh}{00F0}% LATIN SMALL LETTER ETH
+\InputenxName{dieresis}{00A8}% DIAERESIS
+\InputenxName{div}{00F7}% DIVISION SIGN
+\InputenxName{divide}{00F7}% DIVISION SIGN
+\InputenxName{dj}{0111}% LATIN SMALL LETTER D WITH STROKE
+\InputenxName{djecyrillic}{0452}% CYRILLIC SMALL LETTER DJE
+\InputenxName{dkshade}{2593}% DARK SHADE
+\InputenxName{dmacron}{0111}% LATIN SMALL LETTER D WITH STROKE
+\InputenxName{dnblock}{2584}% LOWER HALF BLOCK
+\InputenxName{dotaccent}{02D9}% DOT ABOVE
+\InputenxName{dotlessi}{0131}% LATIN SMALL LETTER DOTLESS I
+\InputenxName{dzecyrillic}{0455}% CYRILLIC SMALL LETTER DZE
+\InputenxName{dzhecyrillic}{045F}% CYRILLIC SMALL LETTER DZHE
+\InputenxName{eacute}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\InputenxName{ecaron}{011B}% LATIN SMALL LETTER E WITH CARON
+\InputenxName{ecircumflex}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\InputenxName{ecyrillic}{0454}% CYRILLIC SMALL LETTER UKRAINIAN IE
+\InputenxName{edieresis}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\InputenxName{edot}{0117}% LATIN SMALL LETTER E WITH DOT ABOVE
+\InputenxName{edotaccent}{0117}% LATIN SMALL LETTER E WITH DOT ABOVE
+\InputenxName{efcyrillic}{0444}% CYRILLIC SMALL LETTER EF
+\InputenxName{egrave}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\InputenxName{elcyrillic}{043B}% CYRILLIC SMALL LETTER EL
+\InputenxName{element}{2208}% ELEMENT OF
+\InputenxName{ellipsis}{2026}% HORIZONTAL ELLIPSIS
+\InputenxName{emacron}{0113}% LATIN SMALL LETTER E WITH MACRON
+\InputenxName{emcyrillic}{043C}% CYRILLIC SMALL LETTER EM
+\InputenxName{emdash}{2014}% EM DASH
+\InputenxName{encyrillic}{043D}% CYRILLIC SMALL LETTER EN
+\InputenxName{endash}{2013}% EN DASH
+\InputenxName{eng}{014B}% LATIN SMALL LETTER ENG
+\InputenxName{eogonek}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\InputenxName{epsilon}{03B5}% GREEK SMALL LETTER EPSILON
+\InputenxName{equivalence}{2261}% IDENTICAL TO
+\InputenxName{ercyrillic}{0440}% CYRILLIC SMALL LETTER ER
+\InputenxName{ereversedcyrillic}{044D}% CYRILLIC SMALL LETTER E
+\InputenxName{escyrillic}{0441}% CYRILLIC SMALL LETTER ES
+\InputenxName{eth}{00F0}% LATIN SMALL LETTER ETH
+\InputenxName{euro}{20AC}% EURO SIGN
+\InputenxName{exclamdown}{00A1}% INVERTED EXCLAMATION MARK
+\InputenxName{fdotaccent}{1E1F}% LATIN SMALL LETTER F WITH DOT ABOVE
+\InputenxName{fi}{FB01}% LATIN SMALL LIGATURE FI
+\InputenxName{filledbox}{25A0}% BLACK SQUARE
+\InputenxName{finalkaf}{05DA}% HEBREW LETTER FINAL KAF
+\InputenxName{finalkafhebrew}{05DA}% HEBREW LETTER FINAL KAF
+\InputenxName{finalmem}{05DD}% HEBREW LETTER FINAL MEM
+\InputenxName{finalmemhebrew}{05DD}% HEBREW LETTER FINAL MEM
+\InputenxName{finalnun}{05DF}% HEBREW LETTER FINAL NUN
+\InputenxName{finalnunhebrew}{05DF}% HEBREW LETTER FINAL NUN
+\InputenxName{finalpe}{05E3}% HEBREW LETTER FINAL PE
+\InputenxName{finalpehebrew}{05E3}% HEBREW LETTER FINAL PE
+\InputenxName{finaltsadi}{05E5}% HEBREW LETTER FINAL TSADI
+\InputenxName{finaltsadihebrew}{05E5}% HEBREW LETTER FINAL TSADI
+\InputenxName{fl}{FB02}% LATIN SMALL LIGATURE FL
+\InputenxName{florin}{0192}% LATIN SMALL LETTER F WITH HOOK
+\InputenxName{fourthtonechinese}{02CB}% MODIFIER LETTER GRAVE ACCENT
+\InputenxName{fraction}{2044}% FRACTION SLASH
+\InputenxName{fractionsolidus}{2044}% FRACTION SLASH
+\InputenxName{gbreve}{011F}% LATIN SMALL LETTER G WITH BREVE
+\InputenxName{gcedilla}{0123}% LATIN SMALL LETTER G WITH CEDILLA
+\InputenxName{gcircumflex}{011D}% LATIN SMALL LETTER G WITH CIRCUMFLEX
+\InputenxName{gcommaaccent}{0123}% LATIN SMALL LETTER G WITH CEDILLA
+\InputenxName{gdot}{0121}% LATIN SMALL LETTER G WITH DOT ABOVE
+\InputenxName{gdotaccent}{0121}% LATIN SMALL LETTER G WITH DOT ABOVE
+\InputenxName{gecyrillic}{0433}% CYRILLIC SMALL LETTER GHE
+\InputenxName{germandbls}{00DF}% LATIN SMALL LETTER SHARP S
+\InputenxName{gheupturncyrillic}{0491}% CYRILLIC SMALL LETTER GHE WITH UPTURN
+\InputenxName{gimel}{05D2}% HEBREW LETTER GIMEL
+\InputenxName{gimelhebrew}{05D2}% HEBREW LETTER GIMEL
+\InputenxName{gjecyrillic}{0453}% CYRILLIC SMALL LETTER GJE
+\InputenxName{greaterequal}{2265}% GREATER-THAN OR EQUAL TO
+\InputenxName{guillemotleft}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\InputenxName{guillemotright}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\InputenxName{guilsinglleft}{2039}% SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\InputenxName{guilsinglright}{203A}% SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\InputenxName{hardsigncyrillic}{044A}% CYRILLIC SMALL LETTER HARD SIGN
+\InputenxName{hbar}{0127}% LATIN SMALL LETTER H WITH STROKE
+\InputenxName{hcircumflex}{0125}% LATIN SMALL LETTER H WITH CIRCUMFLEX
+\InputenxName{he}{05D4}% HEBREW LETTER HE
+\InputenxName{hebalef}{05D0}% HEBREW LETTER ALEF
+\InputenxName{hebayin}{05E2}% HEBREW LETTER AYIN
+\InputenxName{hebbet}{05D1}% HEBREW LETTER BET
+\InputenxName{hebdalet}{05D3}% HEBREW LETTER DALET
+\InputenxName{hebfinalkaf}{05DA}% HEBREW LETTER FINAL KAF
+\InputenxName{hebfinalmem}{05DD}% HEBREW LETTER FINAL MEM
+\InputenxName{hebfinalnun}{05DF}% HEBREW LETTER FINAL NUN
+\InputenxName{hebfinalpe}{05E3}% HEBREW LETTER FINAL PE
+\InputenxName{hebfinaltsadi}{05E5}% HEBREW LETTER FINAL TSADI
+\InputenxName{hebgimel}{05D2}% HEBREW LETTER GIMEL
+\InputenxName{hebhe}{05D4}% HEBREW LETTER HE
+\InputenxName{hebhet}{05D7}% HEBREW LETTER HET
+\InputenxName{hebkaf}{05DB}% HEBREW LETTER KAF
+\InputenxName{heblamed}{05DC}% HEBREW LETTER LAMED
+\InputenxName{hebmem}{05DE}% HEBREW LETTER MEM
+\InputenxName{hebnun}{05E0}% HEBREW LETTER NUN
+\InputenxName{hebpe}{05E4}% HEBREW LETTER PE
+\InputenxName{hebqof}{05E7}% HEBREW LETTER QOF
+\InputenxName{hebresh}{05E8}% HEBREW LETTER RESH
+\InputenxName{hebsamekh}{05E1}% HEBREW LETTER SAMEKH
+\InputenxName{hebshin}{05E9}% HEBREW LETTER SHIN
+\InputenxName{hebtav}{05EA}% HEBREW LETTER TAV
+\InputenxName{hebtet}{05D8}% HEBREW LETTER TET
+\InputenxName{hebtsadi}{05E6}% HEBREW LETTER TSADI
+\InputenxName{hebvav}{05D5}% HEBREW LETTER VAV
+\InputenxName{hebyod}{05D9}% HEBREW LETTER YOD
+\InputenxName{hebzayin}{05D6}% HEBREW LETTER ZAYIN
+\InputenxName{hehebrew}{05D4}% HEBREW LETTER HE
+\InputenxName{het}{05D7}% HEBREW LETTER HET
+\InputenxName{hethebrew}{05D7}% HEBREW LETTER HET
+\InputenxName{horizontalbar}{2015}% HORIZONTAL BAR
+\InputenxName{hungarumlaut}{02DD}% DOUBLE ACUTE ACCENT
+\InputenxName{iacute}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\InputenxName{iacyrillic}{044F}% CYRILLIC SMALL LETTER YA
+\InputenxName{icircumflex}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\InputenxName{icyrillic}{0456}% CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+\InputenxName{idieresis}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\InputenxName{iecyrillic}{0435}% CYRILLIC SMALL LETTER IE
+\InputenxName{igrave}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\InputenxName{iicyrillic}{0438}% CYRILLIC SMALL LETTER I
+\InputenxName{iishortcyrillic}{0439}% CYRILLIC SMALL LETTER SHORT I
+\InputenxName{ij}{0133}% LATIN SMALL LIGATURE IJ
+\InputenxName{ilde}{02DC}% SMALL TILDE
+\InputenxName{imacron}{012B}% LATIN SMALL LETTER I WITH MACRON
+\InputenxName{increment}{2206}% INCREMENT
+\InputenxName{infinity}{221E}% INFINITY
+\InputenxName{integral}{222B}% INTEGRAL
+\InputenxName{intersection}{2229}% INTERSECTION
+\InputenxName{iocyrillic}{0451}% CYRILLIC SMALL LETTER IO
+\InputenxName{iogonek}{012F}% LATIN SMALL LETTER I WITH OGONEK
+\InputenxName{itilde}{0129}% LATIN SMALL LETTER I WITH TILDE
+\InputenxName{iucyrillic}{044E}% CYRILLIC SMALL LETTER YU
+\InputenxName{jcircumflex}{0135}% LATIN SMALL LETTER J WITH CIRCUMFLEX
+\InputenxName{jecyrillic}{0458}% CYRILLIC SMALL LETTER JE
+\InputenxName{kacyrillic}{043A}% CYRILLIC SMALL LETTER KA
+\InputenxName{kaf}{05DB}% HEBREW LETTER KAF
+\InputenxName{kafhebrew}{05DB}% HEBREW LETTER KAF
+\InputenxName{kcedilla}{0137}% LATIN SMALL LETTER K WITH CEDILLA
+\InputenxName{kcommaaccent}{0137}% LATIN SMALL LETTER K WITH CEDILLA
+\InputenxName{kgreenlandic}{0138}% LATIN SMALL LETTER KRA
+\InputenxName{khacyrillic}{0445}% CYRILLIC SMALL LETTER HA
+\InputenxName{kjecyrillic}{045C}% CYRILLIC SMALL LETTER KJE
+\InputenxName{kra}{0138}% LATIN SMALL LETTER KRA
+\InputenxName{lacute}{013A}% LATIN SMALL LETTER L WITH ACUTE
+\InputenxName{lamed}{05DC}% HEBREW LETTER LAMED
+\InputenxName{lamedhebrew}{05DC}% HEBREW LETTER LAMED
+\InputenxName{lcaron}{013E}% LATIN SMALL LETTER L WITH CARON
+\InputenxName{lcedilla}{013C}% LATIN SMALL LETTER L WITH CEDILLA
+\InputenxName{lcommaaccent}{013C}% LATIN SMALL LETTER L WITH CEDILLA
+\InputenxName{lessequal}{2264}% LESS-THAN OR EQUAL TO
+\InputenxName{lfblock}{258C}% LEFT HALF BLOCK
+\InputenxName{ljecyrillic}{0459}% CYRILLIC SMALL LETTER LJE
+\InputenxName{lnot}{00AC}% NOT SIGN
+\InputenxName{logicaland}{2227}% LOGICAL AND
+\InputenxName{logicalnot}{00AC}% NOT SIGN
+\InputenxName{logicalnotreversed}{2310}% REVERSED NOT SIGN
+\InputenxName{lozenge}{25CA}% LOZENGE
+\InputenxName{lslash}{0142}% LATIN SMALL LETTER L WITH STROKE
+\InputenxName{ltshade}{2591}% LIGHT SHADE
+\InputenxName{macron}{00AF}% MACRON
+\InputenxName{malteseH}{0126}% LATIN CAPITAL LETTER H WITH STROKE
+\InputenxName{malteseh}{0127}% LATIN SMALL LETTER H WITH STROKE
+\InputenxName{mdotaccent}{1E41}% LATIN SMALL LETTER M WITH DOT ABOVE
+\InputenxName{mem}{05DE}% HEBREW LETTER MEM
+\InputenxName{memhebrew}{05DE}% HEBREW LETTER MEM
+\InputenxName{middot}{00B7}% MIDDLE DOT
+\InputenxName{mu}{00B5}% MICRO SIGN
+\InputenxName{multiply}{00D7}% MULTIPLICATION SIGN
+\InputenxName{nacute}{0144}% LATIN SMALL LETTER N WITH ACUTE
+\InputenxName{nbspace}{00A0}% NO-BREAK SPACE
+\InputenxName{ncaron}{0148}% LATIN SMALL LETTER N WITH CARON
+\InputenxName{ncedilla}{0146}% LATIN SMALL LETTER N WITH CEDILLA
+\InputenxName{ncommaaccent}{0146}% LATIN SMALL LETTER N WITH CEDILLA
+\InputenxName{ng}{014B}% LATIN SMALL LETTER ENG
+\InputenxName{njecyrillic}{045A}% CYRILLIC SMALL LETTER NJE
+\InputenxName{nobreakspace}{00A0}% NO-BREAK SPACE
+\InputenxName{nonbreakingspace}{00A0}% NO-BREAK SPACE
+\InputenxName{notequal}{2260}% NOT EQUAL TO
+\InputenxName{nsuperior}{207F}% SUPERSCRIPT LATIN SMALL LETTER N
+\InputenxName{ntilde}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\InputenxName{numero}{2116}% NUMERO SIGN
+\InputenxName{nun}{05E0}% HEBREW LETTER NUN
+\InputenxName{nunhebrew}{05E0}% HEBREW LETTER NUN
+\InputenxName{oacute}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\InputenxName{ocircumflex}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\InputenxName{ocyrillic}{043E}% CYRILLIC SMALL LETTER O
+\InputenxName{odblacute}{0151}% LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\InputenxName{odieresis}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\InputenxName{oe}{0153}% LATIN SMALL LIGATURE OE
+\InputenxName{ogonek}{02DB}% OGONEK
+\InputenxName{ograve}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\InputenxName{ohungarumlaut}{0151}% LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\InputenxName{omacron}{014D}% LATIN SMALL LETTER O WITH MACRON
+\InputenxName{onehalf}{00BD}% VULGAR FRACTION ONE HALF
+\InputenxName{onequarter}{00BC}% VULGAR FRACTION ONE QUARTER
+\InputenxName{onesuperior}{00B9}% SUPERSCRIPT ONE
+\InputenxName{ordfeminine}{00AA}% FEMININE ORDINAL INDICATOR
+\InputenxName{ordmasculine}{00BA}% MASCULINE ORDINAL INDICATOR
+\InputenxName{oslash}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\InputenxName{otilde}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\InputenxName{overscore}{00AF}% MACRON
+\InputenxName{paragraph}{00B6}% PILCROW SIGN
+\InputenxName{partial}{2202}% PARTIAL DIFFERENTIAL
+\InputenxName{partialdiff}{2202}% PARTIAL DIFFERENTIAL
+\InputenxName{pdotaccent}{1E57}% LATIN SMALL LETTER P WITH DOT ABOVE
+\InputenxName{pe}{05E4}% HEBREW LETTER PE
+\InputenxName{pecyrillic}{043F}% CYRILLIC SMALL LETTER PE
+\InputenxName{pehebrew}{05E4}% HEBREW LETTER PE
+\InputenxName{periodcentered}{00B7}% MIDDLE DOT
+\InputenxName{perthousand}{2030}% PER MILLE SIGN
+\InputenxName{peseta}{20A7}% PESETA SIGN
+\InputenxName{phi}{03C6}% GREEK SMALL LETTER PHI
+\InputenxName{pi}{03C0}% GREEK SMALL LETTER PI
+\InputenxName{plusminus}{00B1}% PLUS-MINUS SIGN
+\InputenxName{pm}{00B1}% PLUS-MINUS SIGN
+\InputenxName{product}{220F}% N-ARY PRODUCT
+\InputenxName{qof}{05E7}% HEBREW LETTER QOF
+\InputenxName{qofhebrew}{05E7}% HEBREW LETTER QOF
+\InputenxName{questiondown}{00BF}% INVERTED QUESTION MARK
+\InputenxName{quotedblbase}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\InputenxName{quotedblleft}{201C}% LEFT DOUBLE QUOTATION MARK
+\InputenxName{quotedblright}{201D}% RIGHT DOUBLE QUOTATION MARK
+\InputenxName{quoteleft}{2018}% LEFT SINGLE QUOTATION MARK
+\InputenxName{quoteright}{2019}% RIGHT SINGLE QUOTATION MARK
+\InputenxName{quotesinglbase}{201A}% SINGLE LOW-9 QUOTATION MARK
+\InputenxName{racute}{0155}% LATIN SMALL LETTER R WITH ACUTE
+\InputenxName{radical}{221A}% SQUARE ROOT
+\InputenxName{rcaron}{0159}% LATIN SMALL LETTER R WITH CARON
+\InputenxName{rcedilla}{0157}% LATIN SMALL LETTER R WITH CEDILLA
+\InputenxName{rcommaaccent}{0157}% LATIN SMALL LETTER R WITH CEDILLA
+\InputenxName{registered}{00AE}% REGISTERED SIGN
+\InputenxName{resh}{05E8}% HEBREW LETTER RESH
+\InputenxName{reshhebrew}{05E8}% HEBREW LETTER RESH
+\InputenxName{revlogicalnot}{2310}% REVERSED NOT SIGN
+\InputenxName{ring}{02DA}% RING ABOVE
+\InputenxName{rtblock}{2590}% RIGHT HALF BLOCK
+\InputenxName{sacute}{015B}% LATIN SMALL LETTER S WITH ACUTE
+\InputenxName{samekh}{05E1}% HEBREW LETTER SAMEKH
+\InputenxName{samekhhebrew}{05E1}% HEBREW LETTER SAMEKH
+\InputenxName{scaron}{0161}% LATIN SMALL LETTER S WITH CARON
+\InputenxName{scedilla}{015F}% LATIN SMALL LETTER S WITH CEDILLA
+\InputenxName{scircumflex}{015D}% LATIN SMALL LETTER S WITH CIRCUMFLEX
+\InputenxName{scommaaccent}{0219}% LATIN SMALL LETTER S WITH COMMA BELOW
+\InputenxName{sdotaccent}{1E61}% LATIN SMALL LETTER S WITH DOT ABOVE
+\InputenxName{section}{00A7}% SECTION SIGN
+\InputenxName{sfthyphen}{00AD}% SOFT HYPHEN
+\InputenxName{shacyrillic}{0448}% CYRILLIC SMALL LETTER SHA
+\InputenxName{shade}{2592}% MEDIUM SHADE
+\InputenxName{shadedark}{2593}% DARK SHADE
+\InputenxName{shadelight}{2591}% LIGHT SHADE
+\InputenxName{shademedium}{2592}% MEDIUM SHADE
+\InputenxName{shchacyrillic}{0449}% CYRILLIC SMALL LETTER SHCHA
+\InputenxName{shin}{05E9}% HEBREW LETTER SHIN
+\InputenxName{shinhebrew}{05E9}% HEBREW LETTER SHIN
+\InputenxName{sigma}{03C3}% GREEK SMALL LETTER SIGMA
+\InputenxName{softhyphen}{00AD}% SOFT HYPHEN
+\InputenxName{softsigncyrillic}{044C}% CYRILLIC SMALL LETTER SOFT SIGN
+\InputenxName{ss}{00DF}% LATIN SMALL LETTER SHARP S
+\InputenxName{sterling}{00A3}% POUND SIGN
+\InputenxName{summation}{2211}% N-ARY SUMMATION
+\InputenxName{surd}{221A}% SQUARE ROOT
+\InputenxName{tau}{03C4}% GREEK SMALL LETTER TAU
+\InputenxName{tav}{05EA}% HEBREW LETTER TAV
+\InputenxName{tavhebrew}{05EA}% HEBREW LETTER TAV
+\InputenxName{tbar}{0167}% LATIN SMALL LETTER T WITH STROKE
+\InputenxName{tcaron}{0165}% LATIN SMALL LETTER T WITH CARON
+\InputenxName{tcedilla}{0163}% LATIN SMALL LETTER T WITH CEDILLA
+\InputenxName{tcommaaccent}{0163}% LATIN SMALL LETTER T WITH CEDILLA
+\InputenxName{tdotaccent}{1E6B}% LATIN SMALL LETTER T WITH DOT ABOVE
+\InputenxName{tecyrillic}{0442}% CYRILLIC SMALL LETTER TE
+\InputenxName{tet}{05D8}% HEBREW LETTER TET
+\InputenxName{tethebrew}{05D8}% HEBREW LETTER TET
+\InputenxName{th}{00FE}% LATIN SMALL LETTER THORN
+\InputenxName{thorn}{00FE}% LATIN SMALL LETTER THORN
+\InputenxName{threequarters}{00BE}% VULGAR FRACTION THREE QUARTERS
+\InputenxName{threesuperior}{00B3}% SUPERSCRIPT THREE
+\InputenxName{tilde}{02DC}% SMALL TILDE
+\InputenxName{times}{00D7}% MULTIPLICATION SIGN
+\InputenxName{trademark}{2122}% TRADE MARK SIGN
+\InputenxName{tsadi}{05E6}% HEBREW LETTER TSADI
+\InputenxName{tsadihebrew}{05E6}% HEBREW LETTER TSADI
+\InputenxName{tsecyrillic}{0446}% CYRILLIC SMALL LETTER TSE
+\InputenxName{tshecyrillic}{045B}% CYRILLIC SMALL LETTER TSHE
+\InputenxName{tstroke}{0167}% LATIN SMALL LETTER T WITH STROKE
+\InputenxName{twosuperior}{00B2}% SUPERSCRIPT TWO
+\InputenxName{uacute}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\InputenxName{ubreve}{016D}% LATIN SMALL LETTER U WITH BREVE
+\InputenxName{ucircumflex}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\InputenxName{ucyrillic}{0443}% CYRILLIC SMALL LETTER U
+\InputenxName{udblacute}{0171}% LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\InputenxName{udieresis}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\InputenxName{ugrave}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\InputenxName{uhungarumlaut}{0171}% LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\InputenxName{umacron}{016B}% LATIN SMALL LETTER U WITH MACRON
+\InputenxName{underscoredbl}{2017}% DOUBLE LOW LINE
+\InputenxName{uogonek}{0173}% LATIN SMALL LETTER U WITH OGONEK
+\InputenxName{upblock}{2580}% UPPER HALF BLOCK
+\InputenxName{uring}{016F}% LATIN SMALL LETTER U WITH RING ABOVE
+\InputenxName{ushortcyrillic}{045E}% CYRILLIC SMALL LETTER SHORT U
+\InputenxName{utilde}{0169}% LATIN SMALL LETTER U WITH TILDE
+\InputenxName{vav}{05D5}% HEBREW LETTER VAV
+\InputenxName{vavhebrew}{05D5}% HEBREW LETTER VAV
+\InputenxName{vecyrillic}{0432}% CYRILLIC SMALL LETTER VE
+\InputenxName{wacute}{1E83}% LATIN SMALL LETTER W WITH ACUTE
+\InputenxName{wcircumflex}{0175}% LATIN SMALL LETTER W WITH CIRCUMFLEX
+\InputenxName{wdieresis}{1E85}% LATIN SMALL LETTER W WITH DIAERESIS
+\InputenxName{wgrave}{1E81}% LATIN SMALL LETTER W WITH GRAVE
+\InputenxName{yacute}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\InputenxName{ycircumflex}{0177}% LATIN SMALL LETTER Y WITH CIRCUMFLEX
+\InputenxName{ydieresis}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+\InputenxName{yen}{00A5}% YEN SIGN
+\InputenxName{yericyrillic}{044B}% CYRILLIC SMALL LETTER YERU
+\InputenxName{ygrave}{1EF3}% LATIN SMALL LETTER Y WITH GRAVE
+\InputenxName{yicyrillic}{0457}% CYRILLIC SMALL LETTER YI
+\InputenxName{yod}{05D9}% HEBREW LETTER YOD
+\InputenxName{yodhebrew}{05D9}% HEBREW LETTER YOD
+\InputenxName{zacute}{017A}% LATIN SMALL LETTER Z WITH ACUTE
+\InputenxName{zayin}{05D6}% HEBREW LETTER ZAYIN
+\InputenxName{zayinhebrew}{05D6}% HEBREW LETTER ZAYIN
+\InputenxName{zcaron}{017E}% LATIN SMALL LETTER Z WITH CARON
+\InputenxName{zdot}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\InputenxName{zdotaccent}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\InputenxName{zecyrillic}{0437}% CYRILLIC SMALL LETTER ZE
+\InputenxName{zhecyrillic}{0436}% CYRILLIC SMALL LETTER ZHE
+% \end{macrocode}
+% \fi
+%
+% \begin{macrocode}
+%</name>
+% \end{macrocode}
+%
+% \subsection{Mapping Slot, UC to Encodings}
+%
+% \begin{macrocode}
+%<*slot>
+\ProvidesFile{ix-slot.def}%
+ [2016/05/16 v1.11 SLOT and UC to Encodings (inputenx)]%
+% \end{macrocode}
+%
+% \textit{List omitted here, see \xfile{ix-slot.def}.}
+% \iffalse
+% \begin{macrocode}
+\InputenxSlot{128}{00A0}{\do{nextstep}}
+\InputenxSlot{128}{00C4}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{128}{00C7}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{128}{0402}{\do{cp1251}}
+\InputenxSlot{128}{0410}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{128}{0452}{\do{cp855}}
+\InputenxSlot{128}{20AC}{%
+ \do{cp1250}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{128}{2500}{\do{koi8-r}}
+\InputenxSlot{129}{00C0}{\do{nextstep}}
+\InputenxSlot{129}{00C5}{\do{mac-roman}}
+\InputenxSlot{129}{00FC}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{129}{0100}{\do{mac-centeuro}}
+\InputenxSlot{129}{0402}{\do{cp855}}
+\InputenxSlot{129}{0403}{\do{cp1251}}
+\InputenxSlot{129}{0411}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{129}{2502}{\do{koi8-r}}
+\InputenxSlot{130}{00C1}{\do{nextstep}}
+\InputenxSlot{130}{00C7}{\do{mac-roman}}
+\InputenxSlot{130}{00E9}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{130}{0101}{\do{mac-centeuro}}
+\InputenxSlot{130}{0412}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{130}{0453}{\do{cp855}}
+\InputenxSlot{130}{201A}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{130}{250C}{\do{koi8-r}}
+\InputenxSlot{131}{00C2}{\do{nextstep}}
+\InputenxSlot{131}{00C9}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{131}{00E2}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{131}{0192}{\do{cp1252}\do{cp1255}}
+\InputenxSlot{131}{0403}{\do{cp855}}
+\InputenxSlot{131}{0413}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{131}{0453}{\do{cp1251}}
+\InputenxSlot{131}{2510}{\do{koi8-r}}
+\InputenxSlot{132}{00C3}{\do{nextstep}}
+\InputenxSlot{132}{00D1}{\do{mac-roman}}
+\InputenxSlot{132}{00E4}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{132}{0104}{\do{mac-centeuro}}
+\InputenxSlot{132}{0414}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{132}{0451}{\do{cp855}}
+\InputenxSlot{132}{201E}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{132}{2514}{\do{koi8-r}}
+\InputenxSlot{133}{00C4}{\do{nextstep}}
+\InputenxSlot{133}{00D6}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{133}{00E0}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{133}{016F}{\do{cp852}}
+\InputenxSlot{133}{0401}{\do{cp855}}
+\InputenxSlot{133}{0415}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{133}{2026}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{133}{2518}{\do{koi8-r}}
+\InputenxSlot{134}{00C5}{\do{nextstep}}
+\InputenxSlot{134}{00DC}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{134}{00E5}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{134}{0107}{\do{cp852}}
+\InputenxSlot{134}{0416}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{134}{0454}{\do{cp855}}
+\InputenxSlot{134}{2020}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{134}{251C}{\do{koi8-r}}
+\InputenxSlot{135}{00C7}{\do{nextstep}}
+\InputenxSlot{135}{00E1}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{135}{00E7}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{135}{0404}{\do{cp855}}
+\InputenxSlot{135}{0417}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{135}{2021}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{135}{2524}{\do{koi8-r}}
+\InputenxSlot{136}{00C8}{\do{nextstep}}
+\InputenxSlot{136}{00E0}{\do{mac-roman}}
+\InputenxSlot{136}{00EA}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{136}{0105}{\do{mac-centeuro}}
+\InputenxSlot{136}{0142}{\do{cp852}}
+\InputenxSlot{136}{02C6}{\do{cp1252}\do{cp1255}}
+\InputenxSlot{136}{0418}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{136}{0455}{\do{cp855}}
+\InputenxSlot{136}{20AC}{\do{cp1251}}
+\InputenxSlot{136}{252C}{\do{koi8-r}}
+\InputenxSlot{137}{00C9}{\do{nextstep}}
+\InputenxSlot{137}{00E2}{\do{mac-roman}}
+\InputenxSlot{137}{00EB}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{137}{010C}{\do{mac-centeuro}}
+\InputenxSlot{137}{0405}{\do{cp855}}
+\InputenxSlot{137}{0419}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{137}{2030}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{137}{2534}{\do{koi8-r}}
+\InputenxSlot{138}{00CA}{\do{nextstep}}
+\InputenxSlot{138}{00E4}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{138}{00E8}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{138}{0150}{\do{cp852}}
+\InputenxSlot{138}{0160}{\do{cp1250}\do{cp1252}}
+\InputenxSlot{138}{0409}{\do{cp1251}}
+\InputenxSlot{138}{041A}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{138}{0456}{\do{cp855}}
+\InputenxSlot{138}{253C}{\do{koi8-r}}
+\InputenxSlot{139}{00CB}{\do{nextstep}}
+\InputenxSlot{139}{00E3}{\do{mac-roman}}
+\InputenxSlot{139}{00EF}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{139}{010D}{\do{mac-centeuro}}
+\InputenxSlot{139}{0151}{\do{cp852}}
+\InputenxSlot{139}{0406}{\do{cp855}}
+\InputenxSlot{139}{041B}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{139}{2039}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{139}{2580}{\do{koi8-r}}
+\InputenxSlot{140}{00CC}{\do{nextstep}}
+\InputenxSlot{140}{00E5}{\do{mac-roman}}
+\InputenxSlot{140}{00EE}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{140}{0106}{\do{mac-centeuro}}
+\InputenxSlot{140}{0152}{\do{cp1252}}
+\InputenxSlot{140}{015A}{\do{cp1250}}
+\InputenxSlot{140}{040A}{\do{cp1251}}
+\InputenxSlot{140}{041C}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{140}{0457}{\do{cp855}}
+\InputenxSlot{140}{2584}{\do{koi8-r}}
+\InputenxSlot{141}{00A8}{\do{cp1257}}
+\InputenxSlot{141}{00CD}{\do{nextstep}}
+\InputenxSlot{141}{00E7}{\do{mac-roman}}
+\InputenxSlot{141}{00EC}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{141}{0107}{\do{mac-centeuro}}
+\InputenxSlot{141}{0164}{\do{cp1250}}
+\InputenxSlot{141}{0179}{\do{cp852}}
+\InputenxSlot{141}{0407}{\do{cp855}}
+\InputenxSlot{141}{040C}{\do{cp1251}}
+\InputenxSlot{141}{041D}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{141}{2588}{\do{koi8-r}}
+\InputenxSlot{142}{00C4}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{142}{00CE}{\do{nextstep}}
+\InputenxSlot{142}{00E9}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{142}{017D}{\do{cp1250}\do{cp1252}}
+\InputenxSlot{142}{02C7}{\do{cp1257}}
+\InputenxSlot{142}{040B}{\do{cp1251}}
+\InputenxSlot{142}{041E}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{142}{0458}{\do{cp855}}
+\InputenxSlot{142}{258C}{\do{koi8-r}}
+\InputenxSlot{143}{00B8}{\do{cp1257}}
+\InputenxSlot{143}{00C5}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{143}{00CF}{\do{nextstep}}
+\InputenxSlot{143}{00E8}{\do{mac-roman}}
+\InputenxSlot{143}{0106}{\do{cp852}}
+\InputenxSlot{143}{0179}{\do{cp1250}\do{mac-centeuro}}
+\InputenxSlot{143}{0408}{\do{cp855}}
+\InputenxSlot{143}{040F}{\do{cp1251}}
+\InputenxSlot{143}{041F}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{143}{2590}{\do{koi8-r}}
+\InputenxSlot{144}{00C9}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{144}{00D0}{\do{nextstep}}
+\InputenxSlot{144}{00EA}{\do{mac-roman}}
+\InputenxSlot{144}{017A}{\do{mac-centeuro}}
+\InputenxSlot{144}{0420}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{144}{0452}{\do{cp1251}}
+\InputenxSlot{144}{0459}{\do{cp855}}
+\InputenxSlot{144}{2591}{\do{koi8-r}}
+\InputenxSlot{145}{00D1}{\do{nextstep}}
+\InputenxSlot{145}{00E6}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{145}{00EB}{\do{mac-roman}}
+\InputenxSlot{145}{010E}{\do{mac-centeuro}}
+\InputenxSlot{145}{0139}{\do{cp852}}
+\InputenxSlot{145}{0409}{\do{cp855}}
+\InputenxSlot{145}{0421}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{145}{2018}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{145}{2592}{\do{koi8-r}}
+\InputenxSlot{146}{00C6}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{146}{00D2}{\do{nextstep}}
+\InputenxSlot{146}{00ED}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{146}{013A}{\do{cp852}}
+\InputenxSlot{146}{0422}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{146}{045A}{\do{cp855}}
+\InputenxSlot{146}{2019}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{146}{2593}{\do{koi8-r}}
+\InputenxSlot{147}{00D3}{\do{nextstep}}
+\InputenxSlot{147}{00EC}{\do{mac-roman}}
+\InputenxSlot{147}{00F4}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{147}{010F}{\do{mac-centeuro}}
+\InputenxSlot{147}{040A}{\do{cp855}}
+\InputenxSlot{147}{0423}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{147}{201C}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{148}{00D4}{\do{nextstep}}
+\InputenxSlot{148}{00EE}{\do{mac-roman}}
+\InputenxSlot{148}{00F6}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{148}{0112}{\do{mac-centeuro}}
+\InputenxSlot{148}{0424}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{148}{045B}{\do{cp855}}
+\InputenxSlot{148}{201D}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{148}{25A0}{\do{koi8-r}}
+\InputenxSlot{149}{00D5}{\do{nextstep}}
+\InputenxSlot{149}{00EF}{\do{mac-roman}}
+\InputenxSlot{149}{00F2}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{149}{0113}{\do{mac-centeuro}}
+\InputenxSlot{149}{013D}{\do{cp852}}
+\InputenxSlot{149}{040B}{\do{cp855}}
+\InputenxSlot{149}{0425}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{149}{2022}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{149}{2219}{\do{koi8-r}}
+\InputenxSlot{150}{00D6}{\do{nextstep}}
+\InputenxSlot{150}{00F1}{\do{mac-roman}}
+\InputenxSlot{150}{00FB}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{150}{0116}{\do{mac-centeuro}}
+\InputenxSlot{150}{013E}{\do{cp852}}
+\InputenxSlot{150}{0426}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{150}{045C}{\do{cp855}}
+\InputenxSlot{150}{2013}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{150}{221A}{\do{koi8-r}}
+\InputenxSlot{151}{00D9}{\do{nextstep}}
+\InputenxSlot{151}{00F3}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{151}{00F9}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{151}{015A}{\do{cp852}}
+\InputenxSlot{151}{040C}{\do{cp855}}
+\InputenxSlot{151}{0427}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{151}{2014}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{151}{2248}{\do{koi8-r}}
+\InputenxSlot{152}{00DA}{\do{nextstep}}
+\InputenxSlot{152}{00F2}{\do{mac-roman}}
+\InputenxSlot{152}{00FF}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{152}{0117}{\do{mac-centeuro}}
+\InputenxSlot{152}{015B}{\do{cp852}}
+\InputenxSlot{152}{02DC}{\do{cp1252}\do{cp1255}}
+\InputenxSlot{152}{0428}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{152}{045E}{\do{cp855}}
+\InputenxSlot{152}{2264}{\do{koi8-r}}
+\InputenxSlot{153}{00D6}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{153}{00DB}{\do{nextstep}}
+\InputenxSlot{153}{00F4}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{153}{040E}{\do{cp855}}
+\InputenxSlot{153}{0429}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{153}{2122}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{153}{2265}{\do{koi8-r}}
+\InputenxSlot{154}{00A0}{\do{koi8-r}}
+\InputenxSlot{154}{00DC}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+ \do{nextstep}%
+}
+\InputenxSlot{154}{00F6}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{154}{0161}{\do{cp1250}\do{cp1252}}
+\InputenxSlot{154}{042A}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{154}{0459}{\do{cp1251}}
+\InputenxSlot{154}{045F}{\do{cp855}}
+\InputenxSlot{155}{00A2}{\do{atarist}\do{cp437}}
+\InputenxSlot{155}{00DD}{\do{nextstep}}
+\InputenxSlot{155}{00F5}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{155}{00F8}{\do{cp850}\do{cp858}\do{cp865}}
+\InputenxSlot{155}{0164}{\do{cp852}}
+\InputenxSlot{155}{040F}{\do{cp855}}
+\InputenxSlot{155}{042B}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{155}{203A}{%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{156}{00A3}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{156}{00B0}{\do{koi8-r}}
+\InputenxSlot{156}{00DE}{\do{nextstep}}
+\InputenxSlot{156}{00FA}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{156}{0153}{\do{cp1252}}
+\InputenxSlot{156}{015B}{\do{cp1250}}
+\InputenxSlot{156}{0165}{\do{cp852}}
+\InputenxSlot{156}{042C}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{156}{044E}{\do{cp855}}
+\InputenxSlot{156}{045A}{\do{cp1251}}
+\InputenxSlot{157}{00A5}{\do{atarist}\do{cp437}}
+\InputenxSlot{157}{00AF}{\do{cp1257}}
+\InputenxSlot{157}{00B2}{\do{koi8-r}}
+\InputenxSlot{157}{00B5}{\do{nextstep}}
+\InputenxSlot{157}{00D8}{\do{cp850}\do{cp858}\do{cp865}}
+\InputenxSlot{157}{00F9}{\do{mac-roman}}
+\InputenxSlot{157}{011A}{\do{mac-centeuro}}
+\InputenxSlot{157}{0141}{\do{cp852}}
+\InputenxSlot{157}{0165}{\do{cp1250}}
+\InputenxSlot{157}{042D}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{157}{042E}{\do{cp855}}
+\InputenxSlot{157}{045C}{\do{cp1251}}
+\InputenxSlot{158}{00B7}{\do{koi8-r}}
+\InputenxSlot{158}{00D7}{%
+ \do{cp850}\do{cp852}\do{cp858}\do{nextstep}%
+}
+\InputenxSlot{158}{00DF}{\do{atarist}}
+\InputenxSlot{158}{00FB}{\do{mac-roman}}
+\InputenxSlot{158}{011B}{\do{mac-centeuro}}
+\InputenxSlot{158}{017E}{\do{cp1250}\do{cp1252}}
+\InputenxSlot{158}{02DB}{\do{cp1257}}
+\InputenxSlot{158}{042E}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{158}{044A}{\do{cp855}}
+\InputenxSlot{158}{045B}{\do{cp1251}}
+\InputenxSlot{158}{20A7}{\do{cp437}\do{cp865}}
+\InputenxSlot{159}{00F7}{\do{koi8-r}\do{nextstep}}
+\InputenxSlot{159}{00FC}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{159}{010D}{\do{cp852}}
+\InputenxSlot{159}{0178}{\do{cp1252}}
+\InputenxSlot{159}{017A}{\do{cp1250}}
+\InputenxSlot{159}{0192}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{159}{042A}{\do{cp855}}
+\InputenxSlot{159}{042F}{\do{cp866}\do{mac-cyrillic}}
+\InputenxSlot{159}{045F}{\do{cp1251}}
+\InputenxSlot{160}{00A0}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-5}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{160}{00A9}{\do{nextstep}}
+\InputenxSlot{160}{00E1}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{160}{0430}{\do{cp855}\do{cp866}}
+\InputenxSlot{160}{2020}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{160}{2550}{\do{koi8-r}}
+\InputenxSlot{161}{00A1}{%
+ \do{iso-8859-1}\do{iso-8859-9}\do{iso-8859-15}\do{cp1252}%
+ \do{cp1255}\do{dec-mcs}\do{nextstep}%
+}
+\InputenxSlot{161}{00B0}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{161}{00ED}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{161}{0104}{%
+ \do{iso-8859-2}\do{iso-8859-4}\do{iso-8859-10}\do{iso-8859-16}%
+}
+\InputenxSlot{161}{0126}{\do{iso-8859-3}}
+\InputenxSlot{161}{02C7}{\do{cp1250}}
+\InputenxSlot{161}{0401}{\do{iso-8859-5}}
+\InputenxSlot{161}{040E}{\do{cp1251}}
+\InputenxSlot{161}{0410}{\do{cp855}}
+\InputenxSlot{161}{0431}{\do{cp866}}
+\InputenxSlot{161}{1E02}{\do{iso-8859-14}}
+\InputenxSlot{161}{201D}{\do{iso-8859-13}}
+\InputenxSlot{161}{2551}{\do{koi8-r}}
+\InputenxSlot{162}{00A2}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-15}\do{cp1252}\do{cp1255}\do{cp1257}\do{dec-mcs}%
+ \do{mac-roman}\do{nextstep}%
+}
+\InputenxSlot{162}{00F3}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{162}{0105}{\do{iso-8859-16}}
+\InputenxSlot{162}{0112}{\do{iso-8859-10}}
+\InputenxSlot{162}{0118}{\do{mac-centeuro}}
+\InputenxSlot{162}{0138}{\do{iso-8859-4}}
+\InputenxSlot{162}{02D8}{\do{iso-8859-2}\do{iso-8859-3}\do{cp1250}}
+\InputenxSlot{162}{0402}{\do{iso-8859-5}}
+\InputenxSlot{162}{0431}{\do{cp855}}
+\InputenxSlot{162}{0432}{\do{cp866}}
+\InputenxSlot{162}{045E}{\do{cp1251}}
+\InputenxSlot{162}{0490}{\do{mac-cyrillic}}
+\InputenxSlot{162}{1E03}{\do{iso-8859-14}}
+\InputenxSlot{162}{2552}{\do{koi8-r}}
+\InputenxSlot{163}{00A3}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-8}\do{iso-8859-9}%
+ \do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}\do{cp1252}%
+ \do{cp1255}\do{cp1257}\do{dec-mcs}\do{mac-centeuro}%
+ \do{mac-cyrillic}\do{mac-roman}\do{nextstep}%
+}
+\InputenxSlot{163}{00FA}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{163}{0122}{\do{iso-8859-10}}
+\InputenxSlot{163}{0141}{\do{iso-8859-2}\do{iso-8859-16}\do{cp1250}}
+\InputenxSlot{163}{0156}{\do{iso-8859-4}}
+\InputenxSlot{163}{0403}{\do{iso-8859-5}}
+\InputenxSlot{163}{0408}{\do{cp1251}}
+\InputenxSlot{163}{0411}{\do{cp855}}
+\InputenxSlot{163}{0433}{\do{cp866}}
+\InputenxSlot{163}{0451}{\do{koi8-r}}
+\InputenxSlot{164}{00A4}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}\do{cp1250}%
+ \do{cp1251}\do{cp1252}\do{cp1257}%
+}
+\InputenxSlot{164}{00A7}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{164}{00F1}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{164}{0104}{\do{cp852}}
+\InputenxSlot{164}{010A}{\do{iso-8859-14}}
+\InputenxSlot{164}{012A}{\do{iso-8859-10}}
+\InputenxSlot{164}{0404}{\do{iso-8859-5}}
+\InputenxSlot{164}{0434}{\do{cp866}}
+\InputenxSlot{164}{0446}{\do{cp855}}
+\InputenxSlot{164}{2044}{\do{nextstep}}
+\InputenxSlot{164}{20AC}{\do{iso-8859-15}\do{iso-8859-16}}
+\InputenxSlot{164}{2553}{\do{koi8-r}}
+\InputenxSlot{165}{00A5}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-15}%
+ \do{cp1252}\do{cp1255}\do{dec-mcs}\do{nextstep}%
+}
+\InputenxSlot{165}{00D1}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{165}{0104}{\do{cp1250}}
+\InputenxSlot{165}{0105}{\do{cp852}}
+\InputenxSlot{165}{010B}{\do{iso-8859-14}}
+\InputenxSlot{165}{0128}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{165}{013D}{\do{iso-8859-2}}
+\InputenxSlot{165}{0405}{\do{iso-8859-5}}
+\InputenxSlot{165}{0426}{\do{cp855}}
+\InputenxSlot{165}{0435}{\do{cp866}}
+\InputenxSlot{165}{0490}{\do{cp1251}}
+\InputenxSlot{165}{201E}{\do{iso-8859-13}\do{iso-8859-16}}
+\InputenxSlot{165}{2022}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{165}{2554}{\do{koi8-r}}
+\InputenxSlot{166}{00A6}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{166}{00AA}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{166}{00B6}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{166}{0124}{\do{iso-8859-3}}
+\InputenxSlot{166}{0136}{\do{iso-8859-10}}
+\InputenxSlot{166}{013B}{\do{iso-8859-4}}
+\InputenxSlot{166}{015A}{\do{iso-8859-2}}
+\InputenxSlot{166}{0160}{\do{iso-8859-15}\do{iso-8859-16}}
+\InputenxSlot{166}{017D}{\do{cp852}}
+\InputenxSlot{166}{0192}{\do{nextstep}}
+\InputenxSlot{166}{0406}{\do{iso-8859-5}}
+\InputenxSlot{166}{0434}{\do{cp855}}
+\InputenxSlot{166}{0436}{\do{cp866}}
+\InputenxSlot{166}{1E0A}{\do{iso-8859-14}}
+\InputenxSlot{166}{2555}{\do{koi8-r}}
+\InputenxSlot{167}{00A7}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1250}%
+ \do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}\do{dec-mcs}%
+ \do{nextstep}%
+}
+\InputenxSlot{167}{00BA}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{167}{00DF}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{167}{017E}{\do{cp852}}
+\InputenxSlot{167}{0406}{\do{mac-cyrillic}}
+\InputenxSlot{167}{0407}{\do{iso-8859-5}}
+\InputenxSlot{167}{0414}{\do{cp855}}
+\InputenxSlot{167}{0437}{\do{cp866}}
+\InputenxSlot{167}{2556}{\do{koi8-r}}
+\InputenxSlot{168}{00A4}{\do{dec-mcs}\do{nextstep}}
+\InputenxSlot{168}{00A8}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-8}\do{iso-8859-9}\do{cp1250}\do{cp1252}\do{cp1255}%
+}
+\InputenxSlot{168}{00AE}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{168}{00BF}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{168}{00D8}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{168}{0118}{\do{cp852}}
+\InputenxSlot{168}{013B}{\do{iso-8859-10}}
+\InputenxSlot{168}{0161}{\do{iso-8859-15}\do{iso-8859-16}}
+\InputenxSlot{168}{0401}{\do{cp1251}}
+\InputenxSlot{168}{0408}{\do{iso-8859-5}}
+\InputenxSlot{168}{0435}{\do{cp855}}
+\InputenxSlot{168}{0438}{\do{cp866}}
+\InputenxSlot{168}{1E80}{\do{iso-8859-14}}
+\InputenxSlot{168}{2557}{\do{koi8-r}}
+\InputenxSlot{169}{00A9}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1250}%
+ \do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}\do{dec-mcs}%
+ \do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}%
+}
+\InputenxSlot{169}{00AE}{\do{cp850}\do{cp858}}
+\InputenxSlot{169}{0110}{\do{iso-8859-10}}
+\InputenxSlot{169}{0119}{\do{cp852}}
+\InputenxSlot{169}{0130}{\do{iso-8859-3}}
+\InputenxSlot{169}{0160}{\do{iso-8859-2}\do{iso-8859-4}}
+\InputenxSlot{169}{0409}{\do{iso-8859-5}}
+\InputenxSlot{169}{0415}{\do{cp855}}
+\InputenxSlot{169}{0439}{\do{cp866}}
+\InputenxSlot{169}{2019}{\do{nextstep}}
+\InputenxSlot{169}{2310}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{169}{2558}{\do{koi8-r}}
+\InputenxSlot{170}{00AA}{%
+ \do{iso-8859-1}\do{iso-8859-9}\do{iso-8859-15}\do{cp1252}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{170}{00AC}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{170}{00D7}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{170}{0112}{\do{iso-8859-4}}
+\InputenxSlot{170}{0156}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{170}{015E}{\do{iso-8859-2}\do{iso-8859-3}\do{cp1250}}
+\InputenxSlot{170}{0160}{\do{iso-8859-10}}
+\InputenxSlot{170}{0218}{\do{iso-8859-16}}
+\InputenxSlot{170}{0404}{\do{cp1251}}
+\InputenxSlot{170}{040A}{\do{iso-8859-5}}
+\InputenxSlot{170}{043A}{\do{cp866}}
+\InputenxSlot{170}{0444}{\do{cp855}}
+\InputenxSlot{170}{1E82}{\do{iso-8859-14}}
+\InputenxSlot{170}{201C}{\do{nextstep}}
+\InputenxSlot{170}{2122}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{170}{2559}{\do{koi8-r}}
+\InputenxSlot{171}{00AB}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1251}\do{cp1252}%
+ \do{cp1255}\do{cp1257}\do{dec-mcs}\do{nextstep}%
+}
+\InputenxSlot{171}{00B4}{\do{mac-roman}}
+\InputenxSlot{171}{00BD}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{171}{0119}{\do{mac-centeuro}}
+\InputenxSlot{171}{011E}{\do{iso-8859-3}}
+\InputenxSlot{171}{0122}{\do{iso-8859-4}}
+\InputenxSlot{171}{0164}{\do{iso-8859-2}}
+\InputenxSlot{171}{0166}{\do{iso-8859-10}}
+\InputenxSlot{171}{017A}{\do{cp852}}
+\InputenxSlot{171}{0402}{\do{mac-cyrillic}}
+\InputenxSlot{171}{040B}{\do{iso-8859-5}}
+\InputenxSlot{171}{0424}{\do{cp855}}
+\InputenxSlot{171}{043B}{\do{cp866}}
+\InputenxSlot{171}{1E0B}{\do{iso-8859-14}}
+\InputenxSlot{171}{255A}{\do{koi8-r}}
+\InputenxSlot{172}{00A8}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{172}{00AC}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-15}\do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}%
+ \do{cp1257}%
+}
+\InputenxSlot{172}{00BC}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{172}{010C}{\do{cp852}}
+\InputenxSlot{172}{0134}{\do{iso-8859-3}}
+\InputenxSlot{172}{0166}{\do{iso-8859-4}}
+\InputenxSlot{172}{0179}{\do{iso-8859-2}\do{iso-8859-16}}
+\InputenxSlot{172}{017D}{\do{iso-8859-10}}
+\InputenxSlot{172}{040C}{\do{iso-8859-5}}
+\InputenxSlot{172}{0433}{\do{cp855}}
+\InputenxSlot{172}{043C}{\do{cp866}}
+\InputenxSlot{172}{0452}{\do{mac-cyrillic}}
+\InputenxSlot{172}{1EF2}{\do{iso-8859-14}}
+\InputenxSlot{172}{2039}{\do{nextstep}}
+\InputenxSlot{172}{255B}{\do{koi8-r}}
+\InputenxSlot{173}{00A1}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{173}{00AD}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-5}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{173}{015F}{\do{cp852}}
+\InputenxSlot{173}{0413}{\do{cp855}}
+\InputenxSlot{173}{043D}{\do{cp866}}
+\InputenxSlot{173}{203A}{\do{nextstep}}
+\InputenxSlot{173}{2260}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{173}{255C}{\do{koi8-r}}
+\InputenxSlot{174}{00AB}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}%
+ \do{cp865}%
+}
+\InputenxSlot{174}{00AE}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{cp1250}\do{cp1251}\do{cp1252}%
+ \do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{174}{00C6}{\do{mac-roman}}
+\InputenxSlot{174}{0123}{\do{mac-centeuro}}
+\InputenxSlot{174}{016A}{\do{iso-8859-10}}
+\InputenxSlot{174}{017A}{\do{iso-8859-16}}
+\InputenxSlot{174}{017D}{\do{iso-8859-2}\do{iso-8859-4}}
+\InputenxSlot{174}{0403}{\do{mac-cyrillic}}
+\InputenxSlot{174}{040E}{\do{iso-8859-5}}
+\InputenxSlot{174}{043E}{\do{cp866}}
+\InputenxSlot{174}{255D}{\do{koi8-r}}
+\InputenxSlot{174}{FB01}{\do{nextstep}}
+\InputenxSlot{175}{00A4}{\do{cp865}}
+\InputenxSlot{175}{00AF}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-8}\do{iso-8859-9}%
+ \do{iso-8859-15}\do{cp1252}\do{cp1255}%
+}
+\InputenxSlot{175}{00BB}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}%
+}
+\InputenxSlot{175}{00C6}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{175}{00D8}{\do{mac-roman}}
+\InputenxSlot{175}{012E}{\do{mac-centeuro}}
+\InputenxSlot{175}{014A}{\do{iso-8859-10}}
+\InputenxSlot{175}{0178}{\do{iso-8859-14}}
+\InputenxSlot{175}{017B}{%
+ \do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-16}\do{cp1250}%
+}
+\InputenxSlot{175}{0407}{\do{cp1251}}
+\InputenxSlot{175}{040F}{\do{iso-8859-5}}
+\InputenxSlot{175}{043F}{\do{cp866}}
+\InputenxSlot{175}{0453}{\do{mac-cyrillic}}
+\InputenxSlot{175}{255E}{\do{koi8-r}}
+\InputenxSlot{175}{FB02}{\do{nextstep}}
+\InputenxSlot{176}{00AE}{\do{nextstep}}
+\InputenxSlot{176}{00B0}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1251}\do{cp1252}%
+ \do{cp1255}\do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{176}{00E3}{\do{atarist}}
+\InputenxSlot{176}{012F}{\do{mac-centeuro}}
+\InputenxSlot{176}{0410}{\do{iso-8859-5}}
+\InputenxSlot{176}{1E1E}{\do{iso-8859-14}}
+\InputenxSlot{176}{221E}{\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{176}{255F}{\do{koi8-r}}
+\InputenxSlot{176}{2591}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{177}{00B1}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1251}\do{cp1252}%
+ \do{cp1255}\do{cp1257}\do{dec-mcs}\do{mac-cyrillic}\do{mac-roman}%
+}
+\InputenxSlot{177}{00F5}{\do{atarist}}
+\InputenxSlot{177}{0105}{\do{iso-8859-2}\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{177}{0127}{\do{iso-8859-3}}
+\InputenxSlot{177}{012A}{\do{mac-centeuro}}
+\InputenxSlot{177}{0411}{\do{iso-8859-5}}
+\InputenxSlot{177}{1E1F}{\do{iso-8859-14}}
+\InputenxSlot{177}{2013}{\do{nextstep}}
+\InputenxSlot{177}{2560}{\do{koi8-r}}
+\InputenxSlot{177}{2592}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{178}{00B2}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-8}\do{iso-8859-9}%
+ \do{iso-8859-13}\do{iso-8859-15}\do{cp1252}\do{cp1255}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{178}{00D8}{\do{atarist}}
+\InputenxSlot{178}{010C}{\do{iso-8859-16}}
+\InputenxSlot{178}{0113}{\do{iso-8859-10}}
+\InputenxSlot{178}{0120}{\do{iso-8859-14}}
+\InputenxSlot{178}{02DB}{\do{iso-8859-2}\do{iso-8859-4}\do{cp1250}}
+\InputenxSlot{178}{0406}{\do{cp1251}}
+\InputenxSlot{178}{0412}{\do{iso-8859-5}}
+\InputenxSlot{178}{2020}{\do{nextstep}}
+\InputenxSlot{178}{2264}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{178}{2561}{\do{koi8-r}}
+\InputenxSlot{178}{2593}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{179}{00B3}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-8}\do{iso-8859-9}%
+ \do{iso-8859-13}\do{iso-8859-15}\do{cp1252}\do{cp1255}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{179}{00F8}{\do{atarist}}
+\InputenxSlot{179}{0121}{\do{iso-8859-14}}
+\InputenxSlot{179}{0123}{\do{iso-8859-10}}
+\InputenxSlot{179}{0142}{\do{iso-8859-2}\do{iso-8859-16}\do{cp1250}}
+\InputenxSlot{179}{0157}{\do{iso-8859-4}}
+\InputenxSlot{179}{0401}{\do{koi8-r}}
+\InputenxSlot{179}{0413}{\do{iso-8859-5}}
+\InputenxSlot{179}{0456}{\do{cp1251}}
+\InputenxSlot{179}{2021}{\do{nextstep}}
+\InputenxSlot{179}{2265}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{179}{2502}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{180}{00A5}{\do{mac-roman}}
+\InputenxSlot{180}{00B4}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-8}\do{iso-8859-9}\do{cp1250}\do{cp1252}\do{cp1255}%
+ \do{cp1257}%
+}
+\InputenxSlot{180}{00B7}{\do{nextstep}}
+\InputenxSlot{180}{012B}{\do{iso-8859-10}\do{mac-centeuro}}
+\InputenxSlot{180}{0153}{\do{atarist}}
+\InputenxSlot{180}{017D}{\do{iso-8859-15}\do{iso-8859-16}}
+\InputenxSlot{180}{0414}{\do{iso-8859-5}}
+\InputenxSlot{180}{0456}{\do{mac-cyrillic}}
+\InputenxSlot{180}{0491}{\do{cp1251}}
+\InputenxSlot{180}{1E40}{\do{iso-8859-14}}
+\InputenxSlot{180}{201C}{\do{iso-8859-13}}
+\InputenxSlot{180}{2524}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{180}{2562}{\do{koi8-r}}
+\InputenxSlot{181}{00A6}{\do{nextstep}}
+\InputenxSlot{181}{00B5}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-8}\do{iso-8859-9}%
+ \do{iso-8859-13}\do{iso-8859-15}\do{cp1250}\do{cp1251}\do{cp1252}%
+ \do{cp1255}\do{cp1257}\do{dec-mcs}\do{mac-cyrillic}\do{mac-roman}%
+}
+\InputenxSlot{181}{00C1}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{181}{0129}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{181}{0136}{\do{mac-centeuro}}
+\InputenxSlot{181}{013E}{\do{iso-8859-2}}
+\InputenxSlot{181}{0152}{\do{atarist}}
+\InputenxSlot{181}{0415}{\do{iso-8859-5}}
+\InputenxSlot{181}{0445}{\do{cp855}}
+\InputenxSlot{181}{1E41}{\do{iso-8859-14}}
+\InputenxSlot{181}{201D}{\do{iso-8859-16}}
+\InputenxSlot{181}{2561}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{181}{2563}{\do{koi8-r}}
+\InputenxSlot{182}{00B6}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1250}%
+ \do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}\do{dec-mcs}%
+ \do{nextstep}%
+}
+\InputenxSlot{182}{00C0}{\do{atarist}}
+\InputenxSlot{182}{00C2}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{182}{0125}{\do{iso-8859-3}}
+\InputenxSlot{182}{0137}{\do{iso-8859-10}}
+\InputenxSlot{182}{013C}{\do{iso-8859-4}}
+\InputenxSlot{182}{015B}{\do{iso-8859-2}}
+\InputenxSlot{182}{0416}{\do{iso-8859-5}}
+\InputenxSlot{182}{0425}{\do{cp855}}
+\InputenxSlot{182}{0491}{\do{mac-cyrillic}}
+\InputenxSlot{182}{2202}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{182}{2562}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{182}{2564}{\do{koi8-r}}
+\InputenxSlot{183}{00B7}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-8}\do{iso-8859-9}%
+ \do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-15}\do{iso-8859-16}%
+ \do{cp1250}\do{cp1251}\do{cp1252}\do{cp1255}\do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{183}{00C0}{\do{cp850}\do{cp858}}
+\InputenxSlot{183}{00C3}{\do{atarist}}
+\InputenxSlot{183}{011A}{\do{cp852}}
+\InputenxSlot{183}{02C7}{\do{iso-8859-2}\do{iso-8859-4}}
+\InputenxSlot{183}{0408}{\do{mac-cyrillic}}
+\InputenxSlot{183}{0417}{\do{iso-8859-5}}
+\InputenxSlot{183}{0438}{\do{cp855}}
+\InputenxSlot{183}{1E56}{\do{iso-8859-14}}
+\InputenxSlot{183}{2022}{\do{nextstep}}
+\InputenxSlot{183}{2211}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{183}{2556}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{183}{2565}{\do{koi8-r}}
+\InputenxSlot{184}{00A9}{\do{cp850}\do{cp858}}
+\InputenxSlot{184}{00B8}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-8}\do{iso-8859-9}\do{cp1250}\do{cp1252}\do{cp1255}%
+}
+\InputenxSlot{184}{00D5}{\do{atarist}}
+\InputenxSlot{184}{00F8}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{184}{013C}{\do{iso-8859-10}}
+\InputenxSlot{184}{0142}{\do{mac-centeuro}}
+\InputenxSlot{184}{015E}{\do{cp852}}
+\InputenxSlot{184}{017E}{\do{iso-8859-15}\do{iso-8859-16}}
+\InputenxSlot{184}{0404}{\do{mac-cyrillic}}
+\InputenxSlot{184}{0418}{\do{iso-8859-5}\do{cp855}}
+\InputenxSlot{184}{0451}{\do{cp1251}}
+\InputenxSlot{184}{1E81}{\do{iso-8859-14}}
+\InputenxSlot{184}{201A}{\do{nextstep}}
+\InputenxSlot{184}{220F}{\do{mac-roman}}
+\InputenxSlot{184}{2555}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{184}{2566}{\do{koi8-r}}
+\InputenxSlot{185}{00A8}{\do{atarist}}
+\InputenxSlot{185}{00B9}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-15}\do{cp1252}\do{cp1255}\do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{185}{0105}{\do{cp1250}}
+\InputenxSlot{185}{010D}{\do{iso-8859-16}}
+\InputenxSlot{185}{0111}{\do{iso-8859-10}}
+\InputenxSlot{185}{0131}{\do{iso-8859-3}}
+\InputenxSlot{185}{013B}{\do{mac-centeuro}}
+\InputenxSlot{185}{0161}{\do{iso-8859-2}\do{iso-8859-4}}
+\InputenxSlot{185}{03C0}{\do{mac-roman}}
+\InputenxSlot{185}{0419}{\do{iso-8859-5}}
+\InputenxSlot{185}{0454}{\do{mac-cyrillic}}
+\InputenxSlot{185}{1E57}{\do{iso-8859-14}}
+\InputenxSlot{185}{201E}{\do{nextstep}}
+\InputenxSlot{185}{2116}{\do{cp1251}}
+\InputenxSlot{185}{2563}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{185}{2567}{\do{koi8-r}}
+\InputenxSlot{186}{00B4}{\do{atarist}}
+\InputenxSlot{186}{00BA}{%
+ \do{iso-8859-1}\do{iso-8859-9}\do{iso-8859-15}\do{cp1252}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{186}{00F7}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{186}{0113}{\do{iso-8859-4}}
+\InputenxSlot{186}{013C}{\do{mac-centeuro}}
+\InputenxSlot{186}{0157}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{186}{015F}{\do{iso-8859-2}\do{iso-8859-3}\do{cp1250}}
+\InputenxSlot{186}{0161}{\do{iso-8859-10}}
+\InputenxSlot{186}{0219}{\do{iso-8859-16}}
+\InputenxSlot{186}{0407}{\do{mac-cyrillic}}
+\InputenxSlot{186}{041A}{\do{iso-8859-5}}
+\InputenxSlot{186}{0454}{\do{cp1251}}
+\InputenxSlot{186}{1E83}{\do{iso-8859-14}}
+\InputenxSlot{186}{201D}{\do{nextstep}}
+\InputenxSlot{186}{222B}{\do{mac-roman}}
+\InputenxSlot{186}{2551}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{186}{2568}{\do{koi8-r}}
+\InputenxSlot{187}{00AA}{\do{mac-roman}}
+\InputenxSlot{187}{00BB}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1251}\do{cp1252}%
+ \do{cp1255}\do{cp1257}\do{dec-mcs}\do{nextstep}%
+}
+\InputenxSlot{187}{011F}{\do{iso-8859-3}}
+\InputenxSlot{187}{0123}{\do{iso-8859-4}}
+\InputenxSlot{187}{013D}{\do{mac-centeuro}}
+\InputenxSlot{187}{0165}{\do{iso-8859-2}}
+\InputenxSlot{187}{0167}{\do{iso-8859-10}}
+\InputenxSlot{187}{041B}{\do{iso-8859-5}}
+\InputenxSlot{187}{0457}{\do{mac-cyrillic}}
+\InputenxSlot{187}{1E60}{\do{iso-8859-14}}
+\InputenxSlot{187}{2020}{\do{atarist}}
+\InputenxSlot{187}{2557}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{187}{2569}{\do{koi8-r}}
+\InputenxSlot{188}{00B6}{\do{atarist}}
+\InputenxSlot{188}{00BA}{\do{mac-roman}}
+\InputenxSlot{188}{00BC}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{cp1252}\do{cp1255}\do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{188}{0135}{\do{iso-8859-3}}
+\InputenxSlot{188}{013D}{\do{cp1250}}
+\InputenxSlot{188}{013E}{\do{mac-centeuro}}
+\InputenxSlot{188}{0152}{\do{iso-8859-15}\do{iso-8859-16}}
+\InputenxSlot{188}{0167}{\do{iso-8859-4}}
+\InputenxSlot{188}{017A}{\do{iso-8859-2}}
+\InputenxSlot{188}{017E}{\do{iso-8859-10}}
+\InputenxSlot{188}{0409}{\do{mac-cyrillic}}
+\InputenxSlot{188}{041C}{\do{iso-8859-5}}
+\InputenxSlot{188}{0458}{\do{cp1251}}
+\InputenxSlot{188}{1EF3}{\do{iso-8859-14}}
+\InputenxSlot{188}{2026}{\do{nextstep}}
+\InputenxSlot{188}{255D}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{188}{256A}{\do{koi8-r}}
+\InputenxSlot{189}{00A2}{\do{cp850}\do{cp858}}
+\InputenxSlot{189}{00A9}{\do{atarist}}
+\InputenxSlot{189}{00BD}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-8}\do{iso-8859-9}%
+ \do{iso-8859-13}\do{cp1252}\do{cp1255}\do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{189}{0139}{\do{mac-centeuro}}
+\InputenxSlot{189}{014A}{\do{iso-8859-4}}
+\InputenxSlot{189}{0153}{\do{iso-8859-15}\do{iso-8859-16}}
+\InputenxSlot{189}{017B}{\do{cp852}}
+\InputenxSlot{189}{02DD}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{189}{03A9}{\do{mac-roman}}
+\InputenxSlot{189}{0405}{\do{cp1251}}
+\InputenxSlot{189}{041D}{\do{iso-8859-5}}
+\InputenxSlot{189}{0439}{\do{cp855}}
+\InputenxSlot{189}{0459}{\do{mac-cyrillic}}
+\InputenxSlot{189}{1E84}{\do{iso-8859-14}}
+\InputenxSlot{189}{2015}{\do{iso-8859-10}}
+\InputenxSlot{189}{2030}{\do{nextstep}}
+\InputenxSlot{189}{255C}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{189}{256B}{\do{koi8-r}}
+\InputenxSlot{190}{00A5}{\do{cp850}\do{cp858}}
+\InputenxSlot{190}{00AC}{\do{nextstep}}
+\InputenxSlot{190}{00AE}{\do{atarist}}
+\InputenxSlot{190}{00BE}{%
+ \do{iso-8859-1}\do{iso-8859-8}\do{iso-8859-9}\do{iso-8859-13}%
+ \do{cp1252}\do{cp1255}\do{cp1257}%
+}
+\InputenxSlot{190}{00E6}{\do{mac-roman}}
+\InputenxSlot{190}{013A}{\do{mac-centeuro}}
+\InputenxSlot{190}{013E}{\do{cp1250}}
+\InputenxSlot{190}{016B}{\do{iso-8859-10}}
+\InputenxSlot{190}{0178}{\do{iso-8859-15}\do{iso-8859-16}}
+\InputenxSlot{190}{017C}{\do{cp852}}
+\InputenxSlot{190}{017E}{\do{iso-8859-2}\do{iso-8859-4}}
+\InputenxSlot{190}{040A}{\do{mac-cyrillic}}
+\InputenxSlot{190}{0419}{\do{cp855}}
+\InputenxSlot{190}{041E}{\do{iso-8859-5}}
+\InputenxSlot{190}{0455}{\do{cp1251}}
+\InputenxSlot{190}{1E85}{\do{iso-8859-14}}
+\InputenxSlot{190}{255B}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{190}{256C}{\do{koi8-r}}
+\InputenxSlot{191}{00A9}{\do{koi8-r}}
+\InputenxSlot{191}{00BF}{%
+ \do{iso-8859-1}\do{iso-8859-9}\do{iso-8859-15}\do{cp1252}%
+ \do{cp1255}\do{dec-mcs}\do{nextstep}%
+}
+\InputenxSlot{191}{00E6}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{191}{00F8}{\do{mac-roman}}
+\InputenxSlot{191}{0145}{\do{mac-centeuro}}
+\InputenxSlot{191}{014B}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{191}{017C}{%
+ \do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-16}\do{cp1250}%
+}
+\InputenxSlot{191}{041F}{\do{iso-8859-5}}
+\InputenxSlot{191}{0457}{\do{cp1251}}
+\InputenxSlot{191}{045A}{\do{mac-cyrillic}}
+\InputenxSlot{191}{1E61}{\do{iso-8859-14}}
+\InputenxSlot{191}{2122}{\do{atarist}}
+\InputenxSlot{191}{2510}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{192}{00B9}{\do{nextstep}}
+\InputenxSlot{192}{00BF}{\do{mac-roman}}
+\InputenxSlot{192}{00C0}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{192}{0100}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{192}{0104}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{192}{0133}{\do{atarist}}
+\InputenxSlot{192}{0146}{\do{mac-centeuro}}
+\InputenxSlot{192}{0154}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{192}{0410}{\do{cp1251}}
+\InputenxSlot{192}{0420}{\do{iso-8859-5}}
+\InputenxSlot{192}{044E}{\do{koi8-r}}
+\InputenxSlot{192}{0458}{\do{mac-cyrillic}}
+\InputenxSlot{192}{2514}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{193}{00A1}{\do{mac-roman}}
+\InputenxSlot{193}{00C1}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{193}{012E}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{193}{0132}{\do{atarist}}
+\InputenxSlot{193}{0143}{\do{mac-centeuro}}
+\InputenxSlot{193}{02CB}{\do{nextstep}}
+\InputenxSlot{193}{0405}{\do{mac-cyrillic}}
+\InputenxSlot{193}{0411}{\do{cp1251}}
+\InputenxSlot{193}{0421}{\do{iso-8859-5}}
+\InputenxSlot{193}{0430}{\do{koi8-r}}
+\InputenxSlot{193}{2534}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{194}{00AC}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{194}{00B4}{\do{nextstep}}
+\InputenxSlot{194}{00C2}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{194}{0100}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{194}{0412}{\do{cp1251}}
+\InputenxSlot{194}{0422}{\do{iso-8859-5}}
+\InputenxSlot{194}{0431}{\do{koi8-r}}
+\InputenxSlot{194}{05D0}{\do{atarist}}
+\InputenxSlot{194}{252C}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{195}{00C3}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{195}{0102}{\do{iso-8859-2}\do{iso-8859-16}\do{cp1250}}
+\InputenxSlot{195}{0106}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{195}{02C6}{\do{nextstep}}
+\InputenxSlot{195}{0413}{\do{cp1251}}
+\InputenxSlot{195}{0423}{\do{iso-8859-5}}
+\InputenxSlot{195}{0446}{\do{koi8-r}}
+\InputenxSlot{195}{05D1}{\do{atarist}}
+\InputenxSlot{195}{221A}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{195}{251C}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{196}{00C4}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{196}{0144}{\do{mac-centeuro}}
+\InputenxSlot{196}{0192}{\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{196}{02DC}{\do{nextstep}}
+\InputenxSlot{196}{0414}{\do{cp1251}}
+\InputenxSlot{196}{0424}{\do{iso-8859-5}}
+\InputenxSlot{196}{0434}{\do{koi8-r}}
+\InputenxSlot{196}{05D2}{\do{atarist}}
+\InputenxSlot{196}{2500}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{197}{00AF}{\do{nextstep}}
+\InputenxSlot{197}{00C5}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}\do{cp1252}%
+ \do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{197}{0106}{\do{iso-8859-16}}
+\InputenxSlot{197}{010A}{\do{iso-8859-3}}
+\InputenxSlot{197}{0139}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{197}{0147}{\do{mac-centeuro}}
+\InputenxSlot{197}{0415}{\do{cp1251}}
+\InputenxSlot{197}{0425}{\do{iso-8859-5}}
+\InputenxSlot{197}{0435}{\do{koi8-r}}
+\InputenxSlot{197}{05D3}{\do{atarist}}
+\InputenxSlot{197}{2248}{\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{197}{253C}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{198}{00C6}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1252}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{198}{00E3}{\do{cp850}\do{cp858}}
+\InputenxSlot{198}{0102}{\do{cp852}}
+\InputenxSlot{198}{0106}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{198}{0108}{\do{iso-8859-3}}
+\InputenxSlot{198}{0118}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{198}{02D8}{\do{nextstep}}
+\InputenxSlot{198}{0416}{\do{cp1251}}
+\InputenxSlot{198}{0426}{\do{iso-8859-5}}
+\InputenxSlot{198}{043A}{\do{cp855}}
+\InputenxSlot{198}{0444}{\do{koi8-r}}
+\InputenxSlot{198}{05D4}{\do{atarist}}
+\InputenxSlot{198}{2206}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{198}{255E}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{199}{00AB}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{199}{00C3}{\do{cp850}\do{cp858}}
+\InputenxSlot{199}{00C7}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-9}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1250}%
+ \do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{199}{0103}{\do{cp852}}
+\InputenxSlot{199}{0112}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{199}{012E}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{199}{02D9}{\do{nextstep}}
+\InputenxSlot{199}{0417}{\do{cp1251}}
+\InputenxSlot{199}{041A}{\do{cp855}}
+\InputenxSlot{199}{0427}{\do{iso-8859-5}}
+\InputenxSlot{199}{0433}{\do{koi8-r}}
+\InputenxSlot{199}{05D5}{\do{atarist}}
+\InputenxSlot{199}{255F}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{200}{00A8}{\do{nextstep}}
+\InputenxSlot{200}{00BB}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{200}{00C8}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{200}{010C}{%
+ \do{iso-8859-2}\do{iso-8859-4}\do{iso-8859-10}\do{iso-8859-13}%
+ \do{cp1250}\do{cp1257}%
+}
+\InputenxSlot{200}{0418}{\do{cp1251}}
+\InputenxSlot{200}{0428}{\do{iso-8859-5}}
+\InputenxSlot{200}{0445}{\do{koi8-r}}
+\InputenxSlot{200}{05D6}{\do{atarist}}
+\InputenxSlot{200}{255A}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{201}{00B2}{\do{nextstep}}
+\InputenxSlot{201}{00C9}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{201}{0419}{\do{cp1251}}
+\InputenxSlot{201}{0429}{\do{iso-8859-5}}
+\InputenxSlot{201}{0438}{\do{koi8-r}}
+\InputenxSlot{201}{05D7}{\do{atarist}}
+\InputenxSlot{201}{2026}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{201}{2554}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{202}{00A0}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{202}{00CA}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{202}{0118}{%
+ \do{iso-8859-2}\do{iso-8859-4}\do{iso-8859-10}\do{cp1250}%
+}
+\InputenxSlot{202}{0179}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{202}{02DA}{\do{nextstep}}
+\InputenxSlot{202}{041A}{\do{cp1251}}
+\InputenxSlot{202}{042A}{\do{iso-8859-5}}
+\InputenxSlot{202}{0439}{\do{koi8-r}}
+\InputenxSlot{202}{05D8}{\do{atarist}}
+\InputenxSlot{202}{2569}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{203}{00B8}{\do{nextstep}}
+\InputenxSlot{203}{00C0}{\do{mac-roman}}
+\InputenxSlot{203}{00CB}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{203}{0116}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{203}{0148}{\do{mac-centeuro}}
+\InputenxSlot{203}{040B}{\do{mac-cyrillic}}
+\InputenxSlot{203}{041B}{\do{cp1251}}
+\InputenxSlot{203}{042B}{\do{iso-8859-5}}
+\InputenxSlot{203}{043A}{\do{koi8-r}}
+\InputenxSlot{203}{05D9}{\do{atarist}}
+\InputenxSlot{203}{2566}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{204}{00B3}{\do{nextstep}}
+\InputenxSlot{204}{00C3}{\do{mac-roman}}
+\InputenxSlot{204}{00CC}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{204}{0116}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{204}{011A}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{204}{0122}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{204}{0150}{\do{mac-centeuro}}
+\InputenxSlot{204}{041C}{\do{cp1251}}
+\InputenxSlot{204}{042C}{\do{iso-8859-5}}
+\InputenxSlot{204}{043B}{\do{koi8-r}}
+\InputenxSlot{204}{045B}{\do{mac-cyrillic}}
+\InputenxSlot{204}{05DB}{\do{atarist}}
+\InputenxSlot{204}{2560}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{205}{00CD}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{205}{00D5}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{205}{0136}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{205}{02DD}{\do{nextstep}}
+\InputenxSlot{205}{040C}{\do{mac-cyrillic}}
+\InputenxSlot{205}{041D}{\do{cp1251}}
+\InputenxSlot{205}{042D}{\do{iso-8859-5}}
+\InputenxSlot{205}{043C}{\do{koi8-r}}
+\InputenxSlot{205}{05DC}{\do{atarist}}
+\InputenxSlot{205}{2550}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{206}{00CE}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{206}{012A}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{206}{0151}{\do{mac-centeuro}}
+\InputenxSlot{206}{0152}{\do{mac-roman}}
+\InputenxSlot{206}{02DB}{\do{nextstep}}
+\InputenxSlot{206}{041E}{\do{cp1251}}
+\InputenxSlot{206}{042E}{\do{iso-8859-5}}
+\InputenxSlot{206}{043D}{\do{koi8-r}}
+\InputenxSlot{206}{045C}{\do{mac-cyrillic}}
+\InputenxSlot{206}{05DE}{\do{atarist}}
+\InputenxSlot{206}{256C}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{207}{00A4}{%
+ \do{cp850}\do{cp852}\do{cp855}\do{cp858}%
+}
+\InputenxSlot{207}{00CF}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1252}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{207}{010E}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{207}{012A}{\do{iso-8859-4}}
+\InputenxSlot{207}{013B}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{207}{014C}{\do{mac-centeuro}}
+\InputenxSlot{207}{0153}{\do{mac-roman}}
+\InputenxSlot{207}{02C7}{\do{nextstep}}
+\InputenxSlot{207}{041F}{\do{cp1251}}
+\InputenxSlot{207}{042F}{\do{iso-8859-5}}
+\InputenxSlot{207}{043E}{\do{koi8-r}}
+\InputenxSlot{207}{0455}{\do{mac-cyrillic}}
+\InputenxSlot{207}{05E0}{\do{atarist}}
+\InputenxSlot{207}{2567}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{208}{00D0}{%
+ \do{iso-8859-1}\do{iso-8859-10}\do{iso-8859-15}\do{cp1252}%
+}
+\InputenxSlot{208}{00F0}{\do{cp850}\do{cp858}}
+\InputenxSlot{208}{0110}{%
+ \do{iso-8859-2}\do{iso-8859-4}\do{iso-8859-16}\do{cp1250}%
+}
+\InputenxSlot{208}{0111}{\do{cp852}}
+\InputenxSlot{208}{011E}{\do{iso-8859-9}}
+\InputenxSlot{208}{0160}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{208}{0174}{\do{iso-8859-14}}
+\InputenxSlot{208}{0420}{\do{cp1251}}
+\InputenxSlot{208}{0430}{\do{iso-8859-5}}
+\InputenxSlot{208}{043B}{\do{cp855}}
+\InputenxSlot{208}{043F}{\do{koi8-r}}
+\InputenxSlot{208}{05E1}{\do{atarist}}
+\InputenxSlot{208}{2013}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{208}{2014}{\do{nextstep}}
+\InputenxSlot{208}{2568}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{209}{00B1}{\do{nextstep}}
+\InputenxSlot{209}{00D0}{\do{cp850}\do{cp858}}
+\InputenxSlot{209}{00D1}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{209}{0110}{\do{cp852}}
+\InputenxSlot{209}{0143}{%
+ \do{iso-8859-2}\do{iso-8859-13}\do{iso-8859-16}\do{cp1250}%
+ \do{cp1257}%
+}
+\InputenxSlot{209}{0145}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{209}{041B}{\do{cp855}}
+\InputenxSlot{209}{0421}{\do{cp1251}}
+\InputenxSlot{209}{0431}{\do{iso-8859-5}}
+\InputenxSlot{209}{044F}{\do{koi8-r}}
+\InputenxSlot{209}{05E2}{\do{atarist}}
+\InputenxSlot{209}{2014}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{209}{2564}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{210}{00BC}{\do{nextstep}}
+\InputenxSlot{210}{00CA}{\do{cp850}\do{cp858}}
+\InputenxSlot{210}{00D2}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{210}{010E}{\do{cp852}}
+\InputenxSlot{210}{0145}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{210}{0147}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{210}{014C}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{210}{0422}{\do{cp1251}}
+\InputenxSlot{210}{0432}{\do{iso-8859-5}}
+\InputenxSlot{210}{043C}{\do{cp855}}
+\InputenxSlot{210}{0440}{\do{koi8-r}}
+\InputenxSlot{210}{05E4}{\do{atarist}}
+\InputenxSlot{210}{201C}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{210}{2565}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{211}{00BD}{\do{nextstep}}
+\InputenxSlot{211}{00CB}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{211}{00D3}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-9}%
+ \do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{211}{0136}{\do{iso-8859-4}}
+\InputenxSlot{211}{041C}{\do{cp855}}
+\InputenxSlot{211}{0423}{\do{cp1251}}
+\InputenxSlot{211}{0433}{\do{iso-8859-5}}
+\InputenxSlot{211}{0441}{\do{koi8-r}}
+\InputenxSlot{211}{05E6}{\do{atarist}}
+\InputenxSlot{211}{201D}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{211}{2559}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{212}{00BE}{\do{nextstep}}
+\InputenxSlot{212}{00C8}{\do{cp850}\do{cp858}}
+\InputenxSlot{212}{00D4}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{212}{010F}{\do{cp852}}
+\InputenxSlot{212}{014C}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{212}{0424}{\do{cp1251}}
+\InputenxSlot{212}{0434}{\do{iso-8859-5}}
+\InputenxSlot{212}{043D}{\do{cp855}}
+\InputenxSlot{212}{0442}{\do{koi8-r}}
+\InputenxSlot{212}{05E7}{\do{atarist}}
+\InputenxSlot{212}{2018}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{212}{2558}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{213}{00D5}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}\do{cp1252}%
+ \do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{213}{00E0}{\do{nextstep}}
+\InputenxSlot{213}{0120}{\do{iso-8859-3}}
+\InputenxSlot{213}{0131}{\do{cp850}}
+\InputenxSlot{213}{0147}{\do{cp852}}
+\InputenxSlot{213}{0150}{\do{iso-8859-2}\do{iso-8859-16}\do{cp1250}}
+\InputenxSlot{213}{041D}{\do{cp855}}
+\InputenxSlot{213}{0425}{\do{cp1251}}
+\InputenxSlot{213}{0435}{\do{iso-8859-5}}
+\InputenxSlot{213}{0443}{\do{koi8-r}}
+\InputenxSlot{213}{05E8}{\do{atarist}}
+\InputenxSlot{213}{2019}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{213}{20AC}{\do{cp858}}
+\InputenxSlot{213}{2552}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{214}{00CD}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{214}{00D6}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{214}{00E1}{\do{nextstep}}
+\InputenxSlot{214}{00F7}{\do{mac-centeuro}\do{mac-cyrillic}\do{mac-roman}}
+\InputenxSlot{214}{0426}{\do{cp1251}}
+\InputenxSlot{214}{0436}{\do{iso-8859-5}\do{koi8-r}}
+\InputenxSlot{214}{043E}{\do{cp855}}
+\InputenxSlot{214}{05E9}{\do{atarist}}
+\InputenxSlot{214}{2553}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{215}{00CE}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{215}{00D7}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-13}\do{iso-8859-15}\do{cp1250}%
+ \do{cp1252}\do{cp1257}%
+}
+\InputenxSlot{215}{00E2}{\do{nextstep}}
+\InputenxSlot{215}{0152}{\do{dec-mcs}}
+\InputenxSlot{215}{015A}{\do{iso-8859-16}}
+\InputenxSlot{215}{0168}{\do{iso-8859-10}}
+\InputenxSlot{215}{041E}{\do{cp855}}
+\InputenxSlot{215}{0427}{\do{cp1251}}
+\InputenxSlot{215}{0432}{\do{koi8-r}}
+\InputenxSlot{215}{0437}{\do{iso-8859-5}}
+\InputenxSlot{215}{05EA}{\do{atarist}}
+\InputenxSlot{215}{1E6A}{\do{iso-8859-14}}
+\InputenxSlot{215}{201E}{\do{mac-cyrillic}}
+\InputenxSlot{215}{256B}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{215}{25CA}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{216}{00CF}{\do{cp850}\do{cp858}}
+\InputenxSlot{216}{00D8}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{216}{00E3}{\do{nextstep}}
+\InputenxSlot{216}{00FF}{\do{mac-roman}}
+\InputenxSlot{216}{011B}{\do{cp852}}
+\InputenxSlot{216}{011C}{\do{iso-8859-3}}
+\InputenxSlot{216}{014D}{\do{mac-centeuro}}
+\InputenxSlot{216}{0158}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{216}{0170}{\do{iso-8859-16}}
+\InputenxSlot{216}{0172}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{216}{040E}{\do{mac-cyrillic}}
+\InputenxSlot{216}{0428}{\do{cp1251}}
+\InputenxSlot{216}{0438}{\do{iso-8859-5}}
+\InputenxSlot{216}{043F}{\do{cp855}}
+\InputenxSlot{216}{044C}{\do{koi8-r}}
+\InputenxSlot{216}{05DF}{\do{atarist}}
+\InputenxSlot{216}{256A}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{217}{00D9}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{217}{00E4}{\do{nextstep}}
+\InputenxSlot{217}{0141}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{217}{0154}{\do{mac-centeuro}}
+\InputenxSlot{217}{016E}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{217}{0172}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{217}{0178}{\do{mac-roman}}
+\InputenxSlot{217}{0429}{\do{cp1251}}
+\InputenxSlot{217}{0439}{\do{iso-8859-5}}
+\InputenxSlot{217}{044B}{\do{koi8-r}}
+\InputenxSlot{217}{045E}{\do{mac-cyrillic}}
+\InputenxSlot{217}{05DA}{\do{atarist}}
+\InputenxSlot{217}{2518}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{218}{00DA}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{218}{00E5}{\do{nextstep}}
+\InputenxSlot{218}{0155}{\do{mac-centeuro}}
+\InputenxSlot{218}{015A}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{218}{040F}{\do{mac-cyrillic}}
+\InputenxSlot{218}{042A}{\do{cp1251}}
+\InputenxSlot{218}{0437}{\do{koi8-r}}
+\InputenxSlot{218}{043A}{\do{iso-8859-5}}
+\InputenxSlot{218}{05DD}{\do{atarist}}
+\InputenxSlot{218}{2044}{\do{mac-roman}}
+\InputenxSlot{218}{250C}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{219}{00DB}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-4}\do{iso-8859-9}%
+ \do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}%
+ \do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{219}{00E7}{\do{nextstep}}
+\InputenxSlot{219}{0158}{\do{mac-centeuro}}
+\InputenxSlot{219}{016A}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{219}{0170}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{219}{042B}{\do{cp1251}}
+\InputenxSlot{219}{043B}{\do{iso-8859-5}}
+\InputenxSlot{219}{0448}{\do{koi8-r}}
+\InputenxSlot{219}{045F}{\do{mac-cyrillic}}
+\InputenxSlot{219}{05E3}{\do{atarist}}
+\InputenxSlot{219}{20AC}{\do{mac-roman}}
+\InputenxSlot{219}{2588}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{220}{00DC}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{220}{00E8}{\do{nextstep}}
+\InputenxSlot{220}{042C}{\do{cp1251}}
+\InputenxSlot{220}{043C}{\do{iso-8859-5}}
+\InputenxSlot{220}{044D}{\do{koi8-r}}
+\InputenxSlot{220}{05E5}{\do{atarist}}
+\InputenxSlot{220}{2039}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{220}{2116}{\do{mac-cyrillic}}
+\InputenxSlot{220}{2584}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{221}{00A6}{\do{cp850}\do{cp858}}
+\InputenxSlot{221}{00A7}{\do{atarist}}
+\InputenxSlot{221}{00DD}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-10}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{cp1250}\do{cp1252}%
+}
+\InputenxSlot{221}{00E9}{\do{nextstep}}
+\InputenxSlot{221}{0118}{\do{iso-8859-16}}
+\InputenxSlot{221}{0130}{\do{iso-8859-9}}
+\InputenxSlot{221}{0162}{\do{cp852}}
+\InputenxSlot{221}{0168}{\do{iso-8859-4}}
+\InputenxSlot{221}{016C}{\do{iso-8859-3}}
+\InputenxSlot{221}{0178}{\do{dec-mcs}}
+\InputenxSlot{221}{017B}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{221}{0401}{\do{mac-cyrillic}}
+\InputenxSlot{221}{041F}{\do{cp855}}
+\InputenxSlot{221}{042D}{\do{cp1251}}
+\InputenxSlot{221}{043D}{\do{iso-8859-5}}
+\InputenxSlot{221}{0449}{\do{koi8-r}}
+\InputenxSlot{221}{203A}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{221}{258C}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{222}{00CC}{\do{cp850}\do{cp858}}
+\InputenxSlot{222}{00DE}{%
+ \do{iso-8859-1}\do{iso-8859-10}\do{iso-8859-15}\do{cp1252}%
+}
+\InputenxSlot{222}{00EA}{\do{nextstep}}
+\InputenxSlot{222}{0159}{\do{mac-centeuro}}
+\InputenxSlot{222}{015C}{\do{iso-8859-3}}
+\InputenxSlot{222}{015E}{\do{iso-8859-9}}
+\InputenxSlot{222}{0162}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{222}{016A}{\do{iso-8859-4}}
+\InputenxSlot{222}{016E}{\do{cp852}}
+\InputenxSlot{222}{0176}{\do{iso-8859-14}}
+\InputenxSlot{222}{017D}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{222}{021A}{\do{iso-8859-16}}
+\InputenxSlot{222}{042E}{\do{cp1251}}
+\InputenxSlot{222}{043E}{\do{iso-8859-5}}
+\InputenxSlot{222}{0447}{\do{koi8-r}}
+\InputenxSlot{222}{044F}{\do{cp855}}
+\InputenxSlot{222}{0451}{\do{mac-cyrillic}}
+\InputenxSlot{222}{2227}{\do{atarist}}
+\InputenxSlot{222}{2590}{\do{cp437}\do{cp865}\do{cp866}}
+\InputenxSlot{222}{FB01}{\do{mac-roman}}
+\InputenxSlot{223}{00DF}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{223}{00EB}{\do{nextstep}}
+\InputenxSlot{223}{0156}{\do{mac-centeuro}}
+\InputenxSlot{223}{042F}{\do{cp1251}}
+\InputenxSlot{223}{043F}{\do{iso-8859-5}}
+\InputenxSlot{223}{044A}{\do{koi8-r}}
+\InputenxSlot{223}{044F}{\do{mac-cyrillic}}
+\InputenxSlot{223}{2017}{\do{iso-8859-8}}
+\InputenxSlot{223}{221E}{\do{atarist}}
+\InputenxSlot{223}{2580}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{223}{FB02}{\do{mac-roman}}
+\InputenxSlot{224}{00D3}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{224}{00E0}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{224}{00EC}{\do{nextstep}}
+\InputenxSlot{224}{0101}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{224}{0105}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{224}{0155}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{224}{0157}{\do{mac-centeuro}}
+\InputenxSlot{224}{03B1}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{224}{042E}{\do{koi8-r}}
+\InputenxSlot{224}{042F}{\do{cp855}}
+\InputenxSlot{224}{0430}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{224}{0440}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{224}{05D0}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{224}{2021}{\do{mac-roman}}
+\InputenxSlot{225}{00B7}{\do{mac-roman}}
+\InputenxSlot{225}{00C6}{\do{nextstep}}
+\InputenxSlot{225}{00DF}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{225}{00E1}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{225}{012F}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{225}{0160}{\do{mac-centeuro}}
+\InputenxSlot{225}{03B2}{\do{atarist}}
+\InputenxSlot{225}{0410}{\do{koi8-r}}
+\InputenxSlot{225}{0431}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{225}{0440}{\do{cp855}}
+\InputenxSlot{225}{0441}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{225}{05D1}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{226}{00D4}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{226}{00E2}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{226}{00ED}{\do{nextstep}}
+\InputenxSlot{226}{0101}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{226}{0393}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{226}{0411}{\do{koi8-r}}
+\InputenxSlot{226}{0420}{\do{cp855}}
+\InputenxSlot{226}{0432}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{226}{0442}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{226}{05D2}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{226}{201A}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{227}{00AA}{\do{nextstep}}
+\InputenxSlot{227}{00D2}{\do{cp850}\do{cp858}}
+\InputenxSlot{227}{00E3}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{227}{0103}{\do{iso-8859-2}\do{iso-8859-16}\do{cp1250}}
+\InputenxSlot{227}{0107}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{227}{0143}{\do{cp852}}
+\InputenxSlot{227}{03C0}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{227}{0426}{\do{koi8-r}}
+\InputenxSlot{227}{0433}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{227}{0441}{\do{cp855}}
+\InputenxSlot{227}{0443}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{227}{05D3}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{227}{201E}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{228}{00E4}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{228}{00EE}{\do{nextstep}}
+\InputenxSlot{228}{00F5}{\do{cp850}\do{cp858}}
+\InputenxSlot{228}{0144}{\do{cp852}}
+\InputenxSlot{228}{0161}{\do{mac-centeuro}}
+\InputenxSlot{228}{03A3}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{228}{0414}{\do{koi8-r}}
+\InputenxSlot{228}{0421}{\do{cp855}}
+\InputenxSlot{228}{0434}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{228}{0444}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{228}{05D4}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{228}{2030}{\do{mac-roman}}
+\InputenxSlot{229}{00C2}{\do{mac-roman}}
+\InputenxSlot{229}{00D5}{\do{cp850}\do{cp858}}
+\InputenxSlot{229}{00E5}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}\do{cp1252}%
+ \do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{229}{00EF}{\do{nextstep}}
+\InputenxSlot{229}{0107}{\do{iso-8859-16}}
+\InputenxSlot{229}{010B}{\do{iso-8859-3}}
+\InputenxSlot{229}{013A}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{229}{0148}{\do{cp852}}
+\InputenxSlot{229}{015A}{\do{mac-centeuro}}
+\InputenxSlot{229}{03C3}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{229}{0415}{\do{koi8-r}}
+\InputenxSlot{229}{0435}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{229}{0442}{\do{cp855}}
+\InputenxSlot{229}{0445}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{229}{05D5}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{230}{00B5}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{230}{00CA}{\do{mac-roman}}
+\InputenxSlot{230}{00E6}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1252}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{230}{00F0}{\do{nextstep}}
+\InputenxSlot{230}{0107}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{230}{0109}{\do{iso-8859-3}}
+\InputenxSlot{230}{0119}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{230}{015B}{\do{mac-centeuro}}
+\InputenxSlot{230}{0160}{\do{cp852}}
+\InputenxSlot{230}{0422}{\do{cp855}}
+\InputenxSlot{230}{0424}{\do{koi8-r}}
+\InputenxSlot{230}{0436}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{230}{0446}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{230}{05D6}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{231}{00C1}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{231}{00E7}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-9}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1250}%
+ \do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{231}{00F1}{\do{nextstep}}
+\InputenxSlot{231}{00FE}{\do{cp850}\do{cp858}}
+\InputenxSlot{231}{0113}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{231}{012F}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{231}{0161}{\do{cp852}}
+\InputenxSlot{231}{03C4}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{231}{0413}{\do{koi8-r}}
+\InputenxSlot{231}{0437}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{231}{0443}{\do{cp855}}
+\InputenxSlot{231}{0447}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{231}{05D7}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{232}{00CB}{\do{mac-roman}}
+\InputenxSlot{232}{00DE}{\do{cp850}\do{cp858}}
+\InputenxSlot{232}{00E8}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{232}{010D}{%
+ \do{iso-8859-2}\do{iso-8859-4}\do{iso-8859-10}\do{iso-8859-13}%
+ \do{cp1250}\do{cp1257}%
+}
+\InputenxSlot{232}{0141}{\do{nextstep}}
+\InputenxSlot{232}{0154}{\do{cp852}}
+\InputenxSlot{232}{0164}{\do{mac-centeuro}}
+\InputenxSlot{232}{03A6}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{232}{0423}{\do{cp855}}
+\InputenxSlot{232}{0425}{\do{koi8-r}}
+\InputenxSlot{232}{0438}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{232}{0448}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{232}{05D8}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{233}{00C8}{\do{mac-roman}}
+\InputenxSlot{233}{00D8}{\do{nextstep}}
+\InputenxSlot{233}{00DA}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{233}{00E9}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{233}{0165}{\do{mac-centeuro}}
+\InputenxSlot{233}{0398}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{233}{0418}{\do{koi8-r}}
+\InputenxSlot{233}{0436}{\do{cp855}}
+\InputenxSlot{233}{0439}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{233}{0449}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{233}{05D9}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{234}{00CD}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{234}{00DB}{\do{cp850}\do{cp858}}
+\InputenxSlot{234}{00EA}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{234}{0119}{%
+ \do{iso-8859-2}\do{iso-8859-4}\do{iso-8859-10}\do{cp1250}%
+}
+\InputenxSlot{234}{0152}{\do{nextstep}}
+\InputenxSlot{234}{0155}{\do{cp852}}
+\InputenxSlot{234}{017A}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{234}{03A9}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{234}{0416}{\do{cp855}}
+\InputenxSlot{234}{0419}{\do{koi8-r}}
+\InputenxSlot{234}{043A}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{234}{044A}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{234}{05DA}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{235}{00BA}{\do{nextstep}}
+\InputenxSlot{235}{00CE}{\do{mac-roman}}
+\InputenxSlot{235}{00D9}{\do{cp850}\do{cp858}}
+\InputenxSlot{235}{00EB}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{235}{0117}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{235}{0170}{\do{cp852}}
+\InputenxSlot{235}{017D}{\do{mac-centeuro}}
+\InputenxSlot{235}{03B4}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{235}{041A}{\do{koi8-r}}
+\InputenxSlot{235}{0432}{\do{cp855}}
+\InputenxSlot{235}{043B}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{235}{044B}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{235}{05DB}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{236}{00CF}{\do{mac-roman}}
+\InputenxSlot{236}{00EC}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{236}{00F2}{\do{nextstep}}
+\InputenxSlot{236}{00FD}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{236}{0117}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{236}{011B}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{236}{0123}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{236}{017E}{\do{mac-centeuro}}
+\InputenxSlot{236}{0412}{\do{cp855}}
+\InputenxSlot{236}{041B}{\do{koi8-r}}
+\InputenxSlot{236}{043C}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{236}{044C}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{236}{05DC}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{236}{221E}{\do{cp437}\do{cp865}}
+\InputenxSlot{236}{222E}{\do{atarist}}
+\InputenxSlot{237}{00CC}{\do{mac-roman}}
+\InputenxSlot{237}{00DD}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{237}{00ED}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{237}{00F3}{\do{nextstep}}
+\InputenxSlot{237}{0137}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{237}{016A}{\do{mac-centeuro}}
+\InputenxSlot{237}{03C6}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{237}{041C}{\do{koi8-r}}
+\InputenxSlot{237}{043D}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{237}{044C}{\do{cp855}}
+\InputenxSlot{237}{044D}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{237}{05DD}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{238}{00AF}{\do{cp850}\do{cp858}}
+\InputenxSlot{238}{00D3}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{238}{00EE}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{238}{00F4}{\do{nextstep}}
+\InputenxSlot{238}{012B}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{238}{0163}{\do{cp852}}
+\InputenxSlot{238}{03B5}{\do{cp437}\do{cp865}}
+\InputenxSlot{238}{041D}{\do{koi8-r}}
+\InputenxSlot{238}{042C}{\do{cp855}}
+\InputenxSlot{238}{043E}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{238}{044E}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{238}{05DE}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{238}{2208}{\do{atarist}}
+\InputenxSlot{239}{00B4}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{239}{00D4}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{239}{00EF}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}\do{cp1252}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{239}{00F5}{\do{nextstep}}
+\InputenxSlot{239}{010F}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{239}{012B}{\do{iso-8859-4}}
+\InputenxSlot{239}{013C}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{239}{041E}{\do{koi8-r}}
+\InputenxSlot{239}{043F}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{239}{044F}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{239}{05DF}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{239}{2116}{\do{cp855}}
+\InputenxSlot{239}{2229}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{240}{00AD}{%
+ \do{cp850}\do{cp852}\do{cp855}\do{cp858}%
+}
+\InputenxSlot{240}{00F0}{%
+ \do{iso-8859-1}\do{iso-8859-10}\do{iso-8859-15}\do{cp1252}%
+}
+\InputenxSlot{240}{00F6}{\do{nextstep}}
+\InputenxSlot{240}{0111}{%
+ \do{iso-8859-2}\do{iso-8859-4}\do{iso-8859-16}\do{cp1250}%
+}
+\InputenxSlot{240}{011F}{\do{iso-8859-9}}
+\InputenxSlot{240}{0161}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{240}{016B}{\do{mac-centeuro}}
+\InputenxSlot{240}{0175}{\do{iso-8859-14}}
+\InputenxSlot{240}{0401}{\do{cp866}}
+\InputenxSlot{240}{041F}{\do{koi8-r}}
+\InputenxSlot{240}{0440}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{240}{05E0}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{240}{2116}{\do{iso-8859-5}}
+\InputenxSlot{240}{2261}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{241}{00B1}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{241}{00D2}{\do{mac-roman}}
+\InputenxSlot{241}{00E6}{\do{nextstep}}
+\InputenxSlot{241}{00F1}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{241}{0144}{%
+ \do{iso-8859-2}\do{iso-8859-13}\do{iso-8859-16}\do{cp1250}%
+ \do{cp1257}%
+}
+\InputenxSlot{241}{0146}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{241}{016E}{\do{mac-centeuro}}
+\InputenxSlot{241}{02DD}{\do{cp852}}
+\InputenxSlot{241}{042F}{\do{koi8-r}}
+\InputenxSlot{241}{0441}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{241}{044B}{\do{cp855}}
+\InputenxSlot{241}{0451}{\do{iso-8859-5}\do{cp866}}
+\InputenxSlot{241}{05E1}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{242}{00DA}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{242}{00F2}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{242}{00F9}{\do{nextstep}}
+\InputenxSlot{242}{0146}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{242}{0148}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{242}{014D}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{242}{02DB}{\do{cp852}}
+\InputenxSlot{242}{0404}{\do{cp866}}
+\InputenxSlot{242}{0420}{\do{koi8-r}}
+\InputenxSlot{242}{042B}{\do{cp855}}
+\InputenxSlot{242}{0442}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{242}{0452}{\do{iso-8859-5}}
+\InputenxSlot{242}{05E2}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{242}{2017}{\do{cp850}\do{cp858}}
+\InputenxSlot{242}{2265}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{243}{00BE}{\do{cp850}\do{cp858}}
+\InputenxSlot{243}{00DB}{\do{mac-roman}}
+\InputenxSlot{243}{00F3}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-9}%
+ \do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{243}{00FA}{\do{nextstep}}
+\InputenxSlot{243}{0137}{\do{iso-8859-4}}
+\InputenxSlot{243}{016F}{\do{mac-centeuro}}
+\InputenxSlot{243}{02C7}{\do{cp852}}
+\InputenxSlot{243}{0421}{\do{koi8-r}}
+\InputenxSlot{243}{0437}{\do{cp855}}
+\InputenxSlot{243}{0443}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{243}{0453}{\do{iso-8859-5}}
+\InputenxSlot{243}{0454}{\do{cp866}}
+\InputenxSlot{243}{05E3}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{243}{2264}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{244}{00B6}{\do{cp850}\do{cp858}}
+\InputenxSlot{244}{00D9}{\do{mac-roman}}
+\InputenxSlot{244}{00F4}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{244}{00FB}{\do{nextstep}}
+\InputenxSlot{244}{014D}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{244}{0170}{\do{mac-centeuro}}
+\InputenxSlot{244}{02D8}{\do{cp852}}
+\InputenxSlot{244}{0407}{\do{cp866}}
+\InputenxSlot{244}{0417}{\do{cp855}}
+\InputenxSlot{244}{0422}{\do{koi8-r}}
+\InputenxSlot{244}{0444}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{244}{0454}{\do{iso-8859-5}}
+\InputenxSlot{244}{05E4}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{245}{00A7}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{245}{00F5}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-13}\do{iso-8859-14}\do{iso-8859-15}\do{cp1252}%
+ \do{cp1257}\do{dec-mcs}%
+}
+\InputenxSlot{245}{0121}{\do{iso-8859-3}}
+\InputenxSlot{245}{0131}{\do{mac-roman}\do{nextstep}}
+\InputenxSlot{245}{0151}{\do{iso-8859-2}\do{iso-8859-16}\do{cp1250}}
+\InputenxSlot{245}{0171}{\do{mac-centeuro}}
+\InputenxSlot{245}{0423}{\do{koi8-r}}
+\InputenxSlot{245}{0445}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{245}{0448}{\do{cp855}}
+\InputenxSlot{245}{0455}{\do{iso-8859-5}}
+\InputenxSlot{245}{0457}{\do{cp866}}
+\InputenxSlot{245}{05E5}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{246}{00F6}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{246}{00F7}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{246}{00FC}{\do{nextstep}}
+\InputenxSlot{246}{0172}{\do{mac-centeuro}}
+\InputenxSlot{246}{02C6}{\do{mac-roman}}
+\InputenxSlot{246}{040E}{\do{cp866}}
+\InputenxSlot{246}{0416}{\do{koi8-r}}
+\InputenxSlot{246}{0428}{\do{cp855}}
+\InputenxSlot{246}{0446}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{246}{0456}{\do{iso-8859-5}}
+\InputenxSlot{246}{05E6}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{247}{00B8}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{247}{00F7}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-13}\do{iso-8859-15}\do{cp1250}%
+ \do{cp1252}\do{cp1257}%
+}
+\InputenxSlot{247}{00FD}{\do{nextstep}}
+\InputenxSlot{247}{0153}{\do{dec-mcs}}
+\InputenxSlot{247}{015B}{\do{iso-8859-16}}
+\InputenxSlot{247}{0169}{\do{iso-8859-10}}
+\InputenxSlot{247}{0173}{\do{mac-centeuro}}
+\InputenxSlot{247}{02DC}{\do{mac-roman}}
+\InputenxSlot{247}{0412}{\do{koi8-r}}
+\InputenxSlot{247}{0447}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{247}{044D}{\do{cp855}}
+\InputenxSlot{247}{0457}{\do{iso-8859-5}}
+\InputenxSlot{247}{045E}{\do{cp866}}
+\InputenxSlot{247}{05E7}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{247}{1E6B}{\do{iso-8859-14}}
+\InputenxSlot{247}{2248}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{248}{00AF}{\do{mac-roman}}
+\InputenxSlot{248}{00B0}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp852}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{248}{00DD}{\do{mac-centeuro}}
+\InputenxSlot{248}{00F8}{%
+ \do{iso-8859-1}\do{iso-8859-4}\do{iso-8859-9}\do{iso-8859-10}%
+ \do{iso-8859-14}\do{iso-8859-15}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{248}{011D}{\do{iso-8859-3}}
+\InputenxSlot{248}{0142}{\do{nextstep}}
+\InputenxSlot{248}{0159}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{248}{0171}{\do{iso-8859-16}}
+\InputenxSlot{248}{0173}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{248}{042C}{\do{koi8-r}}
+\InputenxSlot{248}{042D}{\do{cp855}}
+\InputenxSlot{248}{0448}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{248}{0458}{\do{iso-8859-5}}
+\InputenxSlot{248}{05E8}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{249}{00A8}{\do{cp850}\do{cp852}\do{cp858}}
+\InputenxSlot{249}{00F8}{\do{nextstep}}
+\InputenxSlot{249}{00F9}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-9}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{249}{00FD}{\do{mac-centeuro}}
+\InputenxSlot{249}{0142}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{249}{016F}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{249}{0173}{\do{iso-8859-4}\do{iso-8859-10}}
+\InputenxSlot{249}{02D8}{\do{mac-roman}}
+\InputenxSlot{249}{042B}{\do{koi8-r}}
+\InputenxSlot{249}{0449}{\do{cp855}\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{249}{0459}{\do{iso-8859-5}}
+\InputenxSlot{249}{05E9}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{249}{2219}{%
+ \do{atarist}\do{cp437}\do{cp865}\do{cp866}%
+}
+\InputenxSlot{250}{00B7}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}\do{cp866}%
+}
+\InputenxSlot{250}{00FA}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1250}\do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{250}{0137}{\do{mac-centeuro}}
+\InputenxSlot{250}{0153}{\do{nextstep}}
+\InputenxSlot{250}{015B}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{250}{02D9}{\do{cp852}\do{mac-roman}}
+\InputenxSlot{250}{0417}{\do{koi8-r}}
+\InputenxSlot{250}{0429}{\do{cp855}}
+\InputenxSlot{250}{044A}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{250}{045A}{\do{iso-8859-5}}
+\InputenxSlot{250}{05EA}{\do{iso-8859-8}\do{cp1255}}
+\InputenxSlot{251}{00B9}{\do{cp850}\do{cp858}}
+\InputenxSlot{251}{00DF}{\do{nextstep}}
+\InputenxSlot{251}{00FB}{%
+ \do{iso-8859-1}\do{iso-8859-3}\do{iso-8859-4}\do{iso-8859-9}%
+ \do{iso-8859-10}\do{iso-8859-14}\do{iso-8859-15}\do{iso-8859-16}%
+ \do{cp1252}\do{dec-mcs}%
+}
+\InputenxSlot{251}{016B}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{251}{0171}{\do{iso-8859-2}\do{cp852}\do{cp1250}}
+\InputenxSlot{251}{017B}{\do{mac-centeuro}}
+\InputenxSlot{251}{02DA}{\do{mac-roman}}
+\InputenxSlot{251}{0428}{\do{koi8-r}}
+\InputenxSlot{251}{0447}{\do{cp855}}
+\InputenxSlot{251}{044B}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{251}{045B}{\do{iso-8859-5}}
+\InputenxSlot{251}{221A}{%
+ \do{atarist}\do{cp437}\do{cp865}\do{cp866}%
+}
+\InputenxSlot{252}{00B3}{\do{cp850}\do{cp858}}
+\InputenxSlot{252}{00B8}{\do{mac-roman}}
+\InputenxSlot{252}{00FC}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}%
+ \do{iso-8859-9}\do{iso-8859-10}\do{iso-8859-13}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{iso-8859-16}\do{cp1250}\do{cp1252}\do{cp1257}%
+ \do{dec-mcs}%
+}
+\InputenxSlot{252}{00FE}{\do{nextstep}}
+\InputenxSlot{252}{0141}{\do{mac-centeuro}}
+\InputenxSlot{252}{0158}{\do{cp852}}
+\InputenxSlot{252}{0427}{\do{cp855}}
+\InputenxSlot{252}{042D}{\do{koi8-r}}
+\InputenxSlot{252}{044C}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{252}{045C}{\do{iso-8859-5}}
+\InputenxSlot{252}{207F}{\do{atarist}\do{cp437}\do{cp865}}
+\InputenxSlot{252}{2116}{\do{cp866}}
+\InputenxSlot{253}{00A4}{\do{cp866}}
+\InputenxSlot{253}{00A7}{\do{iso-8859-5}\do{cp855}}
+\InputenxSlot{253}{00B2}{%
+ \do{atarist}\do{cp437}\do{cp850}\do{cp858}\do{cp865}%
+}
+\InputenxSlot{253}{00FD}{%
+ \do{iso-8859-1}\do{iso-8859-2}\do{iso-8859-10}\do{iso-8859-14}%
+ \do{iso-8859-15}\do{cp1250}\do{cp1252}%
+}
+\InputenxSlot{253}{00FF}{\do{dec-mcs}\do{nextstep}}
+\InputenxSlot{253}{0119}{\do{iso-8859-16}}
+\InputenxSlot{253}{0131}{\do{iso-8859-9}}
+\InputenxSlot{253}{0159}{\do{cp852}}
+\InputenxSlot{253}{0169}{\do{iso-8859-4}}
+\InputenxSlot{253}{016D}{\do{iso-8859-3}}
+\InputenxSlot{253}{017C}{\do{iso-8859-13}\do{cp1257}\do{mac-centeuro}}
+\InputenxSlot{253}{02DD}{\do{mac-roman}}
+\InputenxSlot{253}{0429}{\do{koi8-r}}
+\InputenxSlot{253}{044D}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{254}{00B3}{\do{atarist}}
+\InputenxSlot{254}{00FE}{%
+ \do{iso-8859-1}\do{iso-8859-10}\do{iso-8859-15}\do{cp1252}%
+}
+\InputenxSlot{254}{0122}{\do{mac-centeuro}}
+\InputenxSlot{254}{015D}{\do{iso-8859-3}}
+\InputenxSlot{254}{015F}{\do{iso-8859-9}}
+\InputenxSlot{254}{0163}{\do{iso-8859-2}\do{cp1250}}
+\InputenxSlot{254}{016B}{\do{iso-8859-4}}
+\InputenxSlot{254}{0177}{\do{iso-8859-14}}
+\InputenxSlot{254}{017E}{\do{iso-8859-13}\do{cp1257}}
+\InputenxSlot{254}{021B}{\do{iso-8859-16}}
+\InputenxSlot{254}{02DB}{\do{mac-roman}}
+\InputenxSlot{254}{0427}{\do{koi8-r}}
+\InputenxSlot{254}{044E}{\do{cp1251}\do{mac-cyrillic}}
+\InputenxSlot{254}{045E}{\do{iso-8859-5}}
+\InputenxSlot{254}{25A0}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{255}{00A0}{%
+ \do{cp437}\do{cp850}\do{cp852}\do{cp855}\do{cp858}\do{cp865}%
+ \do{cp866}%
+}
+\InputenxSlot{255}{00AF}{\do{atarist}}
+\InputenxSlot{255}{00FF}{%
+ \do{iso-8859-1}\do{iso-8859-9}\do{iso-8859-14}\do{iso-8859-15}%
+ \do{iso-8859-16}\do{cp1252}%
+}
+\InputenxSlot{255}{0138}{\do{iso-8859-10}}
+\InputenxSlot{255}{02C7}{\do{mac-centeuro}\do{mac-roman}}
+\InputenxSlot{255}{02D9}{%
+ \do{iso-8859-2}\do{iso-8859-3}\do{iso-8859-4}\do{cp1250}\do{cp1257}%
+}
+\InputenxSlot{255}{042A}{\do{koi8-r}}
+\InputenxSlot{255}{044F}{\do{cp1251}}
+\InputenxSlot{255}{045F}{\do{iso-8859-5}}
+\InputenxSlot{255}{2019}{\do{iso-8859-13}}
+\InputenxSlot{255}{20AC}{\do{mac-cyrillic}}
+% \end{macrocode}
+% \fi
+%
+% \begin{macrocode}
+%</slot>
+% \end{macrocode}
+%
+% \subsection{Mapping UC to LICR}
+%
+% \begin{macrocode}
+%<*uc>
+\ProvidesFile{ix-uc.def}%
+ [2016/05/16 v1.11 UC to LICR (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+% \end{macrocode}
+%
+% \textit{List omitted here, see \xfile{ix-uc.def}.}
+% \iffalse
+% \begin{macrocode}
+\InputenxUC{00A0}{\nobreakspace}{}
+\InputenxUC{00A1}{\textexclamdown}{}
+\InputenxUC{00A2}{\textcent}{%
+ \ProvideTextCommandDefault{\textcent}{%
+ \TextSymbolUnavailable\textcent
+ }%
+}
+\InputenxUC{00A3}{\textsterling}{}
+\InputenxUC{00A4}{\textcurrency}{%
+ \ProvideTextCommandDefault{\textcurrency}{%
+ \TextSymbolUnavailable\textcurrency
+ }%
+}
+\InputenxUC{00A5}{\textyen}{%
+ \ProvideTextCommandDefault{\textyen}{%
+ \TextSymbolUnavailable\textyen
+ }%
+}
+\InputenxUC{00A6}{\textbrokenbar}{%
+ \ProvideTextCommandDefault{\textbrokenbar}{%
+ \TextSymbolUnavailable\textbrokenbar
+ }%
+}
+\InputenxUC{00A7}{\textsection}{}
+\InputenxUC{00A8}{\textasciidieresis}{%
+ \ProvideTextCommandDefault{\textasciidieresis}{%
+ \"{}%
+ }%
+}
+\InputenxUC{00A9}{\textcopyright}{}
+\InputenxUC{00AA}{\textordfeminine}{}
+\InputenxUC{00AB}{\guillemotleft}{}
+\InputenxUC{00AC}{\textlnot}{%
+ \ProvideTextCommandDefault{\textlnot}{%
+ \ensuremath\lnot
+ }%
+}
+\InputenxUC{00AD}{\-}{}
+\InputenxUC{00AE}{\textregistered}{}
+\InputenxUC{00AF}{\textasciimacron}{%
+ \ProvideTextCommandDefault{\textasciimacron}{%
+ \@tabacckludge={}%
+ }%
+}
+\InputenxUC{00B0}{\textdegree}{%
+ \ProvideTextCommandDefault{\textdegree}{%
+ \ensuremath{{^\circ}}%
+ }%
+}
+\InputenxUC{00B1}{\textpm}{%
+ \ProvideTextCommandDefault{\textpm}{%
+ \ensuremath\pm
+ }%
+}
+\InputenxUC{00B2}{\texttwosuperior}{%
+ \ProvideTextCommandDefault{\texttwosuperior}{%
+ \ensuremath{{^2}}%
+ }%
+}
+\InputenxUC{00B3}{\textthreesuperior}{%
+ \ProvideTextCommandDefault{\textthreesuperior}{%
+ \ensuremath{{^3}}%
+ }%
+}
+\InputenxUC{00B4}{\textasciiacute}{%
+ \ProvideTextCommandDefault{\textasciiacute}{%
+ \@tabacckludge'{}%
+ }%
+}
+\InputenxUC{00B5}{\textmu}{%
+ \ProvideTextCommandDefault{\textmu}{%
+ \ensuremath\mu
+ }%
+}
+\InputenxUC{00B6}{\textparagraph}{}
+\InputenxUC{00B7}{\textperiodcentered}{}
+\InputenxUC{00B8}{\c\ }{}
+\InputenxUC{00B9}{\textonesuperior}{%
+ \ProvideTextCommandDefault{\textonesuperior}{%
+ \ensuremath{{^1}}%
+ }%
+}
+\InputenxUC{00BA}{\textordmasculine}{}
+\InputenxUC{00BB}{\guillemotright}{}
+\InputenxUC{00BC}{\textonequarter}{%
+ \ProvideTextCommandDefault{\textonequarter}{%
+ \ensuremath{\frac14}%
+ }%
+}
+\InputenxUC{00BD}{\textonehalf}{%
+ \ProvideTextCommandDefault{\textonehalf}{%
+ \ensuremath{\frac12}%
+ }%
+}
+\InputenxUC{00BE}{\textthreequarters}{%
+ \ProvideTextCommandDefault{\textthreequarters}{%
+ \ensuremath{\frac34}%
+ }%
+}
+\InputenxUC{00BF}{\textquestiondown}{}
+\InputenxUC{00C0}{\@tabacckludge`A}{}
+\InputenxUC{00C1}{\@tabacckludge'A}{}
+\InputenxUC{00C2}{\^A}{}
+\InputenxUC{00C3}{\~A}{}
+\InputenxUC{00C4}{\"A}{}
+\InputenxUC{00C5}{\r A}{}
+\InputenxUC{00C6}{\AE}{}
+\InputenxUC{00C7}{\c C}{}
+\InputenxUC{00C8}{\@tabacckludge`E}{}
+\InputenxUC{00C9}{\@tabacckludge'E}{}
+\InputenxUC{00CA}{\^E}{}
+\InputenxUC{00CB}{\"E}{}
+\InputenxUC{00CC}{\@tabacckludge`I}{}
+\InputenxUC{00CD}{\@tabacckludge'I}{}
+\InputenxUC{00CE}{\^I}{}
+\InputenxUC{00CF}{\"I}{}
+\InputenxUC{00D0}{\DH}{}
+\InputenxUC{00D1}{\~N}{}
+\InputenxUC{00D2}{\@tabacckludge`O}{}
+\InputenxUC{00D3}{\@tabacckludge'O}{}
+\InputenxUC{00D4}{\^O}{}
+\InputenxUC{00D5}{\~O}{}
+\InputenxUC{00D6}{\"O}{}
+\InputenxUC{00D7}{\texttimes}{%
+ \ProvideTextCommandDefault{\texttimes}{%
+ \ensuremath\times
+ }%
+}
+\InputenxUC{00D8}{\O}{}
+\InputenxUC{00D9}{\@tabacckludge`U}{}
+\InputenxUC{00DA}{\@tabacckludge'U}{}
+\InputenxUC{00DB}{\^U}{}
+\InputenxUC{00DC}{\"U}{}
+\InputenxUC{00DD}{\@tabacckludge'Y}{}
+\InputenxUC{00DE}{\TH}{}
+\InputenxUC{00DF}{\ss}{}
+\InputenxUC{00E0}{\@tabacckludge`a}{}
+\InputenxUC{00E1}{\@tabacckludge'a}{}
+\InputenxUC{00E2}{\^a}{}
+\InputenxUC{00E3}{\~a}{}
+\InputenxUC{00E4}{\"a}{}
+\InputenxUC{00E5}{\r a}{}
+\InputenxUC{00E6}{\ae}{}
+\InputenxUC{00E7}{\c c}{}
+\InputenxUC{00E8}{\@tabacckludge`e}{}
+\InputenxUC{00E9}{\@tabacckludge'e}{}
+\InputenxUC{00EA}{\^e}{}
+\InputenxUC{00EB}{\"e}{}
+\InputenxUC{00EC}{\@tabacckludge`\i}{}
+\InputenxUC{00ED}{\@tabacckludge'\i}{}
+\InputenxUC{00EE}{\^\i}{}
+\InputenxUC{00EF}{\"\i}{}
+\InputenxUC{00F0}{\dh}{}
+\InputenxUC{00F1}{\~n}{}
+\InputenxUC{00F2}{\@tabacckludge`o}{}
+\InputenxUC{00F3}{\@tabacckludge'o}{}
+\InputenxUC{00F4}{\^o}{}
+\InputenxUC{00F5}{\~o}{}
+\InputenxUC{00F6}{\"o}{}
+\InputenxUC{00F7}{\textdiv}{%
+ \ProvideTextCommandDefault{\textdiv}{%
+ \TextSymbolUnavailable\textdiv
+ }%
+}
+\InputenxUC{00F8}{\o}{}
+\InputenxUC{00F9}{\@tabacckludge`u}{}
+\InputenxUC{00FA}{\@tabacckludge'u}{}
+\InputenxUC{00FB}{\^u}{}
+\InputenxUC{00FC}{\"u}{}
+\InputenxUC{00FD}{\@tabacckludge'y}{}
+\InputenxUC{00FE}{\th}{}
+\InputenxUC{00FF}{\"y}{}
+\InputenxUC{0100}{\@tabacckludge=A}{}
+\InputenxUC{0101}{\@tabacckludge=a}{}
+\InputenxUC{0102}{\u A}{}
+\InputenxUC{0103}{\u a}{}
+\InputenxUC{0104}{\k A}{}
+\InputenxUC{0105}{\k a}{}
+\InputenxUC{0106}{\@tabacckludge'C}{}
+\InputenxUC{0107}{\@tabacckludge'c}{}
+\InputenxUC{0108}{\^C}{}
+\InputenxUC{0109}{\^c}{}
+\InputenxUC{010A}{\.C}{}
+\InputenxUC{010B}{\.c}{}
+\InputenxUC{010C}{\v C}{}
+\InputenxUC{010D}{\v c}{}
+\InputenxUC{010E}{\v D}{}
+\InputenxUC{010F}{\v d}{}
+\InputenxUC{0110}{\DJ}{}
+\InputenxUC{0111}{\dj}{}
+\InputenxUC{0112}{\@tabacckludge=E}{}
+\InputenxUC{0113}{\@tabacckludge=e}{}
+\InputenxUC{0116}{\.E}{}
+\InputenxUC{0117}{\.e}{}
+\InputenxUC{0118}{\k E}{}
+\InputenxUC{0119}{\k e}{}
+\InputenxUC{011A}{\v E}{}
+\InputenxUC{011B}{\v e}{}
+\InputenxUC{011C}{\^G}{}
+\InputenxUC{011D}{\^g}{}
+\InputenxUC{011E}{\u G}{}
+\InputenxUC{011F}{\u g}{}
+\InputenxUC{0120}{\.G}{}
+\InputenxUC{0121}{\.g}{}
+\InputenxUC{0122}{\c G}{}
+\InputenxUC{0123}{\c g}{}
+\InputenxUC{0124}{\^H}{}
+\InputenxUC{0125}{\^h}{}
+\InputenxUC{0126}{\textmalteseH}{%
+ \ProvideTextCommandDefault{\textmalteseH}{%
+ \TextSymbolUnavailable\textmalteseH
+ }%
+}
+\InputenxUC{0127}{\textmalteseh}{%
+ \ProvideTextCommandDefault{\textmalteseh}{%
+ \TextSymbolUnavailable\textmalteseh
+ }%
+}
+\InputenxUC{0128}{\~I}{}
+\InputenxUC{0129}{\~\i}{}
+\InputenxUC{012A}{\@tabacckludge=I}{}
+\InputenxUC{012B}{\@tabacckludge=\i}{}
+\InputenxUC{012E}{\k I}{}
+\InputenxUC{012F}{\k i}{}
+\InputenxUC{0130}{\.I}{}
+\InputenxUC{0131}{\i}{}
+\InputenxUC{0132}{\IJ}{}
+\InputenxUC{0133}{\ij}{}
+\InputenxUC{0134}{\^J}{}
+\InputenxUC{0135}{\^\j}{}
+\InputenxUC{0136}{\c K}{}
+\InputenxUC{0137}{\c k}{}
+\InputenxUC{0138}{\textkra}{%
+ \ProvideTextCommandDefault{\textkra}{%
+ \TextSymbolUnavailable\textkra
+ }%
+}
+\InputenxUC{0139}{\@tabacckludge'L}{}
+\InputenxUC{013A}{\@tabacckludge'l}{}
+\InputenxUC{013B}{\c L}{}
+\InputenxUC{013C}{\c l}{}
+\InputenxUC{013D}{\v L}{}
+\InputenxUC{013E}{\v l}{}
+\InputenxUC{0141}{\L}{}
+\InputenxUC{0142}{\l}{}
+\InputenxUC{0143}{\@tabacckludge'N}{}
+\InputenxUC{0144}{\@tabacckludge'n}{}
+\InputenxUC{0145}{\c N}{}
+\InputenxUC{0146}{\c n}{}
+\InputenxUC{0147}{\v N}{}
+\InputenxUC{0148}{\v n}{}
+\InputenxUC{014A}{\NG}{}
+\InputenxUC{014B}{\ng}{}
+\InputenxUC{014C}{\@tabacckludge=O}{}
+\InputenxUC{014D}{\@tabacckludge=o}{}
+\InputenxUC{0150}{\H O}{}
+\InputenxUC{0151}{\H o}{}
+\InputenxUC{0152}{\OE}{}
+\InputenxUC{0153}{\oe}{}
+\InputenxUC{0154}{\@tabacckludge'R}{}
+\InputenxUC{0155}{\@tabacckludge'r}{}
+\InputenxUC{0156}{\c R}{}
+\InputenxUC{0157}{\c r}{}
+\InputenxUC{0158}{\v R}{}
+\InputenxUC{0159}{\v r}{}
+\InputenxUC{015A}{\@tabacckludge'S}{}
+\InputenxUC{015B}{\@tabacckludge's}{}
+\InputenxUC{015C}{\^S}{}
+\InputenxUC{015D}{\^s}{}
+\InputenxUC{015E}{\c S}{}
+\InputenxUC{015F}{\c s}{}
+\InputenxUC{0160}{\v S}{}
+\InputenxUC{0161}{\v s}{}
+\InputenxUC{0162}{\c T}{}
+\InputenxUC{0163}{\c t}{}
+\InputenxUC{0164}{\v T}{}
+\InputenxUC{0165}{\v t}{}
+\InputenxUC{0166}{\textTstroke}{%
+ \ProvideTextCommandDefault{\textTstroke}{%
+ \TextSymbolUnavailable\textTstroke
+ }%
+}
+\InputenxUC{0167}{\texttstroke}{%
+ \ProvideTextCommandDefault{\texttstroke}{%
+ \TextSymbolUnavailable\texttstroke
+ }%
+}
+\InputenxUC{0168}{\~U}{}
+\InputenxUC{0169}{\~u}{}
+\InputenxUC{016A}{\@tabacckludge=U}{}
+\InputenxUC{016B}{\@tabacckludge=u}{}
+\InputenxUC{016C}{\u U}{}
+\InputenxUC{016D}{\u u}{}
+\InputenxUC{016E}{\r U}{}
+\InputenxUC{016F}{\r u}{}
+\InputenxUC{0170}{\H U}{}
+\InputenxUC{0171}{\H u}{}
+\InputenxUC{0172}{\k U}{}
+\InputenxUC{0173}{\k u}{}
+\InputenxUC{0174}{\^W}{}
+\InputenxUC{0175}{\^w}{}
+\InputenxUC{0176}{\^Y}{}
+\InputenxUC{0177}{\^y}{}
+\InputenxUC{0178}{\"Y}{}
+\InputenxUC{0179}{\@tabacckludge'Z}{}
+\InputenxUC{017A}{\@tabacckludge'z}{}
+\InputenxUC{017B}{\.Z}{}
+\InputenxUC{017C}{\.z}{}
+\InputenxUC{017D}{\v Z}{}
+\InputenxUC{017E}{\v z}{}
+\InputenxUC{0192}{\textflorin}{%
+ \ProvideTextCommandDefault{\textflorin}{%
+ \textit{f}%
+ }%
+}
+\InputenxUC{01CD}{\v A}{}
+\InputenxUC{01CE}{\v a}{}
+\InputenxUC{01CF}{\v I}{}
+\InputenxUC{01D0}{\v\i}{}
+\InputenxUC{01D1}{\v O}{}
+\InputenxUC{01D2}{\v o}{}
+\InputenxUC{01D3}{\v U}{}
+\InputenxUC{01D4}{\v u}{}
+\InputenxUC{01E2}{\@tabacckludge=\AE}{}
+\InputenxUC{01E3}{\@tabacckludge=\ae}{}
+\InputenxUC{01E6}{\v G}{}
+\InputenxUC{01E7}{\v g}{}
+\InputenxUC{01E8}{\v K}{}
+\InputenxUC{01E9}{\v k}{}
+\InputenxUC{01F0}{\v\j}{}
+\InputenxUC{01F4}{\@tabacckludge'G}{}
+\InputenxUC{01F5}{\@tabacckludge'g}{}
+\InputenxUC{01F8}{\@tabacckludge`N}{}
+\InputenxUC{01F9}{\@tabacckludge`n}{}
+\InputenxUC{01FC}{\@tabacckludge'\AE}{}
+\InputenxUC{01FD}{\@tabacckludge'\ae}{}
+\InputenxUC{0218}{\textcommabelow S}{%
+ \ProvideTextCommandDefault{\textcommabelow}[1]{%
+ \hmode@bgroup
+ \ooalign{%
+ \null#1\crcr
+ \hidewidth
+ \raise-.31ex\hbox{%
+ \check@mathfonts
+ \fontsize\ssf@size\z@
+ \math@fontsfalse\selectfont,%
+ }%
+ \hidewidth
+ }%
+ \egroup
+ }%
+}
+\InputenxUC{0219}{\textcommabelow s}{%
+ \ProvideTextCommandDefault{\textcommabelow}[1]{%
+ \hmode@bgroup
+ \ooalign{%
+ \null#1\crcr
+ \hidewidth
+ \raise-.31ex\hbox{%
+ \check@mathfonts
+ \fontsize\ssf@size\z@
+ \math@fontsfalse\selectfont,%
+ }%
+ \hidewidth
+ }%
+ \egroup
+ }%
+}
+\InputenxUC{021A}{\textcommabelow T}{%
+ \ProvideTextCommandDefault{\textcommabelow}[1]{%
+ \hmode@bgroup
+ \ooalign{%
+ \null#1\crcr
+ \hidewidth
+ \raise-.31ex\hbox{%
+ \check@mathfonts
+ \fontsize\ssf@size\z@
+ \math@fontsfalse\selectfont,%
+ }%
+ \hidewidth
+ }%
+ \egroup
+ }%
+}
+\InputenxUC{021B}{\textcommabelow t}{%
+ \ProvideTextCommandDefault{\textcommabelow}[1]{%
+ \hmode@bgroup
+ \ooalign{%
+ \null#1\crcr
+ \hidewidth
+ \raise-.31ex\hbox{%
+ \check@mathfonts
+ \fontsize\ssf@size\z@
+ \math@fontsfalse\selectfont,%
+ }%
+ \hidewidth
+ }%
+ \egroup
+ }%
+}
+\InputenxUC{0226}{\.A}{}
+\InputenxUC{0227}{\.a}{}
+\InputenxUC{0228}{\c E}{}
+\InputenxUC{0229}{\c e}{}
+\InputenxUC{022E}{\.O}{}
+\InputenxUC{022F}{\.o}{}
+\InputenxUC{0232}{\@tabacckludge=y}{}
+\InputenxUC{0237}{\j}{}
+\InputenxUC{02C6}{\textasciicircum}{}
+\InputenxUC{02C7}{\textasciicaron}{%
+ \ProvideTextCommandDefault{\textasciicaron}{%
+ \v{}%
+ }%
+}
+\InputenxUC{02CB}{\textasciigrave}{%
+ \ProvideTextCommandDefault{\textasciigrave}{%
+ \@tabacckludge`{}%
+ }%
+}
+\InputenxUC{02D8}{\textasciibreve}{%
+ \ProvideTextCommandDefault{\textasciibreve}{%
+ \u{}%
+ }%
+}
+\InputenxUC{02D9}{\.{}}{}
+\InputenxUC{02DA}{\r{}}{}
+\InputenxUC{02DB}{\k{}}{}
+\InputenxUC{02DC}{\textasciitilde}{}
+\InputenxUC{02DD}{\textacutedbl}{%
+ \ProvideTextCommandDefault{\textacutedbl}{%
+ \H{}%
+ }%
+}
+\InputenxUC{0393}{\textGamma}{%
+ \ProvideTextCommandDefault{\textGamma}{%
+ \ensuremath\Gamma
+ }%
+}
+\InputenxUC{0398}{\textTheta}{%
+ \ProvideTextCommandDefault{\textTheta}{%
+ \ensuremath\Theta
+ }%
+}
+\InputenxUC{03A3}{\textSigma}{%
+ \ProvideTextCommandDefault{\textSigma}{%
+ \ensuremath\Sigma
+ }%
+}
+\InputenxUC{03A6}{\textPhi}{%
+ \ProvideTextCommandDefault{\textPhi}{%
+ \ensuremath\Phi
+ }%
+}
+\InputenxUC{03A9}{\textOmega}{%
+ \ProvideTextCommandDefault{\textOmega}{%
+ \ensuremath\Omega
+ }%
+}
+\InputenxUC{03B1}{\textalpha}{%
+ \ProvideTextCommandDefault{\textalpha}{%
+ \ensuremath\alpha
+ }%
+}
+\InputenxUC{03B2}{\textbeta}{%
+ \ProvideTextCommandDefault{\textbeta}{%
+ \ensuremath\beta
+ }%
+}
+\InputenxUC{03B4}{\textdelta}{%
+ \ProvideTextCommandDefault{\textdelta}{%
+ \ensuremath\delta
+ }%
+}
+\InputenxUC{03B5}{\textepsilon}{%
+ \ProvideTextCommandDefault{\textepsilon}{%
+ \ensuremath\varepsilon
+ }%
+}
+\InputenxUC{03C0}{\textpi}{%
+ \ProvideTextCommandDefault{\textpi}{%
+ \ensuremath\pi
+ }%
+}
+\InputenxUC{03C3}{\textsigma}{%
+ \ProvideTextCommandDefault{\textsigma}{%
+ \ensuremath\sigma
+ }%
+}
+\InputenxUC{03C4}{\texttau}{%
+ \ProvideTextCommandDefault{\texttau}{%
+ \ensuremath\tau
+ }%
+}
+\InputenxUC{03C6}{\textphi}{%
+ \ProvideTextCommandDefault{\textphi}{%
+ \ensuremath\phi
+ }%
+}
+\InputenxUC{0401}{\CYRYO}{}
+\InputenxUC{0402}{\CYRDJE}{}
+\InputenxUC{0403}{\@tabacckludge'\CYRG}{}
+\InputenxUC{0404}{\CYRIE}{}
+\InputenxUC{0405}{\CYRDZE}{}
+\InputenxUC{0406}{\CYRII}{}
+\InputenxUC{0407}{\CYRYI}{}
+\InputenxUC{0408}{\CYRJE}{}
+\InputenxUC{0409}{\CYRLJE}{}
+\InputenxUC{040A}{\CYRNJE}{}
+\InputenxUC{040B}{\CYRTSHE}{}
+\InputenxUC{040C}{\@tabacckludge'\CYRK}{}
+\InputenxUC{040E}{\CYRUSHRT}{}
+\InputenxUC{040F}{\CYRDZHE}{}
+\InputenxUC{0410}{\CYRA}{}
+\InputenxUC{0411}{\CYRB}{}
+\InputenxUC{0412}{\CYRV}{}
+\InputenxUC{0413}{\CYRG}{}
+\InputenxUC{0414}{\CYRD}{}
+\InputenxUC{0415}{\CYRE}{}
+\InputenxUC{0416}{\CYRZH}{}
+\InputenxUC{0417}{\CYRZ}{}
+\InputenxUC{0418}{\CYRI}{}
+\InputenxUC{0419}{\CYRISHRT}{}
+\InputenxUC{041A}{\CYRK}{}
+\InputenxUC{041B}{\CYRL}{}
+\InputenxUC{041C}{\CYRM}{}
+\InputenxUC{041D}{\CYRN}{}
+\InputenxUC{041E}{\CYRO}{}
+\InputenxUC{041F}{\CYRP}{}
+\InputenxUC{0420}{\CYRR}{}
+\InputenxUC{0421}{\CYRS}{}
+\InputenxUC{0422}{\CYRT}{}
+\InputenxUC{0423}{\CYRU}{}
+\InputenxUC{0424}{\CYRF}{}
+\InputenxUC{0425}{\CYRH}{}
+\InputenxUC{0426}{\CYRC}{}
+\InputenxUC{0427}{\CYRCH}{}
+\InputenxUC{0428}{\CYRSH}{}
+\InputenxUC{0429}{\CYRSHCH}{}
+\InputenxUC{042A}{\CYRHRDSN}{}
+\InputenxUC{042B}{\CYRERY}{}
+\InputenxUC{042C}{\CYRSFTSN}{}
+\InputenxUC{042D}{\CYREREV}{}
+\InputenxUC{042E}{\CYRYU}{}
+\InputenxUC{042F}{\CYRYA}{}
+\InputenxUC{0430}{\cyra}{}
+\InputenxUC{0431}{\cyrb}{}
+\InputenxUC{0432}{\cyrv}{}
+\InputenxUC{0433}{\cyrg}{}
+\InputenxUC{0434}{\cyrd}{}
+\InputenxUC{0435}{\cyre}{}
+\InputenxUC{0436}{\cyrzh}{}
+\InputenxUC{0437}{\cyrz}{}
+\InputenxUC{0438}{\cyri}{}
+\InputenxUC{0439}{\cyrishrt}{}
+\InputenxUC{043A}{\cyrk}{}
+\InputenxUC{043B}{\cyrl}{}
+\InputenxUC{043C}{\cyrm}{}
+\InputenxUC{043D}{\cyrn}{}
+\InputenxUC{043E}{\cyro}{}
+\InputenxUC{043F}{\cyrp}{}
+\InputenxUC{0440}{\cyrr}{}
+\InputenxUC{0441}{\cyrs}{}
+\InputenxUC{0442}{\cyrt}{}
+\InputenxUC{0443}{\cyru}{}
+\InputenxUC{0444}{\cyrf}{}
+\InputenxUC{0445}{\cyrh}{}
+\InputenxUC{0446}{\cyrc}{}
+\InputenxUC{0447}{\cyrch}{}
+\InputenxUC{0448}{\cyrsh}{}
+\InputenxUC{0449}{\cyrshch}{}
+\InputenxUC{044A}{\cyrhrdsn}{}
+\InputenxUC{044B}{\cyrery}{}
+\InputenxUC{044C}{\cyrsftsn}{}
+\InputenxUC{044D}{\cyrerev}{}
+\InputenxUC{044E}{\cyryu}{}
+\InputenxUC{044F}{\cyrya}{}
+\InputenxUC{0451}{\cyryo}{}
+\InputenxUC{0452}{\cyrdje}{}
+\InputenxUC{0453}{\@tabacckludge'\cyrg}{}
+\InputenxUC{0454}{\cyrie}{}
+\InputenxUC{0455}{\cyrdze}{}
+\InputenxUC{0456}{\cyrii}{}
+\InputenxUC{0457}{\cyryi}{}
+\InputenxUC{0458}{\cyrje}{}
+\InputenxUC{0459}{\cyrlje}{}
+\InputenxUC{045A}{\cyrnje}{}
+\InputenxUC{045B}{\cyrtshe}{}
+\InputenxUC{045C}{\@tabacckludge'\cyrk}{}
+\InputenxUC{045E}{\cyrushrt}{}
+\InputenxUC{045F}{\cyrdzhe}{}
+\InputenxUC{0462}{\CYRYAT}{}
+\InputenxUC{0463}{\cyryat}{}
+\InputenxUC{046A}{\CYRBYUS}{}
+\InputenxUC{046B}{\cyrbyus}{}
+\InputenxUC{0472}{\CYRFITA}{}
+\InputenxUC{0473}{\cyrfita}{}
+\InputenxUC{0474}{\CYRIZH}{}
+\InputenxUC{0475}{\cyrizh}{}
+\InputenxUC{048C}{\CYRSEMISFTSN}{}
+\InputenxUC{048D}{\cyrsemisftsn}{}
+\InputenxUC{048E}{\CYRRTICK}{}
+\InputenxUC{048F}{\cyrrtick}{}
+\InputenxUC{0490}{\CYRGUP}{}
+\InputenxUC{0491}{\cyrgup}{}
+\InputenxUC{0492}{\CYRGHCRS}{}
+\InputenxUC{0493}{\cyrghcrs}{}
+\InputenxUC{0494}{\CYRGHK}{}
+\InputenxUC{0495}{\cyrghk}{}
+\InputenxUC{0496}{\CYRZHDSC}{}
+\InputenxUC{0497}{\cyrzhdsc}{}
+\InputenxUC{0498}{\CYRZDSC}{}
+\InputenxUC{0499}{\cyrzdsc}{}
+\InputenxUC{049A}{\CYRKDSC}{}
+\InputenxUC{049B}{\cyrkdsc}{}
+\InputenxUC{049C}{\CYRKVCRS}{}
+\InputenxUC{049D}{\cyrkvcrs}{}
+\InputenxUC{049E}{\CYRKHCRS}{}
+\InputenxUC{049F}{\cyrkhcrs}{}
+\InputenxUC{04A0}{\CYRKBEAK}{}
+\InputenxUC{04A1}{\cyrkbeak}{}
+\InputenxUC{04A2}{\CYRNDSC}{}
+\InputenxUC{04A3}{\cyrndsc}{}
+\InputenxUC{04A4}{\CYRNG}{}
+\InputenxUC{04A5}{\cyrng}{}
+\InputenxUC{04A6}{\CYRPHK}{}
+\InputenxUC{04A7}{\cyrphk}{}
+\InputenxUC{04A8}{\CYRABHHA}{}
+\InputenxUC{04A9}{\cyrabhha}{}
+\InputenxUC{04AA}{\CYRSDSC}{}
+\InputenxUC{04AB}{\cyrsdsc}{}
+\InputenxUC{04AC}{\CYRTDSC}{}
+\InputenxUC{04AD}{\cyrtdsc}{}
+\InputenxUC{04AE}{\CYRY}{}
+\InputenxUC{04AF}{\cyry}{}
+\InputenxUC{04B0}{\CYRYHCRS}{}
+\InputenxUC{04B1}{\cyryhcrs}{}
+\InputenxUC{04B2}{\CYRHDSC}{}
+\InputenxUC{04B3}{\cyrhdsc}{}
+\InputenxUC{04B4}{\CYRTETSE}{}
+\InputenxUC{04B5}{\cyrtetse}{}
+\InputenxUC{04B6}{\CYRCHRDSC}{}
+\InputenxUC{04B7}{\cyrchrdsc}{}
+\InputenxUC{04B8}{\CYRCHVCRS}{}
+\InputenxUC{04B9}{\cyrchvcrs}{}
+\InputenxUC{04BA}{\CYRSHHA}{}
+\InputenxUC{04BB}{\cyrshha}{}
+\InputenxUC{04BC}{\CYRABHCH}{}
+\InputenxUC{04BD}{\cyrabhch}{}
+\InputenxUC{04BE}{\CYRABHCHDSC}{}
+\InputenxUC{04BF}{\cyrabhchdsc}{}
+\InputenxUC{04C0}{\CYRpalochka}{}
+\InputenxUC{04C3}{\CYRKHK}{}
+\InputenxUC{04C4}{\cyrkhk}{}
+\InputenxUC{04C5}{\CYRLDSC}{}
+\InputenxUC{04C6}{\cyrldsc}{}
+\InputenxUC{04C7}{\CYRNHK}{}
+\InputenxUC{04C8}{\cyrnhk}{}
+\InputenxUC{04CB}{\CYRCHLDSC}{}
+\InputenxUC{04CC}{\cyrchldsc}{}
+\InputenxUC{04CD}{\CYRMDSC}{}
+\InputenxUC{04CE}{\cyrmdsc}{}
+\InputenxUC{04D4}{\CYRAE}{}
+\InputenxUC{04D5}{\cyrae}{}
+\InputenxUC{04D8}{\CYRSCHWA}{}
+\InputenxUC{04D9}{\cyrschwa}{}
+\InputenxUC{04E0}{\CYRABHDZE}{}
+\InputenxUC{04E1}{\cyrabhdze}{}
+\InputenxUC{04E8}{\CYROTLD}{}
+\InputenxUC{04E9}{\cyrotld}{}
+\InputenxUC{05D0}{\hebalef}{}
+\InputenxUC{05D1}{\hebbet}{}
+\InputenxUC{05D2}{\hebgimel}{}
+\InputenxUC{05D3}{\hebdalet}{}
+\InputenxUC{05D4}{\hebhe}{}
+\InputenxUC{05D5}{\hebvav}{}
+\InputenxUC{05D6}{\hebzayin}{}
+\InputenxUC{05D7}{\hebhet}{}
+\InputenxUC{05D8}{\hebtet}{}
+\InputenxUC{05D9}{\hebyod}{}
+\InputenxUC{05DA}{\hebfinalkaf}{}
+\InputenxUC{05DB}{\hebkaf}{}
+\InputenxUC{05DC}{\heblamed}{}
+\InputenxUC{05DD}{\hebfinalmem}{}
+\InputenxUC{05DE}{\hebmem}{}
+\InputenxUC{05DF}{\hebfinalnun}{}
+\InputenxUC{05E0}{\hebnun}{}
+\InputenxUC{05E1}{\hebsamekh}{}
+\InputenxUC{05E2}{\hebayin}{}
+\InputenxUC{05E3}{\hebfinalpe}{}
+\InputenxUC{05E4}{\hebpe}{}
+\InputenxUC{05E5}{\hebfinaltsadi}{}
+\InputenxUC{05E6}{\hebtsadi}{}
+\InputenxUC{05E7}{\hebqof}{}
+\InputenxUC{05E8}{\hebresh}{}
+\InputenxUC{05E9}{\hebshin}{}
+\InputenxUC{05EA}{\hebtav}{}
+\InputenxUC{0E3F}{\textbaht}{%
+ \ProvideTextCommandDefault{\textbaht}{%
+ \hmode@bgroup
+ \ooalign{%
+ B%
+ \crcr%
+ \hidewidth
+ \setbox\z@\hbox{B}%
+ \dimen@\ht\z@
+ \advance\dimen@\dp\z@
+ \setbox\z@\hbox{\textbar}%
+ \advance\dimen@-\ht\z@
+ \advance\dimen@\dp\z@
+ \raise.5\dimen@\hbox{\textbar}%
+ \hidewidth
+ }%
+ \egroup
+ }%
+}
+\InputenxUC{1E02}{\.B}{}
+\InputenxUC{1E03}{\.b}{}
+\InputenxUC{1E0A}{\.D}{}
+\InputenxUC{1E0B}{\.d}{}
+\InputenxUC{1E1E}{\.F}{}
+\InputenxUC{1E1F}{\.f}{}
+\InputenxUC{1E40}{\.M}{}
+\InputenxUC{1E41}{\.m}{}
+\InputenxUC{1E56}{\.P}{}
+\InputenxUC{1E57}{\.p}{}
+\InputenxUC{1E60}{\.S}{}
+\InputenxUC{1E61}{\.s}{}
+\InputenxUC{1E6A}{\.T}{}
+\InputenxUC{1E6B}{\.t}{}
+\InputenxUC{1E80}{\@tabacckludge`W}{}
+\InputenxUC{1E81}{\@tabacckludge`w}{}
+\InputenxUC{1E82}{\@tabacckludge'W}{}
+\InputenxUC{1E83}{\@tabacckludge'w}{}
+\InputenxUC{1E84}{\"W}{}
+\InputenxUC{1E85}{\"w}{}
+\InputenxUC{1EF2}{\@tabacckludge`Y}{}
+\InputenxUC{1EF3}{\@tabacckludge`y}{}
+\InputenxUC{200C}{\textcompwordmark}{}
+\InputenxUC{2013}{\textendash}{}
+\InputenxUC{2014}{\textemdash}{}
+\InputenxUC{2015}{\texthorizontalbar}{%
+ \ProvideTextCommandDefault{\texthorizontalbar}{%
+ \mbox{---}\kern-.5em---%
+ }%
+}
+\InputenxUC{2016}{\textbardbl}{}
+\InputenxUC{2017}{\textdbllowline}{%
+ \ProvideTextCommandDefault{\textdbllowline}{%
+ \begingroup
+ \sbox0{\textunderscore}%
+ \leavevmode
+ \ifdim\dp0<.2ex\relax
+ \rlap{\raisebox{-.2ex}[0pt]{\textunderscore}}%
+ \else
+ \rlap{\raisebox{.2ex}[0pt]{\textunderscore}}%
+ \fi
+ \textunderscore
+ \endgroup
+ }%
+}
+\InputenxUC{2018}{\textquoteleft}{}
+\InputenxUC{2019}{\textquoteright}{}
+\InputenxUC{201A}{\quotesinglbase}{}
+\InputenxUC{201C}{\textquotedblleft}{}
+\InputenxUC{201D}{\textquotedblright}{}
+\InputenxUC{201E}{\quotedblbase}{}
+\InputenxUC{2020}{\textdagger}{}
+\InputenxUC{2021}{\textdaggerdbl}{}
+\InputenxUC{2022}{\textbullet}{}
+\InputenxUC{2026}{\textellipsis}{}
+\InputenxUC{2030}{\textperthousand}{}
+\InputenxUC{2031}{\textpertenthousand}{}
+\InputenxUC{2039}{\guilsinglleft}{}
+\InputenxUC{203A}{\guilsinglright}{}
+\InputenxUC{203B}{\textreferencemark}{}
+\InputenxUC{203D}{\textinterrobang}{%
+ \ProvideTextCommandDefault{\textinterrobang}{%
+ \hmode@bgroup\ooalign{?\crcr\hidewidth!\hidewidth}\egroup
+ }%
+}
+\InputenxUC{2044}{\textfractionsolidus}{%
+ \ProvideTextCommandDefault{\textfractionsolidus}{%
+ /%
+ }%
+}
+\InputenxUC{204E}{\textasteriskcentered}{}
+\InputenxUC{2052}{\textdiscount}{}
+\InputenxUC{207F}{\textnsuperior}{%
+ \ProvideTextCommandDefault{\textnsuperior}{%
+ \ensuremath{{^n}}%
+ }%
+}
+\InputenxUC{20A1}{\textcolonmonetary}{}
+\InputenxUC{20A4}{\textlira}{}
+\InputenxUC{20A6}{\textnaira}{}
+\InputenxUC{20A7}{\textpeseta}{%
+ \ProvideTextCommandDefault{\textpeseta}{%
+ Pt%
+ }%
+}
+\InputenxUC{20A9}{\textwon}{}
+\InputenxUC{20AB}{\textdong}{}
+\InputenxUC{20AC}{\texteuro}{%
+ \ProvideTextCommandDefault{\texteuro}{%
+ \TextSymbolUnavailable\texteuro
+ }%
+}
+\InputenxUC{20B1}{\textpeso}{}
+\InputenxUC{2103}{\textcelsius}{%
+ \ProvideTextCommandDefault{\textcelsius}{%
+ \ensuremath{{^\circ}}C%
+ }%
+}
+\InputenxUC{2116}{\textnumero}{%
+ \ProvideTextCommandDefault{\textnumero}{%
+ N%
+ \bgroup
+ \check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse
+ \selectfont
+ \ooalign{%
+ \raise0.5ex\hbox{o}%
+ \crcr
+ \hline
+ }%
+ \egroup
+ }%
+}
+\InputenxUC{2117}{\textcircledP}{%
+ \ProvideTextCommandDefault{\textcircledP}{%
+ \textcircled{%
+ \check@mathfonts
+ \fontsize\sf@size\z@
+ \math@fontsfalse
+ \selectfont
+ P%
+ }%
+ }%
+}
+\InputenxUC{211E}{\textrecipe}{}
+\InputenxUC{2120}{\textservicemark}{%
+ \ProvideTextCommandDefault{\textservicemark}{%
+ \textsuperscript{SM}%
+ }%
+}
+\InputenxUC{2122}{\texttrademark}{}
+\InputenxUC{2126}{\textohm}{%
+ \ProvideTextCommandDefault{\textohm}{%
+ \ensuremath\Omega
+ }%
+}
+\InputenxUC{2127}{\textmho}{}
+\InputenxUC{212E}{\textestimated}{}
+\InputenxUC{2190}{\textleftarrow}{%
+ \ProvideTextCommandDefault{\textleftarrow}{%
+ \ensuremath\leftarrow
+ }%
+}
+\InputenxUC{2191}{\textuparrow}{%
+ \ProvideTextCommandDefault{\textuparrow}{%
+ \ensuremath\uparrow
+ }%
+}
+\InputenxUC{2192}{\textrightarrow}{%
+ \ProvideTextCommandDefault{\textrightarrow}{%
+ \ensuremath\rightarrow
+ }%
+}
+\InputenxUC{2193}{\textdownarrow}{%
+ \ProvideTextCommandDefault{\textdownarrow}{%
+ \ensuremath\downarrow
+ }%
+}
+\InputenxUC{2202}{\textpartial}{%
+ \ProvideTextCommandDefault{\textpartial}{%
+ \ensuremath\partial
+ }%
+}
+\InputenxUC{2206}{\textincrement}{%
+ \ProvideTextCommandDefault{\textincrement}{%
+ \ensuremath\Delta
+ }%
+}
+\InputenxUC{2208}{\textelement}{%
+ \ProvideTextCommandDefault{\textelement}{%
+ \ensuremath\in
+ }%
+}
+\InputenxUC{220F}{\textproduct}{%
+ \ProvideTextCommandDefault{\textproduct}{%
+ \ensuremath\Pi
+ }%
+}
+\InputenxUC{2211}{\textsummation}{%
+ \ProvideTextCommandDefault{\textsummation}{%
+ \ensuremath\Sigma
+ }%
+}
+\InputenxUC{2219}{\textbullet}{}
+\InputenxUC{221A}{\textsurd}{%
+ \ProvideTextCommandDefault{\textsurd}{%
+ \ensuremath\surd
+ }%
+}
+\InputenxUC{221E}{\textinfinity}{%
+ \ProvideTextCommandDefault{\textinfinity}{%
+ \ensuremath\infty
+ }%
+}
+\InputenxUC{2227}{\textcap}{%
+ \ProvideTextCommandDefault{\textcap}{%
+ \ensuremath\cap
+ }%
+}
+\InputenxUC{2229}{\textintersection}{%
+ \ProvideTextCommandDefault{\textintersection}{%
+ \ensuremath\cap
+ }%
+}
+\InputenxUC{222B}{\textintegral}{%
+ \ProvideTextCommandDefault{\textintegral}{%
+ \ensuremath\int
+ }%
+}
+\InputenxUC{222E}{\textcontourintegral}{%
+ \ProvideTextCommandDefault{\textcontourintegral}{%
+ \ensuremath\oint
+ }%
+}
+\InputenxUC{2248}{\textapproxequal}{%
+ \ProvideTextCommandDefault{\textapproxequal}{%
+ \ensuremath\approx
+ }%
+}
+\InputenxUC{2260}{\textnotequal}{%
+ \ProvideTextCommandDefault{\textnotequal}{%
+ \ensuremath\neq
+ }%
+}
+\InputenxUC{2261}{\textequivalence}{%
+ \ProvideTextCommandDefault{\textequivalence}{%
+ \ensuremath\equiv
+ }%
+}
+\InputenxUC{2264}{\textlessequal}{%
+ \ProvideTextCommandDefault{\textlessequal}{%
+ \ensuremath\leq
+ }%
+}
+\InputenxUC{2265}{\textgreaterequal}{%
+ \ProvideTextCommandDefault{\textgreaterequal}{%
+ \ensuremath\geq
+ }%
+}
+\InputenxUC{2310}{\textrevlogicalnot}{%
+ \ProvideTextCommandDefault{\textrevlogicalnot}{%
+ \begingroup
+ \@ifundefined{reflectbox}{%
+ \TextSymbolUnavailable\textrevlogicalnot
+ }{%
+ \def\@revlogicalnot##1##2{%
+ \reflectbox{$##1##2$}%
+ }%
+ \ensuremath{\mathpalette\@revlogicalnot\lnot}%
+ }%
+ \endgroup
+ }%
+}
+\InputenxUC{2329}{\textlangle}{%
+ \ProvideTextCommandDefault{\textlangle}{%
+ \ensuremath\langle
+ }%
+}
+\InputenxUC{232A}{\textrangle}{%
+ \ProvideTextCommandDefault{\textrangle}{%
+ \ensuremath\rangle
+ }%
+}
+\InputenxUC{2422}{\textblank}{}
+\InputenxUC{2423}{\textvisiblespace}{}
+\InputenxUC{2500}{\textSFx}{}
+\InputenxUC{2502}{\textSFxi}{}
+\InputenxUC{250C}{\textSFi}{}
+\InputenxUC{2510}{\textSFiii}{}
+\InputenxUC{2514}{\textSFii}{}
+\InputenxUC{2518}{\textSFiv}{}
+\InputenxUC{251C}{\textSFviii}{}
+\InputenxUC{2524}{\textSFix}{}
+\InputenxUC{252C}{\textSFvi}{}
+\InputenxUC{2534}{\textSFvii}{}
+\InputenxUC{253C}{\textSFv}{}
+\InputenxUC{2550}{\textSFxliii}{}
+\InputenxUC{2551}{\textSFxxiv}{}
+\InputenxUC{2552}{\textSFli}{}
+\InputenxUC{2553}{\textSFlii}{}
+\InputenxUC{2554}{\textSFxxxix}{}
+\InputenxUC{2555}{\textSFxxii}{}
+\InputenxUC{2556}{\textSFxxi}{}
+\InputenxUC{2557}{\textSFxxv}{}
+\InputenxUC{2558}{\textSFl}{}
+\InputenxUC{2559}{\textSFxlix}{}
+\InputenxUC{255A}{\textSFxxxviii}{}
+\InputenxUC{255B}{\textSFxxviii}{}
+\InputenxUC{255C}{\textSFxxvii}{}
+\InputenxUC{255D}{\textSFxxvi}{}
+\InputenxUC{255E}{\textSFxxxvi}{}
+\InputenxUC{255F}{\textSFxxxvii}{}
+\InputenxUC{2560}{\textSFxlii}{}
+\InputenxUC{2561}{\textSFxix}{}
+\InputenxUC{2562}{\textSFxx}{}
+\InputenxUC{2563}{\textSFxxiii}{}
+\InputenxUC{2564}{\textSFxlvii}{}
+\InputenxUC{2565}{\textSFxlviii}{}
+\InputenxUC{2566}{\textSFxli}{}
+\InputenxUC{2567}{\textSFxlv}{}
+\InputenxUC{2568}{\textSFxlvi}{}
+\InputenxUC{2569}{\textSFxl}{}
+\InputenxUC{256A}{\textSFliv}{}
+\InputenxUC{256B}{\textSFliii}{}
+\InputenxUC{256C}{\textSFxliv}{}
+\InputenxUC{2580}{\textupblock}{}
+\InputenxUC{2584}{\textdnblock}{}
+\InputenxUC{2588}{\textblock}{}
+\InputenxUC{258C}{\textlfblock}{}
+\InputenxUC{2590}{\textrtblock}{}
+\InputenxUC{2591}{\textltshade}{}
+\InputenxUC{2592}{\textshade}{}
+\InputenxUC{2593}{\textdkshade}{}
+\InputenxUC{25A0}{\textblacksquare}{%
+ \ProvideTextCommandDefault{\textblacksquare}{%
+ \vrule \@width .3em \@height .4em \@depth -.1em\relax
+ }%
+}
+\InputenxUC{25CA}{\textlozenge}{%
+ \ProvideTextCommandDefault{\textlozenge}{%
+ \ensuremath\diamond
+ }%
+}
+\InputenxUC{25E6}{\textopenbullet}{%
+ \ProvideTextCommandDefault{\textopenbullet}{%
+ \ensuremath\circ
+ }%
+}
+\InputenxUC{25EF}{\textbigcircle}{}
+\InputenxUC{266A}{\textmusicalnote}{}
+\InputenxUC{FB01}{fi}{}
+\InputenxUC{FB02}{fl}{}
+% \end{macrocode}
+% \fi
+%
+% \begin{macrocode}
+\RestoreAtCatcode
+%</uc>
+% \end{macrocode}
+%
+% \subsection{Math meaning declarations}
+%
+% Package \xpackage{inpmath} already declares math meanings
+% for LICRs. Here are some more. One goal is
+% to use the input characters in math that were defined
+% in the standard \LaTeX\ encodings using \cs{DeclareInputMath}.
+% \begin{macrocode}
+%<*math>
+\ProvidesFile{ix-math.def}%
+ [2016/05/16 v1.11 Math list (inputenx)]%
+\edef\RestoreAtCatcode{\catcode64=\the\catcode64\relax}
+\makeatletter
+% \end{macrocode}
+%
+% The next math meaning for \cs{ss} looks a little funny.
+% But it is useful for input characters, where most encodings
+% share in practice the same slot for \cs{ss} and \cs{beta}.
+% Thus we do not need two encodings such as \xfile{cp437de.def}
+% and \xfile{cp437.def}.
+% \begin{macrocode}
+\DeclareMathMeaning{\ss}{\beta}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareMathMeaning{\textalpha}{\alpha}
+\DeclareMathMeaning{\textapproxequal}{\aprox}
+\DeclareMathMeaning{\textbardbl}{\Vert}% = \|
+\DeclareMathMeaning{\textbeta}{\beta}
+\DeclareMathMeaning{\textbullet}{\bullet}
+\DeclareMathMeaning{\textcap}{\cap}
+\DeclareMathMeaning{\textcontourintegral}{\oint}
+\DeclareMathMeaning{\textcopyright}{{\nfss@text{\textcopyright}}}
+\DeclareMathMeaning{\textcup}{\cup}
+\DeclareMathMeaning{\textdagger}{\dagger}
+\DeclareMathMeaning{\textdaggerdbl}{\ddagger}
+\DeclareMathMeaning{\textdegree}{{^\circ}}
+\DeclareMathMeaning{\textdelta}{\delta}
+\DeclareMathMeaning{\textdollar}{\mathdollar}
+\DeclareMathMeaning{\textepsilon}{\varepsilon}
+\DeclareMathMeaning{\textequivalence}{\equiv}
+\DeclareMathMeaning{\textbraceleft}{\lbrace}
+\DeclareMathMeaning{\textbraceright}{\rbrace}
+\DeclareMathMeaning{\textdiv}{\div}
+\DeclareMathMeaning{\textdownarrow}{\downarrow}
+\DeclareMathMeaning{\textelement}{\in}
+\DeclareMathMeaning{\textellipsis}{\mathellipsis}
+\DeclareMathMeaning{\textGamma}{\Gamma}
+\DeclareMathMeaning{\textgreaterequal}{\geq}
+\DeclareMathMeaning{\textincrement}{\Delta}
+\DeclareMathMeaning{\textinfinity}{\infty}
+\DeclareMathMeaning{\textintegral}{\int}
+\DeclareMathMeaning{\textintersection}{\cap}
+\DeclareMathMeaning{\textlangle}{\langle}
+\DeclareMathMeaning{\textleftarrow}{\leftarrow}
+\DeclareMathMeaning{\textlessequal}{\leq}
+\DeclareMathMeaning{\textlnot}{\lnot}
+\DeclareMathMeaning{\textlogicalnot}{\lnot}
+\DeclareMathMeaning{\textlozenge}{\diamond}
+\DeclareMathMeaning{\textmu}{\mu}
+\DeclareMathMeaning{\textnotequal}{\neq}
+\DeclareMathMeaning{\textnsuperior}{^n}
+\DeclareMathMeaning{\textohm}{\Omega}
+\DeclareMathMeaning{\textOmega}{\Omega}
+\DeclareMathMeaning{\textonehalf}{\frac12}
+\DeclareMathMeaning{\textonequarter}{\frac14}
+\DeclareMathMeaning{\textonesuperior}{^1}
+\DeclareMathMeaning{\textopenbullet}{\circ}
+\DeclareMathMeaning{\textparagraph}{\mathparagraph}
+\DeclareMathMeaning{\textpartial}{\partial}
+\DeclareMathMeaning{\textPhi}{\Phi}
+\DeclareMathMeaning{\textphi}{\phi}
+\DeclareMathMeaning{\textpi}{\pi}
+\DeclareMathMeaning{\textproduct}{\prod}
+\DeclareMathMeaning{\textrangle}{\rangle}
+\DeclareMathMeaning{\textrevlogicalnot}{{\nfss@text{\textrevlogicalnot}}}
+\DeclareMathMeaning{\textrightarrow}{\rightarrow}
+\DeclareMathMeaning{\textsection}{\mathsection}
+\DeclareMathMeaning{\textSigma}{\Sigma}
+\DeclareMathMeaning{\textsigma}{\sigma}
+\DeclareMathMeaning{\textsterling}{\mathsterling}
+\DeclareMathMeaning{\textsummation}{\sum}
+\DeclareMathMeaning{\textsurd}{\surd}
+\DeclareMathMeaning{\texttau}{\tau}
+\DeclareMathMeaning{\textTheta}{\Theta}
+\DeclareMathMeaning{\textthreequarters}{\frac34}
+\DeclareMathMeaning{\textthreesuperior}{^3}
+\DeclareMathMeaning{\texttwosuperior}{^2}
+\DeclareMathMeaning{\textuparrow}{\uparrow}
+% \end{macrocode}
+% \begin{macrocode}
+\RestoreAtCatcode
+%</math>
+% \end{macrocode}
+%
+% \subsection{Documentation files}
+%
+% \subsubsection{List of known LICR commands}
+%
+% This is the list of commands for use in LICR that are already
+% defined by standard \LaTeX\ without extra packages.
+% \begin{macrocode}
+%<*licrcmds>
+ % List of known LICR commdands of inputenx 2016/05/16 v1.11
+ %
+ % Format: \LICRcmd{<command>}{<type>}
+ % Types:
+ % Accent: <command> was defined by \DeclareTextAccentDefault
+ % Command: <command> was defined by \DeclareTextCommandDefault
+ % Symbol: <command> was defined by \DeclareTextSymbolDefault
+ % Internal: for \@tabacckludge
+ % Extra: additional commands
+ %
+ % Entries derived from the 2ekernel part
+ % of ltoutenc.dtx 2005/11/08 v1.99h.
+ %
+\LICRcmd{\ }{Extra}
+\LICRcmd{\"}{Composite}
+\LICRcmd{\'}{Composite}
+\LICRcmd{\-}{Extra}
+\LICRcmd{\.}{Composite}
+\LICRcmd{\=}{Accent}
+\LICRcmd{\@tabacckludge}{Internal}
+\LICRcmd{\AE}{Symbol}
+\LICRcmd{\DH}{Symbol}
+\LICRcmd{\DJ}{Symbol}
+\LICRcmd{\H}{Composite}
+\LICRcmd{\IJ}{Symbol}
+\LICRcmd{\L}{Symbol}
+\LICRcmd{\NG}{Symbol}
+\LICRcmd{\O}{Symbol}
+\LICRcmd{\OE}{Symbol}
+\LICRcmd{\SS}{Symbol}
+\LICRcmd{\TH}{Symbol}
+\LICRcmd{\^}{Composite}
+\LICRcmd{\`}{Composite}
+\LICRcmd{\ae}{Symbol}
+\LICRcmd{\b}{Command}
+\LICRcmd{\c}{Composite}
+\LICRcmd{\d}{Command}
+\LICRcmd{\dh}{Symbol}
+\LICRcmd{\dj}{Symbol}
+\LICRcmd{\guillemotleft}{Symbol}
+\LICRcmd{\guillemotright}{Symbol}
+\LICRcmd{\guilsinglleft}{Symbol}
+\LICRcmd{\guilsinglright}{Symbol}
+\LICRcmd{\i}{Symbol}
+\LICRcmd{\ij}{Symbol}
+\LICRcmd{\j}{Symbol}
+\LICRcmd{\k}{CompositeCommand}
+\LICRcmd{\l}{Symbol}
+\LICRcmd{\ng}{Symbol}
+\LICRcmd{\nobreakspace}{Extra}
+\LICRcmd{\o}{Symbol}
+\LICRcmd{\oe}{Symbol}
+\LICRcmd{\quotedblbase}{Symbol}
+\LICRcmd{\quotesinglbase}{Symbol}
+\LICRcmd{\r}{Composite}
+\LICRcmd{\ss}{Symbol}
+\LICRcmd{\t}{Accent}
+\LICRcmd{\textasciicircum}{Symbol}
+\LICRcmd{\textasciitilde}{Symbol}
+\LICRcmd{\textasteriskcentered}{Symbol}
+\LICRcmd{\textbackslash}{Symbol}
+\LICRcmd{\textbar}{Symbol}
+\LICRcmd{\textbardbl}{Symbol}
+\LICRcmd{\textbigcircle}{Symbol}
+\LICRcmd{\textbraceleft}{Symbol}
+\LICRcmd{\textbraceright}{Symbol}
+\LICRcmd{\textbullet}{Symbol}
+\LICRcmd{\textcircled}{Command}
+\LICRcmd{\textcompwordmark}{Symbol}
+\LICRcmd{\textcopyright}{CommandDefault}
+\LICRcmd{\textdagger}{Symbol}
+\LICRcmd{\textdaggerdbl}{Symbol}
+\LICRcmd{\textdollar}{Symbol}
+\LICRcmd{\textellipsis}{CommandDefault}
+\LICRcmd{\textemdash}{Symbol}
+\LICRcmd{\textendash}{Symbol}
+\LICRcmd{\textexclamdown}{Symbol}
+\LICRcmd{\textgreater}{Symbol}
+\LICRcmd{\textless}{Symbol}
+\LICRcmd{\textogonekcentered}{Command}
+\LICRcmd{\textordfeminine}{CommandDefault}
+\LICRcmd{\textordmasculine}{CommandDefault}
+\LICRcmd{\textparagraph}{Symbol}
+\LICRcmd{\textperiodcentered}{Symbol}
+\LICRcmd{\textpertenthousand}{Command}
+\LICRcmd{\textperthousand}{Command}
+\LICRcmd{\textquestiondown}{Symbol}
+\LICRcmd{\textquotedbl}{Symbol}
+\LICRcmd{\textquotedblleft}{Symbol}
+\LICRcmd{\textquotedblright}{Symbol}
+\LICRcmd{\textquoteleft}{Symbol}
+\LICRcmd{\textquoteright}{Symbol}
+\LICRcmd{\textregistered}{CommandDefault}
+\LICRcmd{\textsection}{Symbol}
+\LICRcmd{\textsterling}{Symbol}
+\LICRcmd{\texttrademark}{CommandDefault}
+\LICRcmd{\textunderscore}{Symbol}
+\LICRcmd{\textvisiblespace}{Symbol}
+\LICRcmd{\th}{Symbol}
+\LICRcmd{\u}{Composite}
+\LICRcmd{\v}{Composite}
+\LICRcmd{\~}{Composite}
+%</licrcmds>
+% \end{macrocode}
+%
+% \subsubsection{Commented additions for \xfile{utf8enc.dfu}}
+%
+% \begin{macrocode}
+%<*dfudoc>
+ % inputenx-utf8enc.txt 2016/05/16 v1.11
+ % Commented additions for utf8enc.dfu
+
+% \end{macrocode}
+%
+% \textit{List omitted here, see \xfile{inputenx-utf8enc.txt}.}
+% \iffalse
+% \begin{macrocode}
+\DeclareUnicodeCharacter{00A0}{\nobreakspace}
+ % NO-BREAK SPACE
+
+\DeclareUnicodeCharacter{00AD}{\-}
+ % SOFT HYPHEN
+
+\DeclareUnicodeCharacter{0100}{\@tabacckludge=A}
+ % LATIN CAPITAL LETTER A WITH MACRON
+
+\DeclareUnicodeCharacter{0101}{\@tabacckludge=a}
+ % LATIN SMALL LETTER A WITH MACRON
+
+\DeclareUnicodeCharacter{0108}{\^C}
+ % LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0109}{\^c}
+ % LATIN SMALL LETTER C WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{010A}{\.C}
+ % LATIN CAPITAL LETTER C WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{010B}{\.c}
+ % LATIN SMALL LETTER C WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{0112}{\@tabacckludge=E}
+ % LATIN CAPITAL LETTER E WITH MACRON
+
+\DeclareUnicodeCharacter{0113}{\@tabacckludge=e}
+ % LATIN SMALL LETTER E WITH MACRON
+
+\DeclareUnicodeCharacter{0116}{\.E}
+ % LATIN CAPITAL LETTER E WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{0117}{\.e}
+ % LATIN SMALL LETTER E WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{011C}{\^G}
+ % LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{011D}{\^g}
+ % LATIN SMALL LETTER G WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0120}{\.G}
+ % LATIN CAPITAL LETTER G WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{0121}{\.g}
+ % LATIN SMALL LETTER G WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{0122}{\c G}
+ % LATIN CAPITAL LETTER G WITH CEDILLA
+
+\DeclareUnicodeCharacter{0123}{\c g}
+ % LATIN SMALL LETTER G WITH CEDILLA
+
+\DeclareUnicodeCharacter{0124}{\^H}
+ % LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0125}{\^h}
+ % LATIN SMALL LETTER H WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0126}{\textmalteseH}
+ % LATIN CAPITAL LETTER H WITH STROKE
+ % LATIN CAPITAL LETTER H BAR
+ % latin3.def
+
+\DeclareUnicodeCharacter{0127}{\textmalteseh}
+ % LATIN SMALL LETTER H WITH STROKE
+ % LATIN SMALL LETTER H BAR
+ % latin3.def
+
+\DeclareUnicodeCharacter{0128}{\~I}
+ % LATIN CAPITAL LETTER I WITH TILDE
+
+\DeclareUnicodeCharacter{0129}{\~\i}
+ % LATIN SMALL LETTER I WITH TILDE
+ % LATIN SMALL LETTER I TILDE
+
+\DeclareUnicodeCharacter{012A}{\@tabacckludge=I}
+ % LATIN CAPITAL LETTER I WITH MACRON
+
+\DeclareUnicodeCharacter{012B}{\@tabacckludge=\i}
+ % LATIN SMALL LETTER I WITH MACRON
+
+\DeclareUnicodeCharacter{012E}{\k I}
+ % LATIN CAPITAL LETTER I WITH OGONEK
+
+\DeclareUnicodeCharacter{012F}{\k i}
+ % LATIN SMALL LETTER I WITH OGONEK
+
+\DeclareUnicodeCharacter{0134}{\^J}
+ % LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0135}{\^\j}
+ % LATIN SMALL LETTER J WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0136}{\c K}
+ % LATIN CAPITAL LETTER K WITH CEDILLA
+
+\DeclareUnicodeCharacter{0137}{\c k}
+ % LATIN SMALL LETTER K WITH CEDILLA
+
+\DeclareUnicodeCharacter{0138}{\textkra}
+ % LATIN SMALL LETTER KRA
+ % latin4.def
+
+\DeclareUnicodeCharacter{013B}{\c L}
+ % LATIN CAPITAL LETTER L WITH CEDILLA
+
+\DeclareUnicodeCharacter{013C}{\c l}
+ % LATIN SMALL LETTER L WITH CEDILLA
+
+\DeclareUnicodeCharacter{0145}{\c N}
+ % LATIN CAPITAL LETTER N WITH CEDILLA
+
+\DeclareUnicodeCharacter{0146}{\c n}
+ % LATIN SMALL LETTER N WITH CEDILLA
+
+\DeclareUnicodeCharacter{014C}{\@tabacckludge=O}
+ % LATIN CAPITAL LETTER O WITH MACRON
+
+\DeclareUnicodeCharacter{014D}{\@tabacckludge=o}
+ % LATIN SMALL LETTER O WITH MACRON
+
+\DeclareUnicodeCharacter{0156}{\c R}
+ % LATIN CAPITAL LETTER R WITH CEDILLA
+
+\DeclareUnicodeCharacter{0157}{\c r}
+ % LATIN SMALL LETTER R WITH CEDILLA
+
+\DeclareUnicodeCharacter{015C}{\^S}
+ % LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{015D}{\^s}
+ % LATIN SMALL LETTER S WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0166}{\textTstroke}
+ % LATIN CAPITAL LETTER T WITH STROKE
+ % latin4.def
+
+\DeclareUnicodeCharacter{0167}{\texttstroke}
+ % LATIN SMALL LETTER T WITH STROKE
+ % latin4.def
+
+\DeclareUnicodeCharacter{0168}{\~U}
+ % LATIN CAPITAL LETTER U WITH TILDE
+
+\DeclareUnicodeCharacter{0169}{\~u}
+ % LATIN SMALL LETTER U WITH TILDE
+
+\DeclareUnicodeCharacter{016A}{\@tabacckludge=U}
+ % LATIN CAPITAL LETTER U WITH MACRON
+
+\DeclareUnicodeCharacter{016B}{\@tabacckludge=u}
+ % LATIN SMALL LETTER U WITH MACRON
+
+\DeclareUnicodeCharacter{016C}{\u U}
+ % LATIN CAPITAL LETTER U WITH BREVE
+
+\DeclareUnicodeCharacter{016D}{\u u}
+ % LATIN SMALL LETTER U WITH BREVE
+
+\DeclareUnicodeCharacter{0172}{\k U}
+ % LATIN CAPITAL LETTER U WITH OGONEK
+
+\DeclareUnicodeCharacter{0173}{\k u}
+ % LATIN SMALL LETTER U WITH OGONEK
+
+\DeclareUnicodeCharacter{0174}{\^W}
+ % LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0175}{\^w}
+ % LATIN SMALL LETTER W WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0176}{\^Y}
+ % LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{0177}{\^y}
+ % LATIN SMALL LETTER Y WITH CIRCUMFLEX
+
+\DeclareUnicodeCharacter{01CD}{\v A}
+ % LATIN CAPITAL LETTER A WITH CARON
+
+\DeclareUnicodeCharacter{01CE}{\v a}
+ % LATIN SMALL LETTER A WITH CARON
+
+\DeclareUnicodeCharacter{01CF}{\v I}
+ % LATIN CAPITAL LETTER I WITH CARON
+
+\DeclareUnicodeCharacter{01D0}{\v\i}
+ % LATIN SMALL LETTER I WITH CARON
+
+\DeclareUnicodeCharacter{01D1}{\v O}
+ % LATIN CAPITAL LETTER O WITH CARON
+
+\DeclareUnicodeCharacter{01D2}{\v o}
+ % LATIN SMALL LETTER O WITH CARON
+
+\DeclareUnicodeCharacter{01D3}{\v U}
+ % LATIN CAPITAL LETTER U WITH CARON
+
+\DeclareUnicodeCharacter{01D4}{\v u}
+ % LATIN SMALL LETTER U WITH CARON
+
+\DeclareUnicodeCharacter{01E2}{\@tabacckludge=\AE}
+ % LATIN CAPITAL LETTER AE WITH MACRON
+
+\DeclareUnicodeCharacter{01E3}{\@tabacckludge=\ae}
+ % LATIN SMALL LETTER AE WITH MACRON
+
+\DeclareUnicodeCharacter{01E6}{\v G}
+ % LATIN CAPITAL LETTER G WITH CARON
+
+\DeclareUnicodeCharacter{01E7}{\v g}
+ % LATIN SMALL LETTER G WITH CARON
+
+\DeclareUnicodeCharacter{01E8}{\v K}
+ % LATIN CAPITAL LETTER K WITH CARON
+
+\DeclareUnicodeCharacter{01E9}{\v k}
+ % LATIN SMALL LETTER K WITH CARON
+
+\DeclareUnicodeCharacter{01F0}{\v\j}
+ % LATIN SMALL LETTER J WITH CARON
+
+\DeclareUnicodeCharacter{01F4}{\@tabacckludge'G}
+ % LATIN CAPITAL LETTER G WITH ACUTE
+
+\DeclareUnicodeCharacter{01F5}{\@tabacckludge'g}
+ % LATIN SMALL LETTER G WITH ACUTE
+
+\DeclareUnicodeCharacter{01F8}{\@tabacckludge`N}
+ % LATIN CAPITAL LETTER N WITH GRAVE
+
+\DeclareUnicodeCharacter{01F9}{\@tabacckludge`n}
+ % LATIN SMALL LETTER N WITH GRAVE
+
+\DeclareUnicodeCharacter{01FC}{\@tabacckludge'\AE}
+ % LATIN CAPITAL LETTER AE WITH ACUTE
+
+\DeclareUnicodeCharacter{01FD}{\@tabacckludge'\ae}
+ % LATIN SMALL LETTER AE WITH ACUTE
+
+\DeclareUnicodeCharacter{0226}{\.A}
+ % LATIN CAPITAL LETTER A WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{0227}{\.a}
+ % LATIN SMALL LETTER A WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{0228}{\c E}
+ % LATIN CAPITAL LETTER E WITH CEDILLA
+
+\DeclareUnicodeCharacter{0229}{\c e}
+ % LATIN SMALL LETTER E WITH CEDILLA
+
+\DeclareUnicodeCharacter{022E}{\.O}
+ % LATIN CAPITAL LETTER O WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{022F}{\.o}
+ % LATIN SMALL LETTER O WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{0232}{\@tabacckludge=Y}
+ % LATIN CAPITAL LETTER Y WITH MACRON
+
+\DeclareUnicodeCharacter{0232}{\@tabacckludge=y}
+ % LATIN SMALL LETTER Y WITH MACRON
+
+\DeclareUnicodeCharacter{0232}{\@tabacckludge=y}
+ % LATIN SMALL LETTER Y WITH MACRON
+
+\DeclareUnicodeCharacter{0237}{\j}
+ % LATIN SMALL LETTER DOTLESS J
+
+\DeclareUnicodeCharacter{1E02}{\.B}
+ % LATIN CAPITAL LETTER B WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E03}{\.b}
+ % LATIN SMALL LETTER B WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E0A}{\.D}
+ % LATIN CAPITAL LETTER D WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E0B}{\.d}
+ % LATIN SMALL LETTER D WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E1E}{\.F}
+ % LATIN CAPITAL LETTER F WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E1F}{\.f}
+ % LATIN SMALL LETTER F WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E40}{\.M}
+ % LATIN CAPITAL LETTER M WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E41}{\.m}
+ % LATIN SMALL LETTER M WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E56}{\.P}
+ % LATIN CAPITAL LETTER P WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E57}{\.p}
+ % LATIN SMALL LETTER P WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E60}{\.S}
+ % LATIN CAPITAL LETTER S WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E61}{\.s}
+ % LATIN SMALL LETTER S WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E6A}{\.T}
+ % LATIN CAPITAL LETTER T WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E6B}{\.t}
+ % LATIN SMALL LETTER T WITH DOT ABOVE
+
+\DeclareUnicodeCharacter{1E80}{\@tabacckludge`W}
+ % LATIN CAPITAL LETTER W WITH GRAVE
+
+\DeclareUnicodeCharacter{1E81}{\@tabacckludge`w}
+ % LATIN SMALL LETTER W WITH GRAVE
+
+\DeclareUnicodeCharacter{1E82}{\@tabacckludge'W}
+ % LATIN CAPITAL LETTER W WITH ACUTE
+
+\DeclareUnicodeCharacter{1E83}{\@tabacckludge'w}
+ % LATIN SMALL LETTER W WITH ACUTE
+
+\DeclareUnicodeCharacter{1E84}{\"W}
+ % LATIN CAPITAL LETTER W WITH DIAERESIS
+
+\DeclareUnicodeCharacter{1E85}{\"w}
+ % LATIN SMALL LETTER W WITH DIAERESIS
+
+\DeclareUnicodeCharacter{1EF2}{\@tabacckludge`Y}
+ % LATIN CAPITAL LETTER Y WITH GRAVE
+
+\DeclareUnicodeCharacter{1EF3}{\@tabacckludge`y}
+ % iso-8859-14[0xBC/188]
+
+\DeclareUnicodeCharacter{0218}{\textcommabelow S}
+ % LATIN CAPITAL LETTER S WITH COMMA BELOW
+ % latin10.def
+
+\DeclareUnicodeCharacter{0219}{\textcommabelow s}
+ % LATIN SMALL LETTER S WITH COMMA BELOW
+ % latin10.def
+
+\DeclareUnicodeCharacter{021A}{\textcommabelow T}
+ % LATIN CAPITAL LETTER T WITH COMMA BELOW
+ % latin10.def
+
+\DeclareUnicodeCharacter{021B}{\textcommabelow t}
+ % LATIN SMALL LETTER T WITH COMMA BELOW
+ % latin10.def
+
+\DeclareUnicodeCharacter{02CB}{\textasciigrave}
+ % MODIFIER LETTER GRAVE ACCENT
+ % ??? next.def: \@tabacckludge`{}
+
+\DeclareUnicodeCharacter{02D9}{\.{}}
+ % DOT ABOVE
+ % SPACING DOT ABOVE
+ % ??? \textasciidotabove with default "\.{}"
+
+\DeclareUnicodeCharacter{02DA}{\r{}}
+ % RING ABOVE
+ % SPACING RING ABOVE
+ % ??? \textasciiringabove with default "\r{}"
+
+\DeclareUnicodeCharacter{02DB}{\k{}}
+ % OGONEK
+ % SPACING OGONEK
+ % ??? \textasciiogonek with default "\k{}"
+
+\DeclareUnicodeCharacter{0393}{\textGamma}
+ % GREEK CAPITAL LETTER GAMMA
+ % ???
+
+\DeclareUnicodeCharacter{0398}{\textTheta}
+ % GREEK CAPITAL LETTER THETA
+ % ???
+
+\DeclareUnicodeCharacter{03A3}{\textSigma}
+ % GREEK CAPITAL LETTER SIGMA
+ % ???
+
+\DeclareUnicodeCharacter{03A6}{\textPhi}
+ % GREEK CAPITAL LETTER PHI
+ % ???
+
+\DeclareUnicodeCharacter{03A9}{\textOmega}
+ % GREEK CAPITAL LETTER OMEGA
+ % ???
+
+\DeclareUnicodeCharacter{03B1}{\textalpha}
+ % GREEK SMALL LETTER ALPHA
+ % ???
+
+\DeclareUnicodeCharacter{03B2}{\textbeta}
+ % GREEK SMALL LETTER BETA
+ % atarist[0xE1/225]
+
+\DeclareUnicodeCharacter{03B4}{\textdelta}
+ % GREEK SMALL LETTER DELTA
+ % ???
+
+\DeclareUnicodeCharacter{03B5}{\textepsilon}
+ % GREEK SMALL LETTER EPSILON
+ % ??? (\ensuremath{\varepsilon} as default)
+
+\DeclareUnicodeCharacter{03C0}{\textpi}
+ % GREEK SMALL LETTER PI
+ % ???
+
+\DeclareUnicodeCharacter{03C3}{\textsigma}
+ % GREEK SMALL LETTER SIGMA
+ % ???
+
+\DeclareUnicodeCharacter{03C4}{\texttau}
+ % GREEK SMALL LETTER TAU
+ % ???
+
+\DeclareUnicodeCharacter{03C6}{\textphi}
+ % GREEK SMALL LETTER PHI
+ % ???
+
+\DeclareUnicodeCharacter{0403}{\@tabacckludge'\CYRG}
+ % CYRILLIC CAPITAL LETTER GJE
+ % cp1251[0x81/129]
+
+\DeclareUnicodeCharacter{040C}{\@tabacckludge'\CYRK}
+ % CYRILLIC CAPITAL LETTER KJE
+ % cp1251[0x8D/141]
+
+\DeclareUnicodeCharacter{0453}{\@tabacckludge'\cyrg}
+ % CYRILLIC SMALL LETTER GJE
+ % cp1251[0x83/131]
+
+\DeclareUnicodeCharacter{045C}{\@tabacckludge'\cyrk}
+ % CYRILLIC SMALL LETTER KJE
+ % cp1251[0x9D/157]
+
+\DeclareUnicodeCharacter{05D0}{\hebalef}
+ % HEBREW LETTER ALEF
+ % adobe glyph name: afii57664, alef, alefhebrew
+ % atarist[0xC2/194]
+
+\DeclareUnicodeCharacter{05D1}{\hebbet}
+ % HEBREW LETTER BET
+ % adobe glyph name: afii57665, bet, bethebrew
+ % atarist[0xC3/195]
+
+\DeclareUnicodeCharacter{05D2}{\hebgimel}
+ % HEBREW LETTER GIMEL
+ % adobe glyph name: afii57666, gimel, gimelhebrew
+ % atarist[0xC4/196]
+
+\DeclareUnicodeCharacter{05D3}{\hebdalet}
+ % HEBREW LETTER DALET
+ % adobe glyph name: afii57667, dalet, dalethebrew
+ % atarist[0xC5/197]
+
+\DeclareUnicodeCharacter{05D4}{\hebhe}
+ % HEBREW LETTER HE
+ % adobe glyph name: afii57668, he, hehebrew
+ % atarist[0xC6/198]
+
+\DeclareUnicodeCharacter{05D5}{\hebvav}
+ % HEBREW LETTER VAV
+ % adobe glyph name: afii57669, vav, vavhebrew
+ % atarist[0xC7/199]
+
+\DeclareUnicodeCharacter{05D6}{\hebzayin}
+ % HEBREW LETTER ZAYIN
+ % adobe glyph name: afii57670, zayin, zahinhebrew
+ % atarist[0xC8/200]
+
+\DeclareUnicodeCharacter{05D7}{\hebhet}
+ % HEBREW LETTER HET
+ % adobe glyph name: afii57671, het, hethebrew
+ % atarist[0xC9/201]
+
+\DeclareUnicodeCharacter{05D8}{\hebtet}
+ % HEBREW LETTER TET
+ % adobe glyph name: afii57672, tet, tethebrew
+ % atarist[0xCA/202]
+
+\DeclareUnicodeCharacter{05D9}{\hebyod}
+ % HEBREW LETTER YOD
+ % adobe glyph name: afii57673, yod, hodhebrew
+ % atarist[0xCB/203]
+
+\DeclareUnicodeCharacter{05DA}{\hebfinalkaf}
+ % HEBREW LETTER FINAL KAF
+ % adobe glyph name: afii57674, finalkaf, finalkafhebrew
+ % atarist[0xD9/217]
+
+\DeclareUnicodeCharacter{05DB}{\hebkaf}
+ % HEBREW LETTER KAF
+ % adobe glyph name: afii57675, kaf, kafhebrew
+ % atarist[0xCC/204]
+
+\DeclareUnicodeCharacter{05DC}{\heblamed}
+ % HEBREW LETTER LAMED
+ % adobe glyph name: afii57676, lamed, lamedhebrew
+ % atarist[0xCD/205]
+
+\DeclareUnicodeCharacter{05DD}{\hebfinalmem}
+ % HEBREW LETTER FINAL MEM
+ % adobe glyph name: afii57677, finalmem, finalmemhebrew
+ % atarist[0xDA/218]
+
+\DeclareUnicodeCharacter{05DE}{\hebmem}
+ % HEBREW LETTER MEM
+ % adobe glyph name: afii57678, mem, memhebrew
+ % atarist[0xCE/206]
+
+\DeclareUnicodeCharacter{05DF}{\hebfinalnun}
+ % HEBREW LETTER FINAL NUN
+ % adobe glyph name: afii57679, finalnun, finalnunhebrew
+ % atarist[0xD8/216]
+
+\DeclareUnicodeCharacter{05E0}{\hebnun}
+ % HEBREW LETTER NUN
+ % adobe glyph name: afii57680, nun, nunhebrew
+ % atarist[0xCF/207]
+
+\DeclareUnicodeCharacter{05E1}{\hebsamekh}
+ % HEBREW LETTER SAMEKH
+ % adobe glyph name: afii57681, samekh, samekhhebrew
+ % atarist[0xD0/208]
+
+\DeclareUnicodeCharacter{05E2}{\hebayin}
+ % HEBREW LETTER AYIN
+ % adobe glyph name: afii57682, ayin, ayinhebrew
+ % atarist[0xD1/209]
+
+\DeclareUnicodeCharacter{05E3}{\hebfinalpe}
+ % HEBREW LETTER FINAL PE
+ % adobe glyph name: afii57683, finalpe, finalpehebrew
+ % atarist[0xDB/219]
+
+\DeclareUnicodeCharacter{05E4}{\hebpe}
+ % HEBREW LETTER PE
+ % adobe glyph name: afii57684, pe, pehebrew
+ % atarist[0xD2/210]
+
+\DeclareUnicodeCharacter{05E5}{\hebfinaltsadi}
+ % HEBREW LETTER FINAL TSADI
+ % adobe glyph name: afii57685, finaltsadi, finaltsadihebrew
+ % atarist[0xDC/220]
+
+\DeclareUnicodeCharacter{05E6}{\hebtsadi}
+ % HEBREW LETTER TSADI
+ % adobe glyph name: afii57686, tsadi, tsadihebrew
+ % atarist[0xD3/211]
+
+\DeclareUnicodeCharacter{05E7}{\hebqof}
+ % HEBREW LETTER QOF
+ % adobe glyph name: afii57687, qof, qofhebrew
+ % atarist[0xD4/212]
+
+\DeclareUnicodeCharacter{05E8}{\hebresh}
+ % HEBREW LETTER RESH
+ % adobe glyph name: afii57688, resh, reshhebrew
+ % atarist[0xD5/213]
+
+\DeclareUnicodeCharacter{05E9}{\hebshin}
+ % HEBREW LETTER SHIN
+ % adobe glyph name: afii57689, shin, shinhebrew
+ % atarist[0xD6/214]
+
+\DeclareUnicodeCharacter{05EA}{\hebtav}
+ % HEBREW LETTER TAV
+ % adobe glyph name: afii57690, tav, tavhebrew
+ % atarist[0xD7/215]
+
+\DeclareUnicodeCharacter{2015}{\texthorizontalbar}
+ % HORIZONTAL BAR
+ % QUOTATION DASH
+ % adobe glyph name: afii00208, horizontalbar
+ % iso-8859-10[0xBD/189]
+
+\DeclareUnicodeCharacter{2017}{\textdbllowline}
+ % DOUBLE LOW LINE
+ % SPACING DOUBLE UNDERSCORE
+ % adobe glyph name: dbllowline
+ % cp850[0xF2/242] cp858[0xF2/242]
+
+\DeclareUnicodeCharacter{207F}{\textnsuperior}
+ % SUPERSCRIPT LATIN SMALL LETTER N
+ % cp437[0xFC/252] cp865[0xFC/252]
+ % ???
+
+\DeclareUnicodeCharacter{20A7}{\textpeseta}
+ % PESETA SIGN
+
+\DeclareUnicodeCharacter{2202}{\textpartial}
+ % PARTIAL DIFFERENTIAL
+ % mac-roman[0xB6/182] mac-ce[0xB6/182]
+ % ??? (default: \ensuremath{\partial})
+
+\DeclareUnicodeCharacter{2206}{\textincrement}
+ % INCREMENT
+ % mac-roman[0xC6/198] mac-ce[0xC6/198]
+ % ??? (default: \ensuremath{\Delta})
+
+\DeclareUnicodeCharacter{2208}{\textelement}
+ % ELEMENT OF
+ % adobe glyph name: element
+ % atarist[0xEE/238]
+
+\DeclareUnicodeCharacter{220F}{\textproduct}
+ % N-ARY PRODUCT
+ % adobe glyph name: product
+ % applemac.def: \Pi
+ % ??? (default: \ensuremath{\Pi})
+ % ??? or \textprod because of \prod?
+
+\DeclareUnicodeCharacter{2211}{\textsummation}
+ % N-ARY SUMMATION
+ % adobe glyph name: summation
+ % applemac.def: \Sigma
+ % ??? (default: \ensuremath{\Sigma})
+ % ??? or \textsum because of \sum?
+
+\DeclareUnicodeCharacter{2219}{\textbullet}
+ % BULLET OPERATOR
+ % cp437[0xF9/249] cp865[0xF9/249]
+ % ???
+
+\DeclareUnicodeCharacter{221A}{\textsurd}
+ % SQUARE ROOT
+
+\DeclareUnicodeCharacter{221E}{\textinfinity}
+ % INFINITY
+ % adobe glyph name: infinity
+ % ??? or \textinfty or ...
+
+\DeclareUnicodeCharacter{2227}{\textcap}
+ % LOGICAL AND
+ % atarist[0xDE/222]
+
+\DeclareUnicodeCharacter{2229}{\textintersection}
+ % INTERSECTION
+ % adobe glyph name: intersection
+ % ??? or \textcap or ...
+
+\DeclareUnicodeCharacter{222B}{\textintegral}
+ % INTEGRAL
+ % adobe glyph name: integral
+ % applemac.def: \int
+ % ??? or \textint or ...
+
+\DeclareUnicodeCharacter{222E}{\textcontourintegral}
+ % CONTOUR INTEGRAL
+ % adobe glyph name: contourintegral
+ % atarist[0xEC/236]
+
+\DeclareUnicodeCharacter{2248}{\textapproxequal}
+ % ALMOST EQUAL TO
+ % adobe glyph name: approxequal
+ % ??? or \textapprox or ...
+
+\DeclareUnicodeCharacter{2260}{\textnotequal}
+ % NOT EQUAL TO
+ % adobe glyph name: notequal
+ % applemac.def: \neq
+ % ??? or \textne or \textneq or ...
+
+\DeclareUnicodeCharacter{2261}{\textequivalence}
+ % IDENTICAL TO
+ % adobe glyph name: equivalence
+ % cp437.def: \equiv
+ % ??? or \textequiv or ...
+
+\DeclareUnicodeCharacter{2264}{\textlessequal}
+ % LESS-THAN OR EQUAL TO
+ % adobe glyph name: lessequal
+ % cp437.def: \leq
+ % ??? or \textleq or \textle or \textlessorequal or ...
+
+\DeclareUnicodeCharacter{2265}{\textgreaterequal}
+ % GREATER-THAN OR EQUAL TO
+ % adobe glyph name: greaterequal
+ % cp437.def: \geq
+ % ??? or \textgeq or \textge or \textgreaterorequal
+
+\DeclareUnicodeCharacter{2310}{\textrevlogicalnot}
+ % REVERSED NOT SIGN
+ % adobe glyph name: revlogicalnot
+ % cp437[0xA9/169] cp865[0xA9/169]
+ % ???
+
+ % \DeclareUnicodeCharacter{2320}{}
+ % TOP HALF INTEGRAL
+ % adobe glyph name: integraltp
+ % cp437[0xF4/244] cp865[0xF4/244]
+ % ???
+
+ % \DeclareUnicodeCharacter{2321}{}
+ % BOTTOM HALF INTEGRAL
+ % adobe glyph name: integralbt
+ % cp437[0xF5/245] cp865[0xF5/245]
+ % ???
+
+ % \DeclareUnicodeCharacter{2500}{}
+ % BOX DRAWINGS LIGHT HORIZONTAL
+ % FORMS LIGHT HORIZONTAL
+ % cp437[0xC4/196] cp850[0xC4/196] cp852[0xC4/196] cp858[0xC4/196] cp865[0xC4/196]
+ % ???
+
+ % \DeclareUnicodeCharacter{2502}{}
+ % BOX DRAWINGS LIGHT VERTICAL
+ % FORMS LIGHT VERTICAL
+ % cp437[0xB3/179] cp850[0xB3/179] cp852[0xB3/179] cp858[0xB3/179] cp865[0xB3/179]
+ % ???
+
+ % \DeclareUnicodeCharacter{250C}{}
+ % BOX DRAWINGS LIGHT DOWN AND RIGHT
+ % FORMS LIGHT DOWN AND RIGHT
+ % cp437[0xDA/218] cp850[0xDA/218] cp852[0xDA/218] cp858[0xDA/218] cp865[0xDA/218]
+ % ???
+
+ % \DeclareUnicodeCharacter{2510}{}
+ % BOX DRAWINGS LIGHT DOWN AND LEFT
+ % FORMS LIGHT DOWN AND LEFT
+ % cp437[0xBF/191] cp850[0xBF/191] cp852[0xBF/191] cp858[0xBF/191] cp865[0xBF/191]
+ % ???
+
+ % \DeclareUnicodeCharacter{2514}{}
+ % BOX DRAWINGS LIGHT UP AND RIGHT
+ % FORMS LIGHT UP AND RIGHT
+ % cp437[0xC0/192] cp850[0xC0/192] cp852[0xC0/192] cp858[0xC0/192] cp865[0xC0/192]
+ % ???
+
+ % \DeclareUnicodeCharacter{2518}{}
+ % BOX DRAWINGS LIGHT UP AND LEFT
+ % FORMS LIGHT UP AND LEFT
+ % cp437[0xD9/217] cp850[0xD9/217] cp852[0xD9/217] cp858[0xD9/217] cp865[0xD9/217]
+ % ???
+
+ % \DeclareUnicodeCharacter{251C}{}
+ % BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+ % FORMS LIGHT VERTICAL AND RIGHT
+ % cp437[0xC3/195] cp850[0xC3/195] cp852[0xC3/195] cp858[0xC3/195] cp865[0xC3/195]
+ % ???
+
+ % \DeclareUnicodeCharacter{2524}{}
+ % BOX DRAWINGS LIGHT VERTICAL AND LEFT
+ % FORMS LIGHT VERTICAL AND LEFT
+ % cp437[0xB4/180] cp850[0xB4/180] cp852[0xB4/180] cp858[0xB4/180] cp865[0xB4/180]
+ % ???
+
+ % \DeclareUnicodeCharacter{252C}{}
+ % BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+ % FORMS LIGHT DOWN AND HORIZONTAL
+ % cp437[0xC2/194] cp850[0xC2/194] cp852[0xC2/194] cp858[0xC2/194] cp865[0xC2/194]
+ % ???
+
+ % \DeclareUnicodeCharacter{2534}{}
+ % BOX DRAWINGS LIGHT UP AND HORIZONTAL
+ % FORMS LIGHT UP AND HORIZONTAL
+ % cp437[0xC1/193] cp850[0xC1/193] cp852[0xC1/193] cp858[0xC1/193] cp865[0xC1/193]
+ % ???
+
+ % \DeclareUnicodeCharacter{253C}{}
+ % BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+ % FORMS LIGHT VERTICAL AND HORIZONTAL
+ % cp437[0xC5/197] cp850[0xC5/197] cp852[0xC5/197] cp858[0xC5/197] cp865[0xC5/197]
+ % ???
+
+ % \DeclareUnicodeCharacter{2550}{}
+ % BOX DRAWINGS DOUBLE HORIZONTAL
+ % FORMS DOUBLE HORIZONTAL
+ % cp437[0xCD/205] cp850[0xCD/205] cp852[0xCD/205] cp858[0xCD/205] cp865[0xCD/205]
+ % ???
+
+ % \DeclareUnicodeCharacter{2551}{}
+ % BOX DRAWINGS DOUBLE VERTICAL
+ % FORMS DOUBLE VERTICAL
+ % cp437[0xBA/186] cp850[0xBA/186] cp852[0xBA/186] cp858[0xBA/186] cp865[0xBA/186]
+ % ???
+
+ % \DeclareUnicodeCharacter{2552}{}
+ % BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+ % FORMS DOWN SINGLE AND RIGHT DOUBLE
+ % cp437[0xD5/213] cp865[0xD5/213]
+ % ???
+
+ % \DeclareUnicodeCharacter{2553}{}
+ % BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+ % FORMS DOWN DOUBLE AND RIGHT SINGLE
+ % cp437[0xD6/214] cp865[0xD6/214]
+ % ???
+
+ % \DeclareUnicodeCharacter{2554}{}
+ % BOX DRAWINGS DOUBLE DOWN AND RIGHT
+ % FORMS DOUBLE DOWN AND RIGHT
+ % cp437[0xC9/201] cp850[0xC9/201] cp852[0xC9/201] cp858[0xC9/201] cp865[0xC9/201]
+ % ???
+
+ % \DeclareUnicodeCharacter{2555}{}
+ % BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+ % FORMS DOWN SINGLE AND LEFT DOUBLE
+ % cp437[0xB8/184] cp865[0xB8/184]
+ % ???
+
+ % \DeclareUnicodeCharacter{2556}{}
+ % BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+ % FORMS DOWN DOUBLE AND LEFT SINGLE
+ % cp437[0xB7/183] cp865[0xB7/183]
+ % ???
+
+ % \DeclareUnicodeCharacter{2557}{}
+ % BOX DRAWINGS DOUBLE DOWN AND LEFT
+ % FORMS DOUBLE DOWN AND LEFT
+ % cp437[0xBB/187] cp850[0xBB/187] cp852[0xBB/187] cp858[0xBB/187] cp865[0xBB/187]
+ % ???
+
+ % \DeclareUnicodeCharacter{2558}{}
+ % BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+ % FORMS UP SINGLE AND RIGHT DOUBLE
+ % cp437[0xD4/212] cp865[0xD4/212]
+ % ???
+
+ % \DeclareUnicodeCharacter{2559}{}
+ % BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+ % FORMS UP DOUBLE AND RIGHT SINGLE
+ % cp437[0xD3/211] cp865[0xD3/211]
+ % ???
+
+ % \DeclareUnicodeCharacter{255A}{}
+ % BOX DRAWINGS DOUBLE UP AND RIGHT
+ % FORMS DOUBLE UP AND RIGHT
+ % cp437[0xC8/200] cp850[0xC8/200] cp852[0xC8/200] cp858[0xC8/200] cp865[0xC8/200]
+ % ???
+
+ % \DeclareUnicodeCharacter{255B}{}
+ % BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+ % FORMS UP SINGLE AND LEFT DOUBLE
+ % cp437[0xBE/190] cp865[0xBE/190]
+ % ???
+
+ % \DeclareUnicodeCharacter{255C}{}
+ % BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+ % FORMS UP DOUBLE AND LEFT SINGLE
+ % cp437[0xBD/189] cp865[0xBD/189]
+ % ???
+
+ % \DeclareUnicodeCharacter{255D}{}
+ % BOX DRAWINGS DOUBLE UP AND LEFT
+ % FORMS DOUBLE UP AND LEFT
+ % cp437[0xBC/188] cp850[0xBC/188] cp852[0xBC/188] cp858[0xBC/188] cp865[0xBC/188]
+ % ???
+
+ % \DeclareUnicodeCharacter{255E}{}
+ % BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+ % FORMS VERTICAL SINGLE AND RIGHT DOUBLE
+ % cp437[0xC6/198] cp865[0xC6/198]
+ % ???
+
+ % \DeclareUnicodeCharacter{255F}{}
+ % BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+ % FORMS VERTICAL DOUBLE AND RIGHT SINGLE
+ % cp437[0xC7/199] cp865[0xC7/199]
+ % ???
+
+ % \DeclareUnicodeCharacter{2560}{}
+ % BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+ % FORMS DOUBLE VERTICAL AND RIGHT
+ % cp437[0xCC/204] cp850[0xCC/204] cp852[0xCC/204] cp858[0xCC/204] cp865[0xCC/204]
+ % ???
+
+ % \DeclareUnicodeCharacter{2561}{}
+ % BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+ % FORMS VERTICAL SINGLE AND LEFT DOUBLE
+ % cp437[0xB5/181] cp865[0xB5/181]
+ % ???
+
+ % \DeclareUnicodeCharacter{2562}{}
+ % BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+ % FORMS VERTICAL DOUBLE AND LEFT SINGLE
+ % cp437[0xB6/182] cp865[0xB6/182]
+ % ???
+
+ % \DeclareUnicodeCharacter{2563}{}
+ % BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+ % FORMS DOUBLE VERTICAL AND LEFT
+ % cp437[0xB9/185] cp850[0xB9/185] cp852[0xB9/185] cp858[0xB9/185] cp865[0xB9/185]
+ % ???
+
+ % \DeclareUnicodeCharacter{2564}{}
+ % BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+ % FORMS DOWN SINGLE AND HORIZONTAL DOUBLE
+ % cp437[0xD1/209] cp865[0xD1/209]
+ % ???
+
+ % \DeclareUnicodeCharacter{2565}{}
+ % BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+ % FORMS DOWN DOUBLE AND HORIZONTAL SINGLE
+ % cp437[0xD2/210] cp865[0xD2/210]
+ % ???
+
+ % \DeclareUnicodeCharacter{2566}{}
+ % BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+ % FORMS DOUBLE DOWN AND HORIZONTAL
+ % cp437[0xCB/203] cp850[0xCB/203] cp852[0xCB/203] cp858[0xCB/203] cp865[0xCB/203]
+ % ???
+
+ % \DeclareUnicodeCharacter{2567}{}
+ % BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+ % FORMS UP SINGLE AND HORIZONTAL DOUBLE
+ % cp437[0xCF/207] cp865[0xCF/207]
+ % ???
+
+ % \DeclareUnicodeCharacter{2568}{}
+ % BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+ % FORMS UP DOUBLE AND HORIZONTAL SINGLE
+ % cp437[0xD0/208] cp865[0xD0/208]
+ % ???
+
+ % \DeclareUnicodeCharacter{2569}{}
+ % BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+ % FORMS DOUBLE UP AND HORIZONTAL
+ % cp437[0xCA/202] cp850[0xCA/202] cp852[0xCA/202] cp858[0xCA/202] cp865[0xCA/202]
+ % ???
+
+ % \DeclareUnicodeCharacter{256A}{}
+ % BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+ % FORMS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+ % cp437[0xD8/216] cp865[0xD8/216]
+ % ???
+
+ % \DeclareUnicodeCharacter{256B}{}
+ % BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+ % FORMS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+ % cp437[0xD7/215] cp865[0xD7/215]
+ % ???
+
+ % \DeclareUnicodeCharacter{256C}{}
+ % BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+ % FORMS DOUBLE VERTICAL AND HORIZONTAL
+ % cp437[0xCE/206] cp850[0xCE/206] cp852[0xCE/206] cp858[0xCE/206] cp865[0xCE/206]
+ % ???
+
+ % \DeclareUnicodeCharacter{2580}{}
+ % UPPER HALF BLOCK
+ % cp437[0xDF/223] cp850[0xDF/223] cp852[0xDF/223] cp858[0xDF/223] cp865[0xDF/223]
+ % ???
+
+ % \DeclareUnicodeCharacter{2584}{}
+ % LOWER HALF BLOCK
+ % cp437[0xDC/220] cp850[0xDC/220] cp852[0xDC/220] cp858[0xDC/220] cp865[0xDC/220]
+ % ???
+
+ %\DeclareUnicodeCharacter{2588}{}
+ % FULL BLOCK
+ % cp437[0xDB/219] cp850[0xDB/219] cp852[0xDB/219] cp858[0xDB/219] cp865[0xDB/219]
+ % ???
+
+ % \DeclareUnicodeCharacter{258C}{}
+ % LEFT HALF BLOCK
+ % cp437[0xDD/221] cp865[0xDD/221]
+ % ???
+
+ % \DeclareUnicodeCharacter{2590}{}
+ % RIGHT HALF BLOCK
+ % cp437[0xDE/222] cp865[0xDE/222]
+ % ???
+
+ % \DeclareUnicodeCharacter{2591}{}
+ % LIGHT SHADE
+ % cp437[0xB0/176] cp850[0xB0/176] cp852[0xB0/176] cp858[0xB0/176] cp865[0xB0/176]
+ % ???
+
+ % \DeclareUnicodeCharacter{2592}{}
+ % MEDIUM SHADE
+ % cp437[0xB1/177] cp850[0xB1/177] cp852[0xB1/177] cp858[0xB1/177] cp865[0xB1/177]
+ % ???
+
+ % \DeclareUnicodeCharacter{2593}{}
+ % DARK SHADE
+ % cp437[0xB2/178] cp850[0xB2/178] cp852[0xB2/178] cp858[0xB2/178] cp865[0xB2/178]
+ % ???
+
+\DeclareUnicodeCharacter{25A0}{\textblacksquare}
+ % BLACK SQUARE
+ % cp437.def: \textblacksquare
+
+\DeclareUnicodeCharacter{25CA}{\textlozenge}
+ % LOZENGE
+ % adobe glyph name: lozenge
+ % applemac.def: \diamond
+ % ???
+
+ % \DeclareUnicodeCharacter{F8FF}{}
+ % <Private Use, Last>
+ % applemac.def: \textapplelogo
+ % ???
+
+\DeclareUnicodeCharacter{FB01}{fi}
+ % LATIN SMALL LIGATURE FI
+ % applemac.def: fi
+ % ??? \textfi
+
+\DeclareUnicodeCharacter{FB02}{fl}
+ % LATIN SMALL LIGATURE FL
+ % applemac.def: fl
+ % ??? \textfl
+
+ % pmboxdraw:
+
+\DeclareUnicodeCharacter{2500}{\textSFx}
+\DeclareUnicodeCharacter{2502}{\textSFxi}
+\DeclareUnicodeCharacter{250C}{\textSFi}
+\DeclareUnicodeCharacter{2510}{\textSFiii}
+\DeclareUnicodeCharacter{2514}{\textSFii}
+\DeclareUnicodeCharacter{2518}{\textSFiv}
+\DeclareUnicodeCharacter{251C}{\textSFviii}
+\DeclareUnicodeCharacter{2524}{\textSFix}
+\DeclareUnicodeCharacter{252C}{\textSFvi}
+\DeclareUnicodeCharacter{2534}{\textSFvii}
+\DeclareUnicodeCharacter{253C}{\textSFv}
+\DeclareUnicodeCharacter{2550}{\textSFxliii}
+\DeclareUnicodeCharacter{2551}{\textSFxxiv}
+\DeclareUnicodeCharacter{2552}{\textSFli}
+\DeclareUnicodeCharacter{2553}{\textSFlii}
+\DeclareUnicodeCharacter{2554}{\textSFxxxix}
+\DeclareUnicodeCharacter{2555}{\textSFxxii}
+\DeclareUnicodeCharacter{2556}{\textSFxxi}
+\DeclareUnicodeCharacter{2557}{\textSFxxv}
+\DeclareUnicodeCharacter{2558}{\textSFl}
+\DeclareUnicodeCharacter{2559}{\textSFxlix}
+\DeclareUnicodeCharacter{255A}{\textSFxxxviii}
+\DeclareUnicodeCharacter{255B}{\textSFxxviii}
+\DeclareUnicodeCharacter{255C}{\textSFxxvii}
+\DeclareUnicodeCharacter{255D}{\textSFxxvi}
+\DeclareUnicodeCharacter{255E}{\textSFxxxvi}
+\DeclareUnicodeCharacter{255F}{\textSFxxxvii}
+\DeclareUnicodeCharacter{2560}{\textSFxlii}
+\DeclareUnicodeCharacter{2561}{\textSFxix}
+\DeclareUnicodeCharacter{2562}{\textSFxx}
+\DeclareUnicodeCharacter{2563}{\textSFxxiii}
+\DeclareUnicodeCharacter{2564}{\textSFxlvii}
+\DeclareUnicodeCharacter{2565}{\textSFxlviii}
+\DeclareUnicodeCharacter{2566}{\textSFxli}
+\DeclareUnicodeCharacter{2567}{\textSFxlv}
+\DeclareUnicodeCharacter{2568}{\textSFxlvi}
+\DeclareUnicodeCharacter{2569}{\textSFxl}
+\DeclareUnicodeCharacter{256A}{\textSFliv}
+\DeclareUnicodeCharacter{256B}{\textSFliii}
+\DeclareUnicodeCharacter{256C}{\textSFxliv}
+\DeclareUnicodeCharacter{2580}{\textupblock}
+\DeclareUnicodeCharacter{2584}{\textdnblock}
+\DeclareUnicodeCharacter{2588}{\textblock}
+\DeclareUnicodeCharacter{258C}{\textlfblock}
+\DeclareUnicodeCharacter{2590}{\textrtblock}
+\DeclareUnicodeCharacter{2591}{\textltshade}
+\DeclareUnicodeCharacter{2592}{\textshade}
+\DeclareUnicodeCharacter{2593}{\textdkshade}
+
+% \end{macrocode}
+% \fi
+%
+% \begin{macrocode}
+%</dfudoc>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/inputenx}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/inputenx.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/inputenx.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[\CTAN{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 inputenx.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@{}}
+% inputenx.sty & tex/latex/oberdiek/inputenx.sty\\
+% ix-alias.def & tex/latex/oberdiek/ix-alias.def\\
+% ix-math.def & tex/latex/oberdiek/ix-math.def\\
+% ix-name.def & tex/latex/oberdiek/ix-name.def\\
+% ix-slot.def & tex/latex/oberdiek/ix-slot.def\\
+% ix-uc.def & tex/latex/oberdiek/ix-uc.def\\
+% ix-utf8enc.dfu & tex/latex/oberdiek/ix-utf8enc.dfu\\
+% x-ascii.def & tex/latex/oberdiek/x-ascii.def\\
+% x-verbatim.def & tex/latex/oberdiek/x-verbatim.def\\
+% x-atarist.def & tex/latex/oberdiek/x-atarist.def\\
+% x-iso-8859-1.def & tex/latex/oberdiek/x-iso-8859-1.def\\
+% x-iso-8859-2.def & tex/latex/oberdiek/x-iso-8859-2.def\\
+% x-iso-8859-3.def & tex/latex/oberdiek/x-iso-8859-3.def\\
+% x-iso-8859-4.def & tex/latex/oberdiek/x-iso-8859-4.def\\
+% x-iso-8859-5.def & tex/latex/oberdiek/x-iso-8859-5.def\\
+% x-iso-8859-8.def & tex/latex/oberdiek/x-iso-8859-8.def\\
+% x-iso-8859-9.def & tex/latex/oberdiek/x-iso-8859-9.def\\
+% x-iso-8859-10.def & tex/latex/oberdiek/x-iso-8859-10.def\\
+% x-iso-8859-13.def & tex/latex/oberdiek/x-iso-8859-13.def\\
+% x-iso-8859-14.def & tex/latex/oberdiek/x-iso-8859-14.def\\
+% x-iso-8859-15.def & tex/latex/oberdiek/x-iso-8859-15.def\\
+% x-iso-8859-16.def & tex/latex/oberdiek/x-iso-8859-16.def\\
+% x-cp437.def & tex/latex/oberdiek/x-cp437.def\\
+% x-cp850.def & tex/latex/oberdiek/x-cp850.def\\
+% x-cp852.def & tex/latex/oberdiek/x-cp852.def\\
+% x-cp855.def & tex/latex/oberdiek/x-cp855.def\\
+% x-cp858.def & tex/latex/oberdiek/x-cp858.def\\
+% x-cp865.def & tex/latex/oberdiek/x-cp865.def\\
+% x-cp866.def & tex/latex/oberdiek/x-cp866.def\\
+% x-cp1250.def & tex/latex/oberdiek/x-cp1250.def\\
+% x-cp1251.def & tex/latex/oberdiek/x-cp1251.def\\
+% x-cp1252.def & tex/latex/oberdiek/x-cp1252.def\\
+% x-cp1255.def & tex/latex/oberdiek/x-cp1255.def\\
+% x-cp1257.def & tex/latex/oberdiek/x-cp1257.def\\
+% x-dec-mcs.def & tex/latex/oberdiek/x-dec-mcs.def\\
+% x-koi8-r.def & tex/latex/oberdiek/x-koi8-r.def\\
+% x-mac-centeuro.def & tex/latex/oberdiek/x-mac-centeuro.def\\
+% x-mac-cyrillic.def & tex/latex/oberdiek/x-mac-cyrillic.def\\
+% x-mac-roman.def & tex/latex/oberdiek/x-mac-roman.def\\
+% x-nextstep.def & tex/latex/oberdiek/x-nextstep.def\\
+% inputenx.pdf & doc/latex/oberdiek/inputenx.pdf\\
+% inputenx-licrcmds.txt & doc/latex/oberdiek/inputenx-licrcmds.txt\\
+% inputenx-utf8enc.txt & doc/latex/oberdiek/inputenx-utf8enc.txt\\
+% inputenx.dtx & source/latex/oberdiek/inputenx.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk inputenx.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{inputenx.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 inputenx.dtx
+%makeindex -s gind.ist inputenx.idx
+%pdflatex inputenx.dtx
+%makeindex -s gind.ist inputenx.idx
+%pdflatex inputenx.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{inputenx.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='inputenx'>
+ <name>inputenx</name>
+ <caption>Enhanced input encoding handling.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.11'/>
+ <description>
+ This package deals with input encodings. The first stage
+ provides input encodings using
+ standard mappings and covers nearly all slots. Thus it
+ serves as more uptodate replacement for package
+ <xref refid='inputenc'>inputenc</xref>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/inputenx.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/inputenx.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{ltc}
+% Frank Mittelbach, Michel Goossens,
+% \textit{The \LaTeX\ Companion}, second edition, April 2004.
+%
+% \bibitem{inputenc}
+% Alan Jeffrey, Frank Mittelbach,
+% \textit{inputenc.sty}, 2006/05/05 v1.1b.
+% \CTAN{macros/latex/base/inputenc.dtx}
+%
+% \bibitem{selinput}
+% Heiko Oberdiek,
+% \textit{The \xpackage{selinput} package}, 2007/06/16 v1.1.
+% \CTAN{macros/latex/contrib/oberdiek/selinput.pdf}
+%
+% \bibitem{pmboxdraw}
+% Heiko Oberdiek,
+% \textit{The \xpackage{pmboxdraw} package}, 2006/05/03 v1.0.
+% \CTAN{macros/latex/contrib/oberdiek/pmboxdraw.pdf}
+%
+% \bibitem{dash}
+% Wikipedia, \textit{Dash}.
+% \url{http://en.wikipedia.org/wiki/Dash}
+%
+% \subsection{Mappings to Unicode}
+%
+% \bibitem{atarist}
+% Philippe Verdy, Bruno Haible,
+% \textit{AtariST to Unicode}, 22th April 2005.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MISC/ATARIST.TXT}
+%
+% \bibitem{iso8859-1}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-1:1998 to Unicode}, 27th July 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT}
+%
+% \bibitem{iso8859-2}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-2:1999 to Unicode}, 27th July 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-2.TXT}
+%
+% \bibitem{iso8859-3}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-3:1999 to Unicode}, 27th July 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-3.TXT}
+%
+% \bibitem{iso8859-4}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-4:1998 to Unicode}, 27th July 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-4.TXT}
+%
+% \bibitem{iso8859-5}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-5:1998 to Unicode}, 27th July 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-5.TXT}
+%
+% \bibitem{iso8859-8}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-8:1999 to Unicode}, 3rd January 2000.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-8.TXT}
+%
+% \bibitem{iso8859-9}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-9:1999 to Unicode}, 27th July 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-9.TXT}
+%
+% \bibitem{iso8859-15}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-15:1999 to Unicode}, 27th July 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-15.TXT}
+%
+% \bibitem{iso8859-16}
+% Ken Whistler,
+% \textit{ISO/IEC 8859-16:2001 to Unicode}, 26th July 2001.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-16.TXT}
+%
+% \bibitem{koi8-r}
+% Helmut Richter,
+% \textit{KOI8-R (RFC1486) to Unicode}, 18th August 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT}
+%
+% \bibitem{mac-centeuro}
+% Apple Computer,
+% \textit{Map (external version) from MAC OS Central European character
+% set to Unicode 2.1 and later}, 4th April 2005.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CENTEURO.TXT}
+%
+% \bibitem{mac-cyrillic}
+% Apple Computer,
+% \textit{Map (external version) from MAC OS Cyrillic character
+% set to Unicode 2.1 and later}, 5th April 2005.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT}
+%
+% \bibitem{mac-roman}
+% Apple Computer,
+% \textit{Map (external version) from MAC OS Roman character
+% set to Unicode 2.1 and later}, 5th April 2005.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT}
+%
+% \bibitem{mac-ukrainian}
+% Apple Computer,
+% \textit{Map (external version) from MAC OS Urainian character
+% set to Unicode 2.1 and later}, 5th April 2005.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/APPLE/UKRAINE.TXT}
+%
+% \bibitem{nextstep}
+% Rick McGowan,
+% \textit{NextStep Encoding to Unicode}, 23rd September 1999.
+% \url{ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/NEXT/NEXTSTEP.TXT}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/03/05 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.1}
+% \item
+% Some Cyrillic encodings added:
+% cp855, cp866, cp1251, koi8-r, mac-cyrillic
+% \item
+% x-mac-ce renamed to x-mac-centeuro.
+% \end{Version}
+% \begin{Version}{2007/06/16 v1.2}
+% \item
+% Documentation update.
+% \end{Version}
+% \begin{Version}{2007/08/16 v1.3}
+% \item
+% Fix for U+0135: |\^j| $\rightarrow$ |\^\j| (Behnam Tabatabai).
+% \end{Version}
+% \begin{Version}{2009/08/13 v1.4}
+% \item
+% Encodings for Atari (atarist) and ISO 8859-8 added.
+% \item
+% Support for horizontal bar (U+2015) and double low line (U+2017) added.
+% \end{Version}
+% \begin{Version}{2009/12/15 v1.5}
+% \item
+% Aliases \xoption{clean7bit}, \xoption{ascii-print},
+% \xoption{ascii-printable} added for \xoption{x-ascii}.
+% \end{Version}
+% \begin{Version}{2010/01/11 v1.6}
+% \item
+% \cs{BeforeInputEncoding} and \cs{AfterInputEncoding} added.
+% \item
+% Documentation added.
+% \end{Version}
+% \begin{Version}{2011/02/08 v1.7}
+% \item
+% Encoding \xoption{x-verbatim} added.
+% \item
+% \cs{InputEncoding} saves and restores some catcodes for
+% reading the \xext{def} files.
+% \end{Version}
+% \begin{Version}{2011/04/10 v1.8}
+% \item
+% Fix for Unicode character U+0123 (g with cedilla)
+% (Thanks Zvi Gilboa).
+% \item
+% Some accented characters from set ``Latin Extended-B'' added to
+% \xfile{if-utf8enc.dfu}.
+% \end{Version}
+% \begin{Version}{2011/04/26 v1.9}
+% \item
+% Added encoding: cp1255 (Hebrew, letters only).
+% \end{Version}
+% \begin{Version}{2011/05/27 v1.10}
+% \item
+% Documentation fixed (missing |\end{verbatim}| added).
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.11}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/inputenx.pdf b/macros/latex/contrib/oberdiek/inputenx.pdf
new file mode 100644
index 0000000000..a2b7ba8475
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/inputenx.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/intcalc.dtx b/macros/latex/contrib/oberdiek/intcalc.dtx
new file mode 100644
index 0000000000..c44d7744c2
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/intcalc.dtx
@@ -0,0 +1,4315 @@
+% \iffalse meta-comment
+%
+% File: intcalc.dtx
+% Version: 2016/05/16 v1.2
+% Info: Expandable calculations with integers
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 intcalc.dtx
+% and the derived files
+% intcalc.sty, intcalc.pdf, intcalc.ins, intcalc.drv,
+% intcalc-test1.tex, intcalc-test2.tex, intcalc-test3.tex,
+% intcalc-test4.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/intcalc.dtx
+% CTAN:macros/latex/contrib/oberdiek/intcalc.pdf
+%
+% Unpacking:
+% (a) If intcalc.ins is present:
+% tex intcalc.ins
+% (b) Without intcalc.ins:
+% tex intcalc.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{intcalc.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If intcalc.drv is present:
+% latex intcalc.drv
+% (b) Without intcalc.drv:
+% latex intcalc.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 intcalc.dtx
+% makeindex -s gind.ist intcalc.idx
+% pdflatex intcalc.dtx
+% makeindex -s gind.ist intcalc.idx
+% pdflatex intcalc.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/intcalc.sty
+% TDS:doc/latex/oberdiek/intcalc.pdf
+% TDS:doc/latex/oberdiek/test/intcalc-test1.tex
+% TDS:doc/latex/oberdiek/test/intcalc-test2.tex
+% TDS:doc/latex/oberdiek/test/intcalc-test3.tex
+% TDS:doc/latex/oberdiek/test/intcalc-test4.tex
+% TDS:source/latex/oberdiek/intcalc.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: intcalc 2016/05/16 v1.2 Expandable calculations with integers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: intcalc
+Version: 2016/05/16 v1.2
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 intcalc.dtx
+and the derived files
+ intcalc.sty, intcalc.pdf, intcalc.ins, intcalc.drv,
+ intcalc-test1.tex, intcalc-test2.tex, intcalc-test3.tex,
+ intcalc-test4.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{intcalc.ins}{\from{intcalc.dtx}{install}}%
+ \file{intcalc.drv}{\from{intcalc.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{intcalc.sty}{\from{intcalc.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{intcalc-test1.tex}{\from{intcalc.dtx}{test1}}%
+% \file{intcalc-test2.tex}{\from{intcalc.dtx}{test2,etex}}%
+% \file{intcalc-test3.tex}{\from{intcalc.dtx}{test2,noetex}}%
+% \file{intcalc-test4.tex}{\from{intcalc.dtx}{test4,etex}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{intcalc.xml}{\from{intcalc.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{* intcalc.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `intcalc.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{intcalc.drv}%
+ [2016/05/16 v1.2 Expandable calculations with integers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{wasysym}
+\let\iint\relax
+\let\iiint\relax
+\usepackage[fleqn]{amsmath}
+
+\DeclareMathOperator{\opInv}{Inv}
+\DeclareMathOperator{\opAbs}{Abs}
+\DeclareMathOperator{\opSgn}{Sgn}
+\DeclareMathOperator{\opMin}{Min}
+\DeclareMathOperator{\opMax}{Max}
+\DeclareMathOperator{\opCmp}{Cmp}
+\DeclareMathOperator{\opInc}{Inc}
+\DeclareMathOperator{\opDec}{Dec}
+\DeclareMathOperator{\opAdd}{Add}
+\DeclareMathOperator{\opSub}{Sub}
+\DeclareMathOperator{\opShl}{Shl}
+\DeclareMathOperator{\opShr}{Shr}
+\DeclareMathOperator{\opMul}{Mul}
+\DeclareMathOperator{\opSqr}{Sqr}
+\DeclareMathOperator{\opFac}{Fac}
+\DeclareMathOperator{\opPow}{Pow}
+\DeclareMathOperator{\opDiv}{Div}
+\DeclareMathOperator{\opMod}{Mod}
+\DeclareMathOperator{\opInt}{Int}
+\DeclareMathOperator{\opOdd}{ifodd}
+
+\newcommand*{\Def}{%
+ \ensuremath{%
+ \mathrel{\mathop{:}}=%
+ }%
+}
+\newcommand*{\op}[1]{%
+ \textsf{#1}%
+}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{intcalc.dtx}%
+\end{document}
+%</driver>
+% \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{intcalc.drv}
+%
+% \title{The \xpackage{intcalc} package}
+% \date{2016/05/16 v1.2}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides expandable arithmetic operations
+% with integers.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% Package \xpackage{intcalc} defines arithmetic operations
+% that deal with integers. Integers mean numbers in \TeX.
+% The same restrictions apply, the range is limited to
+% [-2147483647, 2147483647].
+%
+% The operations have the form of macros that take one or
+% two integers as parameter and return the integer result.
+% The macro name is a three letter operation name prefixed
+% by the package name, e.g. \cs{intcalcAdd}|{10}{43}| returns
+% |53|.
+%
+% The macros are fully expandable, exactly two expansion
+% steps generate the result. Therefore the operations
+% may be used nearly everywhere in \TeX, even inside
+% \cs{number}, \cs{csname}, file names, or other
+% expandable contexts.
+%
+% The package contains two implementations of the operations.
+% If \eTeX\ is detected then the macros are implemented
+% using its features (\cs{numexpr}). Otherwise the slower
+% implementation without \eTeX's help is choosen.
+%
+% \subsection{Conditions}
+%
+% \subsubsection{Preconditions}
+%
+% \begin{itemize}
+% \item
+% Arguments can be anything that \TeX\ interprets as ``number''.
+% Examples: plain numbers, count or length register, macros
+% that expands to a number.
+% \item
+% The arguments are limited to the range
+% -2147483647 until 2147483647. These numbers belong to the range.
+% Note that some operations
+% have additionals restrictions to the range.
+% \item
+% The argument may be expressions that \cs{numexpr}
+% understands if \eTeX\ is available.
+% \item
+% The resulting number must fit in the allowed range.
+% \end{itemize}
+%
+% \subsubsection{Postconditions}
+%
+% Additional properties of the macros apart from calculating
+% a correct result (of course \smiley):
+% \begin{itemize}
+% \item
+% The macros are fully expandable. Thus they can
+% be used inside \cs{edef}, \cs{csname}, after \cs{number},
+% for example.
+% \item
+% Furthermore exactly two expansion steps calculate the result.
+% \item
+% The number consists of one optional minus sign and one to
+% ten digits. The first digit is larger than zero for
+% numbers that consists of more than one digit.
+%
+% In short, the number format is exactly the same as
+% \cs{number} generates. And the tokens (minus sign, digits)
+% have catcode 12 (other).
+% \item
+% Call by value is simulated. First the arguments are
+% converted to numbers. Then these numbers are used
+% in the calculations.
+%
+% Remember that arguments
+% may contain expensive macros or \eTeX\ expressions.
+% This strategy avoids multiple evaluations of such
+% arguments.
+% \end{itemize}
+%
+% \subsection{Error handling}
+%
+% There are two kinds of errors if a precondition is violated:
+% Some errors are detected by the macros, example: division by zero.
+% In this cases an undefined control sequence is called and causes
+% a TeX error message, example: \cs{IntCalcError:DivisionByZero}.
+% The name of the control sequence contains
+% the reason for the error. The \TeX\ error may be ignored.
+% Then the operation returns zero as result.
+% Because the macros are supposed to work in expandible contexts.
+% An traditional error message, however, is not expandable and
+% would break these contexts.
+%
+% If a number exceeds the range of -2147483647 until 2147483647, then
+% \TeX\ throws an error ``Number too big'' and recovers by
+% using biggest allowed value.
+% Example for the negative number -3000000000 is replaced
+% by -2147483647.
+%
+% \subsection{Operations}
+%
+% Some definition equations below use the function $\opInt$
+% that converts a real number to an integer. The number
+% is truncated that means rounding to zero:
+% \begin{gather*}
+% \opInt(x) \Def
+% \begin{cases}
+% \lfloor x\rfloor & \text{if $x\geq0$}\\
+% \lceil x\rceil & \text{otherwise}
+% \end{cases}
+% \end{gather*}
+%
+% \subsubsection{\op{Num}}
+%
+% \begin{declcs}{intcalcNum} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcNum} converts its argument to a normalized integer
+% number without unnecessary leading zeros or signs.
+% The result matches the regular expression:
+%\begin{quote}
+%\begin{verbatim}
+%0|-?[1-9][0-9]*
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Inv}, \op{Abs}, \op{Sgn}}
+%
+% \begin{declcs}{intcalcInv} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcInv} switches the sign.
+% \begin{gather*}
+% \opInv(x) \Def -x
+% \end{gather*}
+%
+% \begin{declcs}{intcalcAbs} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcAbs} returns the absolute value
+% of integer \meta{x}.
+% \begin{gather*}
+% \opAbs(x) \Def \vert x\vert
+% \end{gather*}
+%
+% \begin{declcs}{intcalcSgn} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcSgn} encodes the sign of \meta{x} as number.
+% \begin{gather*}
+% \opSgn(x) \Def
+% \begin{cases}
+% -1& \text{if $x<0$}\\
+% 0& \text{if $x=0$}\\
+% 1& \text{if $x>0$}
+% \end{cases}
+% \end{gather*}
+% These return values can easily be distinguished by \cs{ifcase}:
+%\begin{quote}
+%\begin{verbatim}
+%\ifcase\intcalcSgn{<x>}
+% $x=0$
+%\or
+% $x>0$
+%\else
+% $x<0$
+%\fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Min}, \op{Max}, \op{Cmp}}
+%
+% \begin{declcs}{intcalcMin} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcMin} returns the smaller of the two integers.
+% \begin{gather*}
+% \opMin(x,y) \Def
+% \begin{cases}
+% x & \text{if $x<y$}\\
+% y & \text{otherwise}
+% \end{cases}
+% \end{gather*}
+%
+% \begin{declcs}{intcalcMax} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcMax} returns the larger of the two integers.
+% \begin{gather*}
+% \opMax(x,y) \Def
+% \begin{cases}
+% x & \text{if $x>y$}\\
+% y & \text{otherwise}
+% \end{cases}
+% \end{gather*}
+%
+% \begin{declcs}{intcalcCmp} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcCmp} encodes the comparison result as number:
+% \begin{gather*}
+% \opCmp(x,y) \Def
+% \begin{cases}
+% -1 & \text{if $x<y$}\\
+% 0 & \text{if $x=y$}\\
+% 1 & \text{if $x>y$}
+% \end{cases}
+% \end{gather*}
+% These values can be distinguished by \cs{ifcase}:
+%\begin{quote}
+%\begin{verbatim}
+%\ifcase\intcalcCmp{<x>}{<y>}
+% $x=y$
+%\or
+% $x>y$
+%\else
+% $x<y$
+%\fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Inc}, \op{Dec}, \op{Add}, \op{Sub}}
+%
+% \begin{declcs}{intcalcInc} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcInc} increments \meta{x} by one.
+% \begin{gather*}
+% \opInc(x) \Def x + 1
+% \end{gather*}
+%
+% \begin{declcs}{intcalcDec} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcDec} decrements \meta{x} by one.
+% \begin{gather*}
+% \opDec(x) \Def x - 1
+% \end{gather*}
+%
+% \begin{declcs}{intcalcAdd} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcAdd} adds the two numbers.
+% \begin{gather*}
+% \opAdd(x, y) \Def x + y
+% \end{gather*}
+%
+% \begin{declcs}{intcalcSub} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcSub} calculates the difference.
+% \begin{gather*}
+% \opSub(x, y) \Def x - y
+% \end{gather*}
+%
+% \subsubsection{\op{Shl}, \op{Shr}}
+%
+% \begin{declcs}{intcalcShl} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcShl} implements shifting to the left that
+% means the number is multiplied by two. Overflow is possible.
+% The sign is preserved.
+% \begin{gather*}
+% \opShl(x) \Def x*2
+% \end{gather*}
+%
+% \begin{declcs}{intcalcShr} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcShr} implements shifting to the right.
+% That is equivalent to an integer division by two.
+% The sign is preserved.
+% \begin{gather*}
+% \opShr(x) \Def \opInt(x/2)
+% \end{gather*}
+%
+% \subsubsection{\op{Mul}, \op{Sqr}, \op{Fac}, \op{Pow}}
+%
+% \begin{declcs}{intcalcMul} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcMul} calculates the product of
+% \meta{x} and \meta{y}.
+% \begin{gather*}
+% \opMul(x,y) \Def x*y
+% \end{gather*}
+%
+% \begin{declcs}{intcalcSqr} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcSqr} returns the square product.
+% \begin{gather*}
+% \opSqr(x) \Def x^2
+% \end{gather*}
+%
+% \begin{declcs}{intcalcFac} \M{x}
+% \end{declcs}
+% Macro \cs{intcalcFac} returns the factorial of \meta{x}.
+% Negative numbers are not permitted.
+% \begin{gather*}
+% \opFac(x) \Def x!\qquad\text{for $x\geq0$}
+% \end{gather*}
+% ($0! = 1$)
+%
+% \begin{declcs}{intcalcPow} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcPow} calculates the value of \meta{x} to the
+% power of \meta{y}. The error ``division by zero'' is thrown
+% if \meta{x} is zero and \meta{y} is negative.
+% permitted:
+% \begin{gather*}
+% \opPow(x,y) \Def
+% \opInt(x^y)\qquad\text{for $x\neq0$ or $y\geq0$}
+% \end{gather*}
+% ($0^0 = 1$)
+%
+% \subsubsection{\op{Div}, \op{Mod}}
+%
+% \begin{declcs}{intcalcDiv} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcDiv} performs an integer division.
+% Argument \meta{y} must not be zero.
+% \begin{gather*}
+% \opDiv(x,y) \Def \opInt(x/y)\qquad\text{for $y\neq0$}
+% \end{gather*}
+%
+% \begin{declcs}{intcalcMod} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{intcalcMod} gets the remainder of the integer
+% division. The sign follows the divisor \meta{y}.
+% Argument \meta{y} must not be zero.
+% \begin{gather*}
+% \opMod(x,y) \Def x\mathrel{\%}y\qquad\text{for $y\neq0$}
+% \end{gather*}
+% The result ranges:
+% \begin{gather*}
+% -\vert y\vert < \opMod(x,y) \leq 0\qquad\text{for $y<0$}\\
+% 0 \leq \opMod(x,y) < y\qquad\text{for $y\geq0$}
+% \end{gather*}
+%
+% \subsection{Interface for programmer}
+%
+% If the programmer can ensure some more properties about
+% the arguments of the operations, then the following
+% macros are a little more efficient.
+%
+% In general numbers must obey the following constraints:
+% \begin{itemize}
+% \item Plain number: digit tokens only, no command tokens.
+% \item Non-negative. Signs are forbidden.
+% \item Arguments and the result must fit in range |0..2147483647|.
+% \item Delimited by exclamation mark. Curly braces
+% around the number are not allowed and will
+% break the code.
+% \end{itemize}
+%
+% \begin{declcs}{IntCalcInc} \meta{number} |!|
+% \end{declcs}
+% Incrementation, range: |0..2147483646|.
+%
+% \begin{declcs}{IntCalcDec} \meta{number} |!|
+% \end{declcs}
+% Decrementation, range: |1..2147483647|.
+%
+% \begin{declcs}{IntCalcAdd} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Addition, $A\geq B$.
+%
+% \begin{declcs}{IntCalcSub} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Subtraction, $A\geq B$.
+%
+% \begin{declcs}{IntCalcShl} \meta{number} |!|
+% \end{declcs}
+% Left shift (multiplication with two), range: |0..1073741823|.
+%
+% \begin{declcs}{IntCalcShr} \meta{number} |!|
+% \end{declcs}
+% Right shift (integer division by two).
+%
+% \begin{declcs}{IntCalcMul} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Multiplication, $A\geq B$.
+%
+% \begin{declcs}{IntCalcDiv} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Division operation.
+%
+% \begin{declcs}{IntCalcMod} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Modulo operation.
+%
+%
+% \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@intcalc.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{intcalc}{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@intcalc.sty\endcsname
+\ProvidesPackage{intcalc}%
+ [2016/05/16 v1.2 Expandable calculations with integers (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 InCa@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\InCa@AtEnd{%
+ \InCa@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{11}% : (letter!)
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{63}{14}% ? (comment!)
+\edef\InCa@AtEnd{\InCa@AtEnd\noexpand\endinput}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname InCa@TestMode\endcsname\relax
+\else
+ \catcode63=9 % ? (ignore)
+\fi
+? \let\InCa@@TestMode\InCa@TestMode
+% \end{macrocode}
+%
+% \subsection{Macros independent of \eTeX}
+%
+% \subsubsection{\op{Abs}, \op{Sgn}}
+%
+% \begin{macro}{\InCa@Abs}
+% \begin{macrocode}
+\def\InCa@Abs#1#2!{%
+ \ifx#1-%
+ #2%
+ \else
+ #1#2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@Sgn}
+% \begin{macrocode}
+\def\InCa@Sgn#1#2!{%
+ \ifx#1-%
+ -1%
+ \else
+ \ifx#10%
+ 0%
+ \else
+ 1%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Min}, \op{Max}, \op{Cmp}}
+%
+% \begin{macro}{\InCa@Min}
+% \begin{macrocode}
+\def\InCa@Min#1!#2!{%
+ \ifnum#1<#2 %
+ #1%
+ \else
+ #2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@Max}
+% \begin{macrocode}
+\def\InCa@Max#1!#2!{%
+ \ifnum#1>#2 %
+ #1%
+ \else
+ #2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@Cmp}
+% \begin{macrocode}
+\def\InCa@Cmp#1!#2!{%
+ \ifnum#1=#2 %
+ 0%
+ \else
+ \ifnum#1<#2 %
+ -%
+ \fi
+ 1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Fac}}
+%
+% \begin{macro}{\InCa@Fac}
+% It does not make much sense to calculate the
+% faculty by an general algorithm. The allowed
+% range of arguments is too low because of the
+% limited integer domain.
+% \begin{macrocode}
+\def\InCa@Fac#1!{%
+ \ifcase#1 1% 0!
+ \or 1% 1!
+ \or 2% 2!
+ \or 6% 3!
+ \or 24% 4!
+ \or 120% 5!
+ \or 720% 6!
+ \or 5040% 7!
+ \or 40320% 8!
+ \or 362880% 9!
+ \or 3628800% 10!
+ \or 39916800% 11!
+ \or 479001600% 12!
+ \else
+ \ifnum#1<\z@
+ 0\IntCalcError:FacNegative%
+ \else
+ 0\IntCalcError:FacOverflow%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Implementation based on \eTeX}
+%
+% Only \cs{numexpr} is used from \eTeX.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+\else
+% \end{macrocode}
+%
+% \subsubsection{\op{Num}}
+%
+% \begin{macro}{\intcalcNum}
+% \begin{macrocode}
+ \def\intcalcNum#1{%
+ \the\numexpr#1\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Inv}, \op{Abs}, \op{Sgn}}
+%
+% \begin{macro}{\intcalcInv}
+% \begin{macrocode}
+ \def\intcalcInv#1{%
+ \number-\intcalcNum{#1} %
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcAbs}
+% \begin{macrocode}
+ \def\intcalcAbs#1{%
+ \number\expandafter\InCa@Abs\the\numexpr#1! %
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcSgn}
+% \begin{macrocode}
+ \def\intcalcSgn#1{%
+ \number\expandafter\InCa@Sgn\the\numexpr#1! %
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Min}, \op{Max}, \op{Cmp}}
+%
+% \begin{macro}{\intcalcMin}
+% \begin{macrocode}
+ \def\intcalcMin#1#2{%
+ \number\expandafter\InCa@Min
+ \the\numexpr#1\expandafter!%
+ \the\numexpr#2! %
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcMax}
+% \begin{macrocode}
+ \def\intcalcMax#1#2{%
+ \number\expandafter\InCa@Max
+ \the\numexpr#1\expandafter!%
+ \the\numexpr#2! %
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcCmp}
+% \begin{macrocode}
+ \def\intcalcCmp#1#2{%
+ \number\expandafter\InCa@Cmp
+ \the\numexpr#1\expandafter!\the\numexpr#2! %
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Inc}, \op{Dec}}
+%
+% \begin{macro}{\intcalcInc}
+% \begin{macrocode}
+ \def\intcalcInc#1{%
+ \the\numexpr#1+1\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcDec}
+% \begin{macrocode}
+ \def\intcalcDec#1{%
+ \the\numexpr#1-1\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IntCalcInc}
+% \begin{macrocode}
+ \def\IntCalcInc#1!{%
+ \the\numexpr#1+1\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcDec}
+% \begin{macrocode}
+ \def\IntCalcDec#1!{%
+ \the\numexpr#1-1\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Add}, \op{Sub}}
+%
+% \begin{macro}{\intcalcAdd}
+% \begin{macrocode}
+ \def\intcalcAdd#1#2{%
+ \the\numexpr#1+(#2)\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcSub}
+% \begin{macrocode}
+ \def\intcalcSub#1#2{%
+ \the\numexpr#1-(#2)\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IntCalcAdd}
+% \begin{macrocode}
+ \def\IntCalcAdd#1!#2!{%
+ \the\numexpr#1+#2\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IntCalcSub}
+% \begin{macrocode}
+ \def\IntCalcSub#1!#2!{%
+ \the\numexpr#1-#2\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Shl}, \op{Shr}}
+%
+% \begin{macro}{\intcalcShl}
+% \begin{macrocode}
+ \def\intcalcShl#1{%
+ \the\numexpr(#1)*2\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcShr}
+% \begin{macrocode}
+ \def\intcalcShr#1{%
+ \number\expandafter\InCa@Shr\the\numexpr#1! %
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcShl}
+% \begin{macrocode}
+ \def\IntCalcShl#1!{%
+ \the\numexpr#1*2\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IntCalcShr}
+% \begin{macrocode}
+ \def\IntCalcShr#1!{%
+ \the\numexpr\ifodd#1 (#1-1)\else#1\fi/2\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Shr}
+% \begin{macrocode}
+ \def\InCa@Shr#1#2!{%
+ \ifx#1-%
+ -\InCa@Shr#2!%
+ \else
+ \ifodd#1#2 %
+ \the\numexpr(#1#2-1)/2\relax
+ \else
+ \the\numexpr#1#2/2\relax
+ \fi
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Mul}, \op{Sqr}, \op{Fac}}
+%
+% \begin{macro}{\intcalcMul}
+% \begin{macrocode}
+ \def\intcalcMul#1#2{%
+ \the\numexpr(#1)*(#2)\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcMul}
+% \begin{macrocode}
+ \def\IntCalcMul#1!#2!{%
+ \the\numexpr#1*#2\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcSqr}
+% \begin{macrocode}
+ \def\intcalcSqr#1{%
+ \number\expandafter\InCa@Sqr\the\numexpr#1! %
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Sqr}
+% \begin{macrocode}
+ \def\InCa@Sqr#1!{%
+ \the\numexpr#1*#1\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcFac}
+% \begin{macrocode}
+ \def\intcalcFac#1{%
+ \number\expandafter\InCa@Fac\the\numexpr#1! %
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Pow}}
+%
+% \begin{macro}{\intcalcPow}
+% \begin{macrocode}
+ \def\intcalcPow#1#2{%
+ \number\expandafter\InCa@Pow
+ \the\numexpr#1\expandafter!%
+ \the\numexpr#2! %
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Pow}
+% \begin{macrocode}
+ \def\InCa@Pow#1#2!#3#4!{%
+ \ifcase#3#4 % power = 0
+ 1%
+ \or % power = 1
+ #1#2%
+ \or % power = 2
+ \the\numexpr#1#2*#1#2\relax
+ \else
+ \ifcase#1#2 % basis = 0, power <> 0
+ 0%
+ \ifx#3-% power < 0
+ 0\IntCalcError:DivisionByZero%
+ \fi
+ \or
+ 1% basis = 1
+ \else
+ \ifnum#1#2=\m@ne % basis = -1
+ \ifodd#3#4 %
+ -%
+ \fi
+ 1%
+ \else % |basis| > 1
+ \ifx#3-% power < 0
+ 0%
+ \else % power > 2
+ \InCa@PowRec#1#2!#3#4!1!%
+ \fi
+ \fi
+ \fi
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@PowRec}
+%\begin{quote}
+%\begin{verbatim}
+%Pow(b, p) {
+% PowRec(b, p, 1)
+%}
+%PowRec(b, p, r) {
+% if p == 1 then
+% return r*b
+% else
+% ifodd p then
+% return PowRec(b*b, (p-1)/2, r*b) % p div 2 = (p-1)/2
+% else
+% return PowRec(b*b, (p-1)/2, r)
+% fi
+% fi
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+ \def\InCa@PowRec#1!#2!#3!{%
+ \ifnum#2=\@ne
+ \the\numexpr#1*#3\relax
+ \else
+ \ifodd#2 %
+ \expandafter\InCa@PowRec
+ \the\numexpr#1*#1\expandafter!%
+ \the\numexpr(#2-1)/2\expandafter!%
+ \the\numexpr#1*#3\expandafter\expandafter\expandafter!%
+ \else
+ \expandafter\InCa@PowRec
+ \the\numexpr#1*#1\expandafter!%
+ \the\numexpr(#2-1)/2\expandafter!%
+ \number#3\expandafter\expandafter\expandafter!%
+ \fi
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Div}, \op{Mod}}
+%
+% \TeX's \cs{divide} truncates,
+% \eTeX's \cs{numexpr} rounds the result of a division.
+% The rounding method is called ``Symmetric Arithmetic Rounding''
+% or ``Round-Half-Up'' (``Kaufm\"annisches Runden'' in German):
+% \begin{quote}
+% | 1 = 3 divide 2 = 1.5 = numexpr 3/2 = 2|\\
+% |-1 = -3 divide 2 = -1.5 = numexpr -3/2 = -2|
+% \end{quote}
+% Macro \cs{intcalcDiv} follows \TeX\ and truncates.
+% The calculation is done by the following formula:
+% \begin{gather}
+% \opDiv(X,Y) = (X - (Y-1)/2)/Y\qquad\text{for $X, Y > 0$}
+% \end{gather}
+% The operator `/' is \cs{numexpr}'s division.
+% \begin{macro}{\intcalcDiv}
+% \begin{macrocode}
+ \def\intcalcDiv#1#2{%
+ \number\expandafter\InCa@Div
+ \the\numexpr#1\expandafter!%
+ \the\numexpr#2! %
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Div}
+% \begin{macrocode}
+ \def\InCa@Div#1!#2!{%
+ \ifcase#2 %
+ 0\IntCalcError:DivisionByZero%
+ \else
+ \ifcase#1 %
+ 0%
+ \else
+ \expandafter\InCa@@Div
+ \romannumeral 0%
+ \ifnum#1<\z@
+ \expandafter-\number-#1%
+ \else
+ \expandafter+\number#1%
+ \fi
+ \expandafter!%
+ \romannumeral 0%
+ \ifnum#2<\z@
+ \expandafter-\number-#2%
+ \else
+ \expandafter+\number#2%
+ \fi
+ !%
+ \fi
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcDiv}
+% \begin{macrocode}
+ \def\InCa@Temp#1{%
+ \def\IntCalcDiv##1!##2!{%
+ \number
+ \ifcase##2 %
+ 0\IntCalcError:DivisionByZero%
+ \else
+ \ifcase##1 %
+ 0%
+ \else
+ \the\numexpr(##1-(##2-1)/2)/##2\relax
+ \fi
+ \fi
+ #1%
+ }%
+ }%
+ \InCa@Temp{ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@@Div}
+% \begin{macrocode}
+ \def\InCa@@Div#1#2!#3#4!{%
+ #1#3%
+ \the\numexpr(#2-(#4-1)/2)/#4\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcMod}
+% \begin{macrocode}
+ \def\intcalcMod#1#2{%
+ \number\expandafter\InCa@Mod
+ \the\numexpr#1\expandafter!%
+ \the\numexpr#2! %
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Mod}
+% \begin{macrocode}
+ \def\InCa@Mod#1!#2!{%
+ \ifcase#2 %
+ 0\IntCalcError:DivisionByZero%
+ \else
+ \ifcase#1 %
+ 0%
+ \else
+ \expandafter\InCa@@Mod
+ \romannumeral 0%
+ \ifnum#1<\z@
+ \expandafter-\number-#1%
+ \else
+ \expandafter+\number#1%
+ \fi
+ \expandafter!%
+ \romannumeral 0%
+ \ifnum#2<\z@
+ \expandafter-\number-#2%
+ \else
+ \expandafter+\number#2%
+ \fi
+ !%
+ \fi
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcMod}
+% \begin{macrocode}
+ \def\InCa@Temp#1{%
+ \def\IntCalcMod##1!##2!{%
+ \number
+ \ifcase##2 %
+ 0\IntCalcError:DivisionByZero%
+ \else
+ \ifcase##1 %
+ 0%
+ \else
+ \the\numexpr##1-(##1-(##2-1)/2)/##2*##2\relax
+ \fi
+ \fi
+ #1%
+ }%
+ }%
+ \InCa@Temp{ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@@Mod}
+% \begin{macrocode}
+ \def\InCa@@Mod#1#2!#3#4!{%
+ \if#3+%
+ \if#1+%
+ \the\numexpr#2-\InCa@@Div+#2!+#4!*#4\relax
+ \else
+ \expandafter\InCa@ModX
+ \the\numexpr-#2+\InCa@@Div+#2!+#4!*#4!#4!%
+ \fi
+ \else
+ -%
+ \if#1+%
+ \expandafter\InCa@ModX
+ \the\numexpr-#2+\InCa@@Div+#2!+#4!*#4!#4!%
+ \else
+ \the\numexpr#2-\InCa@@Div+#2!+#4!*#4\relax
+ \fi
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ModX}
+% \begin{macrocode}
+ \def\InCa@ModX#1!#2!{%
+ \ifcase#1 %
+ 0%
+ \else
+ \the\numexpr#1+#2\relax
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \expandafter\InCa@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Implementation without \eTeX}
+%
+% \subsubsection{\op{Num}}
+%
+% \begin{macro}{\intcalcNum}
+% \begin{macrocode}
+\def\intcalcNum#1{%
+ \number\expandafter\InCa@FirstOfOne\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Inv}, \op{Abs}, \op{Sgn}}
+%
+% \begin{macro}{\intcalcInv}
+% \begin{macrocode}
+\def\intcalcInv#1{%
+ \number\expandafter\InCa@FirstOfOne\number-#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@FirstOfOne}
+% \begin{macrocode}
+\def\InCa@FirstOfOne#1!{#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcAbs}
+% \begin{macrocode}
+\def\intcalcAbs#1{%
+ \number\expandafter\InCa@Abs\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcSgn}
+% \begin{macrocode}
+\def\intcalcSgn#1{%
+ \number\expandafter\InCa@Sgn\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Min}, \op{Max}, \op{Cmp}}
+%
+% \begin{macro}{\intcalcMin}
+% \begin{macrocode}
+\def\intcalcMin#1#2{%
+ \number\expandafter\InCa@Min
+ \number\number#1\expandafter!\number#2! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcMax}
+% \begin{macrocode}
+\def\intcalcMax#1#2{%
+ \number\expandafter\InCa@Max
+ \number\number#1\expandafter!\number#2! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcCmp}
+% \begin{macrocode}
+\def\intcalcCmp#1#2{%
+ \number\expandafter\InCa@Cmp
+ \number\number#1\expandafter!\number#2! %
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Inc}, \op{Dec}}
+%
+% \begin{macro}{\intcalcInc}
+% \begin{macrocode}
+\def\intcalcInc#1{%
+ \number\expandafter\InCa@IncSwitch\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@IncSwitch}
+% \begin{macrocode}
+\def\InCa@IncSwitch#1#2!{%
+ \ifx#1-%
+ -%
+ \csname InCa@Empty%
+ \InCa@Dec#2!%
+ \else
+ \csname InCa@Empty%
+ \InCa@Inc#1#2!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\intcalcDec}
+% \begin{macrocode}
+\def\intcalcDec#1{%
+ \number\expandafter\InCa@DecSwitch\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@DecSwitch}
+% \begin{macrocode}
+\def\InCa@DecSwitch#1#2!{%
+ \ifx#1-%
+ -%
+ \csname InCa@Empty%
+ \expandafter\InCa@Inc#2!%
+ \else
+ \ifx#10%
+ -1%
+ \else
+ \csname InCa@Empty%
+ \InCa@Dec#1#2!%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IntCalcInc}
+% \begin{macrocode}
+\def\IntCalcInc#1!{%
+ \number\csname InCa@Empty\InCa@Inc#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcDec}
+% \begin{macrocode}
+\def\IntCalcDec#1!{%
+ \number\csname InCa@Empty\InCa@Dec#1! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@Inc}
+% \begin{macrocode}
+\def\InCa@Inc#1#2{%
+ \ifx#2!%
+ \csname InCa@IncDigit#1\endcsname1%
+ \else
+ \csname InCa@IncDigit#1%
+ \expandafter\InCa@Inc\expandafter#2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@IncDigit[0-8]}
+% \begin{macrocode}
+\def\InCa@Temp#1#2{%
+ \expandafter\def\csname InCa@IncDigit#1\endcsname##1{%
+ \endcsname
+ 0%
+ \ifcase##1 %
+ #1%
+ \else
+ #2%
+ \fi
+ }%
+}
+\InCa@Temp 01
+\InCa@Temp 12
+\InCa@Temp 23
+\InCa@Temp 34
+\InCa@Temp 45
+\InCa@Temp 56
+\InCa@Temp 67
+\InCa@Temp 78
+\InCa@Temp 89
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@IncDigit9}
+% \begin{macrocode}
+\expandafter\def\csname InCa@IncDigit9\endcsname#1{%
+ \expandafter\endcsname
+ \ifcase#1 %
+ 09%
+ \else
+ 10%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@Dec}
+% \begin{macrocode}
+\def\InCa@Dec#1#2{%
+ \ifx#2!%
+ \csname InCa@DecDigit#1\endcsname1%
+ \else
+ \csname InCa@DecDigit#1%
+ \expandafter\InCa@Dec\expandafter#2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@DecDigit[1-9]}
+% \begin{macrocode}
+\def\InCa@Temp#1#2{%
+ \expandafter\def\csname InCa@DecDigit#1\endcsname##1{%
+ \endcsname
+ 0%
+ \ifcase##1 %
+ #1%
+ \else
+ #2%
+ \fi
+ }%
+}
+\InCa@Temp 98
+\InCa@Temp 87
+\InCa@Temp 76
+\InCa@Temp 65
+\InCa@Temp 54
+\InCa@Temp 43
+\InCa@Temp 32
+\InCa@Temp 21
+\InCa@Temp 10
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@DecDigit0}
+% \begin{macrocode}
+\expandafter\def\csname InCa@DecDigit0\endcsname#1{%
+ \expandafter\endcsname
+ \ifcase#1 %
+ 00%
+ \else
+ 19%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Add}, \op{Sub}}
+%
+% \begin{macro}{\intcalcAdd}
+% \begin{macrocode}
+\def\intcalcAdd#1#2{%
+ \number
+ \expandafter\InCa@AddSwitch
+ \number\number#1\expandafter!%
+ \number#2! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\intcalcSub}
+% \begin{macrocode}
+\def\intcalcSub#1#2{%
+ \number
+ \expandafter\InCa@AddSwitch
+ \number\number#1\expandafter!%
+ \number-\number#2! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@AddSwitch}
+% Decision table for \cs{InCa@AddSwitch}.
+% The sign of negative numbers can be removed
+% by a simple \cs{@gobble}
+% instead of the more expensive |\number-|.
+% \begin{quote}
+% \begin{tabular}[t]{@{}|l|l|l|l|l|@{}}
+% \hline
+% $x<0$ & $y<0$ & $ x< y$ & $-$ & $\opAdd(-x,-y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opAdd(-y,-x)$\\
+% \cline{2-5}
+% & else & $-x> y$ & $-$ & $\opSub(-x, y)$\\
+% \cline{3-5}
+% & & else & $+$ & $\opSub( y,-x)$\\
+% \hline
+% else & $y<0$ & $ x>-y$ & $+$ & $\opSub( x,-y)$\\
+% \cline{3-5}
+% & & else & $-$ & $\opSub(-y, x)$\\
+% \cline{2-5}
+% & else & $ x> y$ & $+$ & $\opAdd( x, y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opAdd( y, x)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\InCa@AddSwitch#1!#2!{%
+ \ifnum#1<\z@
+ \ifnum#2<\z@
+ -%
+ \ifnum#1<#2 %
+ \expandafter\InCa@Add\number-#1\expandafter!%
+ \@gobble#2!%
+ \else
+ \expandafter\InCa@Add\number-#2\expandafter!%
+ \@gobble#1!%
+ \fi
+ \else
+ \ifnum-#1>#2 %
+ -%
+ \expandafter\InCa@Sub\@gobble#1!#2!%
+ \else
+ \expandafter\InCa@Sub\number#2\expandafter!%
+ \@gobble#1!%
+ \fi
+ \fi
+ \else
+ \ifnum#2<\z@
+ \ifnum#1>-#2 %
+ \expandafter\InCa@Sub\number#1\expandafter!%
+ \@gobble#2!%
+ \else
+ -%
+ \expandafter\InCa@Sub\@gobble#2!#1!%
+ \fi
+ \else
+ \ifnum#1>#2 %
+ \InCa@Add#1!#2!%
+ \else
+ \InCa@Add#2!#1!%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcAdd}
+% \begin{macrocode}
+\def\IntCalcAdd#1!#2!{%
+ \number\InCa@Add#1!#2! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcSub}
+% \begin{macrocode}
+\def\IntCalcSub#1!#2!{%
+ \number\InCa@Sub#1!#2! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Space}
+% \begin{macrocode}
+\begingroup
+ \def\x#1{\endgroup
+ \let\InCa@Space= #1%
+ }%
+\x{ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Add}
+% \begin{macrocode}
+\def\InCa@Add#1!#2!{%
+ \ifcase#2 %
+ #1%
+ \else
+ \InCa@@Add#1!#2!000000000\InCa@Space
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Sub}
+% \begin{macrocode}
+\def\InCa@Sub#1!#2!{%
+ \ifnum#1=#2 %
+ 0%
+ \else
+ \InCa@@Sub#1!#2!000000000\InCa@Space
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@@Add}
+% \begin{macrocode}
+\def\InCa@@Add#1!#2#3!{%
+ \ifx\InCa@Empty#3\InCa@Empty
+ \@ReturnAfterElseFi{%
+ \InCa@@@Add!!#1!#2%
+ }%
+ \else
+ \@ReturnAfterFi{%
+ \InCa@@Add#1!#3!#2%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@@Sub}
+% \begin{macrocode}
+\def\InCa@@Sub#1!#2#3!{%
+ \ifx\InCa@Empty#3\InCa@Empty
+ \@ReturnAfterElseFi{%
+ \InCa@@@Sub!!#1!#2%
+ }%
+ \else
+ \@ReturnAfterFi{%
+ \InCa@@Sub#1!#3!#2%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@@@Add}
+% \begin{macrocode}
+\def\InCa@@@Add#1!#2!#3#4!#5{%
+ \ifx\InCa@Empty#4\InCa@Empty
+ \csname InCa@Empty%
+ \@ReturnAfterElseFi{%
+ \InCa@ProcessAdd#1#3!#5#2%
+ }%
+ \else
+ \@ReturnAfterFi{%
+ \InCa@@@Add#1#3!#5#2!#4!%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@@@Sub}
+% \begin{macrocode}
+\def\InCa@@@Sub#1!#2!#3#4!#5{%
+ \ifx\InCa@Empty#4\InCa@Empty
+ \csname @gobble%
+ \@ReturnAfterElseFi{%
+ \InCa@ProcessSub#1#3!#5#2%
+ }%
+ \else
+ \@ReturnAfterFi{%
+ \InCa@@@Sub#1#3!#5#2!#4!%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@ProcessAdd}
+% \begin{macrocode}
+\def\InCa@ProcessAdd#1#2!#3#4{%
+ \ifx\InCa@Empty#2\InCa@Empty
+ \csname InCa@AddDigit#1\endcsname#3%
+ \romannumeral0#4%
+ \else
+ \csname InCa@AddDigit#1\csname InCa@DigitCarry#3%
+ \@ReturnAfterFi{%
+ \InCa@ProcessAdd#2!#4%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ProcessSub}
+% \begin{macrocode}
+\def\InCa@ProcessSub#1#2!#3#4{%
+ \ifx\InCa@Empty#2\InCa@Empty
+ \csname InCa@SubDigit#1\endcsname#3%
+ \romannumeral0#4%
+ \else
+ \csname InCa@SubDigit#1\csname InCa@DigitCarry#3%
+ \@ReturnAfterFi{%
+ \InCa@ProcessSub#2!#4%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@DigitCarry[0-9]}
+% \begin{macrocode}
+\def\InCa@Temp#1#2{%
+ \expandafter\def\csname InCa@DigitCarry#1\endcsname##1{%
+ \ifcase##1 %
+ \endcsname#1%
+ \else
+ \endcsname#2%
+ \fi
+ }%
+}
+\InCa@Temp 01
+\InCa@Temp 12
+\InCa@Temp 23
+\InCa@Temp 34
+\InCa@Temp 45
+\InCa@Temp 56
+\InCa@Temp 67
+\InCa@Temp 78
+\InCa@Temp 89
+\InCa@Temp 9{{10}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@AddDigit0}
+% \begin{macrocode}
+\expandafter\def\csname InCa@AddDigit0\endcsname#1{%
+ \ifnum#1>9 %
+ \endcsname10%
+ \else
+ \endcsname0#1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@AddDigit[1-9]}
+% \begin{macrocode}
+\def\InCa@Temp#1#2#3{%
+ \expandafter\def\csname InCa@AddDigit#1\endcsname##1{%
+ \ifnum##1>#2 %
+ \endcsname 1%
+ \else
+ \endcsname 0%
+ \fi
+ \ifcase##1 #1% 0
+ #3%
+ \else #1% 10
+ \fi
+ }%
+}
+\InCa@Temp 18{%
+ \or 2% 1
+ \or 3% 2
+ \or 4% 3
+ \or 5% 4
+ \or 6% 5
+ \or 7% 6
+ \or 8% 7
+ \or 9% 8
+ \or 0% 9
+}%
+\InCa@Temp 27{%
+ \or 3% 1
+ \or 4% 2
+ \or 5% 3
+ \or 6% 4
+ \or 7% 5
+ \or 8% 6
+ \or 9% 7
+ \or 0% 8
+ \or 1% 9
+}%
+\InCa@Temp 36{%
+ \or 4% 1
+ \or 5% 2
+ \or 6% 3
+ \or 7% 4
+ \or 8% 5
+ \or 9% 6
+ \or 0% 7
+ \or 1% 8
+ \or 2% 9
+}%
+\InCa@Temp 45{%
+ \or 5% 1
+ \or 6% 2
+ \or 7% 3
+ \or 8% 4
+ \or 9% 5
+ \or 0% 6
+ \or 1% 7
+ \or 2% 8
+ \or 3% 9
+}%
+\InCa@Temp 54{%
+ \or 6% 1
+ \or 7% 2
+ \or 8% 3
+ \or 9% 4
+ \or 0% 5
+ \or 1% 6
+ \or 2% 7
+ \or 3% 8
+ \or 4% 9
+}%
+\InCa@Temp 63{%
+ \or 7% 1
+ \or 8% 2
+ \or 9% 3
+ \or 0% 4
+ \or 1% 5
+ \or 2% 6
+ \or 3% 7
+ \or 4% 8
+ \or 5% 9
+}%
+\InCa@Temp 72{%
+ \or 8% 1
+ \or 9% 2
+ \or 0% 3
+ \or 1% 4
+ \or 2% 5
+ \or 3% 6
+ \or 4% 7
+ \or 5% 8
+ \or 6% 9
+}%
+\InCa@Temp 81{%
+ \or 9% 1
+ \or 0% 2
+ \or 1% 3
+ \or 2% 4
+ \or 3% 5
+ \or 4% 6
+ \or 5% 7
+ \or 6% 8
+ \or 7% 9
+}%
+\InCa@Temp 90{%
+ \or 0% 1
+ \or 1% 2
+ \or 2% 3
+ \or 3% 4
+ \or 4% 5
+ \or 5% 6
+ \or 6% 7
+ \or 7% 8
+ \or 8% 9
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@SubDigit[0-9]}
+% \begin{macrocode}
+\def\InCa@Temp#1#2{%
+ \expandafter\def\csname InCa@SubDigit#1\endcsname##1{%
+ \ifnum##1>#1 %
+ \endcsname 1%
+ \else
+ \endcsname 0%
+ \fi
+ \ifcase##1 #1% 0
+ #2%
+ \else #1% 10
+ \fi
+ }%
+}
+\InCa@Temp 0{%
+ \or 9% 1
+ \or 8% 2
+ \or 7% 3
+ \or 6% 4
+ \or 5% 5
+ \or 4% 6
+ \or 3% 7
+ \or 2% 8
+ \or 1% 9
+}
+\InCa@Temp 1{%
+ \or 0% 1
+ \or 9% 2
+ \or 8% 3
+ \or 7% 4
+ \or 6% 5
+ \or 5% 6
+ \or 4% 7
+ \or 3% 8
+ \or 2% 9
+}
+\InCa@Temp 2{%
+ \or 1% 1
+ \or 0% 2
+ \or 9% 3
+ \or 8% 4
+ \or 7% 5
+ \or 6% 6
+ \or 5% 7
+ \or 4% 8
+ \or 3% 9
+}
+\InCa@Temp 3{%
+ \or 2% 1
+ \or 1% 2
+ \or 0% 3
+ \or 9% 4
+ \or 8% 5
+ \or 7% 6
+ \or 6% 7
+ \or 5% 8
+ \or 4% 9
+}
+\InCa@Temp 4{%
+ \or 3% 1
+ \or 2% 2
+ \or 1% 3
+ \or 0% 4
+ \or 9% 5
+ \or 8% 6
+ \or 7% 7
+ \or 6% 8
+ \or 5% 9
+}
+\InCa@Temp 5{%
+ \or 4% 1
+ \or 3% 2
+ \or 2% 3
+ \or 1% 4
+ \or 0% 5
+ \or 9% 6
+ \or 8% 7
+ \or 7% 8
+ \or 6% 9
+}
+\InCa@Temp 6{%
+ \or 5% 1
+ \or 4% 2
+ \or 3% 3
+ \or 2% 4
+ \or 1% 5
+ \or 0% 6
+ \or 9% 7
+ \or 8% 8
+ \or 7% 9
+}
+\InCa@Temp 7{%
+ \or 6% 1
+ \or 5% 2
+ \or 4% 3
+ \or 3% 4
+ \or 2% 5
+ \or 1% 6
+ \or 0% 7
+ \or 9% 8
+ \or 8% 9
+}
+\InCa@Temp 8{%
+ \or 7% 1
+ \or 6% 2
+ \or 5% 3
+ \or 4% 4
+ \or 3% 5
+ \or 2% 6
+ \or 1% 7
+ \or 0% 8
+ \or 9% 9
+}
+\InCa@Temp 9{%
+ \or 8% 1
+ \or 7% 2
+ \or 6% 3
+ \or 5% 4
+ \or 4% 5
+ \or 3% 6
+ \or 2% 7
+ \or 1% 8
+ \or 0% 9
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Shl}, \op{Shr}}
+%
+% \begin{macro}{\intcalcShl}
+% \begin{macrocode}
+\def\intcalcShl#1{%
+ \number\expandafter\InCa@ShlSwitch\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ShlSwitch}
+% \begin{macrocode}
+\def\InCa@ShlSwitch#1#2!{%
+ \ifx#1-%
+ -\csname InCa@Empty%
+ \InCa@Shl#2!%
+ \else
+ \csname InCa@Empty%
+ \InCa@Shl#1#2!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcShl}
+% \begin{macrocode}
+\def\IntCalcShl#1!{%
+ \number
+ \csname InCa@Empty%
+ \InCa@Shl#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCal@ShlDigit}
+% \begin{macrocode}
+\def\InCa@Shl#1#2{%
+ \ifx#2!%
+ \csname InCa@ShlDigit#1\endcsname0%
+ \else
+ \csname InCa@ShlDigit#1%
+ \@ReturnAfterFi{%
+ \InCa@Shl#2%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ShlDigit0}
+% \begin{macrocode}
+\expandafter\def\csname InCa@ShlDigit0\endcsname{%
+ \endcsname0%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ShlDigit[1-9]}
+% \begin{macrocode}
+\def\InCa@Temp#1#2#3#4#5{%
+ \expandafter\def\csname InCa@ShlDigit#1\endcsname##1{%
+ \expandafter\endcsname
+ \ifcase##1 %
+ #2#3%
+ \else
+ #4#5%
+ \fi
+ }%
+}
+\InCa@Temp 10203
+\InCa@Temp 20405
+\InCa@Temp 30607
+\InCa@Temp 40809
+\InCa@Temp 51011
+\InCa@Temp 61213
+\InCa@Temp 71415
+\InCa@Temp 81617
+\InCa@Temp 91819
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcShr}
+% \begin{macrocode}
+\def\intcalcShr#1{%
+ \number\expandafter\InCa@ShrSwitch\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ShrSwitch}
+% \begin{macrocode}
+\def\InCa@ShrSwitch#1#2!{%
+ \ifx#1-%
+ -\InCa@Shr#2!%
+ \else
+ \InCa@Shr#1#2!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcShr}
+% \begin{macrocode}
+\def\IntCalcShr#1!{%
+ \number\InCa@Shr#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Shr}
+% \begin{macrocode}
+\def\InCa@Shr#1#2{%
+ \InCa@ShrDigit#1!%
+ \ifx#2!%
+ \else
+ \@ReturnAfterFi{%
+ \ifodd#1 %
+ \@ReturnAfterElseFi{%
+ \InCa@Shr{1#2}%
+ }%
+ \else
+ \expandafter\InCa@Shr\expandafter#2%
+ \fi
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\def\InCa@ShrDigit#1!{%
+ \ifcase#1 0% 0
+ \or 0% 1
+ \or 1% 2
+ \or 1% 3
+ \or 2% 4
+ \or 2% 5
+ \or 3% 6
+ \or 3% 7
+ \or 4% 8
+ \or 4% 9
+ \or 5% 10
+ \or 5% 11
+ \or 6% 12
+ \or 6% 13
+ \or 7% 14
+ \or 7% 15
+ \or 8% 16
+ \or 8% 17
+ \or 9% 18
+ \or 9% 19
+ \fi
+}
+% \end{macrocode}
+%
+% \subsubsection{\cs{InCa@Tim}}
+%
+% \begin{macro}{\InCa@Tim}
+% Macro \cs{InCa@Tim} implements
+% ``Number \emph{tim}es digit''.
+% \begin{macrocode}
+\def\InCa@Temp#1{%
+ \def\InCa@Tim##1##2{%
+ \number
+ \ifcase##2 % 0
+ 0%
+ \or % 1
+ ##1%
+ \else % 2-9
+ \csname InCa@Empty%
+ \InCa@ProcessTim##2##1!%
+ \fi
+ #1%
+ }%
+}
+\InCa@Temp{ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ProcessTim}
+% \begin{macrocode}
+\def\InCa@ProcessTim#1#2#3{%
+ \ifx#3!%
+ \csname InCa@TimDigit#2\endcsname#10%
+ \else
+ \csname InCa@TimDigit#2\csname InCa@Param#1%
+ \@ReturnAfterFi{%
+ \InCa@ProcessTim#1#3%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Param[0-9]}
+% \begin{macrocode}
+\def\InCa@Temp#1{%
+ \expandafter\def\csname InCa@Param#1\endcsname{%
+ \endcsname#1%
+ }%
+}
+\InCa@Temp 0%
+\InCa@Temp 1%
+\InCa@Temp 2%
+\InCa@Temp 3%
+\InCa@Temp 4%
+\InCa@Temp 5%
+\InCa@Temp 6%
+\InCa@Temp 7%
+\InCa@Temp 8%
+\InCa@Temp 9%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@TimDigit0}
+% \begin{macrocode}
+\expandafter\def\csname InCa@TimDigit0\endcsname#1#2{%
+ \endcsname
+ 0#2%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@TimDigit1}
+% \begin{macrocode}
+\expandafter\def\csname InCa@TimDigit1\endcsname#1#2{%
+ \ifcase#2 %
+ \endcsname 0#1%
+ \else
+ \csname InCa@AddDigit#1\endcsname #2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@TimDigit[2-9]}
+% \begin{macrocode}
+\def\InCa@Temp#1#2{%
+ \expandafter\def\csname InCa@TimDigit#1\endcsname##1{%
+ \expandafter\InCa@TimDigitCarry
+ \number
+ \ifcase##1 0% 0
+ #2%
+ \fi
+ !%
+ }%
+}
+\InCa@Temp 2{%
+ \or 2% 1
+ \or 4% 2
+ \or 6% 3
+ \or 8% 4
+ \or 10% 5
+ \or 12% 6
+ \or 14% 7
+ \or 16% 8
+ \or 18% 9
+}
+\InCa@Temp 3{%
+ \or 3% 1
+ \or 6% 2
+ \or 9% 3
+ \or 12% 4
+ \or 15% 5
+ \or 18% 6
+ \or 21% 7
+ \or 24% 8
+ \or 27% 9
+}
+\InCa@Temp 4{%
+ \or 4% 1
+ \or 8% 2
+ \or 12% 3
+ \or 16% 4
+ \or 20% 5
+ \or 24% 6
+ \or 28% 7
+ \or 32% 8
+ \or 36% 9
+}
+\InCa@Temp 5{%
+ \or 5% 1
+ \or 10% 2
+ \or 15% 3
+ \or 20% 4
+ \or 25% 5
+ \or 30% 6
+ \or 35% 7
+ \or 40% 8
+ \or 45% 9
+}
+\InCa@Temp 6{%
+ \or 6% 1
+ \or 12% 2
+ \or 18% 3
+ \or 24% 4
+ \or 30% 5
+ \or 36% 6
+ \or 42% 7
+ \or 48% 8
+ \or 54% 9
+}
+\InCa@Temp 7{%
+ \or 7% 1
+ \or 14% 2
+ \or 21% 3
+ \or 28% 4
+ \or 35% 5
+ \or 42% 6
+ \or 49% 7
+ \or 56% 8
+ \or 63% 9
+}
+\InCa@Temp 8{%
+ \or 8% 1
+ \or 16% 2
+ \or 24% 3
+ \or 32% 4
+ \or 40% 5
+ \or 48% 6
+ \or 56% 7
+ \or 64% 8
+ \or 72% 9
+}
+\InCa@Temp 9{%
+ \or 9% 1
+ \or 18% 2
+ \or 27% 3
+ \or 36% 4
+ \or 45% 5
+ \or 54% 6
+ \or 63% 7
+ \or 72% 8
+ \or 81% 9
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@TimDigitCarry}
+% \begin{macrocode}
+\def\InCa@TimDigitCarry#1!{%
+ \ifnum#1<10 %
+ \csname InCa@AddDigit#1\expandafter\endcsname
+ \else
+ \@ReturnAfterFi{%
+ \InCa@@TimDigitCarry#1!%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@@TimDigitCarry}
+% \begin{macrocode}
+\def\InCa@@TimDigitCarry#1#2!#3{%
+ \csname InCa@DigitCarry#1%
+ \csname InCa@AddDigit#2\endcsname #3%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Mul}}
+%
+% \begin{macro}{\intcalcMul}
+% \begin{macrocode}
+\def\intcalcMul#1#2{%
+ \number
+ \expandafter\InCa@MulSwitch
+ \number\number#1\expandafter!%
+ \number#2! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\InCa@MulSwitch}
+% Decision table for \cs{InCa@MulSwitch}.
+% \begin{quote}
+% \begin{tabular}[t]{@{}|l|l|l|l|l|@{}}
+% \hline
+% $x<0$ & $y<0$ & $ x< y$ & $+$ & $\opMul(-x,-y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opMul(-y,-x)$\\
+% \cline{2-5}
+% & else & $-x> y$ & $-$ & $\opMul(-x, y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opMul( y,-x)$\\
+% \hline
+% else & $y<0$ & $ x>-y$ & $-$ & $\opMul( x,-y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opMul(-y, x)$\\
+% \cline{2-5}
+% & else & $ x> y$ & $+$ & $\opMul( x, y)$\\
+% \cline{3-3}\cline{5-5}
+% & & else & & $\opMul( y, x)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\InCa@MulSwitch#1!#2!{%
+ \ifnum#1<\z@
+ \ifnum#2<\z@
+ \ifnum#1<#2 %
+ \expandafter\InCa@Mul\number-#1\expandafter!%
+ \@gobble#2!%
+ \else
+ \expandafter\InCa@Mul\number-#2\expandafter!%
+ \@gobble#1!%
+ \fi
+ \else
+ -%
+ \ifnum-#1>#2 %
+ \expandafter\InCa@Mul\@gobble#1!#2!%
+ \else
+ \expandafter\InCa@Mul\number#2\expandafter!%
+ \@gobble#1!%
+ \fi
+ \fi
+ \else
+ \ifnum#2<\z@
+ -%
+ \ifnum#1>-#2 %
+ \expandafter\InCa@Mul\number#1\expandafter!%
+ \@gobble#2!%
+ \else
+ \expandafter\InCa@Mul\@gobble#2!#1!%
+ \fi
+ \else
+ \ifnum#1>#2 %
+ \InCa@Mul#1!#2!%
+ \else
+ \InCa@Mul#2!#1!%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcMul}
+% \begin{macrocode}
+\def\IntCalcMul#1!#2!{%
+ \number\InCa@Mul#1!#2! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Mul}
+% \begin{macrocode}
+\def\InCa@Mul#1!#2!{%
+ \ifcase#2 %
+ 0%
+ \or
+ #1%
+ \or
+ \csname InCa@Empty%
+ \expandafter\InCa@Shl#1!%
+ \else
+ \ifnum#2<10 %
+ \InCa@Tim{#1}#2%
+ \else
+ \InCa@ProcessMul!#2!#1!%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Mul}
+% \begin{macrocode}
+\def\InCa@ProcessMul#1!#2#3!#4!{%
+ \ifx\InCa@Empty#3\InCa@Empty
+ \expandafter\InCa@Add\number
+ #10\expandafter\expandafter\expandafter!%
+ \InCa@Tim{#4}#2!%
+ \else
+ \ifx\InCa@Empty#1\InCa@Empty
+ \expandafter\expandafter\expandafter\InCa@ProcessMul
+ \InCa@Tim{#4}#2!%
+ #3!#4!%
+ \else
+ \expandafter\InCa@ProcessMul\number
+ \expandafter\InCa@Add\number%
+ #10\expandafter\expandafter\expandafter!%
+ \InCa@Tim{#4}#2!!%
+ #3!#4!%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Sqr}, \op{Fac}}
+%
+% \begin{macro}{\intcalcSqr}
+% \begin{macrocode}
+\def\intcalcSqr#1{%
+ \number\expandafter\InCa@Sqr\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Sqr}
+% \begin{macrocode}
+\def\InCa@Sqr#1#2!{%
+ \ifx#1-%
+ \InCa@Mul#2!#2!%
+ \else
+ \InCa@Mul#1#2!#1#2!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\intcalcFac}
+% \begin{macrocode}
+\def\intcalcFac#1{%
+ \number\expandafter\InCa@Fac\number#1! %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Pow}}
+%
+% \begin{macro}{\intcalcPow}
+% \begin{macrocode}
+\def\intcalcPow#1#2{%
+ \number\expandafter\InCa@Pow
+ \number\number#1\expandafter!%
+ \number#2! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Pow}
+% \begin{macrocode}
+\def\InCa@Pow#1#2!#3#4!{%
+ \ifcase#3#4 % power = 0
+ 1%
+ \or % power = 1
+ #1#2%
+ \or % power = 2
+ \ifx#1-%
+ \InCa@Mul#2!#2!%
+ \else
+ \InCa@Mul#1#2!#1#2!%
+ \fi
+ \else
+ \ifcase#1#2 % basis = 0, power <> 0
+ 0%
+ \ifx#3-% power < 0
+ 0\IntCalcError:DivisionByZero%
+ \fi
+ \or
+ 1% basis = 1
+ \else
+ \ifnum#1#2=\m@ne % basis = -1
+ \ifodd#3#4 %
+ -%
+ \fi
+ 1%
+ \else % |basis| > 1
+ \ifx#3-% power < 0
+ 0%
+ \else % power > 2
+ \ifx#1-% basis < 0
+ \ifodd#3#4 %
+ -%
+ \fi
+ \InCa@PowRec#2!#3#4!1!%
+ \else
+ \InCa@PowRec#1#2!#3#4!1!%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@PowRec}
+%\begin{quote}
+%\begin{verbatim}
+%Pow(b, p) {
+% PowRec(b, p, 1)
+%}
+%PowRec(b, p, r) {
+% if p == 1 then
+% return r
+% else
+% ifodd p then
+% return PowRec(b*b, p div 2, r*b) % p div 2 = (p-1)/2
+% else
+% return PowRec(b*b, p div 2, r)
+% fi
+% fi
+%}
+%\end{verbatim}
+%\end{quote}
+% \begin{macrocode}
+\def\InCa@PowRec#1!#2!#3!{%
+ \ifnum#2=\@ne
+ \ifnum#1>#3 %
+ \InCa@Mul#1!#3!%
+ \else
+ \InCa@Mul#3!#1!%
+ \fi
+ \else
+ \expandafter\InCa@PowRec
+ \number\InCa@Mul#1!#1!\expandafter!%
+ \number\intcalcShr{#2}\expandafter!%
+ \number
+ \ifodd#2 %
+ \ifnum#1>#3 %
+ \InCa@Mul#1!#3!%
+ \else
+ \InCa@Mul#3!#1!%
+ \fi
+ \else
+ #3%
+ \fi
+ \expandafter!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Div}}
+%
+% \begin{macro}{\intcalcDiv}
+% \begin{macrocode}
+\def\intcalcDiv#1#2{%
+ \number\expandafter\InCa@Div
+ \number\number#1\expandafter!%
+ \number#2! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@Div}
+% \begin{macrocode}
+\def\InCa@Div#1!#2!{%
+ \ifcase#2 %
+ 0\IntCalcError:DivisionByZero%
+ \else
+ \ifcase#1 %
+ 0%
+ \else
+ \expandafter\InCa@DivSwitch
+ \number#1\expandafter!%
+ \number#2!%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcDiv}
+% \begin{macrocode}
+\def\InCa@Temp#1{%
+ \def\IntCalcDiv##1!##2!{%
+ \number
+ \ifcase##2 %
+ 0\IntCalcError:DivisionByZero%
+ \else
+ \ifcase##1 %
+ 0%
+ \else
+ \InCa@@Div##1!##2!%
+ \fi
+ \fi
+ #1%
+ }%
+}
+\InCa@Temp{ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@DivSwitch}
+% Decision table for \cs{InCa@DivSwitch}.
+% \begin{quote}
+% \begin{tabular}[t]{@{}|l|l|l|l|@{}}
+% \hline
+% $x<0$ & $y<0$ & $+$ & $\opDiv(-x,-y)$\\
+% \cline{2-4}
+% & else & $-$ & $\opDiv(-x, y)$\\
+% \hline
+% else & $y<0$ & $-$ & $\opDiv( x,-y)$\\
+% \cline{2-4}
+% & else & $+$ & $\opDiv( x, y)$\\
+% \hline
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\InCa@DivSwitch#1!#2!{%
+ \ifnum#1<\z@
+ \ifnum#2<\z@
+ \expandafter\InCa@@Div\number-#1\expandafter!%
+ \@gobble#2!%
+ \else
+ -%
+ \expandafter\InCa@@Div\@gobble#1!#2!%
+ \fi
+ \else
+ \ifnum#2<\z@
+ -%
+ \expandafter\InCa@@Div\number#1\expandafter!%
+ \@gobble#2!%
+ \else
+ \InCa@@Div#1!#2!%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@@Div}
+% \begin{macrocode}
+\def\InCa@@Div#1!#2!{%
+ \ifnum#1>#2 %
+ \ifcase#2 % 0 already catched
+? \IntCalcError:ThisCannotHappen%
+ \or % 1
+ #1%
+ \or % 2
+ \InCa@Shr#1!%
+ \else
+ \InCa@DivStart!#1!#2!#2!%
+ \fi
+ \else
+ \ifnum#1=#2 %
+ 1%
+ \else
+ 0%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@DivStart}
+% \begin{macrocode}
+\def\InCa@DivStart#1!#2#3!#4#5{%
+ \ifx#5!%
+ \@ReturnAfterElseFi{%
+ \InCa@DivStartI{#1#2}#3=!%
+ }%
+ \else
+ \@ReturnAfterFi{%
+ \InCa@DivStart{#1#2}!#3!#5%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@StartI}
+% \begin{macrocode}
+\def\InCa@DivStartI#1!#2!{%
+ \expandafter\InCa@DivStartII
+ \number#2\expandafter\expandafter\expandafter!%
+ \intcalcShl{#2}!%
+ #1!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@StartII}
+% \begin{macrocode}
+\def\InCa@DivStartII#1!#2!{%
+ \expandafter\InCa@DivStartIII
+ \number#1\expandafter!%
+ \number#2\expandafter\expandafter\expandafter!%
+ \intcalcShl{#2}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@StartIII}
+% \begin{macrocode}
+\def\InCa@DivStartIII#1!#2!#3!{%
+ \expandafter\InCa@DivStartIV
+ \number#1\expandafter!%
+ \number#2\expandafter!%
+ \number#3\expandafter!%
+ \number\InCa@Add#3!#2!\expandafter\expandafter\expandafter!%
+ \intcalcShl{#3}!%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@StartIV}
+% \begin{macrocode}
+\def\InCa@DivStartIV#1!#2!#3!#4!#5!#6!{%
+ \InCa@ProcessDiv#6!#1!#2!#3!#4!#5!/%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ProcessDiv}
+% \begin{macrocode}
+\def\InCa@ProcessDiv#1#2#3!#4!#5!#6!#7!#8!#9/{%
+ #9%
+ \ifnum#1<#4 % 0
+ 0%
+ \ifx#2=%
+ \else
+ \InCa@ProcessDiv{#1#2}#3!#4!#5!#6!#7!#8!%
+ \fi
+ \else % 1-9
+ \ifnum#1<#5 % 1
+ 1%
+ \ifx#2=%
+ \else
+ \expandafter\InCa@ProcessDiv\expandafter{%
+ \number\InCa@Sub#1!#4!%
+ #2%
+ }#3!#4!#5!#6!#7!#8!%
+ \fi
+ \else % 2-9
+ \ifnum#1<#7 % 2 3 4 5
+ \ifnum#1<#6 % 2 3
+ \@ReturnAfterElseFi{%
+ \expandafter\InCa@@ProcessDiv
+ \number\InCa@Sub#1!#5!!%
+ 23%
+ }%
+ \else % 4 5
+ \@ReturnAfterFi{%
+ \expandafter\InCa@@ProcessDiv
+ \number\InCa@Sub#1!#6!!%
+ 45%
+ }%
+ \fi
+ #2#3!#4!#5!#6!#7!#8!%
+ \else % 6 7 8 9
+ \ifnum#1<#8 % 6 7
+ \@ReturnAfterElseFi{%
+ \expandafter\InCa@@ProcessDiv
+ \number\InCa@Sub#1!#7!!%
+ 67%
+ }%
+ \else % 8 9
+ \@ReturnAfterFi{%
+ \expandafter\InCa@@ProcessDiv
+ \number\InCa@Sub#1!#8!!%
+ 89%
+ }%
+ \fi
+ #2#3!#4!#5!#6!#7!#8!%
+ \fi
+ \fi
+ \fi
+ \ifx#2=%
+ \expandafter\@gobble
+ \fi
+ /%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@@ProcessDiv}
+% \begin{macrocode}
+\def\InCa@@ProcessDiv#1!#2#3#4#5!#6!{%
+ \ifnum#1<#6 %
+ #2%
+ \@ReturnAfterElseFi{%
+ \ifx#4=%
+ \expandafter\InCa@CleanupIV
+ \else
+ \@ReturnAfterFi{%
+ \InCa@ProcessDiv{#1#4}#5!#6!%
+ }%
+ \fi
+ }%
+ \else
+ #3%
+ \@ReturnAfterFi{%
+ \ifx#4=%
+ \expandafter\InCa@CleanupIV
+ \else
+ \@ReturnAfterFi{%
+ \expandafter\InCa@ProcessDiv\expandafter{%
+ \number\InCa@Sub#1!#6! %
+ #4%
+ }#5!#6!%
+ }%
+ \fi
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@CleanupIV}
+% \begin{macrocode}
+\def\InCa@CleanupIV#1!#2!#3!#4!{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\op{Mod}}
+%
+% \begin{macro}{\intcalcMod}
+% \begin{macrocode}
+\def\intcalcMod#1#2{%
+ \number\expandafter\InCa@Mod
+ \number\number#1\expandafter!%
+ \number#2! %
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\intcalc@Mod}
+% Pseudocode/decision table for \cs{intcalc@Mod}.
+% \begin{quote}
+% \begin{tabular}{@{}lll@{}}
+% if & $y=0$ & DivisionByZero\\
+% elsif & $y<0$ & $-\opMod(-x,-y)$\\
+% elsif & $x=0$ & 0\\
+% elsif & $y=1$ & 0\\
+% elsif & $y=2$ & $\opOdd(x)\mathbin{?}1\mathbin{:}0$\\
+% elsif & $x<0$ &
+% $z\leftarrow x-(x/y)*y;\quad (z<0)\mathbin{?}z+y\mathbin{:}z$\\
+% else & & $x-(x/y)*y$\\
+% \\
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\InCa@Mod#1!#2!{%
+ \ifcase#2 %
+ 0\IntCalcError:DivisionByZero%
+ \else
+ \ifnum#2<\z@
+ -%
+ \expandafter\InCa@Mod
+ \number-#1\expandafter!%
+ \number-#2!%
+ \else
+ \ifcase#1 %
+ 0%
+ \else
+ \ifcase#2 % 0 already catched
+? \IntCalcError:ThisCannotHappen%
+ \or % 1
+ 0%
+ \or % 2
+ \ifodd#1 1\else 0\fi
+ \else
+ \ifnum#1<\z@
+ \expandafter\InCa@ModShift
+ \number-%
+ \expandafter\InCa@Sub
+ \number\@gobble#1\expandafter!%
+ \number\intcalcMul{#2}{%
+ \expandafter\InCa@Div\@gobble#1!#2!%
+ }!%
+ !#2!%
+ \else
+ \expandafter\InCa@Sub\number#1\expandafter!%
+ \number\intcalcMul{#2}{\InCa@Div#1!#2!}!%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IntCalcMod}
+% \begin{macrocode}
+\def\InCa@Temp#1{%
+ \def\IntCalcMod##1!##2!{%
+ \number
+ \ifcase##2 %
+ 0\IntCalcError:DivisionByZero%
+ \else
+ \ifcase##1 %
+ 0%
+ \else
+ \ifcase##2 % 0 already catched
+? \IntCalcError:ThisCannotHappen
+ \or % 1
+ 0%
+ \or % 2
+ \ifodd ##1 1\else 0\fi
+ \else
+ \expandafter\InCa@Sub\number##1\expandafter!%
+ \number\intcalcMul{##2}{\InCa@Div##1!##2!}!%
+ \fi
+ \fi
+ \fi
+ #1%
+ }%
+}
+\InCa@Temp{ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\InCa@ModShift}
+% \begin{macrocode}
+\def\InCa@ModShift#1!#2!{%
+ \ifnum#1<\z@
+ \expandafter\InCa@Sub\number#2\expandafter!%
+ \@gobble#1!%
+ \else
+ #1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Help macros}
+%
+% \begin{macro}{\InCa@Empty}
+% \begin{macrocode}
+\def\InCa@Empty{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@gobble}
+% \begin{macrocode}
+\expandafter\ifx\csname @gobble\endcsname\relax
+ \long\def\@gobble#1{}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ReturnAfterFi}
+% \begin{macrocode}
+\long\def\@ReturnAfterFi#1\fi{\fi#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ReturnAfterElseFi}
+% \begin{macrocode}
+\long\def\@ReturnAfterElseFi#1\else#2\fi{\fi#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\InCa@AtEnd%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \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 intcalc.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \subsubsection{Preamble with test macro definitions}
+%
+% \begin{macrocode}
+%<*test2|test4>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{article}
+%<noetex>\let\SavedNumexpr\numexpr
+%<noetex>\let\numexpr\UNDEFINED
+\makeatletter
+\chardef\InCa@TestMode=1 %
+\makeatother
+\usepackage{intcalc}[2016/05/16]
+%<noetex>\let\numexpr\SavedNumexpr
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+%</test2|test4>
+%<*test2>
+\newcommand*{\TestSpaceAtEnd}[1]{%
+%<noetex> \let\SavedNumexpr\numexpr
+%<noetex> \let\numexpr\UNDEFINED
+ \edef\resultA{#1}%
+ \edef\resultB{#1 }%
+%<noetex> \let\numexpr\SavedNumexpr
+ \Expect*{\resultA\space}*{\resultB}%
+}
+\newcommand*{\TestResult}[2]{%
+%<noetex> \let\SavedNumexpr\numexpr
+%<noetex> \let\numexpr\UNDEFINED
+ \edef\result{#1}%
+%<noetex> \let\numexpr\SavedNumexpr
+ \Expect*{\result}{#2}%
+}
+\newcommand*{\TestResultTwoExpansions}[2]{%
+%<*noetex>
+ \begingroup
+ \let\numexpr\UNDEFINED
+ \expandafter\expandafter\expandafter
+ \endgroup
+%</noetex>
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{#1}{#2}%
+}
+\newcount\TestCount
+%<etex>\newcommand*{\TestArg}[1]{\numexpr#1\relax}
+%<noetex>\newcommand*{\TestArg}[1]{#1}
+\newcommand*{\TestTeXDivide}[2]{%
+ \TestCount=\TestArg{#1}\relax
+ \divide\TestCount by \TestArg{#2}\relax
+ \Expect*{\intcalcDiv{#1}{#2}}*{\the\TestCount}%
+}
+\newcommand*{\Test}[2]{%
+ \TestResult{#1}{#2}%
+ \TestResultTwoExpansions{#1}{#2}%
+ \TestSpaceAtEnd{#1}%
+}
+\newcommand*{\TestExch}[2]{\Test{#2}{#1}}
+\newcommand*{\TestInv}[2]{%
+ \Test{\intcalcInv{#1}}{#2}%
+}
+\newcommand*{\TestNum}[2]{%
+ \Test{\intcalcNum{#1}}{#2}%
+}
+\newcommand*{\TestAbs}[2]{%
+ \Test{\intcalcAbs{#1}}{#2}%
+}
+\newcommand*{\TestSgn}[2]{%
+ \Test{\intcalcSgn{#1}}{#2}%
+}
+\newcommand*{\TestMin}[3]{%
+ \Test{\intcalcMin{#1}{#2}}{#3}%
+}
+\newcommand*{\TestMax}[3]{%
+ \Test{\intcalcMax{#1}{#2}}{#3}%
+}
+\newcommand*{\TestCmp}[3]{%
+ \Test{\intcalcCmp{#1}{#2}}{#3}%
+}
+\newcommand*{\TestInc}[2]{%
+ \Test{\intcalcInc{#1}}{#2}%
+ \ifnum\intcalcNum{#1}>-1 %
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcInc\intcalcNum{#1}!%
+ }{#2}%
+ }%
+ \x
+ \fi
+}
+\newcommand*{\TestDec}[2]{%
+ \Test{\intcalcDec{#1}}{#2}%
+ \ifnum\intcalcNum{#1}>0 %
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcDec\intcalcNum{#1}!%
+ }{#2}%
+ }%
+ \x
+ \fi
+}
+\newcommand*{\TestAdd}[3]{%
+ \Test{\intcalcAdd{#1}{#2}}{#3}%
+ \ifnum\intcalcNum{#1}>0 %
+ \ifnum\intcalcNum{#2}> 0 %
+ \ifnum\intcalcCmp{#1}{#2}>0 %
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcAdd
+ \intcalcNum{#1}!\intcalcNum{#2}!%
+ }{#3}%
+ }%
+ \x
+ \else
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcAdd
+ \intcalcNum{#2}!\intcalcNum{#1}!%
+ }{#3}%
+ }%
+ \x
+ \fi
+ \fi
+ \fi
+}
+\newcommand*{\TestSub}[3]{%
+ \Test{\intcalcSub{#1}{#2}}{#3}%
+ \ifnum\intcalcNum{#1}>0 %
+ \ifnum\intcalcNum{#2}> 0 %
+ \ifnum\intcalcCmp{#1}{#2}>0 %
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcSub
+ \intcalcNum{#1}!\intcalcNum{#2}!%
+ }{#3}%
+ }%
+ \x
+ \fi
+ \fi
+ \fi
+}
+\newcommand*{\TestShl}[2]{%
+ \Test{\intcalcShl{#1}}{#2}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcShl\intcalcAbs{#1}!%
+ }{\intcalcAbs{#2}}%
+ }%
+ \x
+}
+\newcommand*{\TestShr}[2]{%
+ \Test{\intcalcShr{#1}}{#2}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcShr\intcalcAbs{#1}!%
+ }{\intcalcAbs{#2}}%
+ }%
+ \x
+}
+\newcommand*{\TestMul}[3]{%
+ \Test{\intcalcMul{#1}{#2}}{#3}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcMul\intcalcAbs{#1}!\intcalcAbs{#2}!%
+ }{\intcalcAbs{#3}}%
+ }%
+ \x
+}
+\newcommand*{\TestSqr}[2]{%
+ \Test{\intcalcSqr{#1}}{#2}%
+}
+\newcommand*{\TestFac}[2]{%
+ \expandafter\TestExch\expandafter{\the\numexpr#2}{\intcalcFac{#1}}%
+}
+\newcommand*{\TestPow}[3]{%
+ \Test{\intcalcPow{#1}{#2}}{#3}%
+}
+\newcommand*{\TestDiv}[3]{%
+ \Test{\intcalcDiv{#1}{#2}}{#3}%
+ \TestTeXDivide{#1}{#2}%
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcDiv\intcalcAbs{#1}!\intcalcAbs{#2}!%
+ }{\intcalcAbs{#3}}%
+ }%
+}
+\newcommand*{\TestMod}[3]{%
+ \Test{\intcalcMod{#1}{#2}}{#3}%
+ \ifcase\ifcase\intcalcSgn{#1} 0%
+ \or
+ \ifcase\intcalcSgn{#2} 1%
+ \or 0%
+ \else 1%
+ \fi
+ \else
+ \ifcase\intcalcSgn{#2} 1%
+ \or 1%
+ \else 0%
+ \fi
+ \fi\relax
+ \edef\x{%
+ \noexpand\Test{%
+ \noexpand\IntCalcMod
+ \intcalcAbs{#1}!\intcalcAbs{#2}!%
+ }{\intcalcAbs{#3}}%
+ }%
+ \x
+ \fi
+}
+%</test2>
+% \end{macrocode}
+%
+% \subsubsection{Time}
+%
+% \begin{macrocode}
+%<*test2>
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfresettimer\endcsname\relax
+\else
+ \makeatletter
+ \newcount\SummaryTime
+ \newcount\TestTime
+ \SummaryTime=\z@
+ \newcommand*{\PrintTime}[2]{%
+ \typeout{%
+ [Time #1: \strip@pt\dimexpr\number#2sp\relax\space s]%
+ }%
+ }%
+ \newcommand*{\StartTime}[1]{%
+ \renewcommand*{\TimeDescription}{#1}%
+ \pdfresettimer
+ }%
+ \newcommand*{\TimeDescription}{}%
+ \newcommand*{\StopTime}{%
+ \TestTime=\pdfelapsedtime
+ \global\advance\SummaryTime\TestTime
+ \PrintTime\TimeDescription\TestTime
+ }%
+ \let\saved@qstest\qstest
+ \let\saved@endqstest\endqstest
+ \def\qstest#1#2{%
+ \saved@qstest{#1}{#2}%
+ \StartTime{#1}%
+ }%
+ \def\endqstest{%
+ \StopTime
+ \saved@endqstest
+ }%
+ \AtEndDocument{%
+ \PrintTime{summary}\SummaryTime
+ }%
+ \makeatother
+\fi
+%</test2>
+% \end{macrocode}
+%
+% \subsubsection{Test 4: additional mod/div operations}
+%
+% \begin{macrocode}
+%<*test4>
+\newcommand*{\TestDo}[2]{%
+ \ifcase\numexpr#2\relax
+ \else
+ \edef\temp{\intcalcMod{#1}{#2}}%
+ \Expect*{%
+ \the\numexpr
+ \intcalcMul{%
+ \intcalcDiv{\intcalcAbs{#1}}{\intcalcAbs{#2}}%
+ }{\intcalcAbs{#2}}%
+ +\intcalcMod{\intcalcAbs{#1}}{\intcalcAbs{#2}}\relax
+ }*{\the\numexpr\intcalcAbs{#1}\relax}%
+ \fi
+}
+\newcommand*{\TestOne}[2]{%
+ \TestDo{#1}{#1}%
+}
+\newcommand*{\TestTwo}[3]{%
+ \TestDo{#1}{#2}%
+ \TestDo{#2}{#1}%
+}
+\let\TestNum\TestOne
+\let\TestInv\TestOne
+\let\TestAbs\TestOne
+\let\TestSgn\TestOne
+\let\TestMin\TestTwo
+\let\TestMax\TestTwo
+\let\TestCmp\TestTwo
+\let\TestInc\TestOne
+\let\TestDec\TestOne
+\let\TestAdd\TestTwo
+\let\TestSub\TestTwo
+\let\TestShl\TestOne
+\let\TestShr\TestOne
+\let\TestMul\TestTwo
+\let\TestSqr\TestOne
+\def\TestFac#1#2{}
+\let\TestPow\TestTwo
+\let\TestDiv\TestTwo
+\let\TestMod\TestTwo
+%</test4>
+% \end{macrocode}
+%
+% \subsubsection{Test sets}
+%
+% \begin{macrocode}
+%<*test2|test4>
+\makeatletter
+
+\begin{qstest}{num}{num}%
+ \TestNum{0}{0}%
+ \TestNum{1}{1}%
+ \TestNum{-1}{-1}%
+ \TestNum{10}{10}%
+ \TestNum{-10}{-10}%
+ \TestNum{2147483647}{2147483647}%
+ \TestNum{-2147483647}{-2147483647}%
+ \TestNum{ 0 }{0}%
+ \TestNum{ 1 }{1}%
+ \TestNum{--1}{1}%
+ \TestNum{ - + - + 4 }{4}%
+ \TestNum{\z@}{0}%
+ \TestNum{\@ne}{1}%
+ \TestNum{\m@ne}{-1}%
+%<*etex>
+ \TestNum{-10+30}{20}%
+ \TestNum{10-30}{-20}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{inv}{inv}%
+ \TestInv{0}{0}%
+ \TestInv{1}{-1}%
+ \TestInv{-1}{1}%
+ \TestInv{10}{-10}%
+ \TestInv{-10}{10}%
+ \TestInv{2147483647}{-2147483647}%
+ \TestInv{-2147483647}{2147483647}%
+ \TestInv{ 0 }{0}%
+ \TestInv{ 1 }{-1}%
+ \TestInv{--1}{-1}%
+ \TestInv{\z@}{0}%
+ \TestInv{\@ne}{-1}%
+ \TestInv{\m@ne}{1}%
+%<*etex>
+ \TestInv{-10+30}{-20}%
+ \TestInv{10-30}{20}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{abs}{abs}%
+ \TestAbs{0}{0}%
+ \TestAbs{1}{1}%
+ \TestAbs{-1}{1}%
+ \TestAbs{10}{10}%
+ \TestAbs{-10}{10}%
+ \TestAbs{2147483647}{2147483647}%
+ \TestAbs{-2147483647}{2147483647}%
+ \TestAbs{ 0 }{0}%
+ \TestAbs{ 1 }{1}%
+ \TestAbs{--1}{1}%
+ \TestAbs{\z@}{0}%
+ \TestAbs{\@ne}{1}%
+ \TestAbs{\m@ne}{1}%
+%<*etex>
+ \TestAbs{-10+30}{20}%
+ \TestAbs{10-30}{20}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{sign}{sign}%
+ \TestSgn{0}{0}%
+ \TestSgn{1}{1}%
+ \TestSgn{-1}{-1}%
+ \TestSgn{10}{1}%
+ \TestSgn{-10}{-1}%
+ \TestSgn{2147483647}{1}%
+ \TestSgn{-2147483647}{-1}%
+ \TestSgn{ 0 }{0}%
+ \TestSgn{ 2 }{1}%
+ \TestSgn{ -2 }{-1}%
+ \TestSgn{--2}{1}%
+ \TestSgn{\z@}{0}%
+ \TestSgn{\@ne}{1}%
+ \TestSgn{\m@ne}{-1}%
+%<*etex>
+ \TestSgn{-10+30}{1}%
+ \TestSgn{10-30}{-1}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{min}{min}%
+ \TestMin{0}{1}{0}%
+ \TestMin{1}{0}{0}%
+ \TestMin{-10}{-20}{-20}%
+ \TestMin{ 1 }{ 2 }{1}%
+ \TestMin{ 2 }{ 1 }{1}%
+ \TestMin{1}{1}{1}%
+ \TestMin{\z@}{\@ne}{0}%
+ \TestMin{\@ne}{\m@ne}{-1}%
+%<*etex>
+ \TestMin{1+2}{3+4}{3}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{max}{max}%
+ \TestMax{0}{1}{1}%
+ \TestMax{1}{0}{1}%
+ \TestMax{-10}{-20}{-10}%
+ \TestMax{ 1 }{ 2 }{2}%
+ \TestMax{ 2 }{ 1 }{2}%
+ \TestMax{1}{1}{1}%
+ \TestMax{\z@}{\@ne}{1}%
+ \TestMax{\@ne}{\m@ne}{1}%
+%<*etex>
+ \TestMax{1+2}{3+4}{7}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{cmp}{cmp}%
+ \TestCmp{0}{0}{0}%
+ \TestCmp{-21}{17}{-1}%
+ \TestCmp{3}{4}{-1}%
+ \TestCmp{-10}{-10}{0}%
+ \TestCmp{-10}{-11}{1}%
+ \TestCmp{100}{5}{1}%
+ \TestCmp{2147483647}{-2147483647}{1}%
+ \TestCmp{-2147483647}{2147483647}{-1}%
+ \TestCmp{2147483647}{2147483647}{0}%
+ \TestCmp{\z@}{\@ne}{-1}%
+ \TestCmp{\@ne}{\m@ne}{1}%
+ \TestCmp{ 4 }{ 5 }{-1}%
+ \TestCmp{ -3 }{ -7 }{1}%
+%<*etex>
+ \TestCmp{1+2}{3+4}{-1}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{fac}{fac}
+ \TestFac{0}{1}%
+ \TestFac{1}{1}%
+ \TestFac{2}{2}%
+ \TestFac{3}{2*3}%
+ \TestFac{4}{2*3*4}%
+ \TestFac{5}{2*3*4*5}%
+ \TestFac{6}{2*3*4*5*6}%
+ \TestFac{7}{2*3*4*5*6*7}%
+ \TestFac{8}{2*3*4*5*6*7*8}%
+ \TestFac{9}{2*3*4*5*6*7*8*9}%
+ \TestFac{10}{2*3*4*5*6*7*8*9*10}%
+ \TestFac{11}{2*3*4*5*6*7*8*9*10*11}%
+ \TestFac{12}{2*3*4*5*6*7*8*9*10*11*12}%
+\end{qstest}
+
+\begin{qstest}{inc}{inc}%
+ \TestInc{0}{1}%
+ \TestInc{1}{2}%
+ \TestInc{-1}{0}%
+ \TestInc{10}{11}%
+ \TestInc{-10}{-9}%
+ \TestInc{999}{1000}%
+ \TestInc{-1000}{-999}%
+ \TestInc{129}{130}%
+ \TestInc{2147483646}{2147483647}%
+ \TestInc{-2147483647}{-2147483646}%
+\end{qstest}
+
+\begin{qstest}{dec}{dec}%
+ \TestDec{0}{-1}%
+ \TestDec{1}{0}%
+ \TestDec{-1}{-2}%
+ \TestDec{10}{9}%
+ \TestDec{-10}{-11}%
+ \TestDec{1000}{999}%
+ \TestDec{-999}{-1000}%
+ \TestDec{130}{129}%
+ \TestDec{2147483647}{2147483646}%
+ \TestDec{-2147483646}{-2147483647}%
+\end{qstest}
+
+\begin{qstest}{add}{add}%
+ \TestAdd{0}{0}{0}%
+ \TestAdd{1}{0}{1}%
+ \TestAdd{0}{1}{1}%
+ \TestAdd{1}{2}{3}%
+ \TestAdd{-1}{-1}{-2}%
+ \TestAdd{2147483646}{1}{2147483647}%
+ \TestAdd{-2147483647}{2147483647}{0}%
+ \TestAdd{20}{-5}{15}%
+ \TestAdd{-4}{-1}{-5}%
+ \TestAdd{-1}{-4}{-5}%
+ \TestAdd{-4}{1}{-3}%
+ \TestAdd{-1}{4}{3}%
+ \TestAdd{4}{-1}{3}%
+ \TestAdd{1}{-4}{-3}%
+ \TestAdd{-4}{-1}{-5}%
+ \TestAdd{-1}{-4}{-5}%
+ \TestAdd{ -4 }{ -1 }{-5}%
+ \TestAdd{ -1 }{ -4 }{-5}%
+ \TestAdd{ -4 }{ 1 }{-3}%
+ \TestAdd{ -1 }{ 4 }{3}%
+ \TestAdd{ 4 }{ -1 }{3}%
+ \TestAdd{ 1 }{ -4 }{-3}%
+ \TestAdd{ -4 }{ -1 }{-5}%
+ \TestAdd{ -1 }{ -4 }{-5}%
+ \TestAdd{876543210}{111111111}{987654321}%
+ \TestAdd{999999999}{2}{1000000001}%
+%<*etex>
+ \TestAdd{100}{50+150}{300}%
+ \TestAdd{2147483647}{10-2147483647}{10}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{sub}{sub}
+ \TestSub{0}{0}{0}%
+ \TestSub{1}{0}{1}%
+ \TestSub{1}{2}{-1}%
+ \TestSub{-1}{-1}{0}%
+ \TestSub{2147483646}{-1}{2147483647}%
+ \TestSub{-2147483647}{-2147483647}{0}%
+ \TestSub{-4}{-1}{-3}%
+ \TestSub{-1}{-4}{3}%
+ \TestSub{-4}{1}{-5}%
+ \TestSub{-1}{4}{-5}%
+ \TestSub{4}{-1}{5}%
+ \TestSub{1}{-4}{5}%
+ \TestSub{-4}{-1}{-3}%
+ \TestSub{-1}{-4}{3}%
+ \TestSub{ -4 }{ -1 }{-3}%
+ \TestSub{ -1 }{ -4 }{3}%
+ \TestSub{ -4 }{ 1 }{-5}%
+ \TestSub{ -1 }{ 4 }{-5}%
+ \TestSub{ 4 }{ -1 }{5}%
+ \TestSub{ 1 }{ -4 }{5}%
+ \TestSub{ -4 }{ -1 }{-3}%
+ \TestSub{ -1 }{ -4 }{3}%
+ \TestSub{1000000000}{2}{999999998}%
+ \TestSub{987654321}{111111111}{876543210}%
+%<*etex>
+ \TestSub{100}{50+150}{-100}%
+ \TestSub{2147483647}{-10+2147483647}{10}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{shl}{shl}
+ \TestShl{0}{0}%
+ \TestShl{1}{2}%
+ \TestShl{5621}{11242}%
+ \TestShl{1073741823}{2147483646}%
+ \TestShl{-1}{-2}%
+ \TestShl{-5621}{-11242}%
+\end{qstest}
+
+\begin{qstest}{shr}{shr}
+ \TestShr{0}{0}%
+ \TestShr{1}{0}%
+ \TestShr{2}{1}%
+ \TestShr{3}{1}%
+ \TestShr{4}{2}%
+ \TestShr{5}{2}%
+ \TestShr{6}{3}%
+ \TestShr{7}{3}%
+ \TestShr{8}{4}%
+ \TestShr{9}{4}%
+ \TestShr{10}{5}%
+ \TestShr{11}{5}%
+ \TestShr{12}{6}%
+ \TestShr{13}{6}%
+ \TestShr{14}{7}%
+ \TestShr{15}{7}%
+ \TestShr{16}{8}%
+ \TestShr{17}{8}%
+ \TestShr{18}{9}%
+ \TestShr{19}{9}%
+ \TestShr{20}{10}%
+ \TestShr{21}{10}%
+ \TestShr{22}{11}%
+ \TestShr{11241}{5620}%
+ \TestShr{73054202}{36527101}%
+ \TestShr{2147483646}{1073741823}%
+ \TestShr{-1}{0}%
+ \TestShr{-2}{-1}%
+ \TestShr{-3}{-1}%
+ \TestShr{-11241}{-5620}%
+\end{qstest}
+
+\begin{qstest}{mul}{mul}
+ \TestMul{0}{0}{0}%
+ \TestMul{1}{0}{0}%
+ \TestMul{0}{1}{0}%
+ \TestMul{1}{1}{1}%
+ \TestMul{3}{1}{3}%
+ \TestMul{1}{-3}{-3}%
+ \TestMul{-4}{-5}{20}%
+ \TestMul{3}{7}{21}%
+ \TestMul{7}{3}{21}%
+ \TestMul{3}{-7}{-21}%
+ \TestMul{7}{-3}{-21}%
+ \TestMul{-3}{7}{-21}%
+ \TestMul{-7}{3}{-21}%
+ \TestMul{-3}{-7}{21}%
+ \TestMul{-7}{-3}{21}%
+ \TestMul{12}{11}{132}%
+ \TestMul{999}{333}{332667}%
+ \TestMul{1000}{4321}{4321000}%
+ \TestMul{12345}{173955}{2147474475}%
+ \TestMul{1073741823}{2}{2147483646}%
+ \TestMul{2}{1073741823}{2147483646}%
+ \TestMul{-1073741823}{2}{-2147483646}%
+ \TestMul{2}{-1073741823}{-2147483646}%
+%<*etex>
+ \TestMul{2+3}{5+7}{60}%
+ \TestMul{2147483647}{2147483647/2147483647}{2147483647}%
+%</etex>
+\end{qstest}
+
+\begin{qstest}{sqr}{sqr}
+ \TestSqr{0}{0}%
+ \TestSqr{1}{1}%
+ \TestSqr{2}{4}%
+ \TestSqr{3}{9}%
+ \TestSqr{4}{16}%
+ \TestSqr{9}{81}%
+ \TestSqr{10}{100}%
+ \TestSqr{46340}{2147395600}%
+ \TestSqr{-1}{1}%
+ \TestSqr{-2}{4}%
+ \TestSqr{-46340}{2147395600}%
+\end{qstest}
+
+\begin{qstest}{pow}{pow}
+ \TestPow{-2}{0}{1}%
+ \TestPow{-1}{0}{1}%
+ \TestPow{0}{0}{1}%
+ \TestPow{1}{0}{1}%
+ \TestPow{2}{0}{1}%
+ \TestPow{3}{0}{1}%
+ \TestPow{-2}{1}{-2}%
+ \TestPow{-1}{1}{-1}%
+ \TestPow{1}{1}{1}%
+ \TestPow{2}{1}{2}%
+ \TestPow{3}{1}{3}%
+ \TestPow{-2}{2}{4}%
+ \TestPow{-1}{2}{1}%
+ \TestPow{0}{2}{0}%
+ \TestPow{1}{2}{1}%
+ \TestPow{2}{2}{4}%
+ \TestPow{3}{2}{9}%
+ \TestPow{0}{1}{0}%
+ \TestPow{1}{-2}{1}%
+ \TestPow{1}{-1}{1}%
+ \TestPow{-1}{-2}{1}%
+ \TestPow{-1}{-1}{-1}%
+ \TestPow{-1}{3}{-1}%
+ \TestPow{-1}{4}{1}%
+ \TestPow{-2}{-1}{0}%
+ \TestPow{-2}{-2}{0}%
+ \TestPow{2}{3}{8}%
+ \TestPow{2}{4}{16}%
+ \TestPow{2}{5}{32}%
+ \TestPow{2}{6}{64}%
+ \TestPow{2}{7}{128}%
+ \TestPow{2}{8}{256}%
+ \TestPow{2}{9}{512}%
+ \TestPow{2}{10}{1024}%
+ \TestPow{-2}{3}{-8}%
+ \TestPow{-2}{4}{16}%
+ \TestPow{-2}{5}{-32}%
+ \TestPow{-2}{6}{64}%
+ \TestPow{-2}{7}{-128}%
+ \TestPow{-2}{8}{256}%
+ \TestPow{-2}{9}{-512}%
+ \TestPow{-2}{10}{1024}%
+ \TestPow{3}{3}{27}%
+ \TestPow{3}{4}{81}%
+ \TestPow{3}{5}{243}%
+ \TestPow{-3}{3}{-27}%
+ \TestPow{-3}{4}{81}%
+ \TestPow{-3}{5}{-243}%
+ \TestPow{2}{30}{1073741824}%
+ \TestPow{-3}{19}{-1162261467}%
+ \TestPow{5}{13}{1220703125}%
+ \TestPow{-7}{11}{-1977326743}%
+\end{qstest}
+
+\begin{qstest}{div}{div}
+ \TestDiv{1}{1}{1}%
+ \TestDiv{2}{1}{2}%
+ \TestDiv{-2}{1}{-2}%
+ \TestDiv{2}{-1}{-2}%
+ \TestDiv{-2}{-1}{2}%
+ \TestDiv{15}{2}{7}%
+ \TestDiv{-16}{2}{-8}%
+ \TestDiv{1}{2}{0}%
+ \TestDiv{1}{3}{0}%
+ \TestDiv{2}{3}{0}%
+ \TestDiv{-2}{3}{0}%
+ \TestDiv{2}{-3}{0}%
+ \TestDiv{-2}{-3}{0}%
+ \TestDiv{13}{3}{4}%
+ \TestDiv{-13}{-3}{4}%
+ \TestDiv{-13}{3}{-4}%
+ \TestDiv{-6}{5}{-1}%
+ \TestDiv{-5}{5}{-1}%
+ \TestDiv{-4}{5}{0}%
+ \TestDiv{-3}{5}{0}%
+ \TestDiv{-2}{5}{0}%
+ \TestDiv{-1}{5}{0}%
+ \TestDiv{0}{5}{0}%
+ \TestDiv{1}{5}{0}%
+ \TestDiv{2}{5}{0}%
+ \TestDiv{3}{5}{0}%
+ \TestDiv{4}{5}{0}%
+ \TestDiv{5}{5}{1}%
+ \TestDiv{6}{5}{1}%
+ \TestDiv{-5}{4}{-1}%
+ \TestDiv{-4}{4}{-1}%
+ \TestDiv{-3}{4}{0}%
+ \TestDiv{-2}{4}{0}%
+ \TestDiv{-1}{4}{0}%
+ \TestDiv{0}{4}{0}%
+ \TestDiv{1}{4}{0}%
+ \TestDiv{2}{4}{0}%
+ \TestDiv{3}{4}{0}%
+ \TestDiv{4}{4}{1}%
+ \TestDiv{5}{4}{1}%
+ \TestDiv{12345}{678}{18}%
+ \TestDiv{32372}{5952}{5}%
+ \TestDiv{284271294}{18162}{15651}%
+ \TestDiv{217652429}{12561}{17327}%
+ \TestDiv{462028434}{5439}{84947}%
+ \TestDiv{2147483647}{1000}{2147483}%
+ \TestDiv{2147483647}{-1000}{-2147483}%
+ \TestDiv{-2147483647}{1000}{-2147483}%
+ \TestDiv{-2147483647}{-1000}{2147483}%
+\end{qstest}
+
+\begin{qstest}{mod}{mod}
+ \TestMod{-6}{5}{4}%
+ \TestMod{-5}{5}{0}%
+ \TestMod{-4}{5}{1}%
+ \TestMod{-3}{5}{2}%
+ \TestMod{-2}{5}{3}%
+ \TestMod{-1}{5}{4}%
+ \TestMod{0}{5}{0}%
+ \TestMod{1}{5}{1}%
+ \TestMod{2}{5}{2}%
+ \TestMod{3}{5}{3}%
+ \TestMod{4}{5}{4}%
+ \TestMod{5}{5}{0}%
+ \TestMod{6}{5}{1}%
+ \TestMod{-5}{4}{3}%
+ \TestMod{-4}{4}{0}%
+ \TestMod{-3}{4}{1}%
+ \TestMod{-2}{4}{2}%
+ \TestMod{-1}{4}{3}%
+ \TestMod{0}{4}{0}%
+ \TestMod{1}{4}{1}%
+ \TestMod{2}{4}{2}%
+ \TestMod{3}{4}{3}%
+ \TestMod{4}{4}{0}%
+ \TestMod{5}{4}{1}%
+ \TestMod{-6}{-5}{-1}%
+ \TestMod{-5}{-5}{0}%
+ \TestMod{-4}{-5}{-4}%
+ \TestMod{-3}{-5}{-3}%
+ \TestMod{-2}{-5}{-2}%
+ \TestMod{-1}{-5}{-1}%
+ \TestMod{0}{-5}{0}%
+ \TestMod{1}{-5}{-4}%
+ \TestMod{2}{-5}{-3}%
+ \TestMod{3}{-5}{-2}%
+ \TestMod{4}{-5}{-1}%
+ \TestMod{5}{-5}{0}%
+ \TestMod{6}{-5}{-4}%
+ \TestMod{-5}{-4}{-1}%
+ \TestMod{-4}{-4}{0}%
+ \TestMod{-3}{-4}{-3}%
+ \TestMod{-2}{-4}{-2}%
+ \TestMod{-1}{-4}{-1}%
+ \TestMod{0}{-4}{0}%
+ \TestMod{1}{-4}{-3}%
+ \TestMod{2}{-4}{-2}%
+ \TestMod{3}{-4}{-1}%
+ \TestMod{4}{-4}{0}%
+ \TestMod{5}{-4}{-3}%
+ \TestMod{2147483647}{1000}{647}%
+ \TestMod{2147483647}{-1000}{-353}%
+ \TestMod{-2147483647}{1000}{353}%
+ \TestMod{-2147483647}{-1000}{-647}%
+ \TestMod{ 0 }{ 4 }{0}%
+ \TestMod{ 1 }{ 4 }{1}%
+ \TestMod{ -1 }{ 4 }{3}%
+ \TestMod{ 0 }{ -4 }{0}%
+ \TestMod{ 1 }{ -4 }{-3}%
+ \TestMod{ -1 }{ -4 }{-1}%
+%<*etex>
+ \TestMod{1+2}{1+3}{3}%
+ \TestMod{1-2}{1+3}{3}%
+ \TestMod{1-2}{1-4}{-1}%
+ \TestMod{1+2}{1-4}{0}%
+ \TestMod{1+2}{1-5}{-1}%
+%</etex>
+\end{qstest}
+%</test2|test4>
+% \end{macrocode}
+% \begin{macrocode}
+%<*test2>
+\newcommand*{\TestError}[2]{%
+ \begingroup
+ \expandafter\def\csname IntCalcError:#1\endcsname{}%
+ \Expect*{#2}{0}%
+ \expandafter\def\csname IntCalcError:#1\endcsname{ERROR}%
+ \Expect*{#2}{0ERROR }%
+ \endgroup
+}
+\begin{qstest}{error}{error}
+ \TestError{FacNegative}{\intcalcFac{-1}}%
+ \TestError{FacNegative}{\intcalcFac{-2147483647}}%
+ \TestError{FacOverflow}{\intcalcFac{13}}%
+ \TestError{FacOverflow}{\intcalcFac{2147483647}}%
+ \TestError{DivisionByZero}{\intcalcPow{0}{-1}}%
+ \TestError{DivisionByZero}{\intcalcDiv{1}{0}}%
+ \TestError{DivisionByZero}{\intcalcMod{1}{0}}%
+ \TestError{DivisionByZero}{\IntCalcDiv1!0!}%
+ \TestError{DivisionByZero}{\IntCalcMod1!0!}%
+\end{qstest}
+%</test2>
+% \end{macrocode}
+% \begin{macrocode}
+%<*test2|test4>
+\begin{document}
+\end{document}
+%</test2|test4>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/intcalc}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/intcalc.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/intcalc.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[\CTAN{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 intcalc.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@{}}
+% intcalc.sty & tex/generic/oberdiek/intcalc.sty\\
+% intcalc.pdf & doc/latex/oberdiek/intcalc.pdf\\
+% test/intcalc-test1.tex & doc/latex/oberdiek/test/intcalc-test1.tex\\
+% test/intcalc-test2.tex & doc/latex/oberdiek/test/intcalc-test2.tex\\
+% test/intcalc-test3.tex & doc/latex/oberdiek/test/intcalc-test3.tex\\
+% test/intcalc-test4.tex & doc/latex/oberdiek/test/intcalc-test4.tex\\
+% intcalc.dtx & source/latex/oberdiek/intcalc.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk intcalc.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{intcalc.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 intcalc.dtx
+%makeindex -s gind.ist intcalc.idx
+%pdflatex intcalc.dtx
+%makeindex -s gind.ist intcalc.idx
+%pdflatex intcalc.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{intcalc.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='intcalc'>
+ <name>intcalc</name>
+ <caption>Expandable arithmetic operations with integers.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.2'/>
+ <description>
+ This package provides expandable arithmetic operations
+ with integers, using the e-TeX extension <tt>\numexpr</tt> if it
+ is available.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/intcalc.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/intcalc.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/09/09 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/09/27 v1.1}
+% \item
+% \cs{intcalcNum} added.
+% \item
+% \cs{intcalcShl} and \cs{intcalcShr} allow negative numbers.
+% The sign is preserved.
+% \item
+% Reuse \cs{@gobble} instead of own macro \cs{IntCalc@Gobble}.
+% \item
+% Small fixes.
+% \item
+% Shorter internal prefix.
+% \item
+% Some programmer's interface.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.2}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/intcalc.pdf b/macros/latex/contrib/oberdiek/intcalc.pdf
new file mode 100644
index 0000000000..65d448bfbf
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/intcalc.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/kvdefinekeys.dtx b/macros/latex/contrib/oberdiek/kvdefinekeys.dtx
new file mode 100644
index 0000000000..f6d3313a6a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/kvdefinekeys.dtx
@@ -0,0 +1,792 @@
+% \iffalse meta-comment
+%
+% File: kvdefinekeys.dtx
+% Version: 2016/05/16 v1.4
+% Info: Define keys
+%
+% Copyright (C) 2010, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 kvdefinekeys.dtx
+% and the derived files
+% kvdefinekeys.sty, kvdefinekeys.pdf, kvdefinekeys.ins, kvdefinekeys.drv,
+% kvdefinekeys-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/kvdefinekeys.dtx
+% CTAN:macros/latex/contrib/oberdiek/kvdefinekeys.pdf
+%
+% Unpacking:
+% (a) If kvdefinekeys.ins is present:
+% tex kvdefinekeys.ins
+% (b) Without kvdefinekeys.ins:
+% tex kvdefinekeys.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{kvdefinekeys.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If kvdefinekeys.drv is present:
+% latex kvdefinekeys.drv
+% (b) Without kvdefinekeys.drv:
+% latex kvdefinekeys.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 kvdefinekeys.dtx
+% makeindex -s gind.ist kvdefinekeys.idx
+% pdflatex kvdefinekeys.dtx
+% makeindex -s gind.ist kvdefinekeys.idx
+% pdflatex kvdefinekeys.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/kvdefinekeys.sty
+% TDS:doc/latex/oberdiek/kvdefinekeys.pdf
+% TDS:doc/latex/oberdiek/test/kvdefinekeys-test1.tex
+% TDS:source/latex/oberdiek/kvdefinekeys.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: kvdefinekeys
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2010, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 kvdefinekeys.dtx
+and the derived files
+ kvdefinekeys.sty, kvdefinekeys.pdf, kvdefinekeys.ins, kvdefinekeys.drv,
+ kvdefinekeys-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{kvdefinekeys.ins}{\from{kvdefinekeys.dtx}{install}}%
+ \file{kvdefinekeys.drv}{\from{kvdefinekeys.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{kvdefinekeys.sty}{\from{kvdefinekeys.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{kvdefinekeys-test1.tex}{\from{kvdefinekeys.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{kvdefinekeys.xml}{\from{kvdefinekeys.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{* kvdefinekeys.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `kvdefinekeys.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{kvdefinekeys.drv}%
+ [2016/05/16 v1.4 Define keys (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{kvdefinekeys.dtx}%
+\end{document}
+%</driver>
+% \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{kvdefinekeys.drv}
+%
+% \title{The \xpackage{kvdefinekeys} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{kvdefinekeys} provides \cs{kv@define@key} to define
+% keys the same way as \xpackage{keyval}'s \cs{define@key}. However, it
+% works also using \iniTeX.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \def\M#1{\texttt{\{}\meta{#1}\texttt{\}}}
+%
+% \section{Documentation}
+%
+% \subsection{Motivation}
+%
+% \cs{kvsetkeys} serves as replacement for \xpackage{keyval}'s
+% \cs{setkeys}. This package adds macros to define keys, closing
+% the gap \cs{kvsetkeys} leaves.
+%
+% \begin{declcs}{kv@define@key}\,\M{family}\,\M{key}\,[\meta{default}]\,^^A
+% \M{definition}
+% \end{declcs}
+% Macro \cs{kv@define@key} reimplements \xpackage{keyval}'s
+% \cs{define@key}. Differences to the original:
+% \begin{itemize}
+% \item The defined keys also allow \cs{par} inside values.
+% \item Shorthands of package \xpackage{babel} are supported in
+% family and key names.
+% \item Macro \cs{kv@define@key} is made robust if
+% \hologo{eTeX}'s \cs{protected} or \hologo{LaTeX}'s
+% \cs{DeclareRobustCommand} are found.
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@kvdefinekeys.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{kvdefinekeys}{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@kvdefinekeys.sty\endcsname
+\ProvidesPackage{kvdefinekeys}%
+ [2016/05/16 v1.4 Define keys (HO)]%
+% \end{macrocode}
+%
+% \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 KVD@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\KVD@AtEnd{%
+ \KVD@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\KVD@AtEnd{\KVD@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Package loading}
+%
+% \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{ltxcmds}[2010/03/01]%
+\else
+ \RequirePackage{ltxcmds}[2010/03/01]%
+\fi
+% \end{macrocode}
+%
+%
+% \subsection{Provide key defining macro}
+%
+% \begin{macro}{\kv@define@key}
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\kv@define@key#1#2%
+ }{%
+ \DeclareRobustCommand*{\kv@define@key}[2]%
+ }%
+}{%
+ \protected\def\kv@define@key#1#2%
+}%
+{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \let\ifincsname\iftrue
+ \edef\KVD@temp{\endgroup
+ \noexpand\KVD@DefineKey{#1}{#2}%
+ }%
+ \KVD@temp
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVD@DefineKey}
+% \begin{macrocode}
+\def\KVD@DefineKey#1#2{%
+ \ltx@ifnextchar[{%
+ \KVD@DefineKeyWithDefault{#1}{#2}%
+ }{%
+ \long\expandafter\def\csname KV@#1@#2\endcsname##1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVD@DefineKeyWithDefault}
+% \begin{macrocode}
+\long\def\KVD@DefineKeyWithDefault#1#2[#3]{%
+ \expandafter\def\csname KV@#1@#2@default\expandafter\endcsname
+ \expandafter{%
+ \csname KV@#1@#2\endcsname{#3}%
+ }%
+ \long\expandafter\def\csname KV@#1@#2\endcsname##1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\KVD@AtEnd%
+%</package>
+% \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 kvdefinekeys.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/kvdefinekeys}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/kvdefinekeys.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/kvdefinekeys.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[\CTAN{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 kvdefinekeys.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@{}}
+% kvdefinekeys.sty & tex/generic/oberdiek/kvdefinekeys.sty\\
+% kvdefinekeys.pdf & doc/latex/oberdiek/kvdefinekeys.pdf\\
+% test/kvdefinekeys-test1.tex & doc/latex/oberdiek/test/kvdefinekeys-test1.tex\\
+% kvdefinekeys.dtx & source/latex/oberdiek/kvdefinekeys.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk kvdefinekeys.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{kvdefinekeys.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 kvdefinekeys.dtx
+%makeindex -s gind.ist kvdefinekeys.idx
+%pdflatex kvdefinekeys.dtx
+%makeindex -s gind.ist kvdefinekeys.idx
+%pdflatex kvdefinekeys.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{kvdefinekeys.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='kvdefinekeys'>
+ <name>kvdefinekeys</name>
+ <caption>Define keys for use in the kvsetkeys package.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2010,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ The package provides a macro <tt>\kv@define@key</tt> (analogous to
+ <xref refid='keyval'>keyval&#x2019;s</xref> <tt>\define@key</tt>, to
+ define keys for use by <xref refid='kvsetkeys'>kvsetkeys</xref>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/kvdefinekeys.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/kvdefinekeys.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{keyval}
+% David Carlisle:
+% \textit{The \xpackage{keyval} package};
+% 1999/03/16 v1.13;
+% \CTAN{macros/latex/required/graphics/keyval.dtx}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2010/03/01 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2010/08/19 v1.1}
+% \item
+% Documentation fix, no code change.
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.2}
+% \item
+% Already loaded package files are not input in \hologo{plainTeX}.
+% \end{Version}
+% \begin{Version}{2011/04/07 v1.3}
+% \item
+% Support for package \xpackage{babel}'s shorthands added.
+% \item
+% \cs{kv@define@key} is made robust if available.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/kvdefinekeys.pdf b/macros/latex/contrib/oberdiek/kvdefinekeys.pdf
new file mode 100644
index 0000000000..a54a7b0544
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/kvdefinekeys.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/kvoptions.dtx b/macros/latex/contrib/oberdiek/kvoptions.dtx
new file mode 100644
index 0000000000..07a40c307a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/kvoptions.dtx
@@ -0,0 +1,3439 @@
+% \iffalse meta-comment
+%
+% File: kvoptions.dtx
+% Version: 2016/05/16 v3.12
+% Info: Key value format for package options
+%
+% Copyright (C) 2004, 2006, 2007, 2009-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file kvoptions.dtx
+% and the derived files
+% kvoptions.sty, kvoptions.pdf, kvoptions.ins, kvoptions.drv,
+% kvoptions-patch.sty, example-mycolorsetup.sty,
+% kvoptions-test1.tex, kvoptions-test2.tex,
+% kvoptions-test3.tex, kvoptions-test4.tex,
+% kvoptions-test4.sty.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/kvoptions.dtx
+% CTAN:macros/latex/contrib/oberdiek/kvoptions.pdf
+%
+% Unpacking:
+% (a) If kvoptions.ins is present:
+% tex kvoptions.ins
+% (b) Without kvoptions.ins:
+% tex kvoptions.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{kvoptions.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If kvoptions.drv is present:
+% latex kvoptions.drv
+% (b) Without kvoptions.drv:
+% latex kvoptions.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 kvoptions.dtx
+% makeindex -s gind.ist kvoptions.idx
+% pdflatex kvoptions.dtx
+% makeindex -s gind.ist kvoptions.idx
+% pdflatex kvoptions.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/kvoptions.sty
+% TDS:tex/latex/oberdiek/kvoptions-patch.sty
+% TDS:doc/latex/oberdiek/kvoptions.pdf
+% TDS:doc/latex/oberdiek/example-mycolorsetup.sty
+% TDS:doc/latex/oberdiek/test/kvoptions-test1.tex
+% TDS:doc/latex/oberdiek/test/kvoptions-test2.tex
+% TDS:doc/latex/oberdiek/test/kvoptions-test3.tex
+% TDS:doc/latex/oberdiek/test/kvoptions-test4.tex
+% TDS:doc/latex/oberdiek/test/kvoptions-test4.sty
+% TDS:source/latex/oberdiek/kvoptions.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: kvoptions
+Version: 2016/05/16 v3.12
+
+Copyright (C) 2004, 2006, 2007, 2009-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file kvoptions.dtx
+and the derived files
+ kvoptions.sty, kvoptions.pdf, kvoptions.ins, kvoptions.drv,
+ kvoptions-patch.sty, example-mycolorsetup.sty,
+ kvoptions-test1.tex, kvoptions-test2.tex,
+ kvoptions-test3.tex, kvoptions-test4.tex,
+ kvoptions-test4.sty.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{kvoptions.ins}{\from{kvoptions.dtx}{install}}%
+ \file{kvoptions.drv}{\from{kvoptions.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{kvoptions.sty}{\from{kvoptions.dtx}{package}}%
+ \file{kvoptions-patch.sty}{\from{kvoptions.dtx}{patch}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{example-mycolorsetup.sty}{\from{kvoptions.dtx}{example}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{kvoptions-test1.tex}{\from{kvoptions.dtx}{test1}}%
+% \file{kvoptions-test2.tex}{\from{kvoptions.dtx}{test2}}%
+% \file{kvoptions-test3.tex}{\from{kvoptions.dtx}{test3}}%
+% \file{kvoptions-test4.tex}{\from{kvoptions.dtx}{test4}}%
+% \file{kvoptions-test4.sty}{\from{kvoptions.dtx}{test4pkg}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{kvoptions.xml}{\from{kvoptions.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{* kvoptions.sty, kvoptions-patch.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `kvoptions.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{kvoptions.drv}%
+ [2016/05/16 v3.12 Key value format for package options (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{kvoptions.dtx}%
+\end{document}
+%</driver>
+% \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{kvoptions.drv}
+%
+% \title{The \xpackage{kvoptions} package}
+% \date{2016/05/16 v3.12}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package is intended for package authors who want to
+% use options in key value format for their package options.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \def\M#1{\texttt{\{}\meta{#1}\texttt{\}}}
+% \def\O#1{\texttt{[}\meta{#1}\texttt{]}}
+%
+% \section{Introduction}
+%
+% First I want to recommend the very good review article
+% ``A guide to key-value methods'' by Joseph Wright \cite{tb94wright}.
+% It introduces the different key-value packages and compares them.
+%
+% \subsection{The beginning}
+%
+% This package \xpackage{kvoptions} addresses class or package writers
+% that want to allow their users to specify options
+% as key value pairs, e.g.:
+% \begin{quote}
+% |\documentclass[verbose=false,name=me]{myclass}|\\
+% |\usepackage[format=print]{mylayout}|
+% \end{quote}
+% Prominent example is package \xpackage{hyperref},
+% probably the first package that offers this service.
+% It's \cs{ProcessOptionsWithKV} is often copied und
+% used in other packages, e.g. package \xpackage{helvet}
+% that uses this interface for its option \xoption{scaled}.
+%
+% However copying code is not the most modern software
+% development technique. And \xpackage{hyperref}'s
+% code for \cs{ProcessOptionsWithKV} was changed
+% to fix bugs. The version used in other packages
+% depends on the time of copying and the awareness
+% of \xpackage{hyperref}'s changes.
+% Now the code is sourced out into this package and
+% available for other package or class writers.
+%
+% \subsection{Overview}
+%
+% Package \xpackage{kvoptions} connects package
+% \xpackage{\emph{k}ey\emph{v}al}
+% with \LaTeX's package and class \emph{options}:
+% \begin{center}
+% \def\T#1{\bfseries #1}
+% \renewcommand{\arraystretch}{1.5}
+% \begin{tabular}{l|l|l}
+% \T{Package \xpackage{keyval}}
+% & \T{Package \xpackage{kvoptions}}
+% & \T{\LaTeX\ kernel}
+% \\
+% \hline
+% \cs{define@key}
+% &
+% \renewcommand*{\arraystretch}{1}^^A
+% \begin{tabular}[t]{@{}l@{}}
+% \cs{DeclareVoidOption}\\
+% \cs{DeclareStringOption}\\
+% \cs{DeclareBoolOption}\\
+% \cs{DeclareComplementaryOption}\\
+% \cs{DisableKeyvalOption}
+% \end{tabular}
+% & \cs{DeclareOption}
+% \\
+% \hline
+% & \cs{DeclareDefaultOption}
+% & \cs{DeclareOption*}
+% \\
+% \hline
+% & \cs{ProcessKeyvalOptions}
+% & \cs{ProcessOptions*}
+% \\
+% \hline
+% & Option \xoption{patch}
+% &
+% \renewcommand*{\arraystretch}{1}^^A
+% \begin{tabular}[t]{@{}l@{}}
+% Class/package\\
+% option system
+% \end{tabular}
+% \\
+% \hline
+% & \cs{SetupKeyvalOptions} &
+% \\
+% \end{tabular}
+% \end{center}
+%
+% \hypersetup{bookmarksopenlevel=3}
+% \section{Usage}
+%
+% \subsection{Process options}
+%
+% \subsubsection{\cs{ProcessKeyvalOptions}}
+%
+% \begin{declcs}{ProcessKeyvalOptions}\,\M{family}\\
+% \cs{ProcessKeyvalOptions} \*
+% \end{declcs}
+% This command evaluates the global or local options of
+% the package that are defined with \xpackage{keyval}'s
+% interface within the family \meta{family}. It acts the
+% same way as \LaTeX's \cs{ProcessOptions*}. In a package
+% unknown global options are ignored, in a class they
+% are added to the unknown option list. The known global
+% options and all local options are passed to \xpackage{keyval}'s
+% \cs{setkeys} command for executing the options.
+% Unknown options are reported to the user by an error.
+%
+% If the family name happens to be the same as the name
+% of the package or class where \cs{ProcessKeyvalOptions}
+% is used or the family name has previously been setup by
+% \cs{SetupKeyvalOptions}, then \cs{ProcessKeyvalOptions}
+% knows the family name already and you can use the star form
+% without mandatory argument.
+%
+% \subsubsection{\cs{ProcessLocalKeyvalOptions}}
+%
+% \begin{declcs}{ProcessLocalKeyvalOptions}\,\M{family}\\
+% \cs{ProcessLocalKeyvalOptions} \*
+% \end{declcs}
+% This macro has the same syntax and works similar as
+% \cs{ProcessKeyvalOptions}. However it ignores
+% global options and only processes the local package options.
+% Therefore it only can be used inside a package.
+% An error is thrown, if it is used inside a class.
+%
+% Neither of the following macros are necessary for
+% \cs{ProcessKeyvalOptions{}}. They just help the package/class
+% author in common tasks.
+%
+% \subsubsection{\cs{SetupKeyvalOptions}}\label{setup}
+%
+% \begin{declcs}{SetupKeyvalOptions}\,\texttt{\{}\\
+% \hspace{1.5em}|family|\,|=|\,\meta{family}|,|\\
+% \hspace{1.5em}|prefix|\,|=|\,\meta{prefix}\\
+% \hspace{1.5em}|setkeys|\,|=|\,\meta{setkeys command}\\
+% \texttt{\}}
+% \end{declcs}
+% This command allows to configure the default assumptions
+% that are based on the current package or class name.
+% \LaTeX\ remembers this name in \cs{@currname}. The syntax
+% description of the default looks a little weird, therefor
+% an example is given for a package or class named |foobar|.
+% \begin{quote}
+% \begin{tabular}{@{}l|ll|l@{}}
+% Key & Default & (example) & Used by\\
+% \hline
+% \rule{0pt}{1.2\ht\csname @arstrutbox\endcsname}^^A
+% |family| & \meta{\cs{@currname}} & (|foobar|)
+% & \cs{ProcessKeyvalOptions*} \\
+% &&& \cs{DeclareBoolOption} \\
+% &&& \cs{DeclareStringOption} \\
+% \hline
+% \rule{0pt}{1.2\ht\csname @arstrutbox\endcsname}^^A
+% |prefix| & \meta{\cs{@currname}}|@| & (|foobar@|)
+% & \cs{DeclareBoolOption} \\
+% &&& \cs{DeclareStringOption} \\
+% &&& \cs{DeclareVoidOption} \\
+% \hline
+% \rule{0pt}{1.2\ht\csname @arstrutbox\endcsname}^^A
+% |setkeys| & \cs{setkeys} & (\cs{kvsetkeys})
+% & \cs{ProcessKeyvalOptions} \\
+% &&& \cs{ProcessLocalKeyvalOptions}
+% \end{tabular}
+% \end{quote}
+% Key |setkeys| was added in version 3.9. The original
+% \cs{setkeys} of package \xpackage{keyval} is not reentrant.
+% If an option is processed by this \cs{setkeys}, then
+% the option should not call \cs{setkeys} again with a
+% different family. Otherwise the next options of the
+% first \cs{setkeys} call are processed with the wrong
+% family. With key |setkeys| the macro \cs{kvsetkeys}
+% can be set that does not have the problem of the
+% original \cs{setkeys} of package {keyval}.
+%
+% Probably \cs{setkeys} of package \xpackage{xkeyval}
+% is safe in this respect. But I haven't made a full
+% analysis. At least it does not have the problem
+% of the original \cs{setkeys}.
+%
+% \subsection{Option declarations}
+%
+% The options for \cs{ProcessKeyvalOptions} are defined
+% by \xpackage{keyval}'s \cs{define@key}.
+% Common purposes of such keys are boolean switches, they
+% enable or disable something. Or they store a name or some kind of
+% string in a macro. The following commands help the user. He
+% declares what he wants and \xpackage{kvoptions} take care of
+% the key definition, resource allocation and initialization.
+%
+% In order to avoid name clashes of macro names, internal
+% commands are prefixed. Both the prefix and the family
+% name for the defined keys can be configured by
+% \cs{SetupKeyvalOptions}.
+%
+% \subsubsection{\cs{DeclareStringOption}}
+%
+% \begin{declcs}{DeclareStringOption}\,\O{init}\,\M{key}\,\O{default}
+% \end{declcs}
+% A macro is created that remembers the value of the key \meta{key}.
+% The name of the macro consists of the option name \meta{key} that
+% is prefixed by the prefix (see \ref{setup}).
+% The initial contents of the
+% macro can be given by the first optional argument \meta{init}.
+% The default is empty.
+%
+% The the option \meta{key} is defined. The option code
+% just stores its value in the macro. If the optional argument
+% at the end of \cs{DeclareStringOption} is given, then option
+% \meta{key} is defined with the default \meta{default}.
+%
+% Example for a package with the following two lines:
+% \begin{quote}
+% |\ProvidesPackage{foobar}|\\
+% |\DeclareStringOption[me]{name}|
+% \end{quote}
+% Then \cs{DeclareStringOption} defines the macro with content |me|,
+% note \LaTeX\ complains if the name of the macro already exists:
+% \begin{quote}
+% |\newcommand*{\foobar@name}{me}|
+% \end{quote}
+% The option definition is similar to:
+% \begin{quote}
+% |\define@key{foobar}{name}{%|\\
+% | \renewcommand*{\foobar@name}{#1}%|\\
+% |}|
+% \end{quote}
+%
+% \subsubsection{\cs{DeclareBoolOption}}
+%
+% \begin{declcs}{DeclareBoolOption}\,\O{init}\,\M{key}
+% \end{declcs}
+% A boolean switch is generated, initialized by value \meta{init}
+% and the corresponding key \meta{key} is defined. If the
+% initialization value is not given, |false| is used as default.
+%
+% The internal actions of \cs{DeclareBoolOption} are shown below.
+% The example is given for a package author who has the following
+% two lines in his package/class:
+% \begin{quote}
+% |\ProvidesPackage{foobar}|\\
+% |\DeclareBoolOption{verbose}|
+% \end{quote}
+% First a new switch is created:
+% \begin{quote}
+% |\newif\iffoobar@verbose|
+% \end{quote}
+% and initialized:
+% \begin{quote}
+% |\foobar@verbosefalse|
+% \end{quote}
+% Finally the key is defined:
+% \begin{quote}
+% |\define@key{foobar}{verbose}[true]{|\dots|}|
+% \end{quote}
+% The option code configures the boolean option in the following way:
+% If the author specifies |true| or |false| then the switch is
+% turned on or off respectivly. Also the option can be given without
+% explicit value. Then the switch is enabled.
+% Other values are reported as errors.
+%
+% Now the switch is ready to use in the package/class, e.g.:
+% \begin{quote}
+% |\iffoobar@verbose|\\
+% \qquad\textit{\% print verbose message}\\
+% |\else|\\
+% \qquad\textit{\% be quiet}\\
+% |\fi|
+% \end{quote}
+% Users of package \cs{ifthen} can use the switch as
+% boolean:
+% \begin{quote}
+% |\boolean{foobar@verbose}|
+% \end{quote}
+%
+% \subsubsection{\cs{DeclareComplementaryOption}}
+%
+% \begin{declcs}{DeclareComplementaryOption}\,\M{key}\,\M{parent}
+% \end{declcs}
+% Sometimes contrasting names are used to characterize the
+% two states of a boolean switch, for example \xoption{draft}
+% vs.\@ \xoption{final}. Both options behave like boolean
+% options but they do not need two different switches, they
+% should share one. \cs{DeclareComplementaryOption} allows this.
+% The option \meta{key} shares the switch of option \meta{parent}.
+% Example:
+% \begin{quote}
+% |\DeclareBoolOption{draft}|\\
+% |\DeclareComplementaryOption{final}{draft}|
+% \end{quote}
+% Then |final| sets the switch of \xoption{draft} to |false|, and
+% |final=false| enables the \xoption{draft} switch.
+%
+% \subsubsection{\cs{DeclareVoidOption}}
+%
+% \begin{declcs}{DeclareVoidOption}\,\M{key}\,\M{code}
+% \end{declcs}
+% \cs{ProcessKeyvalOptions} can be extended to recognize
+% options that are declared in traditional way by \cs{DeclareOption}.
+% But in case of the error that the user specifies a value, then
+% this option would not recognized as key value option because
+% of \cs{DeclareOption} and not detected as traditional option
+% because of the value part. The user would get an unknown option
+% error, difficult to understand.
+%
+% \cs{DeclareVoidOption} solves
+% this problem. It defines the option \meta{key} as key value option.
+% If the user specifies a value, a warning is given and the
+% value is ignored.
+%
+% The code part \meta{code} is stored in a macro.
+% The name of the macro consists of the option name \meta{key} that
+% is prefixed by the prefix (see \ref{setup}).
+% If the option is set, the macro will be executed. During the
+% execution \cs{CurrentOption} is available with the current key name.
+%
+% \subsubsection{\cs{DeclareDefaultOption}}
+%
+% \begin{declcs}{DeclareDefaultOption}\,\M{code}
+% \end{declcs}
+% \begin{sloppypar}
+% This command does not define a specific key, it is the equivalent
+% to \LaTeX's \cs{DeclareOption*}. It allows the specification
+% of a default action \meta{code} that is invoked if an unknown option
+% is found.
+% While \meta{code} is called,
+% macro \cs{CurrentOption} contains the current option string.
+% In addition \cs{CurrentOptionValue} contains the value part
+% if the option string is parsable as key value pair, otherwise
+% it is \cs{relax}. \cs{CurrentOptionKey} contains the key of
+% the key value pair, or the whole option string, if it misses
+% the equal sign.
+% \end{sloppypar}
+%
+% Inside packages typical default actions are to pass unknown
+% options to another package. Or an error message can be thrown
+% by \cs{@unknownoptionerror}. This is the original error
+% message that \LaTeX\ gives for unkown package options.
+% This error message is easier to understand for the user
+% as the error message from package \xpackage{keyval} that
+% is given otherwise.
+%
+% A Class ignores unknown options and puts them on the
+% unused option list. Let \LaTeX\ do the job and just
+% call \cs{OptionNotUsed}. Or the options can be passed to
+% another class that is later loaded.
+%
+% \subsubsection{Local options}
+%
+% \begin{declcs}{DeclareLocalOption} \M{option}\\
+% \cs{DeclareLocalOptions} \M{option list}
+% \end{declcs}
+% Both macros mark package options as local options. That means
+% that they are ignored by \cs{ProcessKeyvalOptions} if they are given
+% as global options. \cs{DeclareLocalOptions} takes one option,
+% \cs{DeclareLocalOptions} expects a comma separated list of options.
+%
+% \subsubsection{Dynamic options}
+%
+% Options of \LaTeX's package/class system are cleared
+% in \cs{ProcessOptions}. They modify the static model
+% of a package. For example, depending on option \xoption{bookmarks}
+% package \xpackage{hyperref} loads differently.
+%
+% Options, however,
+% defined by \xpackage{keyval}'s \cs{define@key} remain
+% defined, if the options are processed by \cs{setkeys}.
+% Therefore these options can also be used to model
+% the dynamic behaviour of a package. For example, in
+% \xpackage{hyperref} the link colors can be changed
+% everywhere until the end in |\end{document}|.
+%
+% However package \xpackage{color} that adds color support
+% is necessary and it
+% cannot be loaded after |\begin{document}|. Option \xoption{colorlinks}
+% that loads \xpackage{color} should be active until |\begin{document}|
+% and die in some way if it is too late for loading packages.
+% With \cs{DisableKeyvalOption} the package/class author can
+% specify and configure the death of an option and controls
+% the life period of the option.
+%
+% \subsubsection{\cs{DisableKeyvalOption}}
+%
+% \begin{declcs}{DisableKeyvalOption}\,\O{options}\,\M{family}\,\M{key}
+% \\[0.5ex]
+% \meta{options}:\\
+% \hspace{1.5em}^^A
+% \begin{tabular}[t]{@{}l@{ \texttt{=} }l@{\qquad}>{default: }l@{}}
+% |action| & |undef|, |warning|, |error|, or |ignore|
+% & |undef|
+% \\
+% \multicolumn{1}{@{}l}{|global| or |local|} & & |global|
+% \\
+% |package| or |class| & \meta{name}
+% \\
+% \end{tabular}^^A
+% \end{declcs}
+% \cs{DisableKeyvalOption} can be called to mark the end when
+% the option \meta{key} is no longer useful. The behaviour of
+% an option after its death can be configured by \xoption{action}:
+% \begin{description}
+% \item[\texttt{undef}:] The option will be undefined,
+% If it is called, \cs{setkeys} reports an error because
+% of unknown key.
+% \item[\texttt{error} or \texttt{warning}:] Use of the
+% option will cause an error or warning message.
+% Also these actions require that exclusivly either the
+% package or class name is given in options \xoption{package}
+% or \xoption{class}.
+% \item[\texttt{ignore}:] The use of the option will silently
+% be ignored.
+% \end{description}
+% The option's death can be limited to the end of the current
+% group, if option \xoption{local} is given. Default is
+% \xoption{global}.
+%
+% The package/class author can wish the end of the option
+% already during the package loading, then he will have
+% static behaviour. In case of dynamic options \cs{DisableKeyvalOption}
+% can be executed everywhere, also outside the package. Therefore
+% the family name and the package/class name is usually unknown for
+% \cs{DisableKeyvalOption}. Therefore the argument for the family
+% name is mandatory and for some actions the package/class name
+% must be provided.
+%
+% Usually a macro would configure the option death, Example:
+%\begin{quote}
+%\begin{verbatim}
+%\ProvidesPackage{foobar}
+%\DeclareBoolOption{color}
+%\DeclareStringOption[red]{emphcolor}
+%\ProcessKeyvalOptions*
+%
+%\newcommand*{\foobar@DisableOption}[2]{%
+% \DisableKeyvalueOption[
+% action={#1},
+% package=foobar
+% ]{foobar}{#2}%
+%}
+%
+%\iffoobar@color
+% \RequirePackage{color}
+% \renewcommand*{\emph}[1]{\textcolor{\foobar@emphcolor}{#1}}
+%\else
+% % Option emphcolor is not wrong, if we have color support.
+% % otherwise the option has no effect, but we don't want to
+% % remove it. Therefore action 'ignore' is the best choice:
+% \foobar@DisableOption{ignore}{emphcolor}
+%\fi
+%% No we don't need the option 'color'.
+%\foobar@DisableOption{warning}{color}
+%
+%% With color support option 'emphcolor' will dynamically
+%% change the color of \emph statements.
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\cs{AddToKeyvalOption}}
+%
+% \begin{declcs}{AddToKeyvalOption}\,\M{family}\,\M{key}\,\M{code}\\
+% \cs{AddToKeyvalOption} \*\,\M{key}\,\M{code}
+% \end{declcs}
+% The code for an existing key \meta{key} of family \meta{family} is
+% extended by code \meta{code}. In the starred form the current
+% family setting is used, see \cs{ProcessKeyvalOptions*}.
+%
+% \subsection{Global vs. local options}
+%
+% Options that are given for \cs{documentclass} are called
+% global options. They are known to the class and all packages.
+% A package may make use of a global option and marks it as
+% used. The advantage for the user is the freedom to specify
+% options both in the \cs{documentclass} or \cs{usepackage}
+% commands.
+%
+% However global options are shared with the class options
+% and options of all other packages. Thus there can be the
+% same option with different semantics for different
+% packages and classes. As example, package \xpackage{bookmark}
+% knows option \xoption{open} that specifies whether the bookmarks
+% are opened or closed initially. It's values are |true| or |false|.
+% Since KOMA-Script version 3.00 the KOMA classes also introduces
+% option \xoption{open} with values |right| and |any| and a
+% complete different meaning.
+%
+% Such conflicts can be resolved by marking all or part of options
+% as local by \cs{DeclareLocalOption} or \cs{DeclareLocalOptions}.
+% Then the packages ignores global occurences of these options.
+% Package \xpackage{kvoptions} provides two methods:
+% \begin{itemize}
+% \item \cs{ProcessLocalKeyvalOptions} automatically uses all options
+% as local options. It ignores all global options.
+% \item \cs{DeclareLocalOption} or \cs{DeclareLocalOptions} marks
+% options as local options. \cs{ProcessKeyvalOptions} will then
+% ignore global occurences for these local options.
+% \end{itemize}
+% Since version 1.5 package \xpackage{bookmark} uses the latter
+% method. It checks global and local option places for driver options
+% and limits all other options as local options. Thus the class
+% option \xoption{open} of KOMA-Script is not misread as
+% option for package \xpackage{bookmark}.
+%
+% \subsection{Summary of internal macros}
+%
+% The \cs{Declare}\texttt{\dots Option} commands define
+% macros, additionally to the macros generated by the key definition.
+% These macros can be used by the package/class author.
+% The name of the macros starts with the prefix \meta{prefix}
+% that can be configured by \cs{SetupKeyvalOptions}.
+% \begin{center}
+% \def\prefix{\cs{}\meta{prefix}\meta{key}}^^A
+% \def\Hline{^^A
+% \hline
+% \rule{0pt}{1.2\ht\csname @arstrutbox\endcsname}^^A
+% }^^A
+% \begin{tabular}{@{}l|>{\ttfamily}l|l@{}}
+% Declare \meta{key} & \textrm{Defined macro} & Description\\
+% \Hline
+% \cs{DeclareStringOption}
+% & \prefix & holds the string\\
+% \Hline
+% \cs{DeclareBoolOption}
+% & \cs{if}\meta{prefix}\meta{key}& boolean switch\\
+% &\prefix false& disable switch\\
+% &\prefix true& enable switch\\
+% \Hline
+% \cs{DeclareComplementaryOption}
+% & \prefix false& enable parent switch\\
+% & \prefix true& disable parent switch\\
+% \Hline
+% \cs{DeclareVoidOption}
+% & \prefix & holds the action
+% \end{tabular}
+% \end{center}
+%
+% \subsection{\plainTeX}
+%
+% Package \xpackage{keyval} is also usable in \plainTeX\ with
+% the help of file \xfile{miniltx.tex}. Some features of this
+% package \xpackage{kvoptions} might also be useful for \plainTeX.
+% If \LaTeX\ is not found, \cs{ProcessKeyvalOptions} and option
+% \xoption{patch} are disabled. Before using the option declaration
+% commands \cs{Declare...Option}, \cs{SetupKeyvalOptions} must be
+% used.
+%
+% \hypersetup{bookmarksopenlevel=1}
+%
+% \section{Example}
+%
+% The following example defined a package that serves some
+% private color management. A boolean option \xoption{print} enables
+% print mode without colors. An option \xoption{emph} redefines
+% \cs{emph} to print in the given color. And the driver
+% can be specified by option \xoption{driver}.
+%
+% \begin{macrocode}
+%<*example>
+ % Package identification
+ % -----------------------
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{example-mycolorsetup}[2016/05/16 Managing my colors]
+
+\RequirePackage{ifpdf}
+\RequirePackage{kvoptions}
+
+ % Option declarations
+ % -------------------
+
+\SetupKeyvalOptions{
+ family=MCS,
+ prefix=MCS@
+}
+ % Use a shorter family name and prefix
+
+ % Option print
+\DeclareBoolOption{print}
+ % is the same as
+ % \DeclareBoolOption[false]{print}
+
+ % Option driver
+\ifpdf
+ \DeclareStringOption[pdftex]{driver}
+\else
+ \DeclareStringOption[dvips]{driver}
+\fi
+
+ % Alternative interface for driver options
+\DeclareVoidOption{dvips}{\SetupDriver}
+\DeclareVoidOption{dvipdfm}{\SetupDriver}
+\DeclareVoidOption{pdftex}{\SetupDriver}
+ % In \SetupDriver we take the current option \CurrentOption
+ % and pass it to the driver option.
+ % The \expandafter commands expand \CurrentOption at the
+ % time, when \SetupDriver is executed and \CurrentOption
+ % has the correct meaning.
+\newcommand*{\SetupDriver}{%
+ \expandafter\@SetupDriver\expandafter{\CurrentOption}%
+}
+\newcommand*{\@SetupDriver}[1]{%
+ \setkeys{MCS}{driver={#1}}%
+}
+
+ % Option emph
+ % An empty value means, we want to have no color for \emph.
+ % If the user specifies option emph without value, the red is used.
+\DeclareStringOption{emph}[red]
+ % is the same as
+ % \DeclareStringOption[]{emph}[red]
+
+ % Default option rule
+\DeclareDefaultOption{%
+ \ifx\CurrentOptionValue\relax
+ \PackageWarningNoLine{\@currname}{%
+ Unknown option `\CurrentOption'\MessageBreak
+ is passed to package `color'%
+ }%
+ % Pass the option to package color.
+ % Again it is better to expand \CurrentOption.
+ \expandafter\PassOptionsToPackage
+ \expandafter{\CurrentOption}{color}%
+ \else
+ % Package color does not take options with values.
+ % We provide the standard LaTeX error.
+ \@unknownoptionerror
+ \fi
+}
+
+ % Process options
+ % ---------------
+\ProcessKeyvalOptions*
+
+ % Implementation depending on option values
+ % -----------------------------------------
+ % Code for print mode
+\ifMCS@print
+ \PassOptionsToPackage{monochrome}{color}
+ % tells package color to use black and white
+\fi
+
+\RequirePackage[\MCS@driver]{color}
+ % load package color with the correct driver
+
+ % \emph setup
+\ifx\MCS@emph\@empty
+ % \@empty is a predefined macro with empty contents.
+ % the option value of option emph is empty, thus
+ % we do not want a redefinition of \emph.
+\else
+ \renewcommand*{\emph}[1]{%
+ \textcolor{\MCS@emph}{#1}%
+ }
+\fi
+%</example>
+% \end{macrocode}
+%
+% \section{Package options}
+%
+% The package \xpackage{kvoptions} knows two package options
+% \xoption{patch} and \xoption{debugshow}.
+% The options of package \xpackage{kvoptions} are intended
+% for authors, not for package/class writers. Inside a package
+% it is too late for option \xoption{patch} and \xoption{debugshow}
+% enables some messages that are perhaps useful for the debugging
+% phase. Also \LaTeX\ is unhappy if a package is loaded
+% later again with options that are previously not given.
+% Thus package and class authors, stay with |\RequirePackage{kvoptions}|
+% without options.
+%
+% Option \xoption{patch} loads package \xpackage{kvoptions-patch}.
+%
+% \subsection{Package \xpackage{kvoptions-patch}}
+%
+% \LaTeX's system of package/class options has some severe limitations
+% that especially affects the value part if options are used as
+% pair of key and value.
+% \begin{itemize}
+% \item Spaces are removed, regardless where:
+% \begin{quote}
+% |\documentclass[box=0 0 400 600]{article}|
+% \end{quote}
+% Now each package will see |box=00400600| as global option.
+% \item In the previous case also braces would not help:
+% \begin{quote}
+% |\documentclass[box={0 0 400 600}]{article}|
+% \end{quote}
+% The result is an error message:
+% \begin{quote}
+% |! LaTeX Error: Missing \begin{document}.|
+% \end{quote}
+% As local option, however, it works if the package
+% knows about key value options (By using this package, for example).
+% \item The requirements on robustness are extremly high.
+% \LaTeX\ expands the option. All that will not work as environment
+% name will break also as option. Even a \cs{relax} will generate
+% an error message:
+% \begin{quote}
+% |! Missing \endcsname inserted.|
+% \end{quote}
+% Of course, \LaTeX\ does not use its protecting mechanisms.
+% On contrary \cs{protect} itself will cause errors.
+% \item The options are expanded. But perhaps the package will
+% do that, because it has to setup some things before?
+% Example \xpackage{hyperref}:
+% \begin{quote}
+% |\usepackage[pdfauthor=M\"uller]{hyperref}|
+% \end{quote}
+% Package \xpackage{hyperref} does not see |M\"uller| but
+% its expansion and it does not like it, you get many warnings
+% \begin{quote}
+% |Token not allowed in a PDFDocEncoded string|
+% \end{quote}
+% And the title becomes: |Mu127uller|.
+% Therefore such options must usually be given after package
+% \xpackage{hyperref}
+% is loaded:
+% \begin{quote}
+% |\usepackage{hyperref}|\\
+% |\hypersetup{pdfauthor=Fran\c coise M\"uller}|
+% \end{quote}
+% As package option it will even break with |Fran\c coise|
+% because of the cedilla |\c c|, it is not robust enough.
+% \end{itemize}
+% For users that do not want with this limitations the package
+% offers package \xoption{kvoptions-patch}. It patches \LaTeX's option system
+% and tries to teach it also to handle options that are given
+% as pairs of key and value and to prevent expansion.
+% It can already be used at the very beginning, before \cs{documentclass}:
+% \begin{quote}
+% |\RequirePackage{kvoptions-patch}|\\
+% |\documentclass[pdfauthor=Fran\c coise M\"uller]{article}|\\
+% |\usepackage{hyperref}|
+% \end{quote}
+% The latest time is before the package where you want to use
+% problematic values:
+% \begin{quote}
+% |\usepackage{kvoptions-patch}|\\
+% |\usepackage[Fran\c coise M\"uller]{hyperref}|
+% \end{quote}
+% Some remarks:
+% \begin{itemize}
+% \item The patch requires \eTeX, its \cs{unexpanded} feature
+% is much too nice. It is possible to work around using token
+% registers. But the code becomes longer, slower, more difficult
+% to read and maintain. The package without option \xoption{patch}
+% works and will work without \eTeX.
+% \item The code for the patch is quite long, there are many test
+% cases. Thus the probability for bugs is probably not too small.
+% \item Since 2008/10/18 v3.0 package \xpackage{kvoptions-patch} is
+% available. Before option \xoption{patch} of package \xpackage{kvoptions}
+% must be used instead. I think, the solution as standalone package
+% \xpackage{kvoptions-patch} is cleaner and avoids option clashes.
+% \end{itemize}
+%
+% \subsection{Option \xoption{debugshow}}
+%
+% The name of this option follows the convention of packages
+% \xpackage{multicol}, \xpackage{tabularx}, and \xpackage{tracefnt}.
+% Currently it prints the setting of boolean options, declared
+% by \cs{DeclareBoolOption} in the \xfile{.log} file, if that
+% boolean option is used.
+% You can activate the option by
+% \begin{itemize}
+% \item |\PassOptionsToPackage{debugshow}{kvoptions}|\\
+% Put this somewhere before package \xpackage{kvoptions} is
+% loaded first, e.g. before \cs{documentclass}.
+% \item |\RequirePackage[debugshow]{kvoptions}|\\
+% Before \cs{documentclass} even an author has to use
+% \cs{RequirePackage}. \cs{usepackage} only works after
+% \cs{documentclass}.
+% \end{itemize}
+% The preferred method is \cs{PassOptionsToPackage}, because
+% it does not force the package loading and does not disturb,
+% if the package is not loaded later at all.
+%
+% \section{Limitations}
+%
+% \subsection{Compatibility}
+% \subsubsection{Package \xpackage{kvoptions-patch} vs. package \xpackage{xkvltxp}}
+%
+% Package \xpackage{xkvltxp} from the \xpackage{xkeyval} project
+% has the same goal as package \xpackage{kvoptions-patch}
+% and to patch \LaTeX's kernel commands in order to get better support
+% for key value options.
+% Of course they cannot be used both. The user must decide, which
+% method he prefers. Package \xpackage{kvoptions-patch} aborts itself,
+% if it detects that \xpackage{xkvltxp} is
+% already loaded.
+%
+% However package \xpackage{xkvltxp} and \xpackage{kvoptions}
+% can be used together, example:
+% \begin{quote}
+% |\usepackage{xkvltxp}|\\
+% |\usepackage[...]{foobar} % |\texttt{\itshape foobar using kvoptions}
+% \end{quote}
+% The other way should work, too.
+%
+% Package \xpackage{kvoptions-patch} tries to catch more situations
+% and to be more robust.
+% For example, during the comparison of options it normalizes
+% them by removing spaces around |=| and the value. Thus the
+% following is not reported as option clash:
+% \begin{quote}
+%\begin{verbatim}
+%\RequirePackage{kvoptions-patch}
+%\documentclass{article}
+%
+%\usepackage[scaled=0.7]{helvet}
+%\usepackage[scaled = 0.7]{helvet}
+%
+%\begin{document}
+%\end{document}
+%\end{verbatim}
+% \end{quote}
+%
+% \subsection{Limitations}
+%
+% \subsubsection{Option comparisons}
+%
+% In some situations \LaTeX\ compares option lists, e.g. option clash check,
+% \cs{@ifpackagewith}, or \cs{@ifclasswith}. Apart from catcode and
+% sanitizing problems of option \xoption{patch}, there is another problem.
+% \LaTeX\ does not know about the type and default values of
+% options in key value style. Thus an option clash is reported,
+% even if the key value has the same meaning:
+% \begin{quote}
+% |\usepackage[scaled]{helvet} %| \texttt{\textit{default is }.95}\\
+% |\usepackage[.95]{helvet}|\\
+% |\usepackage[0.95]{helvet}|
+% \end{quote}
+%
+% \subsubsection{Option list parsing with package \xpackage{kvoptions-patch}}
+%
+% With package \xpackage{kvoptions-patch} the range of possible values
+% in key value specifications is much large, for example
+% the comma can be used, if enclosed in curly braces.
+%
+% Other packages, especially the packages that uses their
+% own process option code can be surprised to find tokens
+% inside options that they do not expect and errors would
+% be the consequence. To avoid errors the options, especially
+% the unused option list is sanitized. That means the list
+% will only contain tokens with catcode 12 (other) and
+% perhaps spaces (catcode 10). This allows a safe parsing
+% for other packages. But a comma in the value part is
+% no longer protected by curly braces because they have lost
+% their special meaning. This is the price for compatibility.
+%
+% Example:
+% \begin{quote}
+% |\RequirePackage{kvoptions-patch}|\\
+% |\documentclass[a={a,b,c},b]{article}|\\
+% |\begin{document}|\\
+% |\end{document}|
+% \end{quote}
+% Result:
+% \begin{quote}
+% |LaTeX Warning: Unused global option(s):|\\
+% | [a={a,c},b].|
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Preamble}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \paragraph{Reload 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@kvoptions.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{kvoptions}{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@kvoptions.sty\endcsname
+\ProvidesPackage{kvoptions}%
+ [2016/05/16 v3.12 Key value format for package options (HO)]%
+% \end{macrocode}
+%
+% \paragraph{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 KVO@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\KVO@AtEnd{%
+ \KVO@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{1}{14}% ^^A (comment)
+\TMP@EnsureCode{2}{14}% ^^A (comment)
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^ (superscript)
+\TMP@EnsureCode{96}{12}% `
+\edef\KVO@AtEnd{\KVO@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \paragraph{External resources.}
+% The package extends the support for key value pairs of
+% package \cs{keyval} to package options. Thus the package
+% needs to be loaded anyway. and we use it for
+% \cs{SetupKeyvalOptions}. AFAIK this does not disturb
+% users of \xpackage{xkeyval}.
+% \begin{macrocode}
+\@ifundefined{define@key}{%
+ \RequirePackage{keyval}\relax
+}{}
+% \end{macrocode}
+%
+% Macro \cs{DeclareLocalOptions} parses a comma separated key list
+% and uses \cs{comma@parse} of package \xpackage{kvsetkeys},
+% version 1.3.
+% \begin{macrocode}
+\RequirePackage{ltxcmds}[2010/12/02]
+\RequirePackage{kvsetkeys}[2007/09/29]
+% \end{macrocode}
+%
+% \paragraph{Provide macros for \plainTeX.}
+% \begin{macrocode}
+\@ifundefined{@x@protect}{%
+ \def\@x@protect#1\fi#2#3{%
+ \fi\protect#1%
+ }%
+ \let\@typeset@protect\relax
+}{}
+\@ifundefined{@currname}{%
+ \def\@currname{}%
+}{}
+\@ifundefined{@currext}{%
+ \def\@currext{}%
+}{}
+% \end{macrocode}
+%
+% \paragraph{Options}
+% Option \xoption{debugshow} enables additional lines of
+% code that prints information into the \xfile{.log}
+% file.
+% \begin{macrocode}
+\DeclareOption{debugshow}{\catcode\@ne=9 }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareOption{patch}{%
+ \AtEndOfPackage{%
+ \RequirePackage{kvoptions-patch}[2016/05/16]%
+ }%
+}
+% \end{macrocode}
+%
+% Optionen auswerten:
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \subsection{Option declaration macros}
+%
+% \subsubsection{\cs{SetupKeyvalOptions}}
+%
+% The family for the key value pairs can be setup once
+% and is remembered later.
+% The package name seems a reasonable default for the
+% family key, if it is not set by the package author.
+%
+% \begin{macro}{\KVO@family}
+% We cannot store the family setting in one macro,
+% because the package should be usable for many
+% other packages, too. Thus we remember the family
+% setting in a macro, whose name contains the
+% package name with extension, a key in \LaTeX's
+% class/package system.
+% \begin{macrocode}
+\define@key{KVO}{family}{%
+ \expandafter\edef\csname KVO@family@%
+ \@currname.\@currext\endcsname{#1}%
+}
+\def\KVO@family{%
+ \@ifundefined{KVO@family@\@currname.\@currext}{%
+ \@currname
+ }{%
+ \csname KVO@family@\@currname.\@currext\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KVO@prefix}
+% The value settings of options that are declared by \cs{DeclareBoolOption}
+% and \cs{DeclareStringOption} need to be saved in macros.
+% in the first case this is a switch \cs{if}\meta{prefix}\meta{key},
+% in the latter case a macro \cs{}\meta{prefix}\meta{key}.
+% The prefix can be configured, by \xoption{prefix} that is declared
+% here. The default is the package name with |@| appended.
+% \begin{macrocode}
+\define@key{KVO}{prefix}{%
+ \expandafter\edef\csname KVO@prefix@%
+ \@currname.\@currext\endcsname{#1}%
+}
+\def\KVO@prefix{%
+ \ltx@ifundefined{KVO@prefix@\@currname.\@currext}{%
+ \@currname @%
+ }{%
+ \csname KVO@prefix@\@currname.\@currext\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\define@key{KVO}{setkeys}{%
+ \expandafter\def\csname KVO@setkeys@%
+ \@currname.\@currext\endcsname{#1}%
+}
+% \end{macrocode}
+% \begin{macro}{\KVO@setkeys}
+% \begin{macrocode}
+\def\KVO@setkeys{%
+ \ltx@IfUndefined{KVO@setkeys@\@currname.\@currext}{%
+ \setkeys
+ }{%
+ \csname KVO@setkeys@\@currname.\@currext\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SetupKeyvalOptions}
+% The argument of \cs{SetupKeyvalOptions} expects a key value
+% list, known keys are \xoption{family} and \xoption{prefix}.
+% \begin{macrocode}
+\newcommand*{\SetupKeyvalOptions}{%
+ \kvsetkeys{KVO}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{DeclareBoolOption}}
+%
+% \begin{macro}{\DeclareBoolOption}
+% Usually options of boolean type can be given by the
+% user without value and this means a setting to \emph{true}.
+% We follow this convention here. Also it simplifies the
+% user interface.
+%
+% The switch is created and initialized with \emph{false}.
+% The default setting can be overwritten by the optional
+% argument.
+%
+% \LaTeX's \cs{newif} does not check for already defined
+% macros, therefore we add this check here to prevent
+% the user from accidently redefining of \TeX's primitives
+% and other macros.
+% \begin{macrocode}
+\newcommand*{\DeclareBoolOption}[2][false]{%
+ \KVO@ifdefinable{if\KVO@prefix#2}{%
+ \KVO@ifdefinable{\KVO@prefix#2true}{%
+ \KVO@ifdefinable{\KVO@prefix#2false}{%
+ \csname newif\expandafter\endcsname
+ \csname if\KVO@prefix#2\endcsname
+ \@ifundefined{\KVO@prefix#2#1}{%
+ \PackageWarning{kvoptions}{%
+ Initialization of option `#2' failed,\MessageBreak
+ cannot set boolean option to `#1',\MessageBreak
+ use `true' or `false', now using `false'%
+ }%
+ }{%
+ \csname\KVO@prefix#2#1\endcsname
+ }%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\define@key{\KVO@family}{#2}[true]{%
+ \noexpand\KVO@boolkey{\@currname}%
+ \ifx\@currext\@clsextension
+ \noexpand\@clsextension
+ \else
+ \noexpand\@pkgextension
+ \fi
+ {\KVO@prefix}{#2}{####1}%
+ }%
+ }%
+ \x
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareComplementaryOption}
+% The first argument is the key name, the second the
+% key that must be a boolean option with the same
+% current family and prefix. A new switch is not
+% created for the new key, we have already a switch.
+% Instead we define switch setting commands to work
+% on the parent switch.
+% \begin{macrocode}
+\newcommand*{\DeclareComplementaryOption}[2]{%
+ \@ifundefined{if\KVO@prefix#2}{%
+ \PackageError{kvoptions}{%
+ Cannot generate option code for `#1',\MessageBreak
+ parent switch `#2' does not exist%
+ }{%
+ You are inside %
+ \ifx\@currext\@clsextension class\else package\fi\space
+ `\@currname.\@currext'.\MessageBreak
+ `\KVO@family' is used as familiy %
+ for the keyval options.\MessageBreak
+ `\KVO@prefix' serves as prefix %
+ for internal switch macros.\MessageBreak
+ \MessageBreak
+ \@ehc
+ }%
+ }{%
+ \KVO@ifdefinable{\KVO@prefix#1true}{%
+ \KVO@ifdefinable{\KVO@prefix#1false}{%
+ \expandafter\let\csname\KVO@prefix#1false\expandafter\endcsname
+ \csname\KVO@prefix#2true\endcsname
+ \expandafter\let\csname\KVO@prefix#1true\expandafter\endcsname
+ \csname\KVO@prefix#2false\endcsname
+% \end{macrocode}
+% The same code part as in \cs{DeclareBoolOption} can
+% now be used.
+% \begin{macrocode}
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\define@key{\KVO@family}{#1}[true]{%
+ \noexpand\KVO@boolkey{\@currname}%
+ \ifx\@currext\@clsextension
+ \noexpand\@clsextension
+ \else
+ \noexpand\@pkgextension
+ \fi
+ {\KVO@prefix}{#1}{####1}%
+ }%
+ }%
+ \x
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KVO@ifdefinable}
+% Generate the command token LaTeX's \cs{@ifdefinable} expects.
+% \begin{macrocode}
+\def\KVO@ifdefinable#1{%
+ \expandafter\@ifdefinable\csname #1\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KVO@boolkey}
+% We check explicitly for |true| and |false| to prevent
+% the user from accidently calling other macros.
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% |#1|& package/class name\\
+% |#2|& |\@pkgextension|/|\@clsextension|\\
+% |#3|& prefix \\
+% |#4|& key name\\
+% |#5|& new value
+% \end{tabular}
+% \end{quote}
+% \begin{macrocode}
+\def\KVO@boolkey#1#2#3#4#5{%
+ \edef\KVO@param{#5}%
+ \ltx@onelevel@sanitize\KVO@param
+ \ifx\KVO@param\KVO@true
+ \expandafter\@firstofone
+ \else
+ \ifx\KVO@param\KVO@false
+ \expandafter\expandafter\expandafter\@firstofone
+ \else
+ \ifx#2\@clsextension
+ \expandafter\ClassWarning
+ \else
+ \expandafter\PackageWarning
+ \fi
+ {#1}{%
+ Value `\KVO@param' is not supported by\MessageBreak
+ option `#4'%
+ }%
+ \expandafter\expandafter\expandafter\@gobble
+ \fi
+ \fi
+ {%
+ ^^A\ifx#2\@clsextension
+ ^^A \expandafter\ClassInfo
+ ^^A\else
+ ^^A \expandafter\PackageInfo
+ ^^A\fi
+ ^^A{#1}{[option] #4=\KVO@param}%
+ \csname#3#4\KVO@param\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@true}
+% \begin{macro}{\KVO@false}
+% The macros \cs{KVO@true} and \cs{KVO@false} are used
+% for string comparisons. After \cs{ltx@onelevel@sanitize}
+% we have only tokens with catcode 12 (other).
+% \begin{macrocode}
+\def\KVO@true{true}
+\def\KVO@false{false}
+\ltx@onelevel@sanitize\KVO@true
+\ltx@onelevel@sanitize\KVO@false
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{\cs{DeclareStringOption}}
+%
+% \begin{macro}{\DeclareStringOption}
+% \begin{macrocode}
+\newcommand*{\DeclareStringOption}[2][]{%
+ \@ifnextchar[{%
+ \KVO@DeclareStringOption{#1}{#2}@%
+ }{%
+ \KVO@DeclareStringOption{#1}{#2}{}[]%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@DeclareStringOption}
+% \begin{macrocode}
+\def\KVO@DeclareStringOption#1#2#3[#4]{%
+ \KVO@ifdefinable{\KVO@prefix#2}{%
+ \@namedef{\KVO@prefix#2}{#1}%
+ \begingroup
+ \ifx\\#3\\%
+ \toks@{}%
+ \else
+ \toks@{[{#4}]}%
+ \fi
+ \edef\x{\endgroup
+ \noexpand\define@key{\KVO@family}{#2}\the\toks@{%
+ ^^A\begingroup
+ ^^A \toks@{####1}%
+ ^^A \ifx\@currext\@clsextension
+ ^^A \noexpand\ClassInfo
+ ^^A \else
+ ^^A \noexpand\PackageInfo
+ ^^A \fi
+ ^^A {\@currname}{%
+ ^^A [option] #2={\noexpand\the\toks@}%
+ ^^A }%
+ ^^A\endgroup
+ \noexpand\def
+ \expandafter\noexpand\csname\KVO@prefix#2\endcsname{####1}%
+ }%
+ }%
+ \x
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{DeclareVoidOption}}
+%
+% \begin{macro}{\DeclareVoidOption}
+% \begin{macrocode}
+\newcommand*{\DeclareVoidOption}[2]{%
+ \begingroup
+ \let\next\@gobbletwo
+ \KVO@ifdefinable{\KVO@prefix#1}{%
+ \let\next\@firstofone
+ }%
+ \expandafter\endgroup
+ \next{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\define@key{\KVO@family}{#1}[\KVO@VOID@]{%
+ \noexpand\KVO@voidkey{\@currname}%
+ \ifx\@currext\@clsextension
+ \noexpand\@clsextension
+ \else
+ \noexpand\@pkgextension
+ \fi
+ {#1}%
+ {####1}%
+ \expandafter\noexpand\csname\KVO@prefix#1\endcsname
+ }%
+ }%
+ \x
+ \begingroup
+ \toks@{#2}%
+ \expandafter\endgroup
+ \expandafter\def
+ \csname\KVO@prefix#1\expandafter\endcsname
+ \expandafter{\the\toks@}%
+ }%
+}
+\def\KVO@VOID@{@VOID@}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@voidkey}
+% \begin{tabular}{@{}ll@{}}
+% |#1|& package/class name\\
+% |#2|& |\@pkgextension|/|\@clsextension|\\
+% |#3|& key name\\
+% |#4|& default (|@VOID@|)\\
+% |#5|& macro with option code
+% \end{tabular}
+% \begin{macrocode}
+\def\KVO@voidkey#1#2#3#4{%
+ \def\CurrentOption{#3}%
+ \begingroup
+ \def\x{#4}%
+ \expandafter\endgroup
+ \ifx\x\KVO@VOID@
+ \else
+ \ifx#2\@clsextension
+ \expandafter\ClassWarning
+ \else
+ \expandafter\PackageWarning
+ \fi
+ {#1}{%
+ Unexpected value for option `#3'\MessageBreak
+ is ignored%
+ }%
+ \fi
+ ^^A\ifx#2\@clsextension
+ ^^A \expandafter\ClassInfo
+ ^^A\else
+ ^^A \expandafter\PackageInfo
+ ^^A\fi
+ ^^A{#1}{[option] #3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{DeclareDefaultOption}}
+%
+% \begin{macro}{\DeclareDefaultOption}
+% \begin{macrocode}
+\newcommand*{\DeclareDefaultOption}{%
+ \@namedef{KVO@default@\@currname.\@currext}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{DeclareLocalOptions}}
+%
+% \begin{macro}{\DeclareLocalOptions}
+% \begin{macrocode}
+\newcommand*{\DeclareLocalOptions}[1]{%
+ \comma@parse{#1}\KVO@DeclareLocalOption
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@DeclareLocalOption}
+% \begin{macrocode}
+\def\KVO@DeclareLocalOption#1{%
+ \expandafter\def\csname KVO@local@\KVO@family @#1\endcsname{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Dynamic options}
+%
+% \subsubsection{\cs{DisableKeyvalOption}}
+%
+% \begin{macrocode}
+\SetupKeyvalOptions{%
+ family=KVOdyn,%
+ prefix=KVOdyn@%
+}
+\DeclareBoolOption[true]{global}
+\DeclareComplementaryOption{local}{global}
+\DeclareStringOption[undef]{action}
+\let\KVOdyn@name\relax
+\let\KVOdyn@ext\@empty
+\define@key{KVOdyn}{class}{%
+ \def\KVOdyn@name{#1}%
+ \let\KVOdyn@ext\@clsextension
+}
+\define@key{KVOdyn}{package}{%
+ \def\KVOdyn@name{#1}%
+ \let\KVOdyn@ext\@pkgextension
+}
+\newcommand*{\DisableKeyvalOption}[3][]{%
+ \begingroup
+ \kvsetkeys{KVOdyn}{#1}%
+ \def\x{\endgroup}%
+ \@ifundefined{KVO@action@\KVOdyn@action}{%
+ \PackageError{kvoptions}{%
+ Unknown disable action %
+ `\expandafter\strip@prefix\meaning\KVOdyn@action'\MessageBreak
+ for option `#3' in keyval family '#2'%
+ }\@ehc
+ }{%
+ \csname KVO@action@\KVOdyn@action\endcsname{#2}{#3}%
+ }%
+ \x
+}
+\def\KVO@action@undef#1#2{%
+ \edef\x{\endgroup
+ \ifKVOdyn@global\global\fi
+ \let
+ \expandafter\noexpand\csname KV@#1@#2\endcsname
+ \relax
+ \ifKVOdyn@global\global\fi
+ \let
+ \expandafter\noexpand\csname KV@#1@#2@default\endcsname
+ \relax
+ }%
+ ^^A\PackageInfo{kvoptions}{%
+ ^^A [option] key `#2' of family `#1'\MessageBreak
+ ^^A is disabled (undef, \ifKVOdyn@global global\else local\fi)%
+ ^^A}%
+}
+\def\KVO@action@ignore#1#2{%
+ \edef\x{\endgroup
+ \ifKVOdyn@global\global\fi
+ \let
+ \expandafter\noexpand\csname KV@#1@#2\endcsname
+ \noexpand\@gobble
+ \ifKVOdyn@global\global\fi
+ \let
+ \expandafter\noexpand\csname KV@#1@#2@default\endcsname
+ \noexpand\@empty
+ }%
+ ^^A\PackageInfo{kvoptions}{%
+ ^^A [option] key `#2' of family `#1'\MessageBreak
+ ^^A is disabled (ignore, \ifKVOdyn@global global\else local\fi)%
+ ^^A}%
+}
+\def\KVO@action@error{%
+ \KVO@do@action{error}%
+}
+\def\KVO@action@warning{%
+ \KVO@do@action{warning}%
+}
+% \end{macrocode}
+% \begin{tabular}{@{}ll@{}}
+% |#1|& |error| or |warning|\\
+% |#2|& \meta{family}\\
+% |#3|& \meta{key}\\
+% \end{tabular}
+% \begin{macrocode}
+\def\KVO@do@action#1#2#3{%
+ \ifx\KVOdyn@name\relax
+ \PackageError{kvoptions}{%
+ Action type `#1' needs package/class name\MessageBreak
+ for key `#3' in family `#2'%
+ }\@ehc
+ \else
+ \edef\x{\endgroup
+ \noexpand\define@key{#2}{#3}[]{%
+ \expandafter\noexpand\csname KVO@disable@#1\endcsname
+ {\KVOdyn@name}\noexpand\KVOdyn@ext{#3}%
+ }%
+ \ifKVOdyn@global
+ \global\let
+ \expandafter\noexpand\csname KV@#2@#3\endcsname
+ \expandafter\noexpand\csname KV@#2@#3\endcsname
+ \global\let
+ \expandafter\noexpand\csname KV@#2@#3@default\endcsname
+ \expandafter\noexpand\csname KV@#2@#3@default\endcsname
+ \fi
+ }%
+ ^^A\ifx\KVOdyn@ext\@clsextension
+ ^^A \expandafter\ClassInfo
+ ^^A\else
+ ^^A \expandafter\PackageInfo
+ ^^A\fi
+ ^^A{\KVOdyn@name}{%
+ ^^A [option] key `#3' of family `#2'\MessageBreak
+ ^^A is disabled (#1, \ifKVOdyn@global global\else local\fi)%
+ ^^A}%
+ \fi
+}
+\def\KVO@disable@error#1#2#3{%
+ \ifx#2\@clsextension
+ \expandafter\ClassError
+ \else
+ \expandafter\PackageError
+ \fi
+ {#1}{%
+ Option `#3' is given too late,\MessageBreak
+ now the option is ignored%
+ }\@ehc
+}
+\def\KVO@disable@warning#1#2#3{%
+ \ifx#2\@clsextension
+ \expandafter\ClassWarning
+ \else
+ \expandafter\PackageWarning
+ \fi
+ {#1}{%
+ Option `#3' is already consumed\MessageBreak
+ and has no effect%
+ }%
+}
+% \end{macrocode}
+%
+% \subsection{Change option code}
+%
+% \subsubsection{\cs{AddToKeyvalOption}}
+%
+% \begin{macro}{\AddToKeyvalOption}
+% \begin{macrocode}
+\newcommand*{\AddToKeyvalOption}{%
+ \@ifstar{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\KVO@AddToKeyvalOption{\KVO@family}%
+ }%
+ \x
+ }%
+ \KVO@AddToKeyvalOption
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@AddToKeyvalOption}
+% \begin{macrocode}
+\def\KVO@AddToKeyvalOption#1#2{%
+ \@ifundefined{KV@#1@#2}{%
+ \PackageWarning{kvoptions}{%
+ Key `#2' of family `#1' does not exist.\MessageBreak
+ Ignoring \string\AddToKeyvalOption
+ }%
+ \@gobble
+ }{%
+ \edef\KVO@next{%
+ \noexpand\KVO@@AddToKeyvalOption
+ \expandafter\noexpand\csname KV@#1@#2\endcsname
+ }%
+ \afterassignment\KVO@next
+ \def\KVO@temp##1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@@AddToKeyvalOption}
+% \begin{macrocode}
+\def\KVO@@AddToKeyvalOption#1{%
+ \begingroup
+ \toks@\expandafter{#1{##1}}%
+ \toks@\expandafter{\the\expandafter\toks@\KVO@temp{##1}}%
+ \edef\x{\endgroup
+ \noexpand\def\noexpand#1####1{\the\toks@}%
+ }%
+ \x
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Process options}
+%
+% \subsubsection{Get global options}
+%
+% Package \xpackage{xkeyval} removes options with equal signs from
+% the global options (\cs{@classoptionslist}). The effect is that
+% other packages and classes will not see these global options anymore.
+% A bug-report was answered that this behaviour is ``by design''.
+% Thus I call it a design bug. Now getting the global options require
+% an algorithm instead of a simple macro call.
+% \begin{macrocode}
+%</package>
+%<*package|patch>
+% \end{macrocode}
+% \begin{macro}{\KVO@IfDefThen}
+% Call |#2| if command |#1| is defined and not \cs{relax}.
+% (Package \xpackage{kvoptions-patch} does not load
+% package \xpackage{ltxcmds}.)
+% \begin{macrocode}
+\def\KVO@IfDefThen#1#2{%
+ \ifx#1\ltx@undefined
+ \else
+ \ifx#1\relax
+ \else
+ #2%
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@GetClassOptionsList}
+% \begin{macrocode}
+\def\KVO@GetClassOptionsList{%
+ \let\KVO@classoptionslist\@classoptionslist
+ \KVO@IfDefThen\@classoptionslist{%
+ \KVO@IfDefThen\XKV@documentclass{%
+ \ifx\XKV@documentclass\ltx@empty
+ \else
+ \KVO@IfDefThen\XKV@classoptionslist{%
+ \ifx\XKV@classoptionslist\ltx@empty
+ \else
+ \let\KVO@classoptionslist\XKV@classoptionslist
+ \fi
+ }%
+ \fi
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</package|patch>
+%<*package>
+% \end{macrocode}
+%
+% \subsubsection{\cs{ProcessKeyvalOptions}}
+%
+% \begin{macro}{\ProcessKeyvalOptions}
+% If the optional star is given, we get the family
+% name and expand it for safety.
+% \begin{macrocode}
+\newcommand*{\ProcessKeyvalOptions}{%
+ \@ifstar{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\KVO@ProcessKeyvalOptions{\KVO@family}%
+ }%
+ \x
+ }%
+ \KVO@ProcessKeyvalOptions
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\KVO@ProcessKeyvalOptions#1{%
+ \let\@tempc\relax
+ \let\KVO@temp\@empty
+% \end{macrocode}
+% Add any global options that are known to KV to the start of
+% the list being built in |\KVO@temp| and mark them used (by
+% removing them from the unused option list).
+% \begin{macrocode}
+ \ifx\@currext\@clsextension
+ \else
+ \KVO@GetClassOptionsList
+ \ifx\KVO@classoptionslist\relax
+ \else
+ \@for\KVO@CurrentOption:=\KVO@classoptionslist\do{%
+ \@ifundefined{KV@#1@\expandafter\KVO@getkey
+ \KVO@CurrentOption=\@nil}{%
+ }{%
+ \@ifundefined{KVO@local@#1@\expandafter\KVO@getkey
+ \KVO@CurrentOption=\@nil}{%
+ \ifx\KVO@Patch Y%
+ \edef\KVO@temp{%
+ \etex@unexpanded\expandafter{%
+ \KVO@temp
+ }%
+ ,%
+ \etex@unexpanded\expandafter{%
+ \KVO@CurrentOption
+ }%
+ ,%
+ }%
+ \ltx@onelevel@sanitize\KVO@CurrentOption
+ \else
+ \edef\KVO@temp{%
+ \KVO@temp
+ ,%
+ \KVO@CurrentOption
+ ,%
+ }%
+ \fi
+ \@expandtwoargs\@removeelement\KVO@CurrentOption
+ \@unusedoptionlist\@unusedoptionlist
+ }{}%
+ }%
+ }%
+ \fi
+ \fi
+% \end{macrocode}
+% Now stick the package options at the end of the list and wrap
+% in a call to \cs{setkeys}. A class ignores unknown global
+% options, we must remove them to prevent error messages
+% from \cs{setkeys}.
+% \begin{macrocode}
+ \begingroup
+ \toks\tw@{}%
+ \@ifundefined{opt@\@currname.\@currext}{%
+ \toks@\expandafter{\KVO@temp}%
+ }{%
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname opt@\@currname.\@currext\endcsname
+ }%
+ \ifx\@currext\@clsextension
+ \edef\CurrentOption{\the\toks@}%
+ \toks@\expandafter{\KVO@temp}%
+ \@for\CurrentOption:=\CurrentOption\do{%
+ \@ifundefined{%
+ KV@#1@\expandafter\KVO@getkey\CurrentOption=\@nil
+ }{%
+% \end{macrocode}
+% A class puts not used options in the unused option list
+% unless there is a default handler.
+% \begin{macrocode}
+ \@ifundefined{KVO@default@\@currname.\@currext}{%
+ \ifx\KVO@Patch Y%
+ \ltx@onelevel@sanitize\CurrentOption
+ \fi
+ \ifx\@unusedoptionlist\@empty
+ \global\let\@unusedoptionlist\CurrentOption
+ \else
+ \expandafter\expandafter\expandafter\gdef
+ \expandafter\expandafter\expandafter\@unusedoptionlist
+ \expandafter\expandafter\expandafter{%
+ \expandafter\@unusedoptionlist
+ \expandafter,\CurrentOption
+ }%
+ \fi
+ }{%
+ \toks\tw@\expandafter{%
+ \the\toks\expandafter\tw@\expandafter,\CurrentOption
+ }%
+ }%
+ }{%
+ \toks@\expandafter{%
+ \the\expandafter\toks@\expandafter,\CurrentOption
+ }%
+ }%
+ }%
+ \else
+% \end{macrocode}
+% Without default action we pass all options to \cs{setkeys}.
+% Otherwise we have to check which options are known.
+% These are passed to \cs{setkeys}. For the others the default
+% action is performed.
+% \begin{macrocode}
+ \@ifundefined{KVO@default@\@currname.\@currext}{%
+ \toks@\expandafter\expandafter\expandafter{%
+ \expandafter\KVO@temp\the\toks@
+ }%
+ }{%
+ \edef\CurrentOption{\the\toks@}%
+ \toks@\expandafter{\KVO@temp}%
+ \@for\CurrentOption:=\CurrentOption\do{%
+ \@ifundefined{%
+ KV@#1@\expandafter\KVO@getkey\CurrentOption=\@nil
+ }{%
+ \toks\tw@\expandafter{%
+ \the\toks\expandafter\tw@\expandafter,\CurrentOption
+ }%
+ }{%
+ \toks@\expandafter{%
+ \the\expandafter\toks@\expandafter,\CurrentOption
+ }%
+ }%
+ }%
+ }%
+ \fi
+ }%
+ \edef\KVO@temp{\endgroup
+ \noexpand\KVO@calldefault{\the\toks\tw@}%
+ \noexpand\KVO@setkeys{#1}{\the\toks@}%
+ }%
+ \KVO@temp
+% \end{macrocode}
+% Some cleanup of \cs{ProcessOptions}.
+% \begin{macrocode}
+ \let\CurrentOption\@empty
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}%
+}
+% \end{macrocode}
+%
+% \subsubsection{\cs{ProcessLocalKeyvalOptions}}
+%
+% \begin{macro}{\ProcessLocalKeyvalOptions}
+% If the optional star is given, we get the family
+% name and expand it for safety.
+% \begin{macrocode}
+\newcommand*{\ProcessLocalKeyvalOptions}{%
+ \@ifstar{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\KVO@ProcessLocalKeyvalOptions{\KVO@family}%
+ }%
+ \x
+ }%
+ \KVO@ProcessLocalKeyvalOptions
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\KVO@ProcessLocalKeyvalOptions#1{%
+ \let\@tempc\relax
+ \let\KVO@temp\@empty
+% \end{macrocode}
+% Check if \cs{ProcessLocalKeyvalOptions} is called inside
+% a package.
+% \begin{macrocode}
+ \ifx\@currext\@pkgextension
+ \else
+ \PackageError{kvoptions}{%
+ \string\ProcessLocalKeyvalOptions\space is intended for packages only%
+ }\@ehc
+ \fi
+% \end{macrocode}
+% The package options are put into toks register \cs{toks@}.
+% \begin{macrocode}
+ \begingroup
+ \toks\tw@{}%
+ \@ifundefined{opt@\@currname.\@currext}{%
+ \toks@\expandafter{\KVO@temp}%
+ }{%
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname opt@\@currname.\@currext\endcsname
+ }%
+% \end{macrocode}
+% Without default action we pass all options to \cs{setkeys}.
+% Otherwise we have to check which options are known.
+% These are passed to \cs{setkeys}. For the others the default
+% action is performed.
+% \begin{macrocode}
+ \@ifundefined{KVO@default@\@currname.\@currext}{%
+ \toks@\expandafter\expandafter\expandafter{%
+ \expandafter\KVO@temp\the\toks@
+ }%
+ }{%
+ \edef\CurrentOption{\the\toks@}%
+ \toks@\expandafter{\KVO@temp}%
+ \@for\CurrentOption:=\CurrentOption\do{%
+ \@ifundefined{%
+ KV@#1@\expandafter\KVO@getkey\CurrentOption=\@nil
+ }{%
+ \toks\tw@\expandafter{%
+ \the\toks\expandafter\tw@\expandafter,\CurrentOption
+ }%
+ }{%
+ \toks@\expandafter{%
+ \the\expandafter\toks@\expandafter,\CurrentOption
+ }%
+ }%
+ }%
+ }%
+ }%
+ \edef\KVO@temp{\endgroup
+ \noexpand\KVO@calldefault{\the\toks\tw@}%
+ \noexpand\KVO@setkeys{#1}{\the\toks@}%
+ }%
+ \KVO@temp
+% \end{macrocode}
+% Some cleanup of \cs{ProcessOptions}.
+% \begin{macrocode}
+ \let\CurrentOption\@empty
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Helper macros}
+%
+% \begin{macro}{\KVO@getkey}
+% Extract the key part of a key=value pair.
+% \begin{macrocode}
+\def\KVO@getkey#1=#2\@nil{#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KVO@calldefault}
+% \begin{macrocode}
+\def\KVO@calldefault#1{%
+ \begingroup
+ \def\x{#1}%
+ \expandafter\endgroup
+ \ifx\x\@empty
+ \else
+ \@for\CurrentOption:=#1\do{%
+ \ifx\CurrentOption\@empty
+ \else
+ \expandafter\KVO@setcurrents\CurrentOption=\@nil
+ \@nameuse{KVO@default@\@currname.\@currext}%
+ \fi
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVO@setcurrents}
+% Extract the key part of a key=value pair.
+% \begin{macrocode}
+\def\KVO@setcurrents#1=#2\@nil{%
+ \def\CurrentOptionValue{#2}%
+ \ifx\CurrentOptionValue\@empty
+ \let\CurrentOptionKey\CurrentOption
+ \let\CurrentOptionValue\relax
+ \else
+ \edef\CurrentOptionKey{\zap@space#1 \@empty}%
+ \expandafter\KVO@setcurrentvalue\CurrentOption\@nil
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KV@setcurrentvalue}
+% Here the value part is parsed. Package \xpackage{keyval}'s
+% \cs{KV@@sp@def} helps in removing spaces at the begin and
+% end of the value.
+% \begin{macrocode}
+\def\KVO@setcurrentvalue#1=#2\@nil{%
+ \KV@@sp@def\CurrentOptionValue{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\plainTeX}
+%
+% Disable \LaTeX\ stuff.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \def\ProcessKeyvalOptions{%
+ \@ifstar{}\@gobble
+ }%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\KVO@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \subsection{Package \xpackage{kvoptions-patch}}
+%
+% \begin{macrocode}
+%<*patch>
+\NeedsTeXFormat{LaTeX2e}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \catcode64=11 % @
+ \def\x{\endgroup
+ \expandafter\edef\csname KVO@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\KVO@AtEnd{%
+ \KVO@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{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{96}{12}% `
+\TMP@EnsureCode{124}{12}% |
+\edef\KVO@AtEnd{\KVO@AtEnd\noexpand\endinput}
+\ProvidesPackage{kvoptions-patch}%
+ [2016/05/16 v3.12 LaTeX patch for keyval options (HO)]%
+% \end{macrocode}
+%
+% Check for \eTeX.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname eTeXversion\endcsname\relax
+ \PackageWarningNoLine{kvoptions-patch}{%
+ Package loading is aborted, because e-TeX is missing%
+ }%
+ \expandafter\KVO@AtEnd
+\fi%
+% \end{macrocode}
+%
+% Package \xpackage{etexcmds} for \cs{etex@unexpanded}.
+% \begin{macrocode}
+\RequirePackage{etexcmds}[2007/09/09]
+\ifetex@unexpanded
+\else
+ \PackageError{kvoptions-patch}{%
+ Could not find eTeX's \string\unexpanded.\MessageBreak
+ Try adding \string\RequirePackage\string{etexcmds\string} %
+ before \string\documentclass%
+ }\@ehd
+ \expandafter\KVO@AtEnd
+\fi%
+% \end{macrocode}
+%
+% Check for package \xpackage{xkvltxp}.
+% \begin{macrocode}
+\@ifpackageloaded{xkvltxp}{%
+ \PackageWarningNoLine{kvoptions}{%
+ Option `patch' cannot be used together with\MessageBreak
+ package `xkvltxp' that is already loaded.\MessageBreak
+ Therefore package loading is aborted%
+ }%
+ \KVO@AtEnd
+}{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@if@ptions#1#2#3{%
+ \begingroup
+ \KVO@normalize\KVO@temp{#3}%
+ \edef\x{\endgroup
+ \noexpand\@if@pti@ns{%
+ \detokenize\expandafter\expandafter\expandafter{%
+ \csname opt@#2.#1\endcsname
+ }%
+ }{%
+ \detokenize\expandafter{\KVO@temp}%
+ }%
+ }%
+ \x
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@pass@ptions#1#2#3{%
+ \KVO@normalize\KVO@temp{#2}%
+ \@ifundefined{opt@#3.#1}{%
+ \expandafter\gdef\csname opt@#3.#1%
+ \expandafter\endcsname\expandafter{%
+ \KVO@temp
+ }%
+ }{%
+ \expandafter\gdef\csname opt@#3.#1%
+ \expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter{%
+ \csname opt@#3.#1\expandafter\endcsname\expandafter,\KVO@temp
+ }%
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\ProcessOptions{%
+ \let\ds@\@empty
+ \@ifundefined{opt@\@currname.\@currext}{%
+ \let\@curroptions\@empty
+ }{%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\@curroptions
+ \expandafter\expandafter\expandafter{%
+ \csname opt@\@currname.\@currext\endcsname
+ }%
+ }%
+ \@ifstar\KVO@xprocess@ptions\KVO@process@ptions
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\KVO@process@ptions{%
+ \@for\CurrentOption:=\@declaredoptions\do{%
+ \ifx\CurrentOption\@empty
+ \else
+ \begingroup
+ \ifx\@currext\@clsextension
+ \toks@{}%
+ \else
+ \KVO@GetClassOptionsList
+ \toks@\expandafter{\KVO@classoptionslist,}%
+ \fi
+ \toks\tw@\expandafter{\@curroptions}%
+ \edef\x{\endgroup
+ \noexpand\in@{,\CurrentOption,}{,\the\toks@\the\toks\tw@,}%
+ }%
+ \x
+ \ifin@
+ \KVO@use@ption
+ \expandafter\let\csname ds@\CurrentOption\endcsname\@empty
+ \fi
+ \fi
+ }%
+ \KVO@process@pti@ns
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\KVO@xprocess@ptions{%
+ \ifx\@currext\@clsextension
+ \else
+ \KVO@GetClassOptionsList
+ \@for\CurrentOption:=\KVO@classoptionslist\do{%
+ \ifx\CurrentOption\@empty
+ \else
+ \KVO@in@\CurrentOption\@declaredoptions
+ \ifin@
+ \KVO@use@ption
+ \expandafter\let\csname ds@\CurrentOption\endcsname\@empty
+ \fi
+ \fi
+ }%
+ \fi
+ \KVO@process@pti@ns
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\KVO@in@#1#2{%
+ \in@false
+ \begingroup
+ \@for\x:=#2\do{%
+ \ifx\x#1\relax
+ \in@true
+ \fi
+ }%
+ \edef\x{\endgroup
+ \ifin@
+ \noexpand\in@true
+ \fi
+ }%
+ \x
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\KVO@process@pti@ns{%
+ \@for\CurrentOption:=\@curroptions\do{%
+ \@ifundefined{ds@\KVO@SanitizedCurrentOption}{%
+ \KVO@use@ption
+ \default@ds
+ }%
+ \KVO@use@ption
+ }%
+ \@for\CurrentOption:=\@declaredoptions\do{%
+ \expandafter\let\csname ds@\CurrentOption\endcsname\relax
+ }%
+ \let\CurrentOption\@empty
+ \let\@fileswith@pti@ns\@@fileswith@pti@ns
+ \AtEndOfPackage{\let\@unprocessedoptions\relax}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\KVO@use@ption{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\@removeelement{%
+ \detokenize\expandafter{\CurrentOption}%
+ }{%
+ \detokenize\expandafter{\@unusedoptionlist}%
+ }%
+ }%
+ \x\@unusedoptionlist
+ \csname ds@\KVO@SanitizedCurrentOption\endcsname
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\OptionNotUsed{%
+ \ifx\@currext\@clsextension
+ \xdef\@unusedoptionlist{%
+ \ifx\@unusedoptionlist\@empty
+ \else
+ \detokenize\expandafter{\@unusedoptionlist,}%
+ \fi
+ \detokenize\expandafter{\CurrentOption}%
+ }%
+ \fi
+}
+% \end{macrocode}
+%
+% Variant of \cs{ExecuteOptions} that better protects \cs{CurrentOption}.
+% \begin{macrocode}
+\def\CurrentOption@SaveLevel{0}
+\def\ExecuteOptions{%
+ \expandafter\KVO@ExecuteOptions
+ \csname CurrentOption@\CurrentOption@SaveLevel\endcsname
+}
+\def\KVO@ExecuteOptions#1#2{%
+ \let#1\CurrentOption
+ \edef\CurrentOption@SaveLevel{%
+ \the\numexpr\CurrentOption@SaveLevel+1%
+ }%
+ \@for\CurrentOption:=#2\do{%
+ \csname ds@\CurrentOption\endcsname
+ }%
+ \edef\CurrentOption@SaveLevel{%
+ \the\numexpr\CurrentOption@SaveLevel-1%
+ }%
+ \let\CurrentOption#1%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\KVO@fileswith@pti@ns#1[#2]#3[#4]{%
+ \ifx#1\@clsextension
+ \ifx\@classoptionslist\relax
+ \KVO@normalize\KVO@temp{#2}%
+ \expandafter\gdef\expandafter\@classoptionslist\expandafter{%
+ \KVO@temp
+ }%
+ \def\reserved@a{%
+ \KVO@onefilewithoptions{#3}[{#2}][{#4}]#1%
+ \@documentclasshook
+ }%
+ \else
+ \def\reserved@a{%
+ \KVO@onefilewithoptions{#3}[{#2}][{#4}]#1%
+ }%
+ \fi
+ \else
+ \begingroup
+ \let\KVO@temp\relax
+ \let\KVO@onefilewithoptions\relax
+ \let\@pkgextension\relax
+ \def\reserved@b##1,{%
+ \ifx\@nil##1\relax
+ \else
+ \ifx\relax##1\relax
+ \else
+ \KVO@onefilewithoptions{##1}[{\KVO@temp}][{#4}]%
+ \@pkgextension
+ \fi
+ \expandafter\reserved@b
+ \fi
+ }%
+ \edef\reserved@a{\zap@space#3 \@empty}%
+ \edef\reserved@a{\expandafter\reserved@b\reserved@a,\@nil,}%
+ \toks@{#2}%
+ \def\KVO@temp{\the\toks@}%
+ \edef\reserved@a{\endgroup \reserved@a}%
+ \fi
+ \reserved@a
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\KVO@onefilewithoptions#1[#2][#3]#4{%
+ \@pushfilename
+ \xdef\@currname{#1}%
+ \global\let\@currext#4%
+ \expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty
+ \let\CurrentOption\@empty
+ \@reset@ptions
+ \makeatletter
+ \def\reserved@a{%
+ \@ifl@aded\@currext{#1}{%
+ \@if@ptions\@currext{#1}{#2}{%
+ }{%
+ \begingroup
+ \@ifundefined{opt@#1.\@currext}{%
+ \def\x{}%
+ }{%
+ \edef\x{%
+ \expandafter\expandafter\expandafter\strip@prefix
+ \expandafter\meaning\csname opt@#1.\@currext\endcsname
+ }%
+ }%
+ \def\y{#2}%
+ \edef\y{\expandafter\strip@prefix\meaning\y}%
+ \@latex@error{Option clash for \@cls@pkg\space #1}{%
+ The package #1 has already been loaded %
+ with options:\MessageBreak
+ \space\space[\x]\MessageBreak
+ There has now been an attempt to load it %
+ with options\MessageBreak
+ \space\space[\y]\MessageBreak
+ Adding the global options:\MessageBreak
+ \space\space
+ \x,\y\MessageBreak
+ to your \noexpand\documentclass declaration may fix this.%
+ \MessageBreak
+ Try typing \space <return> \space to proceed.%
+ }%
+ \endgroup
+ }%
+ }{%
+ \@pass@ptions\@currext{#2}{#1}%
+ \global\expandafter
+ \let\csname ver@\@currname.\@currext\endcsname\@empty
+ \InputIfFileExists
+ {\@currname.\@currext}%
+ {}%
+ {\@missingfileerror\@currname\@currext}%
+ \let\@unprocessedoptions\@@unprocessedoptions
+ \csname\@currname.\@currext-h@@k\endcsname
+ \expandafter\let\csname\@currname.\@currext-h@@k\endcsname
+ \@undefined
+ \@unprocessedoptions
+ }%
+ \@ifl@ter\@currext{#1}{#3}{%
+ }{%
+ \@latex@warning@no@line{%
+ You have requested,\on@line, %
+ version\MessageBreak
+ #3' of \@cls@pkg\space #1,\MessageBreak
+ but only version\MessageBreak
+ `\csname ver@#1.\@currext\endcsname'\MessageBreak
+ is available%
+ }%
+ }%
+ \ifx\@currext\@clsextension\let\LoadClass\@twoloadclasserror\fi
+ \@popfilename
+ \@reset@ptions
+ }%
+ \reserved@a
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@unknownoptionerror{%
+ \@latex@error{%
+ Unknown option `\KVO@SanitizedCurrentOption' %
+ for \@cls@pkg\space`\@currname'%
+ }{%
+ The option `\KVO@SanitizedCurrentOption' was not declared in %
+ \@cls@pkg\space`\@currname', perhaps you\MessageBreak
+ misspelled its name. %
+ Try typing \space <return> %
+ \space to proceed.%
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@@unprocessedoptions{%
+ \ifx\@currext\@pkgextension
+ \@ifundefined{opt@\@currname.\@currext}{%
+ \let\@curroptions\@empty
+ }{%
+ \expandafter\let\expandafter\@curroptions
+ \csname opt@\@currname.\@currext\endcsname
+ }%
+ \@for\CurrentOption:=\@curroptions\do{%
+ \ifx\CurrentOption\@empty\else\@unknownoptionerror\fi
+ }%
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\KVO@SanitizedCurrentOption{%
+ \expandafter\strip@prefix\meaning\CurrentOption
+}
+% \end{macrocode}
+%
+% Normalize option list.
+% \begin{macrocode}
+\def\KVO@normalize#1#2{%
+ \let\KVO@result\@empty
+ \KVO@splitcomma#2,\@nil
+ \let#1\KVO@result
+}
+\def\KVO@splitcomma#1,#2\@nil{%
+ \KVO@ifempty{#1}{}{%
+ \KVO@checkkv#1=\@nil
+ }%
+ \KVO@ifempty{#2}{}{\KVO@splitcomma#2\@nil}%
+}
+\def\KVO@ifempty#1{%
+ \expandafter\ifx\expandafter\\\detokenize{#1}\\%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+\def\KVO@checkkv#1=#2\@nil{%
+ \KVO@ifempty{#2}{%
+ % option without value
+ \edef\KVO@x{\zap@space#1 \@empty}%
+ \ifx\KVO@x\@empty
+ % ignore empty option
+ \else
+ % append to list
+ \edef\KVO@result{%
+ \etex@unexpanded\expandafter{\KVO@result},\KVO@x
+ }%
+ \fi
+ }{%
+ % #1: "key", #2: "value="
+ % add key part
+ \edef\KVO@result{%
+ \etex@unexpanded\expandafter{\KVO@result},%
+ \zap@space#1 \@empty
+ }%
+ \futurelet\@let@token\KVO@checkfirsttok#2 \@nil| = \@nil|\KVO@nil
+ }%
+}
+\def\KVO@checkfirsttok{%
+ \ifx\@let@token\bgroup
+ % no space at start
+ \expandafter\KVO@removelastspace\expandafter=%
+ % "<value><spaceopt>= \@nil"
+ \else
+ \expandafter\KVO@checkfirstA
+ \fi
+}
+\def\KVO@checkfirstA#1 #2\@nil{%
+ \KVO@ifempty{#2}{%
+ \KVO@removelastspace=#1 \@nil
+ }{%
+ \KVO@ifempty{#1}{%
+ \KVO@removelastspace=#2\@nil
+ }{%
+ \KVO@removelastspace=#1 #2\@nil
+ }%
+ }%
+}
+\def\KVO@removelastspace#1 = \@nil|#2\KVO@nil{%
+ \KVO@ifempty{#2}{%
+ \edef\KVO@result{%
+ \etex@unexpanded\expandafter{\KVO@result}%
+ \etex@unexpanded\expandafter{\KVO@removegarbage#1\KVO@nil}%
+ }%
+ }{%
+ \edef\KVO@result{%
+ \etex@unexpanded\expandafter{\KVO@result}%
+ \etex@unexpanded{#1}%
+ }%
+ }%
+}
+\def\KVO@removegarbage#1= \@nil#2\KVO@nil{#1}%
+% \end{macrocode}
+%
+% Arguments |#1| and |#2| are macros.
+% \begin{macrocode}
+\def\KVO@removeelement#1#2{%
+ \begingroup
+ \toks@={}%
+ \@for\x:=#2\do{%
+ \ifx\x\@empty
+ \else
+ \ifx\x#1\relax
+ \else
+ \edef\t{\the\toks@}%
+ \ifx\t\@empty
+ \else
+ \toks@\expandafter{\the\toks@,}%
+ \fi
+ \toks@\expandafter{\the\expandafter\toks@\x}%
+ \fi
+ \fi
+ }%
+ \edef\x{\endgroup
+ \def\noexpand#2{\the\toks@}%
+ }%
+ \x
+}
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\let\@@fileswith@pti@ns\KVO@fileswith@pti@ns
+\ifx\@fileswith@pti@ns\@badrequireerror
+\else
+ \let\@fileswith@pti@ns\KVO@fileswith@pti@ns
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\KVO@Patch}
+% \begin{macrocode}
+\let\KVO@Patch=Y
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\KVO@AtEnd%
+%</patch>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Preface for standard catcode check}
+%
+% \begin{macrocode}
+%<*test1>
+\input miniltx.tex\relax
+%</test1>
+% \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 kvoptions.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\makeatletter
+\catcode`\@=11 %
+\def\RestoreCatcodes{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@\@ne
+\repeat
+
+\def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@\@ne
+ \repeat
+}
+\def\Test#1{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\[=12 %
+ \catcode`\]=12 %
+ \catcode`\%=14 %
+ \catcode`\ =10 %
+ \catcode13=5 %
+ #1\relax
+ \RestoreCatcodes
+}
+\Test{\RequirePackage{kvoptions-patch}}%
+\Test{\RequirePackage{kvoptions}}%
+\csname @@end\endcsname
+%</test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test3>
+\NeedsTeXFormat{LaTeX2e}
+\makeatletter
+\RequirePackage{kvoptions}[2016/05/16]
+\def\msg#{\immediate\write16}
+\define@key{testfamily}{testkey}{%
+ \msg{[testfamily/testkey/#1]}%
+}
+\define@key{testfamily}{testdefaultkey}[testdefault]{%
+ \msg{[testfamily/testdefaultkey/#1]}%
+}
+\AddToKeyvalOption{testfamily}{testkey}{%
+ \msg{[addition/#1]}%
+}
+\AddToKeyvalOption{testfamily}{testdefaultkey}{%
+ \msg{[addition/#1]}%
+}
+\setkeys{testfamily}{%
+ testkey=testA,%
+ testdefaultkey=testB,%
+ testdefaultkey,%
+}
+\SetupKeyvalOptions{%
+ family=testfamily%
+}
+\AddToKeyvalOption*{testkey}{%
+ \msg{[star addition/#1]}%
+}
+\AddToKeyvalOption*{testdefaultkey}{%
+ \msg{[star addition/#1]}%
+}
+\setkeys{testfamily}{%
+ testkey=testA,%
+ testdefaultkey=testB,%
+ testdefaultkey,%
+}
+\@@end
+%</test3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test4pkg>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{kvoptions-test4}[2016/05/16 package for testing]
+\RequirePackage{kvoptions}[2016/05/16]
+\SetupKeyvalOptions{%
+ family=FOO,%
+ prefix=foo,%
+ setkeys=\kvsetkeys,%
+}
+\DeclareStringOption{str}
+\define@key{FOO}{set}{%
+ \setkeys{BAR}{strbar={#1}}%
+}
+\define@key{BAR}{strbar}{%
+ \def\foostr{[BAR:#1]}%
+}
+\ProcessKeyvalOptions*
+%</test4pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*test4>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{kvoptions-test4.tex}[2016/05/16 test file]
+\RequirePackage[%
+ str=A,set=B,str=C,%
+]{kvoptions-test4}[2016/05/16]
+\def\TestExpected{C}
+\ifx\foostr\TestExpected
+ \typeout{* Test ok.}%
+\else
+ \typeout{* Result: [\foostr]}%
+ \typeout{* Expected: [\TestExpected]}%
+ \errmessage{Test failed!}%
+\fi
+\csname @@end\endcsname\end
+%</test4>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/kvoptions}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/kvoptions.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/kvoptions.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[\CTAN{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 kvoptions.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@{}}
+% kvoptions.sty & tex/latex/oberdiek/kvoptions.sty\\
+% kvoptions-patch.sty & tex/latex/oberdiek/kvoptions-patch.sty\\
+% kvoptions.pdf & doc/latex/oberdiek/kvoptions.pdf\\
+% example-mycolorsetup.sty & doc/latex/oberdiek/example-mycolorsetup.sty\\
+% test/kvoptions-test1.tex & doc/latex/oberdiek/test/kvoptions-test1.tex\\
+% test/kvoptions-test2.tex & doc/latex/oberdiek/test/kvoptions-test2.tex\\
+% test/kvoptions-test3.tex & doc/latex/oberdiek/test/kvoptions-test3.tex\\
+% test/kvoptions-test4.tex & doc/latex/oberdiek/test/kvoptions-test4.tex\\
+% test/kvoptions-test4.sty & doc/latex/oberdiek/test/kvoptions-test4.sty\\
+% kvoptions.dtx & source/latex/oberdiek/kvoptions.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk kvoptions.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{kvoptions.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 kvoptions.dtx
+%makeindex -s gind.ist kvoptions.idx
+%pdflatex kvoptions.dtx
+%makeindex -s gind.ist kvoptions.idx
+%pdflatex kvoptions.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{kvoptions.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='kvoptions'>
+ <name>kvoptions</name>
+ <caption>Key value format for package options.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2004,2006,2007,2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='3.12'/>
+ <description>
+ This package offers support for package authors who want to
+ use options in key-value format for their package options.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/kvoptions.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/kvoptions.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \newcommand*{\bibpackage}[4]{^^A
+% \bibitem{#1}
+% Package \xpackage{#1}, #2, #3.^^A
+% \ifx\\#4\\\else\space#4\fi\par
+% }
+%
+% \begin{thebibliography}{99}
+% \bibitem{tb94wright}
+% A guide to key-value methods, Joseph Wright, second draft for
+% \href{http://www.tug.org/tugboat}{TUGBoat}, 2009-03-17.
+% \url{http://www.texdev.net/wp-content/uploads/2009/03/keyval.pdf}
+% \bibpackage{ifthen}{David Carlisle}{2001/05/26}
+% {\CTAN{macros/latex/base/ifthen.dtx}}
+% \bibpackage{helvet}{Sebastian Rahtz, Walter Schmidt}{2004/01/26}
+% {\CTAN{macros/latex/required/psnfss/psfonts.dtx}}
+% \bibpackage{hyperref}{Sebastian Rahtz, Heiko Oberdiek}{2006/02/12}
+% {\CTAN{macros/latex/contrib/hyperref/}}
+% \bibpackage{keyval}{David Carlisle}{1999/03/16}
+% {\CTAN{macros/latex/required/graphics/keyval.dtx}}
+% \bibpackage{multicol}{Frank Mittelbach}{2004/02/14}
+% {\CTAN{macros/latex/required/tools/multicol.dtx}}
+% \bibpackage{tabularx}{David Carlisle}{1999/01/07}
+% {\CTAN{macros/latex/required/tools/tabularx.dtx}}
+% \bibpackage{tracefnt}{Frank Mittelbach, Rainer Sch\"opf}{1997/05/29}
+% {\CTAN{macros/latex/base/ltfsstrc.dtx}}
+% \bibpackage{xkeyval}{Hendri Adriaens}{2005/05/07}
+% {\CTAN{macros/latex/contrib/xkeyval/}}
+% \bibitem{clsguide}
+% The \LaTeX3 Project, \textit{\LaTeXe\ for class and package writers},
+% 2003/12/09.
+% \CTAN{macros/latex/doc/clsguide.pdf}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{0000/00/00 v0.0}
+% \item
+% Probably David Carlisle's code in \xpackage{hyperref}
+% was the start.
+% \end{Version}
+% \begin{Version}{2004/02/22 v1.0}
+% \item
+% The first version was never published. It also
+% has offered a patch to get rid of \LaTeX's option
+% expansion.
+% \end{Version}
+% \begin{Version}{2006/02/16 v2.0}
+% \item
+% Now the package is redesigned with an easier
+% user interface.
+% \item
+% \cs{ProcessKeyvalOptions} remains the central service, inherited
+% from \xpackage{hyperref}'s \cs{ProcessOptionsWithKV}.
+% Now the use inside classes is also supported.
+% \item
+% Provides help macros for boolean and simple string options.
+% \item
+% Fixes for the patch of \LaTeX{}. The patch is only enabled,
+% if the user requests it.
+% \end{Version}
+% \begin{Version}{2006/02/20 v2.1}
+% \item
+% Unused option list is sanitized to prevent problems
+% with other packages that uses own processing methods
+% for key value options. Disadvantage: the unused global
+% option detection is weakened.
+% \item
+% New option type by \cs{DeclareVoidOption} for options without
+% value.
+% \item
+% Default rule by \cs{DeclareDefaultOption}.
+% \item
+% Dynamic options: \cs{DisableKeyvalOption}.
+% \end{Version}
+% \begin{Version}{2006/06/01 v2.2}
+% \item
+% Fixes for option \xoption{patch}.
+% \end{Version}
+% \begin{Version}{2006/08/17 v2.3}
+% \item
+% \cs{DeclareBooleanOption} renamed to \cs{DeclareBoolOption}
+% to avoid a name clash with package \cs{ifoption}.
+% \end{Version}
+% \begin{Version}{2006/08/22 v2.4}
+% \item
+% Option \xoption{patch}: \cs{ExecuteOptions} does not
+% change the meaning of macro \cs{CurrentOption} at all.
+% \end{Version}
+% \begin{Version}{2007/04/11 v2.5}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/05/06 v2.6}
+% \item
+% Uses package \xpackage{etexcmds}.
+% \end{Version}
+% \begin{Version}{2007/06/11 v2.7}
+% \item
+% The patch part fixes LaTeX bug latex/3965.
+% \end{Version}
+% \begin{Version}{2007/10/02 v2.8}
+% \item
+% Compatibility for \plainTeX\ added.
+% \item
+% Typos in documentation fixed (Axel Sommerfeldt).
+% \end{Version}
+% \begin{Version}{2007/10/11 v2.9}
+% \item
+% Bug fix for option \xoption{patch}.
+% \end{Version}
+% \begin{Version}{2007/10/18 v3.0}
+% \item
+% New package \xpackage{kvoptions-patch}.
+% \end{Version}
+% \begin{Version}{2009/04/10 v3.1}
+% \item
+% Space by line end removed in definition of internal macro.
+% \end{Version}
+% \begin{Version}{2009/07/17 v3.2}
+% \item
+% \cs{ProcessLocalKeyvalOptions} added.
+% \item
+% \cs{DisableKeyvalOption} with the \texttt{action=ignore} option
+% fixed (Joseph Wright).
+% \end{Version}
+% \begin{Version}{2009/07/21 v3.3}
+% \item
+% \cs{DeclareLocalOption}, \cs{DeclareLocalOptions} added.
+% \end{Version}
+% \begin{Version}{2009/08/13 v3.4}
+% \item
+% Documentation addition: recommendation for Joseph Wright's
+% review article.
+% \item
+% Documentation addition: local/global options.
+% \end{Version}
+% \begin{Version}{2009/12/04 v3.5}
+% \item
+% \cs{AddToKeyvalOption} added.
+% \end{Version}
+% \begin{Version}{2009/12/08 v3.6}
+% \item
+% Fix: If a default handler is configured, it is now also
+% called for classes.
+% \end{Version}
+% \begin{Version}{2010/02/22 v3.7}
+% \item
+% Missing space in error message added.
+% \end{Version}
+% \begin{Version}{2010/07/23 v3.8}
+% \item
+% Documenation for package \xpackage{kvoptions-patch} improved.
+% No code changes.
+% \end{Version}
+% \begin{Version}{2010/12/02 v3.9}
+% \item
+% Key \texttt{setkeys} added for \cs{SetupKeyvalOptions}.
+% \end{Version}
+% \begin{Version}{2010/12/23 v3.10}
+% \item
+% \cs{DeclareVoidOption} also parses the second parameter as
+% \hologo{TeX} argument to improve compatibility with
+% \cs{DeclareOption}.
+% \end{Version}
+% \begin{Version}{2011/06/30 v3.11}
+% \item
+% Fix because of design bug in package \xpackage{xkeyval} that
+% removes global options with equal signs.
+% \end{Version}
+% \begin{Version}{2016/05/16 v3.12}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/kvoptions.pdf b/macros/latex/contrib/oberdiek/kvoptions.pdf
new file mode 100644
index 0000000000..8b444640d3
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/kvoptions.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/kvsetkeys.dtx b/macros/latex/contrib/oberdiek/kvsetkeys.dtx
new file mode 100644
index 0000000000..9c07858dd8
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/kvsetkeys.dtx
@@ -0,0 +1,2201 @@
+% \iffalse meta-comment
+%
+% File: kvsetkeys.dtx
+% Version: 2016/05/16 v1.17
+% Info: Key value parser
+%
+% Copyright (C) 2006, 2007, 2009-2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 kvsetkeys.dtx
+% and the derived files
+% kvsetkeys.sty, kvsetkeys.pdf, kvsetkeys.ins, kvsetkeys.drv,
+% kvsetkeys-example.tex, kvsetkeys-test1.tex,
+% kvsetkeys-test2.tex, kvsetkeys-test3.tex,
+% kvsetkeys-test4.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/kvsetkeys.dtx
+% CTAN:macros/latex/contrib/oberdiek/kvsetkeys.pdf
+%
+% Unpacking:
+% (a) If kvsetkeys.ins is present:
+% tex kvsetkeys.ins
+% (b) Without kvsetkeys.ins:
+% tex kvsetkeys.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{kvsetkeys.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If kvsetkeys.drv is present:
+% latex kvsetkeys.drv
+% (b) Without kvsetkeys.drv:
+% latex kvsetkeys.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 kvsetkeys.dtx
+% makeindex -s gind.ist kvsetkeys.idx
+% pdflatex kvsetkeys.dtx
+% makeindex -s gind.ist kvsetkeys.idx
+% pdflatex kvsetkeys.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/kvsetkeys.sty
+% TDS:doc/latex/oberdiek/kvsetkeys.pdf
+% TDS:doc/latex/oberdiek/kvsetkeys-example.tex
+% TDS:doc/latex/oberdiek/test/kvsetkeys-test1.tex
+% TDS:doc/latex/oberdiek/test/kvsetkeys-test2.tex
+% TDS:doc/latex/oberdiek/test/kvsetkeys-test3.tex
+% TDS:doc/latex/oberdiek/test/kvsetkeys-test4.tex
+% TDS:source/latex/oberdiek/kvsetkeys.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: kvsetkeys
+Version: 2016/05/16 v1.17
+
+Copyright (C) 2006, 2007, 2009-2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 kvsetkeys.dtx
+and the derived files
+ kvsetkeys.sty, kvsetkeys.pdf, kvsetkeys.ins, kvsetkeys.drv,
+ kvsetkeys-example.tex, kvsetkeys-test1.tex,
+ kvsetkeys-test2.tex, kvsetkeys-test3.tex,
+ kvsetkeys-test4.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{kvsetkeys.ins}{\from{kvsetkeys.dtx}{install}}%
+ \file{kvsetkeys.drv}{\from{kvsetkeys.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{kvsetkeys.sty}{\from{kvsetkeys.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{kvsetkeys-example.tex}{\from{kvsetkeys.dtx}{example}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{kvsetkeys-test1.tex}{\from{kvsetkeys.dtx}{test1}}%
+% \file{kvsetkeys-test2.tex}{\from{kvsetkeys.dtx}{test2}}%
+% \file{kvsetkeys-test3.tex}{\from{kvsetkeys.dtx}{test2,noetex}}%
+% \file{kvsetkeys-test4.tex}{\from{kvsetkeys.dtx}{test4}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{kvsetkeys.xml}{\from{kvsetkeys.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{* kvsetkeys.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `kvsetkeys.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{kvsetkeys.drv}%
+ [2016/05/16 v1.17 Key value parser (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{kvsetkeys.dtx}%
+\end{document}
+%</driver>
+% \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{kvsetkeys.drv}
+%
+% \title{The \xpackage{kvsetkeys} package}
+% \date{2016/05/16 v1.17}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{kvsetkeys} provides \cs{kvsetkeys}, a variant
+% of package \xpackage{keyval}'s \cs{setkeys}. It allows to specify
+% a handler that deals with unknown options. Active commas and equal
+% signs may be used (e.g. see \xpackage{babel}'s shorthands) and
+% only one level of curly braces is removed from the values.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \def\M#1{\texttt{\{}\meta{#1}\texttt{\}}}
+%
+% \section{Documentation}
+%
+% First I want to recommend the very good review article
+% ``A guide to key-value methods'' by Joseph Wright \cite{tb94wright}.
+% It introduces the different key-value packages and compares them.
+%
+% \subsection{Motivation}
+%
+% \cs{kvsetkeys} serves as replacement for \xpackage{keyval}'s
+% \cs{setkeys}. It basically uses the same syntax. But the
+% implementation is more robust and predictable:
+% \begin{description}
+% \item[Active syntax characters:]
+% Comma `|,|' and the equals sign `|=|' are used inside
+% key value lists as syntax characters. Package \xpackage{keyval}
+% uses the catcode of the characters that is active during
+% package loading, usually this is catcode 12 (other).
+% But it can happen that the catcode setting of the syntax characters
+% changes. Especially active characters are of interest, because
+% some language adaptations uses them. For example, option \xoption{turkish}
+% of package \xpackage{babel} uses the equals sign as active shorthand
+% character. Therefore package \xpackage{kvsetkeys} deals with
+% both catcode settings 12 (other) and 13 (active).
+% \item[Brace removal:]
+% Package \xpackage{keyval}'s \cs{setkeys} removes up to two
+% levels of curly braces around the value in some unpredictable way:
+%\begin{quote}
+%|\setkeys{fam}{key={{value}}} || || | $\rightarrow$ |value|\\
+%|\setkeys{fam}{key={{{value}}}} | $\rightarrow$ |{value}|\\
+%|\setkeys{fam}{key= {{{value}}}}| $\rightarrow$ |{{value}}|
+%\end{quote}
+% This package \xpackage{kvsetkeys} follows a much stronger rule:
+% Exactly one level of braces are removed from an item, if the
+% item is surrounded by curly braces. An item can be a
+% the key value pair, the key or the value.
+%\begin{quote}
+%|\kvsetkeys{fam}{key={value}} || | $\rightarrow$ |value|\\
+%|\kvsetkeys{fam}{key={{value}} | $\rightarrow$ |{value}|\\
+%|\kvsetkeys{fam}{key= {{value}}| $\rightarrow$ |{value}|
+%\end{quote}
+% \item[Arbitrary values:] Unmatched conditionals are supported.
+% \end{description}
+%
+% Before I describe
+% \cs{kvsetkeys} in more detail, first I want to explain, how
+% this package deals with key value lists. For the package also
+% provides low level interfaces that can be used by package authors.
+%
+% \subsection{Normalizing key value lists}
+%
+% \begin{declcs}{kv@normalize}\,\M{key value list}
+% \end{declcs}
+% If the user specifies key value lists, he usually prefers
+% nice formatted source code, e.g.:
+% \begin{quote}
+%\begin{verbatim}
+%\hypersetup{
+% pdftitle = {...},
+% pdfsubject = {...},
+% pdfauthor = {...},
+% pdfkeywords = {...},
+% ...
+%}
+%\end{verbatim}
+% \end{quote}
+% Thus there can be spaces around keys, around |=| or around the value.
+% Also empty entries are possible by too many commas. Therefore these
+% spaces and empty entries are silently removed by package \xpackage{keyval}
+% and this package. Whereas the contents of the value can be protected
+% by curly braces, especially if spaces or commas are used inside,
+% a key name must not use spaces or other syntax characters.
+%
+% \cs{kv@normalize} takes a key value list and performs the cleanup:
+% \begin{itemize}
+% \item Spaces are removed.
+% \item Syntax characters (comma and equal sign) that are active
+% are replaced by the same characters with standard catcode.
+% (Example: \xpackage{babel}'s language option \xoption{turkish}
+% uses the equal sign as active shorthand character.)
+% \end{itemize}
+% The result is stored in \cs{kv@list}, e.g.:
+% \begin{quote}
+% |\kv@list| $\rightarrow$ |,pdftitle={...},pdfsubject={...},...,|
+% \end{quote}
+% Curly braces around values (or keys) remain untouched.
+% \begin{description}
+% \item[v1.3+:]
+% One comma is added in front of the list and each pair ends with
+% a comma. Thus an empty list consists of one comma, otherwise
+% two commas encloses the list. Empty entries other than the first
+% are removed.
+% \item[v1.0 -- v1.2:]
+% Empty entries are removed later. In fact it adds a comma at the begin
+% and end to protect the last value and an easier implementation.
+% \end{description}
+%
+% \subsection{Parsing key value lists}
+%
+% \begin{declcs}{kv@parse}\,\M{key value list}\,\M{processor}
+% \end{declcs}
+% It is easier to parse a normalized list, thus \cs{kv@parse}
+% normalizes the list and calls \cs{kv@parse@normalized}.
+%
+% \begin{declcs}{kv@parse@normalized}\,\M{key value list}%
+% \,\M{processor}
+% \end{declcs}
+% Now the key value list is split into single key value pairs.
+% For further processing the key and value are given as arguments
+% for the \meta{processor}:
+% \begin{quote}
+% \meta{processor}\,\M{key}\,\M{value}
+% \end{quote}
+% Also key and value are stored in macro names:
+% \begin{itemize}
+% \item \cs{kv@key} stores the key.
+% \item \cs{kv@value} stores the value or if the value was not
+% specified it has the meaning \cs{relax}.
+% \end{itemize}
+% The behaviour in pseudo code:
+% \begin{quote}
+% foreach (\meta{key}, \meta{value}) in (\meta{key value list})\\
+% \hspace*{1.5em}\cs{kv@key} := \meta{key}\\
+% \hspace*{1.5em}\cs{kv@value} := \meta{value}\\
+% \hspace*{1.5em}\meta{processor}\,\M{key}\,\M{value}
+% \end{quote}
+%
+% \begin{declcs}{kv@break}
+% \end{declcs}
+% Since version 2011/03/03 v1.11 \cs{kv@break} can be
+% called inside the \meta{processor}
+% of \cs{kv@parse} or \cs{kv@parse@normalized}, then
+% the processing is stopped and the following entries discarded.
+%
+% \subsection{Processing key value pairs}
+%
+% Key value pairs can be processed in many different ways.
+% For example, the processor for \cs{kvsetkeys} works similar
+% to \cs{setkeys} of package \xpackage{keyval}. There unknown
+% keys raise an error.
+%
+% Package \xpackage{xkeyval} also knows a star form of \cs{setkeys}
+% that stores unknown keys in an internal macro for further processing
+% with \cs{setrmkeys} and similar macros. This feature is covered
+% by processor \cs{kv@processor@known}.
+%
+% \subsubsection{Processing similar to \xpackage{keyval}}
+%
+% \begin{declcs}{kv@processor@default}\,\M{family}\,\M{key}\,\M{value}
+% \end{declcs}
+% There are many possiblities to process key value pairs.
+% \cs{kv@processor@default} is the processor used in \cs{kvsetkeys}.
+% It reimplements and extends the behaviour of
+% \xpackage{keyval}'s \cs{setkeys}.
+% In case of unknown keys \cs{setkeys} raise an error.
+% This processer, however, calls a handler instead, if it
+% is provided by the family. Both \meta{family} and \meta{key}
+% may contain package \xpackage{babel}'s shorthands
+% (since 2011/04/07 v1.13).
+%
+% Since 2011/10/18 v1.15 the family handler can reject the
+% successful handling of a key by calling \cs{kv@handled@false}.
+%
+% Since 2016/05/16 v1.17 \cs{kv@processor@default} also defines
+% macro \cs{kv@fam} with meaning \meta{family} for convenience.
+%
+% \subsubsection{Processing similar to \cs{setkeys*} of package \xpackage{xkeyval}}
+%
+% \begin{declcs}{kv@processor@known}\,\M{family}\,^^A
+% \M{cmd}\,\M{key}\,\M{value}
+% \end{declcs}
+% The key value processor \cs{kv@processor@known} behaves similar
+% to \cs{kv@processor@default}. If the \meta{key} exists in the
+% \meta{family} its code is called, otherwise the family handler
+% is tried. If the family handler is not set or cannot handle the
+% key, the unknown key value pair is added to the macro \meta{cmd}.
+% Since 2011/10/18 v1.15.
+%
+% The behaviour in pseudo code:
+% \begin{quote}
+% if \meta{key} exists\\
+% \hspace*{1.5em}call the keyval code of \meta{key}\\
+% else\\
+% \hspace*{1.5em}if \meta{handler} for \meta{family} exists\\
+% \hspace*{3em}handled = true\\
+% \hspace*{3em}\meta{handler}\,\M{key}\,\M{value}\\
+% \hspace*{3em}if handled\\
+% \hspace*{3em}else\\
+% \hspace*{4.5em}add \texttt{"}\M{key}\texttt{=}\M{value}\texttt{"}
+% to \M{cmd}\\
+% \hspace*{3em}fi\\
+% \hspace*{1.5em}else\\
+% \hspace*{3em}add \texttt{"}\M{key}\texttt{=}\M{value}\texttt{"}
+% to \M{cmd}\\
+% \hspace*{3em}raise unknown key error\\
+% \hspace*{1.5em}fi\\
+% fi
+% \end{quote}
+%
+% Since 2016/05/16 v1.17 \cs{kv@processor@known} also defines
+% macro \cs{kv@fam} with meaning \meta{family} for convenience.
+%
+% \subsection{Default family handler}
+%
+% \cs{kv@processor@default} calls \meta{handler}, the default
+% handler for the family, if the key does not exist in the family.
+% The handler is called with two arguments, the key and the value.
+% It can be defined with \cs{kv@set@family@hander}:
+%
+% \begin{declcs}{kv@set@family@handler}\,\M{family}\,\M{handler definition}
+% \end{declcs}
+% This sets the default family handler for the keyval family
+% \meta{family}. Inside \meta{handler definition} |#1| stands for
+% the key and |#2| is the value. Also \cs{kv@key} and \cs{kv@value}
+% can be used for the key and the value. If the value is not given,
+% \cs{kv@value} has the meaning \cs{relax}.
+%
+% \begin{declcs}{kv@unset@family@handler}\,\M{family}
+% \end{declcs}
+% It removes the family handler for \meta{family}.
+% Since 2011/10/18 v1.15.
+%
+% \subsection{Put it all together}
+%
+% \begin{declcs}{kvsetkeys}\,\M{family}\,\M{key value list}
+% \end{declcs}
+% Macro \cs{kvsetkeys} processes the \meta{key value list} with
+% the standard processor \cs{kv@processor@default}:
+% \begin{quote}
+% \cs{kv@parse}\,\M{key value list}^^A
+% \texttt{\{}\cs{kv@processor@default}\,\M{family}\texttt{\}}
+% \end{quote}
+%
+% \begin{declcs}{kvsetknownkeys}\,\M{family}\,\M{cmd}\,\M{key value list}
+% \end{declcs}
+% Macro \cs{kvsetknownkeys} processes the \meta{key value list}
+% with processor \cs{kv@processor@known}. All key value pairs
+% with keys that are not known in \meta{family} are stored
+% in macro \meta{cmd}. A previous contents of macro \meta{cmd}
+% will be overwritten. If all keys can be handled, \meta{cmd}
+% will be empty, otherwise it contains a key value list of
+% unhandled key value pairs.
+% Since 2011/10/18 v1.15.
+%
+% Pseudo code:
+% \begin{quote}
+% create macro \meta{cmdaux} with unique name (inside the current group)\\
+% \cs{def}\meta{cmdaux}\{\}\\
+% \cs{kv@parse}\,\M{key value list}^^A
+% \texttt{\{}\cs{kv@processor@known}\,\M{family}\,\M{cmdaux}\texttt{\}}\\
+% \cs{let}\meta{cmd}=\meta{cmdaux}
+% \end{quote}
+%
+% \begin{declcs}{kvsetkeys@expandafter}\,\M{family}\,\M{list cmd}\\
+% \cs{kvsetknownkeys@expandafter}\,\M{family}\,%
+% \M{cmd}\,\M{list cmd}
+% \end{declcs}
+% Both macros behave like the counterparts without suffix
+% |@expandafter|. The difference is that the key value list is
+% given as macro that is expanded once.
+% Since 2011/10/18 v1.15.
+%
+% Thus you can replace \cs{setkeys} of package \xpackage{keyval}
+% by the key value parser of this package:
+% \begin{quote}
+% |\renewcommand*{\setkeys}{\kvsetkeys}|\\
+% or\\
+% |\let\setkeys\kvsetkeys|
+% \end{quote}
+%
+% \subsection{Comma separated lists}
+%
+% Since version 2007/09/29 v1.3 this package also supports the normalizing
+% and parsing of general comma separated lists.
+%
+% \begin{declcs}{comma@normalize}\,\M{comma list}
+% \end{declcs}
+% Macro \cs{comma@normalize} normalizes the comma separated list,
+% removes spaces around commas. The result is put in macro \cs{comma@list}.
+%
+% \begin{declcs}{comma@parse}\,\M{comma list}\,\M{processor}
+% \end{declcs}
+% Macro \cs{comma@parse} first normalizes the comma separated list
+% and then parses the list by calling \cs{comma@parse@normalized}.
+%
+% \begin{declcs}{comma@parse@normalized}\,\M{normalized comma list}^^A
+% \,\M{processor}
+% \end{declcs}
+% The list is parsed. Empty entries are ignored. \meta{processor}
+% is called for each non-empty entry with the entry as argument:
+% \begin{quote}
+% \meta{processor}|{|\meta{entry}|}|
+% \end{quote}
+% Also the entry is stored in the macro \cs{comma@entry}.
+%
+% \begin{declcs}{comma@break}
+% \end{declcs}
+% Since version 2011/03/03 v1.11 \cs{comma@break} can be
+% called inside the \meta{processor}
+% of \cs{comma@parse} or \cs{comma@parse@normalized}, then
+% the processing is stopped and the following entries discarded.
+%
+% \section{Example}
+%
+% The following example prints a short piece of HTML code using
+% the tabbing environment for indenting purpose and a key value
+% syntax for specifying the attributes of an HTML tag.
+% The example illustrates the use of a default family handler.
+% \begin{macrocode}
+%<*example>
+\documentclass{article}
+\usepackage[T1]{fontenc}
+\usepackage{kvsetkeys}
+\usepackage{keyval}
+
+\makeatletter
+\newcommand*{\tag}[2][]{%
+ % #1: attributes
+ % #2: tag name
+ \begingroup
+ \toks@={}%
+ \let\@endslash\@empty
+ \kvsetkeys{tag}{#1}%
+ \texttt{%
+ \textless #2\the\toks@\@endslash\textgreater
+ }%
+ \endgroup
+}
+\kv@set@family@handler{tag}{%
+ % #1: key
+ % #2: value
+ \toks@\expandafter{%
+ \the\toks@
+ \space
+ #1=\string"#2\string"%
+ }%
+}
+\define@key{tag}{/}[]{%
+ \def\@endslash{/}%
+}
+\makeatother
+
+\begin{document}
+\begin{tabbing}
+ \mbox{}\qquad\=\qquad\=\kill
+ \tag{html}\\
+ \>\dots\\
+ \>\tag[border=1]{table}\\
+ \>\>\tag[width=200, span=3, /]{colgroup}\\
+ \>\>\dots\\
+ \>\tag{/table}\\
+ \>\dots\\
+ \tag{/html}\\
+\end{tabbing}
+\end{document}
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@kvsetkeys.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{kvsetkeys}{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@kvsetkeys.sty\endcsname
+\ProvidesPackage{kvsetkeys}%
+ [2016/05/16 v1.17 Key value parser (HO)]%
+% \end{macrocode}
+%
+% \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 KVS@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\KVS@AtEnd{%
+ \KVS@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{36}{3}% $
+\TMP@EnsureCode{38}{4}% &
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^ (superscript)
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{126}{13}% ~ (active)
+\edef\KVS@AtEnd{\KVS@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Package loading}
+%
+% \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{etexcmds}[2010/01/28]%
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{etexcmds}[2010/01/28]%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\ifx\csname toks@\endcsname\relax
+ \toksdef\toks@=0 %
+\fi
+% \end{macrocode}
+%
+% \subsection{Check for \eTeX}
+%
+% \cs{unexpanded}, \cs{ifcsname}, and \cs{unless} are used if found.
+% \begin{macrocode}
+\begingroup\expandafter\endgroup
+\ifcase0\ifetex@unexpanded
+ \expandafter\ifx\csname ifcsname\endcsname\relax
+ \else
+ \expandafter\ifx\csname unless\endcsname\relax
+ \else
+ 1%
+ \fi
+ \fi
+ \fi
+ \catcode`\$=9 % ignore
+ \catcode`\&=14 % comment
+\else % e-TeX
+ \catcode`\$=14 % comment
+ \catcode`\&=9 % ignore
+\fi
+% \end{macrocode}
+%
+% \subsection{Generic help macros}
+%
+% \begin{macro}{\KVS@Empty}
+% \begin{macrocode}
+\def\KVS@Empty{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@FirstOfTwo}
+% \begin{macrocode}
+\long\def\KVS@FirstOfTwo#1#2{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@SecondOfTwo}
+% \begin{macrocode}
+\long\def\KVS@SecondOfTwo#1#2{#2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KVS@IfEmpty}
+% \begin{macrocode}
+\long\def\KVS@IfEmpty#1{%
+& \edef\KVS@Temp{\etex@unexpanded{#1}}%
+$ \begingroup
+$ \toks@{#1}%
+$ \edef\KVS@Temp{\the\toks@}%
+$ \expandafter\endgroup
+ \ifx\KVS@Temp\KVS@Empty
+ \expandafter\KVS@FirstOfTwo
+ \else
+ \expandafter\KVS@SecondOfTwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Normalizing}
+%
+% \begin{macro}{\kv@normalize}
+% \begin{macrocode}
+\long\def\kv@normalize#1{%
+ \begingroup
+ \toks@{,#1,}%
+ \KVS@Comma
+ \KVS@SpaceComma
+ \KVS@CommaSpace
+ \KVS@CommaComma
+ \KVS@Equals
+ \KVS@SpaceEquals
+ \KVS@EqualsSpace
+ \xdef\KVS@Global{\the\toks@}%
+ \endgroup
+ \let\kv@list\KVS@Global
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\comma@normalize}
+% \begin{macrocode}
+\def\comma@normalize#1{%
+ \begingroup
+ \toks@{,#1,}%
+ \KVS@Comma
+ \KVS@SpaceComma
+ \KVS@CommaSpace
+ \KVS@CommaComma
+ \xdef\KVS@Global{\the\toks@}%
+ \endgroup
+ \let\comma@list\KVS@Global
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@Comma}
+% Converts active commas into comma with catcode other.
+% Also adds a comma at the end to protect the last value
+% for next cleanup steps.
+% \begin{macrocode}
+\begingroup
+ \lccode`\,=`\,%
+ \lccode`\~=`\,%
+\lowercase{\endgroup
+ \def\KVS@Comma{%
+ \toks@\expandafter{\expandafter}\expandafter
+ \KVS@@Comma\the\toks@~\KVS@Nil
+ }%
+ \long\def\KVS@@Comma#1~#2\KVS@Nil{%
+ \toks@\expandafter{\the\toks@#1}%
+ \KVS@IfEmpty{#2}{%
+ }{%
+ \KVS@@Comma,#2\KVS@Nil
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@SpaceComma}
+% Removes spaces before the comma, may add commas at the end.
+% \begin{macrocode}
+\def\KVS@SpaceComma#1{%
+ \def\KVS@SpaceComma{%
+ \expandafter\KVS@@SpaceComma\the\toks@#1,\KVS@Nil
+ }%
+}
+\KVS@SpaceComma{ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@@SpaceComma}
+% \begin{macrocode}
+\long\def\KVS@@SpaceComma#1 ,#2\KVS@Nil{%
+ \KVS@IfEmpty{#2}{%
+ \toks@{#1}%
+ }{%
+ \KVS@@SpaceComma#1,#2\KVS@Nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@CommaSpace}
+% Removes spaces after the comma, may add commas at the end.
+% \begin{macrocode}
+\def\KVS@CommaSpace{%
+ \expandafter\KVS@@CommaSpace\the\toks@, \KVS@Nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@@CommaSpace}
+% \begin{macrocode}
+\long\def\KVS@@CommaSpace#1, #2\KVS@Nil{%
+ \KVS@IfEmpty{#2}{%
+ \toks@{#1}%
+ }{%
+ \KVS@@CommaSpace#1,#2\KVS@Nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@CommaComma}
+% Replaces multiple commas by one comma.
+% \begin{macrocode}
+\def\KVS@CommaComma{%
+ \expandafter\KVS@@CommaComma\the\toks@,\KVS@Nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@@CommaComma}
+% \begin{macrocode}
+\long\def\KVS@@CommaComma#1,,#2\KVS@Nil{%
+ \KVS@IfEmpty{#2}{%
+ \toks@{#1,}% (!)
+ }{%
+ \KVS@@CommaComma#1,#2\KVS@Nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KVS@Equals}
+% Converts active equals signs into catcode other characters.
+% \begin{macrocode}
+\begingroup
+ \lccode`\==`\=%
+ \lccode`\~=`\=%
+\lowercase{\endgroup
+ \def\KVS@Equals{%
+ \toks@\expandafter{\expandafter}\expandafter
+ \KVS@@Equals\the\toks@~\KVS@Nil
+ }%
+ \long\def\KVS@@Equals#1~#2\KVS@Nil{%
+ \edef\KVS@Temp{\the\toks@}%
+ \ifx\KVS@Temp\KVS@Empty
+ \expandafter\KVS@FirstOfTwo
+ \else
+ \expandafter\KVS@SecondOfTwo
+ \fi
+ {%
+ \toks@{#1}%
+ }{%
+ \toks@\expandafter{\the\toks@=#1}%
+ }%
+ \KVS@IfEmpty{#2}{%
+ }{%
+ \KVS@@Equals#2\KVS@Nil
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@SpaceEquals}
+% Removes spaces before the equals sign.
+% \begin{macrocode}
+\def\KVS@SpaceEquals#1{%
+ \def\KVS@SpaceEquals{%
+ \expandafter\KVS@@SpaceEquals\the\toks@#1=\KVS@Nil
+ }%
+}
+\KVS@SpaceEquals{ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@@SpaceEquals}
+% \begin{macrocode}
+\long\def\KVS@@SpaceEquals#1 =#2\KVS@Nil{%
+ \KVS@IfEmpty{#2}{%
+ \toks@{#1}%
+ }{%
+ \KVS@@SpaceEquals#1=#2\KVS@Nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@EqualsSpace}
+% Removes spaces after the equals sign.
+% \begin{macrocode}
+\def\KVS@EqualsSpace{%
+ \expandafter\KVS@@EqualsSpace\the\toks@= \KVS@Nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@@EqualsSpace}
+% \begin{macrocode}
+\long\def\KVS@@EqualsSpace#1= #2\KVS@Nil{%
+ \KVS@IfEmpty{#2}{%
+ \toks@{#1}%
+ }{%
+ \KVS@@EqualsSpace#1=#2\KVS@Nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Parsing key value lists}
+%
+% \begin{macro}{\kv@parse}
+% Normalizes and parses the key value list. Also sets \cs{kv@list}.
+% \begin{macrocode}
+\long\def\kv@parse#1{%
+ \kv@normalize{#1}%
+ \expandafter\kv@parse@normalized\expandafter{\kv@list}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\kv@parse@normalized}
+% |#1|: key value list\\
+% |#2|: processor
+% \begin{macrocode}
+\long\def\kv@parse@normalized#1#2{%
+ \KVS@Parse#1,\KVS@Nil{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@Parse}
+% |#1,#2|: key value list\\
+% |#3|: processor
+% \begin{macrocode}
+\long\def\KVS@Parse#1,#2\KVS@Nil#3{%
+ \KVS@IfEmpty{#1}{%
+ }{%
+ \KVS@Process#1=\KVS@Nil{#3}%
+ }%
+ \KVS@MaybeBreak
+ \KVS@IfEmpty{#2}{%
+ }{%
+ \KVS@Parse#2\KVS@Nil{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@Process}
+% |#1|: key\\
+% |#2|: value, |=|\\
+% |#3|: processor
+% \begin{macrocode}
+\long\def\KVS@Process#1=#2\KVS@Nil#3{%
+ \let\KVS@MaybeBreak\relax
+ \def\kv@key{#1}%
+ \KVS@IfEmpty{#2}{%
+ \let\kv@value\relax
+ #3{#1}{}%
+ }{%
+ \KVS@@Process{#1}#2\KVS@Nil{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@@Process}
+% |#1|: key\\
+% |#2|: value\\
+% |#3|: processor
+% \begin{macrocode}
+\long\def\KVS@@Process#1#2=\KVS@Nil#3{%
+& \edef\kv@value{\etex@unexpanded{#2}}%
+$ \begingroup
+$ \toks@{#2}%
+$ \xdef\KVS@Global{\the\toks@}%
+$ \endgroup
+$ \let\kv@value\KVS@Global
+ #3{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@MaybeBreak}
+% \begin{macrocode}
+\let\KVS@MaybeBreak\relax
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@break}
+% \begin{macrocode}
+\def\KVS@break#1#2#3#4{%
+ \let\KVS@MaybeBreak\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\kv@break}
+% \begin{macrocode}
+\def\kv@break{%
+ \let\KVS@MaybeBreak\KVS@break
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Parsing comma lists}
+%
+% \begin{macro}{\comma@parse}
+% Normalizes and parses the key value list. Also sets \cs{comma@list}.
+% \begin{macrocode}
+\def\comma@parse#1{%
+ \comma@normalize{#1}%
+ \expandafter\comma@parse@normalized\expandafter{\comma@list}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\comma@parse@normalized}
+% |#1|: comma list\\
+% |#2|: processor
+% \begin{macrocode}
+\def\comma@parse@normalized#1#2{%
+ \KVS@CommaParse#1,\KVS@Nil{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@CommaParse}
+% |#1,#2|: comma list\\
+% |#3|: processor
+% \begin{macrocode}
+\def\KVS@CommaParse#1,#2\KVS@Nil#3{%
+ \KVS@IfEmpty{#1}{%
+ }{%
+ \def\comma@entry{#1}%
+ #3{#1}%
+ }%
+ \KVS@MaybeBreak
+ \KVS@IfEmpty{#2}{%
+ }{%
+ \KVS@CommaParse#2\KVS@Nil{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\comma@break}
+% \begin{macrocode}
+\def\comma@break{%
+ \let\KVS@MaybeBreak\KVS@break
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Processing key value pairs}
+%
+% \begin{macro}{\kv@handled@false}
+% The handler can call \cs{kv@handled@false} or
+% \cs{kv@handled@true} so report failure or success.
+% The default is success (compatibility for versions
+% before 2011/10/18 v1.15).
+% \begin{macrocode}
+\def\kv@handled@false{%
+ \let\ifkv@handled@\iffalse
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\kv@handled@true}
+% \begin{macrocode}
+\def\kv@handled@true{%
+ \let\ifkv@handled@\iftrue
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifkv@handled@}
+% \begin{macrocode}
+\kv@handled@true
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\kv@processor@default}
+% \begin{macrocode}
+\def\kv@processor@default#1#2{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \let\ifincsname\iftrue
+ \edef\KVS@temp{\endgroup
+ \noexpand\KVS@ProcessorDefault{#1}{#2}%
+ }%
+ \KVS@temp
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@ProcessorDefault}
+% \begin{macrocode}
+\long\def\KVS@ProcessorDefault#1#2#3{%
+ \def\kv@fam{#1}%
+& \unless\ifcsname KV@#1@#2\endcsname
+$ \begingroup\expandafter\expandafter\expandafter\endgroup
+$ \expandafter\ifx\csname KV@#1@#2\endcsname\relax
+& \unless\ifcsname KVS@#1@handler\endcsname
+$ \begingroup\expandafter\expandafter\expandafter\endgroup
+$ \expandafter\ifx\csname KVS@#1@handler\endcsname\relax
+ \kv@error@unknownkey{#1}{#2}%
+ \else
+ \kv@handled@true
+ \csname KVS@#1@handler\endcsname{#2}{#3}%
+ \relax
+ \ifkv@handled@
+ \else
+ \kv@error@unknownkey{#1}{#2}%
+ \fi
+ \fi
+ \else
+ \ifx\kv@value\relax
+& \unless\ifcsname KV@#1@#2@default\endcsname
+$ \begingroup\expandafter\expandafter\expandafter\endgroup
+$ \expandafter\ifx\csname KV@#1@#2@default\endcsname\relax
+ \kv@error@novalue{#1}{#2}%
+ \else
+ \csname KV@#1@#2@default\endcsname
+ \relax
+ \fi
+ \else
+ \csname KV@#1@#2\endcsname{#3}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\kv@processor@known}
+% \begin{macrocode}
+\def\kv@processor@known#1#2#3{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \let\ifincsname\iftrue
+ \edef\KVS@temp{\endgroup
+ \noexpand\KVS@ProcessorKnown{#1}\noexpand#2{#3}%
+ }%
+ \KVS@temp
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@ProcessorKnown}
+% \begin{macrocode}
+\long\def\KVS@ProcessorKnown#1#2#3#4{%
+ \def\kv@fam{#1}%
+& \unless\ifcsname KV@#1@#3\endcsname
+$ \begingroup\expandafter\expandafter\expandafter\endgroup
+$ \expandafter\ifx\csname KV@#1@#3\endcsname\relax
+& \unless\ifcsname KVS@#1@handler\endcsname
+$ \begingroup\expandafter\expandafter\expandafter\endgroup
+$ \expandafter\ifx\csname KVS@#1@handler\endcsname\relax
+ \KVS@AddUnhandled#2{#3}{#4}%
+ \else
+ \kv@handled@true
+ \csname KVS@#1@handler\endcsname{#3}{#4}%
+ \relax
+ \ifkv@handled@
+ \else
+ \KVS@AddUnhandled#2{#3}{#4}%
+ \fi
+ \fi
+ \else
+ \ifx\kv@value\relax
+& \unless\ifcsname KV@#1@#2@default\endcsname
+$ \begingroup\expandafter\expandafter\expandafter\endgroup
+$ \expandafter\ifx\csname KV@#1@#3@default\endcsname\relax
+ \kv@error@novalue{#1}{#3}%
+ \else
+ \csname KV@#1@#3@default\endcsname
+ \relax
+ \fi
+ \else
+ \csname KV@#1@#3\endcsname{#4}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@AddUnhandled}
+% \begin{macrocode}
+\long\def\KVS@AddUnhandled#1#2#3{%
+& \edef#1{%
+& \ifx#1\KVS@empty
+& \else
+& \etex@unexpanded{#1},%
+& \fi
+& \etex@unexpanded{{#2}={#3}}%
+& }%
+$ \begingroup
+$ \ifx#1\KVS@empty
+$ \toks@{{#2}={#3}}%
+$ \else
+$ \toks@\expandafter{#1,{#2}={#3}}%
+$ \fi
+$ \xdef\KVS@Global{\the\toks@}%
+$ \endgroup
+$ \let#1\KVS@Global
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\kv@set@family@handler}
+% \begin{macrocode}
+\long\def\kv@set@family@handler#1#2{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \let\ifincsname\iftrue
+ \expandafter\endgroup
+ \expandafter\def\csname KVS@#1@handler\endcsname##1##2{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\kv@unset@family@handler}
+% \begin{macrocode}
+\long\def\kv@unset@family@handler#1#2{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \let\ifincsname\iftrue
+ \expandafter\endgroup
+ \expandafter\let\csname KVS@#1@handler\endcsname\@UnDeFiNeD
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Error handling}
+%
+% \begin{macro}{\kv@error@novalue}
+% \begin{macrocode}
+\def\kv@error@novalue{%
+ \kv@error@generic{No value specified for}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\kv@error@unknownkey}
+% \begin{macrocode}
+\def\kv@error@unknownkey{%
+ \kv@error@generic{Undefined}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\kv@error@generic}
+% \begin{macrocode}
+\def\kv@error@generic#1#2#3{%
+ \@PackageError{kvsetkeys}{%
+ #1 key `#3'%
+ }{%
+ The keyval family of the key `#3' is `#2'.\MessageBreak
+ The setting of the key is ignored because of the error.\MessageBreak
+ \MessageBreak
+ \@ehc
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Do it all}
+%
+% \begin{macro}{\kvsetkeys}
+% \begin{macrocode}
+\long\def\kvsetkeys#1#2{%
+ \kv@parse{#2}{\kv@processor@default{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\kvsetkeys@expandafter}
+% \begin{macrocode}
+\def\kvsetkeys@expandafter#1#2{%
+ \expandafter\kv@parse\expandafter{#2}{%
+ \kv@processor@default{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KVS@cmd}
+% \begin{macrocode}
+\def\KVS@cmd{0}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@cmd@inc}
+% \begin{macrocode}
+\def\KVS@cmd@inc{%
+& \edef\KVS@cmd{\the\numexpr\KVS@cmd+1}%
+$ \begingroup
+$ \count255=\KVS@cmd\relax
+$ \advance\count255 by 1\relax
+$ \edef\x{\endgroup
+$ \noexpand\def\noexpand\KVS@cmd{\number\count255}%
+$ }%
+$ \x
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@cmd@dec}
+% \begin{macrocode}
+\def\KVS@cmd@dec{%
+& \edef\KVS@cmd{\the\numexpr\KVS@cmd-1}%
+$ \begingroup
+$ \count255=\KVS@cmd\relax
+$ \advance\count255 by -1\relax
+$ \edef\x{\endgroup
+$ \noexpand\def\noexpand\KVS@cmd{\number\count255}%
+$ }%
+$ \x
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@empty}
+% \begin{macrocode}
+\def\KVS@empty{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\kvsetknownkeys}
+% \begin{macrocode}
+\def\kvsetknownkeys{%
+ \expandafter
+ \KVS@setknownkeys\csname KVS@cmd\KVS@cmd\endcsname{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\KVS@setknownkeys}
+% \begin{macrocode}
+\long\def\KVS@setknownkeys#1#2#3#4#5{%
+ \let#1\KVS@empty
+ \KVS@cmd@inc
+ #2\kv@parse#2{#5}{\kv@processor@known{#3}#1}%
+ \KVS@cmd@dec
+ \let#4=#1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\kvsetknownkeys@expandafter}
+% \begin{macrocode}
+\def\kvsetknownkeys@expandafter{%
+ \expandafter
+ \KVS@setknownkeys
+ \csname KVS@cmd\KVS@cmd\endcsname\expandafter
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\KVS@AtEnd%
+%</package>
+% \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 kvsetkeys.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \subsubsection{Preamble}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{article}
+%<noetex>\let\SavedUnexpanded\unexpanded
+%<noetex>\let\unexpanded\UNDEFINED
+\makeatletter
+\chardef\KVS@TestMode=1 %
+\makeatother
+\usepackage{kvsetkeys}[2016/05/16]
+%<noetex>\let\unexpanded\SavedUnexpanded
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+% \end{macrocode}
+%
+% \subsubsection{Time}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfresettimer\endcsname\relax
+\else
+ \makeatletter
+ \newcount\SummaryTime
+ \newcount\TestTime
+ \SummaryTime=\z@
+ \newcommand*{\PrintTime}[2]{%
+ \typeout{%
+ [Time #1: \strip@pt\dimexpr\number#2sp\relax\space s]%
+ }%
+ }%
+ \newcommand*{\StartTime}[1]{%
+ \renewcommand*{\TimeDescription}{#1}%
+ \pdfresettimer
+ }%
+ \newcommand*{\TimeDescription}{}%
+ \newcommand*{\StopTime}{%
+ \TestTime=\pdfelapsedtime
+ \global\advance\SummaryTime\TestTime
+ \PrintTime\TimeDescription\TestTime
+ }%
+ \let\saved@qstest\qstest
+ \let\saved@endqstest\endqstest
+ \def\qstest#1#2{%
+ \saved@qstest{#1}{#2}%
+ \StartTime{#1}%
+ }%
+ \def\endqstest{%
+ \StopTime
+ \saved@endqstest
+ }%
+ \AtEndDocument{%
+ \PrintTime{summary}\SummaryTime
+ }%
+ \makeatother
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Test sets}
+%
+% \begin{macrocode}
+\makeatletter
+\def\@makeactive#1{%
+ \catcode`#1=13\relax
+}
+\@makeactive\,
+\def,{\errmessage{COMMA}}
+\@makeother\,
+\@makeactive\=
+\def={\errmessage{EQUALS}}
+\@makeother\=
+
+\begin{qstest}{normalize}{normalize,active-chars,space-removal}%
+ \long\def\Test#1#2{%
+ \@makeother\,%
+ \@makeother\=%
+ \scantokens{\toks@={#2}}%
+ \edef\Result{\the\toks@}%
+ \@makeother\,%
+ \@makeother\=%
+ \@Test{#1}%
+ \@makeactive\,%
+ \@Test{#1}%
+ \@makeactive\=%
+ \@Test{#1}%
+ \@makeother\,%
+ \@Test{#1}%
+ \@makeother\=%
+ }%
+ \long\def\@Test#1{%
+ \scantokens{\kv@normalize{#1}}%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter
+ {\expandafter\kv@list\expandafter}\expandafter{\Result}%
+ \Expect*{\ifx\kv@list\Result true\else false\fi}{true}%
+ }%
+ \Test{}{,}%
+ \Test{,}{,}%
+ \Test{,,}{,}%
+ \Test{,,,}{,}%
+ \Test{ , }{,}%
+ \Test{{a}}{,{a},}%
+ \Test{,{a}}{,{a},}%
+ \Test{{a},}{,{a},}%
+ \Test{{a},{b}}{,{a},{b},}%
+ \Test{{b}={c},{}=,{}={},{d}=}{,{b}={c},{}=,{}={},{d}=,}%
+ \Test{{}}{,{},}%
+ \Test{{},{},{}}{,{},{},{},}%
+ \Test{=}{,=,}%
+ \Test{=,=,=}{,=,=,=,}%
+ \Test{a=\par}{,a=\par,}%
+ \Test{\par}{,\par,}%
+ \def\TestSet#1{%
+ \Test{#1#1}{,}%
+ \Test{#1#1,#1#1}{,}%
+ \Test{#1#1,#1#1,#1#1}{,}%
+ \Test{#1#1#1#1#1}{,}%
+ \Test{{a}#1#1=#1#1{b}}{,{a}={b},}%
+ }%
+ \TestSet{ }%
+ \begingroup
+ \let\saved@normalize\kv@normalize
+ \def\kv@normalize#1{%
+ \saved@normalize{#1}%
+ \@onelevel@sanitize\kv@list
+ \@onelevel@sanitize\Result
+ }%
+ \Test{#,#=#,{#}={#},{#}=,{#}}{,#,#=#,{#}={#},{#}=,{#},}%
+ \endgroup
+ \begingroup
+ \def\Test#1#2{%
+ \edef\Result{#2}%
+ \@Test{#1}%
+ }%
+ \Test{{ a = b }}{,{ a = b },}%
+ \@makeactive\,%
+ \Test{{,}}{\string,{\noexpand,}\string,}%
+ \@makeother\,%
+ \@makeactive\=%
+ \Test{a={=}}{,a\string={\noexpand=},}%
+ \endgroup
+ \Test{a=b}{,a=b,}%
+ \Test{a={b}}{,a={b},}%
+ \Test{a ={b}}{,a={b},}%
+ \Test{a= {b}}{,a={b},}%
+ \Test{a = {b}}{,a={b},}%
+ \Test{a = {b} ,}{,a={b},}%
+ \Test{a}{,a,}%
+ \Test{ a}{,a,}%
+ \Test{a }{,a,}%
+ \Test{ a }{,a,}%
+ \Test{, a ,}{,a,}%
+ \Test{, a b ,}{,a b,}%
+ \Test{,a ,}{,a,}%
+ \Test{ a =}{,a=,}%
+ \Test{ a = }{,a=,}%
+ \Test{a =}{,a=,}%
+ \Test{{a} =}{,{a}=,}%
+ \Test{{a}= {}}{,{a}={},}%
+ \Test{, a = {}}{,a={},}%
+ \Test{a,,b}{,a,b,}%
+ \Test{a=\fi}{,a=\fi,}%
+ \Test{a=\iffalse}{,a=\iffalse,}%
+ \Test{a=\iffalse,b=\fi}{,a=\iffalse,b=\fi,}%
+\end{qstest}
+
+\begin{qstest}{parse}{parse,brace-removal}
+ \def\Processor#1#2{%
+ \expandafter\Expect\expandafter{\kv@key}{#1}%
+ \toks@{#2}%
+ \edef\x{\the\toks@}%
+ \ifx\kv@value\relax
+ \Expect*{\the\toks@}{}%
+ \def\Value{<>}%
+ \else
+ \edef\Value{[\the\toks@]}%
+ \@onelevel@sanitize\Value
+ \fi
+ \toks@{#1}%
+ \ifx\Result\@empty
+ \edef\Result{[\the\toks@]=\Value}%
+ \else
+ \edef\Result{\Result,[\the\toks@]=\Value}%
+ \fi
+ \@onelevel@sanitize\Result
+ }%
+ \def\Test#1#2{%
+ \sbox0{%
+ \let\Result\@empty
+ \kv@parse{#1}\Processor
+ \Expect*{\Result}{#2}%
+ }%
+ \Expect*{\the\wd0}{0.0pt}%
+ }%
+ \Test{}{}%
+ \Test{{}}{}%
+ \Test{{{}}}{[]=<>}%
+ \Test{{{{}}}}{[{}]=<>}%
+ \Test{a}{[a]=<>}%
+ \Test{{a}}{[a]=<>}%
+ \Test{{a}}{[a]=<>}%
+ \Test{{{a}}}{[a]=<>}%
+ \Test{{{{a}}}}{[{a}]=<>}%
+ \Test{a=}{[a]=[]}%
+ \Test{{a}=}{[a]=[]}%
+ \Test{{{a}}=}{[{a}]=[]}%
+ \Test{a={}}{[a]=[]}%
+ \Test{{a}={{}}}{[a]=[{}]}%
+ \Test{a=b}{[a]=[b]}%
+ \Test{a=\fi}{[a]=[\fi]}%
+ \Test{a=\iffalse}{[a]=[\iffalse]}%
+ \Test{a=\iffalse,b=\fi}{[a]=[\iffalse],[b]=[\fi]}%
+ \Test{{ a = b }}{[ a ]=[ b ]}%
+ \Test{{{ a = b }}}{[ a = b ]=<>}%
+\end{qstest}
+
+\begin{qstest}{comma}{comma,parse}
+ \def\Processor#1{%
+ \expandafter\Expect\expandafter{\comma@entry}{#1}%
+ \toks@{#1}%
+ \ifx\Result\@empty
+ \edef\Result{[\the\toks@]}%
+ \else
+ \edef\Result{\Result,[\the\toks@]}%
+ \fi
+ \@onelevel@sanitize\Result
+ }%
+ \def\Test#1#2{%
+ \sbox0{%
+ \let\Result\@empty
+ \comma@parse{#1}\Processor
+ \Expect*{\Result}{#2}%
+ }%
+ \Expect*{\the\wd0}{0.0pt}%
+ }%
+ \Test{}{}%
+ \Test{{}}{}%
+ \Test{{{}}}{[{}]}%
+ \Test{a}{[a]}%
+ \Test{{a}}{[a]}%
+ \Test{{{a}}}{[{a}]}%
+ \Test{a=}{[a=]}%
+ \Test{a\fi}{[a\fi]}%
+ \Test{a\iffalse}{[a\iffalse]}%
+ \Test{\iffalse,\fi}{[\iffalse],[\fi]}%
+ \Test{ a , b , c }{[a],[b],[c]}%
+ \Test{ { } ,{ }, { }, { } , { } }{[ ],[ ],[ ],[ ],[ ]}%
+ \Test{ {{}} ,{{}}, {{}}, {{}} , {{}} }{[{}],[{}],[{}],[{}],[{}]}%
+\end{qstest}
+
+\begin{document}
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \subsection{Tests for key value processing handler}
+%
+% \begin{macrocode}
+%<*test4>
+\catcode`\{=1
+\catcode`\}=2
+\catcode`\#=6
+\catcode`\@=11
+\input kvdefinekeys.sty\relax
+\input kvsetkeys.sty\relax
+\input infwarerr.sty\relax
+\def\Error#1{%
+ \@PackageError{test}{#1}\@ehc
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\temp#1#2{%
+ \kv@define@key{#1}{#2}{%
+ \edef\result{%
+ \result
+ [#1:#2=##1]% hash-ok
+ }%
+ }%
+}
+\temp{FA}{key1}
+\temp{FA}{key2}
+\temp{FB}{key3}
+\temp{FB}{key3}
+% \end{macrocode}
+% \begin{macrocode}
+\setbox0=\hbox{%
+ \def\result{}%
+ \kvsetknownkeys{FA}\cmd{key1=234,key3=456}%
+ \def\expected{[FA:key1=234]}%
+ \ifx\expected\result
+ \else
+ \Error{%
+ \string\kvsetknownkeys/\string\result\MessageBreak
+ Expected: \expected\MessageBreak
+ Result: \space\result
+ }%
+ \fi
+ \def\expected{{key3}={456}}%
+ \ifx\cmd\expected
+ \else
+ \Error{%
+ \string\kvsetknownkeys/\string\cmd\MessageBreak
+ Expected: \expected\MessageBreak
+ Result: \space\cmd
+ }%
+ \fi
+}
+\ifdim\wd0=0pt %
+\else
+ \Error{Spurious spaces?}%
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\csname @@end\endcsname\end
+%</test4>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/kvsetkeys}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/kvsetkeys.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/kvsetkeys.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[\CTAN{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 kvsetkeys.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@{}}
+% kvsetkeys.sty & tex/generic/oberdiek/kvsetkeys.sty\\
+% kvsetkeys.pdf & doc/latex/oberdiek/kvsetkeys.pdf\\
+% kvsetkeys-example.tex & doc/latex/oberdiek/kvsetkeys-example.tex\\
+% test/kvsetkeys-test1.tex & doc/latex/oberdiek/test/kvsetkeys-test1.tex\\
+% test/kvsetkeys-test2.tex & doc/latex/oberdiek/test/kvsetkeys-test2.tex\\
+% test/kvsetkeys-test3.tex & doc/latex/oberdiek/test/kvsetkeys-test3.tex\\
+% test/kvsetkeys-test4.tex & doc/latex/oberdiek/test/kvsetkeys-test4.tex\\
+% kvsetkeys.dtx & source/latex/oberdiek/kvsetkeys.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk kvsetkeys.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{kvsetkeys.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 kvsetkeys.dtx
+%makeindex -s gind.ist kvsetkeys.idx
+%pdflatex kvsetkeys.dtx
+%makeindex -s gind.ist kvsetkeys.idx
+%pdflatex kvsetkeys.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{kvsetkeys.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='kvsetkeys'>
+ <name>kvsetkeys</name>
+ <caption>Key value parser with default handler support.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006,2007,2009-2012'/>
+ <license type='lppl1.3'/>
+ <version number='1.17'/>
+ <description>
+ This package provides \kvsetkeys, a variant of package
+ <xref refid='keyval'>keyval</xref>'s <tt>\setkeys</tt>. It allows
+ the user to specify a handler that deals with unknown options.
+ Active commas and equal signs may be used (e.g. see
+ <xref refid='babel'>babel</xref>'s shorthands) and only one level
+ of curly braces are removed from the values.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/kvsetkeys.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/kvsetkeys.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{tb94wright}
+% A guide to key-value methods, Joseph Wright, second draft for
+% \href{http://www.tug.org/tugboat}{TUGBoat}, 2009-03-17.
+% \url{http://www.texdev.net/wp-content/uploads/2009/03/keyval.pdf}
+%
+% \bibitem{keyval}
+% David Carlisle:
+% \textit{The \xpackage{keyval} package};
+% 1999/03/16 v1.13;
+% \CTAN{macros/latex/required/graphics/keyval.dtx}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/03/06 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2006/10/19 v1.1}
+% \item
+% Fix of \cs{kv@set@family@handler}.
+% \item
+% Example added.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.2}
+% \item
+% Using package \xpackage{infwarerr} for error messages.
+% \item
+% Catcode section rewritten.
+% \end{Version}
+% \begin{Version}{2007/09/29 v1.3}
+% \item
+% Normalizing and parsing of comma separated lists added.
+% \item
+% \cs{kv@normalize} rewritten.
+% \item
+% Robustness increased for normalizing and parsing,
+% e.g. for values with unmatched conditionals.
+% \item
+% \eTeX\ is used if available.
+% \item
+% Tests added for normalizing and parsing.
+% \end{Version}
+% \begin{Version}{2009/07/19 v1.4}
+% \item
+% Bug fix for \cs{kv@normalize}: unwanted space removed (Florent Chervet).
+% \end{Version}
+% \begin{Version}{2009/07/30 v1.5}
+% \item
+% Documentation addition: recommendation for Joseph Wright's
+% review article.
+% \end{Version}
+% \begin{Version}{2009/12/12 v1.6}
+% \item
+% Short info shortened.
+% \end{Version}
+% \begin{Version}{2009/12/22 v1.7}
+% \item
+% Internal optimization (\cs{KVS@CommaSpace}, \dots, \cs{KVS@EqualsSpace}).
+% \end{Version}
+% \begin{Version}{2010/01/28 v1.8}
+% \item
+% Compatibility to ini\TeX\ added.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.9}
+% \item
+% Support of \cs{par} inside values.
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.10}
+% \item
+% Already loaded package files are not input in \hologo{plainTeX}.
+% \end{Version}
+% \begin{Version}{2011/03/03 v1.11}
+% \item
+% \cs{kv@break} and \cs{comma@break} added.
+% \end{Version}
+% \begin{Version}{2011/04/05 v1.12}
+% \item
+% Error message with recovery action in help message
+% (request by GL).
+% \end{Version}
+% \begin{Version}{2011/04/07 v1.13}
+% \item
+% \cs{kv@processor@default} supports package \xpackage{babel}'s
+% shorthands.
+% \item
+% \cs{kv@set@family@handler} with shorthand support.
+% \end{Version}
+% \begin{Version}{2011/06/15 v1.14}
+% \item
+% Some optimizations in token register uses (GL, HO).
+% \end{Version}
+% \begin{Version}{2011/10/18 v1.15}
+% \item
+% \cs{kv@processor@known} and \cs{kvsetknownkeys} added.
+% \item
+% \cs{kvsetkeys@expandafter} and \cs{kvsetknownkeys@expandafter} added.
+% \item
+% Family handler can report success or failure by \cs{kv@handled@true}
+% or \cs{kv@handled@false}.
+% \item
+% \cs{kv@unset@family@handler} added.
+% \end{Version}
+% \begin{Version}{2012/04/25 v1.16}
+% \item
+% \cs{kv@processor@default} and \cs{kv@processor@known} define
+% macro \cs{kv@fam} for convenience.
+% \item
+% Catcode section: Catcode setting for \texttt{+} added for \hologo{eTeX}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.17}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/kvsetkeys.pdf b/macros/latex/contrib/oberdiek/kvsetkeys.pdf
new file mode 100644
index 0000000000..4689b89669
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/kvsetkeys.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/letltxmacro.dtx b/macros/latex/contrib/oberdiek/letltxmacro.dtx
new file mode 100644
index 0000000000..7e61c000f3
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/letltxmacro.dtx
@@ -0,0 +1,1208 @@
+% \iffalse meta-comment
+%
+% File: letltxmacro.dtx
+% Version: 2016/05/16 v1.5
+% Info: Let assignment for LaTeX macros
+%
+% Copyright (C) 2008, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file letltxmacro.dtx
+% and the derived files
+% letltxmacro.sty, letltxmacro.pdf, letltxmacro.ins, letltxmacro.drv,
+% letltxmacro-showcases.tex, letltxmacro-test1.tex,
+% letltxmacro-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/letltxmacro.dtx
+% CTAN:macros/latex/contrib/oberdiek/letltxmacro.pdf
+%
+% Unpacking:
+% (a) If letltxmacro.ins is present:
+% tex letltxmacro.ins
+% (b) Without letltxmacro.ins:
+% tex letltxmacro.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{letltxmacro.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If letltxmacro.drv is present:
+% latex letltxmacro.drv
+% (b) Without letltxmacro.drv:
+% latex letltxmacro.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 letltxmacro.dtx
+% makeindex -s gind.ist letltxmacro.idx
+% pdflatex letltxmacro.dtx
+% makeindex -s gind.ist letltxmacro.idx
+% pdflatex letltxmacro.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/letltxmacro.sty
+% TDS:doc/latex/oberdiek/letltxmacro.pdf
+% TDS:doc/latex/oberdiek/letltxmacro-showcases.tex
+% TDS:doc/latex/oberdiek/test/letltxmacro-test1.tex
+% TDS:doc/latex/oberdiek/test/letltxmacro-test2.tex
+% TDS:source/latex/oberdiek/letltxmacro.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: letltxmacro 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: letltxmacro
+Version: 2016/05/16 v1.5
+
+Copyright (C) 2008, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file letltxmacro.dtx
+and the derived files
+ letltxmacro.sty, letltxmacro.pdf, letltxmacro.ins, letltxmacro.drv,
+ letltxmacro-showcases.tex, letltxmacro-test1.tex,
+ letltxmacro-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{letltxmacro.ins}{\from{letltxmacro.dtx}{install}}%
+ \file{letltxmacro.drv}{\from{letltxmacro.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{letltxmacro.sty}{\from{letltxmacro.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{letltxmacro-showcases.tex}{\from{letltxmacro.dtx}{showcases}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{letltxmacro-test1.tex}{\from{letltxmacro.dtx}{test1}}%
+% \file{letltxmacro-test2.tex}{\from{letltxmacro.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{letltxmacro.xml}{\from{letltxmacro.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{* letltxmacro.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `letltxmacro.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{letltxmacro.drv}%
+ [2016/05/16 v1.5 Let assignment for LaTeX macros (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{letltxmacro.dtx}%
+\end{document}
+%</driver>
+% \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{letltxmacro.drv}
+%
+% \title{The \xpackage{letltxmacro} package}
+% \date{2016/05/16 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% \TeX's \cs{let} assignment does not work for \LaTeX\ macros
+% with optional arguments or for macros that are defined
+% as robust macros by \cs{DeclareRobustCommand}. This package
+% defines \cs{LetLtxMacro} that also takes care of the involved
+% internal macros.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% If someone wants to redefine a macro with using the old
+% meaning, then one method is \TeX's command \cs{let}:
+%\begin{quote}
+%\begin{verbatim}
+%\newcommand{\Macro}{\typeout{Test Macro}}
+%\let\SavedMacro=\Macro
+%\renewcommand{\Macro}{%
+% \typeout{Begin}%
+% \SavedMacro
+% \typeout{End}%
+%}
+%\end{verbatim}
+%\end{quote}
+% However, this method fails, if \cs{Macro} is defined
+% by \cs{DeclareRobustCommand} and/or has an optional argument.
+% In both cases \LaTeX\ defines an additional internal macro
+% that is forgotten in the simple \cs{let} assignment of
+% the example above.
+%
+% \begin{declcs}{LetLtxMacro} \M{new macro} \M{old macro}
+% \end{declcs}
+% Macro \cs{LetLtxMacro} behaves similar to \TeX's \cs{let}
+% assignment, but it takes care of macros that are
+% defined by \cs{DeclareRobustCommand} and/or have optional
+% arguments. Example:
+%\begin{quote}
+%\begin{verbatim}
+%\DeclareRobustCommand{\Macro}[1][default]{...}
+%\LetLtxMacro{\SavedMacro}{\Macro}
+%\end{verbatim}
+%\end{quote}
+% Then macro \cs{SavedMacro} only uses internal macro names
+% that are derived from \cs{SavedMacro}'s macro name. Macro \cs{Macro}
+% can now be redefined without affecting \cs{SavedMacro}.
+%
+% \begin{declcs}{GlobalLetLtxMacro} \M{new macro} \M{old macro}
+% \end{declcs}
+% Like \cs{LetLtxMacro}, but the \meta{new macro} is defined globally.
+% Since version 2016/05/16~v1.4.
+%
+% \subsection{Supported macro definition commands}
+%
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% \cs{newcommand}, \cs{renewcommand} & latex/base\\
+% \cs{newenvironment}, \cs{renewenvironment} & latex/base\\
+% \cs{DeclareRobustCommand}& latex/base\\
+% \cs{newrobustcmd}, \cs{renewrobustcmd} & etoolbox\\
+% \cs{robustify} & etoolbox 2008/06/22 v1.6\\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Show cases}
+%
+% \subsubsection{\xfile{letltxmacro-showcases.tex}}
+%
+% \begin{macrocode}
+%<*showcases>
+\NeedsTeXFormat{LaTeX2e}
+\makeatletter
+% \end{macrocode}
+% \begin{macro}{\Line}
+% The result is displayed by macro \cs{Line}. The percent symbol
+% at line start allows easy grepping and inserting into the DTX
+% file.
+% \begin{macrocode}
+\newcommand*{\Line}[1]{%
+ \typeout{\@percentchar#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\newcommand*{\ShowCmdName}[1]{%
+ \@ifundefined{#1}{}{%
+ \Line{%
+ \space\space(\expandafter\string\csname#1\endcsname) = %
+ (\expandafter\meaning\csname#1\endcsname)%
+ }%
+ }%
+}
+\newcommand*{\ShowCmds}[1]{%
+ \ShowCmdName{#1}%
+ \ShowCmdName{#1 }%
+ \ShowCmdName{\\#1}%
+ \ShowCmdName{\\#1 }%
+}
+\let\\\@backslashchar
+% \end{macrocode}
+% \begin{macro}{\ShowDef}
+% \begin{macrocode}
+\newcommand*{\ShowDef}[2]{%
+ \begingroup
+ \Line{}%
+ \newcommand*{\DefString}{#2}%
+ \@onelevel@sanitize\DefString
+ \Line{\DefString}%
+ #2%
+ \ShowCmds{#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\typeout{}
+\Line{* LaTeX definitions:}
+\ShowDef{cmd}{%
+ \newcommand{\cmd}[2][default]{}%
+}
+\ShowDef{cmd}{%
+ \DeclareRobustCommand{\cmd}{}%
+}
+\ShowDef{cmd}{%
+ \DeclareRobustCommand{\cmd}[2][default]{}%
+}
+\typeout{}
+% \end{macrocode}
+% The minimal version of package \xpackage{etoolbox} is 2008/06/12 v1.6a
+% because it fixes \cs{robustify}.
+% \begin{macrocode}
+\RequirePackage{etoolbox}[2008/06/12]%
+\Line{}
+\Line{* etoolbox's robust definitions:}
+\ShowDef{cmd}{%
+ \newrobustcmd{\cmd}{}%
+}
+\ShowDef{cmd}{%
+ \newrobustcmd{\cmd}[2][default]{}%
+}
+\Line{}
+\Line{* etoolbox's \string\robustify:}
+\ShowDef{cmd}{%
+ \newcommand{\cmd}[2][default]{} %
+ \robustify{\cmd}%
+}
+\ShowDef{cmd}{%
+ \DeclareRobustCommand{\cmd}{} %
+ \robustify{\cmd}%
+}
+\ShowDef{cmd}{%
+ \DeclareRobustCommand{\cmd}[2][default]{} %
+ \robustify{\cmd}%
+}
+\typeout{}
+\@@end
+%</showcases>
+% \end{macrocode}
+%
+% \subsubsection{Result}
+%
+% \begingroup
+% \makeatletter
+% \let\org@verbatim\@verbatim
+% \def\@verbatim{^^A
+% \org@verbatim
+% \catcode`\~=\active
+% }^^A
+% \let~\textvisiblespace
+%\begin{verbatim}
+%* LaTeX definitions:
+%
+%\newcommand {\cmd }[2][default]{}
+% (\cmd) = (macro:->\@protected@testopt \cmd \\cmd {default})
+% (\\cmd) = (\long macro:[#1]#2->)
+%
+%\DeclareRobustCommand {\cmd }{}
+% (\cmd) = (macro:->\protect \cmd~ )
+% (\cmd~) = (\long macro:->)
+%
+%\DeclareRobustCommand {\cmd }[2][default]{}
+% (\cmd) = (macro:->\protect \cmd~ )
+% (\cmd~) = (macro:->\@protected@testopt \cmd~ \\cmd~ {default})
+% (\\cmd~) = (\long macro:[#1]#2->)
+%
+%* etoolbox's robust definitions:
+%
+%\newrobustcmd {\cmd }{}
+% (\cmd) = (\protected\long macro:->)
+%
+%\newrobustcmd {\cmd }[2][default]{}
+% (\cmd) = (\protected macro:->\@testopt \\cmd {default})
+% (\\cmd) = (\long macro:[#1]#2->)
+%
+%* etoolbox's \robustify:
+%
+%\newcommand {\cmd }[2][default]{} \robustify {\cmd }
+% (\cmd) = (\protected macro:->\@protected@testopt \cmd \\cmd {default})
+% (\\cmd) = (\long macro:[#1]#2->)
+%
+%\DeclareRobustCommand {\cmd }{} \robustify {\cmd }
+% (\cmd) = (\protected macro:->)
+%
+%\DeclareRobustCommand {\cmd }[2][default]{} \robustify {\cmd }
+% (\cmd) = (\protected macro:->\@protected@testopt \cmd~ \\cmd~ {default})
+% (\cmd~) = (macro:->\@protected@testopt \cmd~ \\cmd~ {default})
+% (\\cmd~) = (\long macro:[#1]#2->)
+%\end{verbatim}
+% \endgroup
+%
+% \subsection{Package}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsubsection{Catcodes and identification}
+%
+% \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 llm@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\llm@AtEnd{%
+ \llm@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\llm@AtEnd{%
+ \llm@AtEnd
+ \escapechar\the\escapechar\relax
+ \noexpand\endinput
+}
+\escapechar=92 % `\\
+% \end{macrocode}
+%
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{letltxmacro}%
+ [2016/05/16 v1.5 Let assignment for LaTeX macros (HO)]
+% \end{macrocode}
+%
+% \subsubsection{Main macros}
+%
+% \begin{macro}{\LetLtxMacro}
+% \begin{macrocode}
+\newcommand*{\LetLtxMacro}{%
+ \llm@ModeLetLtxMacro{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GlobalLetLtxMacro}
+% \begin{macrocode}
+\newcommand*{\GlobalLetLtxMacro}{%
+ \llm@ModeLetLtxMacro\global
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\llm@ModeLetLtxMacro}
+% \begin{macrocode}
+\newcommand*{\llm@ModeLetLtxMacro}[3]{%
+ \edef\llm@escapechar{\the\escapechar}%
+ \escapechar=-1 %
+ \edef\reserved@a{%
+ \noexpand\protect
+ \expandafter\noexpand
+ \csname\string#3 \endcsname
+ }%
+ \ifx\reserved@a#3\relax
+ #1\edef#2{%
+ \noexpand\protect
+ \expandafter\noexpand
+ \csname\string#2 \endcsname
+ }%
+ #1\expandafter\let
+ \csname\string#2 \expandafter\endcsname
+ \csname\string#3 \endcsname
+ \expandafter\llm@LetLtxMacro
+ \csname\string#2 \expandafter\endcsname
+ \csname\string#3 \endcsname{#1}%
+ \else
+ \llm@LetLtxMacro{#2}{#3}{#1}%
+ \fi
+ \escapechar=\llm@escapechar\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\llm@LetLtxMacro}
+% \begin{macrocode}
+\def\llm@LetLtxMacro#1#2#3{%
+ \escapechar=92 %
+ \expandafter\llm@CheckParams\meaning#2:->\@nil{%
+ \begingroup
+ \def\@protected@testopt{%
+ \expandafter\@testopt\@gobble
+ }%
+ \def\@testopt##1##2{%
+ \toks@={##2}%
+ }%
+ \let\llm@testopt\@empty
+ \edef\x{%
+ \noexpand\@protected@testopt
+ \noexpand#2%
+ \expandafter\noexpand\csname\string#2\endcsname
+ }%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\y
+ \expandafter\expandafter\expandafter{%
+ \expandafter\llm@CarThree#2{}{}{}\llm@nil
+ }%
+ \ifx\x\y
+ #2%
+ \def\llm@testopt{%
+ \noexpand\@protected@testopt
+ \noexpand#1%
+ }%
+ \else
+ \edef\x{%
+ \noexpand\@testopt
+ \expandafter\noexpand
+ \csname\string#2\endcsname
+ }%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\y
+ \expandafter\expandafter\expandafter{%
+ \expandafter\llm@CarTwo#2{}{}\llm@nil
+ }%
+ \ifx\x\y
+ #2%
+ \def\llm@testopt{%
+ \noexpand\@testopt
+ }%
+ \fi
+ \fi
+ \ifx\llm@testopt\@empty
+ \else
+ \llm@protected\xdef\llm@GlobalTemp{%
+ \llm@testopt
+ \expandafter\noexpand
+ \csname\string#1\endcsname
+ {\the\toks@}%
+ }%
+ \fi
+ \expandafter\endgroup\ifx\llm@testopt\@empty
+ #3\let#1=#2\relax
+ \else
+ #3\let#1=\llm@GlobalTemp
+ #3\expandafter\let
+ \csname\string#1\expandafter\endcsname
+ \csname\string#2\endcsname
+ \fi
+ }{%
+ #3\let#1=#2\relax
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\llm@CheckParams}
+% \begin{macrocode}
+\def\llm@CheckParams#1:->#2\@nil{%
+ \begingroup
+ \def\x{#1}%
+ \ifx\x\llm@macro
+ \endgroup
+ \def\llm@protected{}%
+ \expandafter\@firstoftwo
+ \else
+ \ifx\x\llm@protectedmacro
+ \endgroup
+ \def\llm@protected{\protected}%
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \endgroup
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\llm@macro}
+% \begin{macrocode}
+\def\llm@macro{macro}
+\@onelevel@sanitize\llm@macro
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\llm@protectedmacro}
+% \begin{macrocode}
+\def\llm@protectedmacro{\protected macro}
+\@onelevel@sanitize\llm@protectedmacro
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\llm@CarThree}
+% \begin{macrocode}
+\def\llm@CarThree#1#2#3#4\llm@nil{#1#2#3}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\llm@CarTwo}
+% \begin{macrocode}
+\def\llm@CarTwo#1#2#3\llm@nil{#1#2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\llm@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Catcode checks for loading}
+%
+% \begin{macrocode}
+%<*test1>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\makeatletter
+\def\RestoreCatcodes{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@\@ne
+\repeat
+
+\def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@\@ne
+ \repeat
+}
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{127}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\[=12 %
+ \catcode`\]=12 %
+ \catcode`\%=14 %
+ \catcode`\ =10 %
+ \catcode13=5 %
+ \RequirePackage{letltxmacro}[2016/05/16]\relax
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Package tests}
+%
+% \begin{macrocode}
+%<*test2>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{minimal}
+
+\usepackage{letltxmacro}[2016/05/16]
+
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\makeatletter
+
+\def\TestDef#1{%
+ \begingroup
+ \@makeother\\%
+ \@makeother\ %
+ \expandafter\@TestDef\csname #1\endcsname
+}
+\def\@TestDef#1#2{%
+ \edef\a{\expandafter\strip@prefix\meaning#1}%
+ \edef\b{\detokenize{#2}}%
+ \ifx\a\b
+ \else
+ \typeout{1 [\a]}%
+ \typeout{2 [\b]}%
+ \fi
+ \endgroup
+ \Expect*{\expandafter\strip@prefix\meaning#1}*{\detokenize{#2}}%
+}
+\def\TestEquals#1#2{%
+ \Expect*{%
+ \expandafter\ifx\csname#1\expandafter\endcsname
+ \csname#2\endcsname
+ equals%
+ \else
+ wrong%
+ \fi
+ }{equals}%
+}
+\def\SaveA{%
+ \let\SavedA\TestA
+ \expandafter\let\csname\string\SavedA\expandafter\endcsname
+ \csname\string\TestA\endcsname
+ \expandafter\let\csname SavedA \expandafter\endcsname
+ \csname TestA \endcsname
+}
+\def\CheckA{%
+ \TestEquals{SavedA}{TestA}%
+ \TestEquals{\string\SavedA}{\string\TestA}%
+ \TestEquals{SavedA }{TestA }%
+}
+
+\begin{qstest}{robust}{robust}
+ \begingroup
+ \DeclareRobustCommand*{\TestA}{Test}%
+ \SaveA
+ \TestDef{TestA}{\protect \TestA }%
+ \CheckA
+ \DeclareRobustCommand{\TestA}{Test}%
+ \SaveA
+ \TestDef{TestA}{\protect \TestA }%
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\protect \TestB }%
+ \TestEquals{TestB }{TestA }%
+ \CheckA
+ \GlobalLetLtxMacro\TestC\TestA
+ \CheckA
+ \endgroup
+ \TestDef{TestC}{\protect \TestC }%
+ \DeclareRobustCommand{\TestA}{Test}%
+ \TestEquals{TestC }{TestA }%
+\end{qstest}
+
+\begin{qstest}{default}{default}
+ \begingroup
+ \newcommand{\TestA}[1][\relax default \empty]{TestA #1}%
+ \SaveA
+ \TestDef
+ {TestA}{\@protected@testopt \TestA \\TestA {\relax default \empty }}%
+ \LetLtxMacro\TestB\TestA
+ \TestDef
+ {TestB}{\@protected@testopt \TestB \\TestB {\relax default \empty }}%
+ \CheckA
+ \TestEquals{\string\TestB}{\string\TestA}%
+ \GlobalLetLtxMacro\TestC\TestA
+ \CheckA
+ \endgroup
+ \TestDef
+ {TestC}{\@protected@testopt \TestC \\TestC {\relax default \empty }}%
+ \newcommand{\TestA}[1][\relax default \empty]{TestA #1}%
+ \TestEquals{\string\TestC}{\string\TestA}%
+\end{qstest}
+
+\begin{qstest}{robustdefault}{robustdefault}
+ \begingroup
+ \DeclareRobustCommand{\TestA}[1][\default]{TestA}%
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\protect \TestB }%
+ \TestDef{TestB }{\@protected@testopt \TestB \\TestB {\default }}%
+ \CheckA
+ \GlobalLetLtxMacro\TestC\TestA
+ \CheckA
+ \endgroup
+ \TestDef{TestC}{\protect \TestC }%
+ \TestDef{TestC }{\@protected@testopt \TestC \\TestC {\default }}%
+\end{qstest}
+
+\begin{qstest}{plain}{plain}
+ \LetLtxMacro\NewRelax\relax
+ \Expect*{\meaning\relax}*{\string\relax}%
+ \Expect*{\meaning\NewRelax}*{\string\relax}%
+ \LetLtxMacro\NewHbox\hbox
+ \Expect*{\meaning\hbox}*{\string\hbox}%
+ \Expect*{\meaning\NewHbox}*{\string\hbox}%
+ \LetLtxMacro\NewEmpty\empty
+ \Expect*{\meaning\empty}{macro:->}%
+ \Expect*{\meaning\NewEmpty}{macro:->}%
+ \def\TestA{\iffalse}%
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\iffalse }%
+ \TestEquals{TestA}{TestB}%
+\end{qstest}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\usepackage{etoolbox}[2008/06/22]
+
+\begin{qstest}{oldnewrobustcmd}{oldnewrobustcmd}
+ \begingroup
+ \protected\edef\TestA{%
+ \noexpand\@protected@testopt
+ \noexpand\TestA
+ \expandafter\noexpand\csname\string\TestA\endcsname
+ {\noexpand\default}%
+ }%
+ \expandafter\protected\expandafter
+ \def\csname\string\TestA\endcsname{TestA}%
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\@protected@testopt \TestB \\TestB {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@protected@testopt
+ \noexpand\TestB
+ \expandafter\noexpand\csname\string\TestB\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestB}{TestC}%
+ \CheckA
+ \GlobalLetLtxMacro\TestD\TestA
+ \CheckA
+ \endgroup
+ \TestDef{TestD}{\@protected@testopt \TestD \\TestD {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@protected@testopt
+ \noexpand\TestD
+ \expandafter\noexpand\csname\string\TestD\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestD}{TestC}%
+\end{qstest}
+
+\begin{qstest}{newrobustcmd}{newrobustcmd}
+ \begingroup
+ \newrobustcmd{\TestA}[1][\default]{TestA}%
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\@testopt \\TestB {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@testopt
+ \expandafter\noexpand\csname\string\TestB\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestB}{TestC}%
+ \CheckA
+ \GlobalLetLtxMacro\TestD\TestA
+ \CheckA
+ \endgroup
+ \TestDef{TestD}{\@testopt \\TestD {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@testopt
+ \expandafter\noexpand\csname\string\TestD\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestD}{TestC}%
+\end{qstest}
+
+\begin{qstest}{robustifyopt}{robustifyopt}
+ \newcommand{\TestA}[2][\default]{}%
+ \TestDef{TestA}{\@protected@testopt \TestA \\TestA {\default }}%
+ \robustify\TestA
+ \TestDef{TestA}{\@protected@testopt \TestA \\TestA {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@protected@testopt
+ \noexpand\TestA
+ \expandafter\noexpand\csname\string\TestA\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestA}{TestC}%
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\@protected@testopt \TestB \\TestB {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@protected@testopt
+ \noexpand\TestB
+ \expandafter\noexpand\csname\string\TestB\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestB}{TestC}%
+ \CheckA
+\end{qstest}
+
+\begin{qstest}{robustifydeclare}{robustifydeclare}
+ \DeclareRobustCommand\TestA{\iffalse}%
+ \robustify\TestA
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\iffalse }%
+ % before etoolbox 2008/06/22: \protected\long\def
+ % since etoolbox 2008/06/22: \protected\def
+ \protected\def\TestC{\iffalse}%
+ \TestEquals{TestB}{TestC}%
+ \CheckA
+\end{qstest}
+
+\begin{qstest}{robustifydeclarelong}{robustifydeclarelong}
+ \DeclareRobustCommand\TestA[1]{\iffalse}%
+ \robustify\TestA
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\iffalse }%
+ % before etoolbox 2008/06/22: \protected\long\def
+ % since etoolbox 2008/06/22: \protected\def
+ \protected\long\def\TestC#1{\iffalse}%
+ \TestEquals{TestB}{TestC}%
+ \CheckA
+\end{qstest}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\csname @@end\endcsname
+% \end{macrocode}
+% \begin{macrocode}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/letltxmacro}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/letltxmacro.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/letltxmacro.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[\CTAN{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 letltxmacro.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@{}}
+% letltxmacro.sty & tex/latex/oberdiek/letltxmacro.sty\\
+% letltxmacro.pdf & doc/latex/oberdiek/letltxmacro.pdf\\
+% letltxmacro-showcases.tex & doc/latex/oberdiek/letltxmacro-showcases.tex\\
+% test/letltxmacro-test1.tex & doc/latex/oberdiek/test/letltxmacro-test1.tex\\
+% test/letltxmacro-test2.tex & doc/latex/oberdiek/test/letltxmacro-test2.tex\\
+% letltxmacro.dtx & source/latex/oberdiek/letltxmacro.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk letltxmacro.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{letltxmacro.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 letltxmacro.dtx
+%makeindex -s gind.ist letltxmacro.idx
+%pdflatex letltxmacro.dtx
+%makeindex -s gind.ist letltxmacro.idx
+%pdflatex letltxmacro.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{letltxmacro.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='letltxmacro'>
+ <name>letltxmacro</name>
+ <caption>Let assignment for LaTeX macros.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2008,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.5'/>
+ <description>
+ TeX&#x2019;s <tt>\let</tt> assignment does not work for LaTeX macros
+ with optional arguments or for macros that are defined
+ as robust macros by <tt>\DeclareRobustCommand</tt>. This package
+ defines <tt>\LetLtxMacro</tt> that also takes care of the involved
+ internal macros.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/letltxmacro.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/letltxmacro.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2008/06/09 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2008/06/12 v1.1}
+% \item
+% Support for \xpackage{etoolbox}'s \cs{newrobustcmd} added.
+% \end{Version}
+% \begin{Version}{2008/06/13 v1.2}
+% \item
+% Support for \xpackage{etoolbox}'s \cs{robustify} added.
+% \end{Version}
+% \begin{Version}{2008/06/24 v1.3}
+% \item
+% Test file adapted for etoolbox 2008/06/22 v1.6.
+% \end{Version}
+% \begin{Version}{2010/09/02 v1.4}
+% \item
+% \cs{GlobalLetLtxMacro} added.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/letltxmacro.pdf b/macros/latex/contrib/oberdiek/letltxmacro.pdf
new file mode 100644
index 0000000000..7ed1f55b34
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/letltxmacro.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/listingsutf8.dtx b/macros/latex/contrib/oberdiek/listingsutf8.dtx
new file mode 100644
index 0000000000..1a07e24615
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/listingsutf8.dtx
@@ -0,0 +1,857 @@
+% \iffalse meta-comment
+%
+% File: listingsutf8.dtx
+% Version: 2016/05/16 v1.3
+% Info: Allow UTF-8 in listings input
+%
+% Copyright (C) 2007, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file listingsutf8.dtx
+% and the derived files
+% listingsutf8.sty, listingsutf8.pdf, listingsutf8.ins, listingsutf8.drv,
+% listingsutf8-test1.tex, listingsutf8-test2.tex,
+% listingsutf8-test3.tex, listingsutf8-test4.tex,
+% listingsutf8-test5.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/listingsutf8.dtx
+% CTAN:macros/latex/contrib/oberdiek/listingsutf8.pdf
+%
+% Unpacking:
+% (a) If listingsutf8.ins is present:
+% tex listingsutf8.ins
+% (b) Without listingsutf8.ins:
+% tex listingsutf8.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{listingsutf8.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If listingsutf8.drv is present:
+% latex listingsutf8.drv
+% (b) Without listingsutf8.drv:
+% latex listingsutf8.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 listingsutf8.dtx
+% makeindex -s gind.ist listingsutf8.idx
+% pdflatex listingsutf8.dtx
+% makeindex -s gind.ist listingsutf8.idx
+% pdflatex listingsutf8.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/listingsutf8.sty
+% TDS:doc/latex/oberdiek/listingsutf8.pdf
+% TDS:doc/latex/oberdiek/test/listingsutf8-test1.tex
+% TDS:doc/latex/oberdiek/test/listingsutf8-test2.tex
+% TDS:doc/latex/oberdiek/test/listingsutf8-test3.tex
+% TDS:doc/latex/oberdiek/test/listingsutf8-test4.tex
+% TDS:doc/latex/oberdiek/test/listingsutf8-test5.tex
+% TDS:source/latex/oberdiek/listingsutf8.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: listingsutf8 2016/05/16 v1.3 Allow UTF-8 in listings input (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: listingsutf8
+Version: 2016/05/16 v1.3
+
+Copyright (C) 2007, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file listingsutf8.dtx
+and the derived files
+ listingsutf8.sty, listingsutf8.pdf, listingsutf8.ins, listingsutf8.drv,
+ listingsutf8-test1.tex, listingsutf8-test2.tex,
+ listingsutf8-test3.tex, listingsutf8-test4.tex,
+ listingsutf8-test5.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{listingsutf8.ins}{\from{listingsutf8.dtx}{install}}%
+ \file{listingsutf8.drv}{\from{listingsutf8.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{listingsutf8.sty}{\from{listingsutf8.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{listingsutf8-test1.tex}{\from{listingsutf8.dtx}{test1}}%
+% \file{listingsutf8-test2.tex}{\from{listingsutf8.dtx}{test2,utf8}}%
+% \file{listingsutf8-test3.tex}{\from{listingsutf8.dtx}{test3,utf8x}}%
+% \file{listingsutf8-test4.tex}{\from{listingsutf8.dtx}{test4,utf8,noetex}}%
+% \file{listingsutf8-test5.tex}{\from{listingsutf8.dtx}{test5,utf8x,noetex}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{listingsutf8.xml}{\from{listingsutf8.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{* listingsutf8.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `listingsutf8.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{listingsutf8.drv}%
+ [2016/05/16 v1.3 Allow UTF-8 in listings input (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{listingsutf8.dtx}%
+\end{document}
+%</driver>
+% \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{listingsutf8.drv}
+%
+% \title{The \xpackage{listingsutf8} package}
+% \date{2016/05/16 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{listings} does not support files with multi-byte
+% encodings such as UTF-8. In case of \cs{lstinputlisting} a simple
+% workaround is possible if an one-byte encoding exists that the file
+% can be converted to. Also \eTeX\ and \pdfTeX\ regardless of its mode
+% are required.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{User interface}
+%
+% Load this package after or instead of package \xpackage{listings}
+% \cite{listings}.
+% The package does not define own options and passes given options to
+% package \xpackage{listings}.
+%
+% The syntax of package \xpackage{listings}' key \xoption{inputencoding}
+% is extended:
+% \begin{quote}
+% |inputencoding=utf8/|\meta{one-byte-encoding}\\
+% Example: |inputencoding=utf8/latin1|
+% \end{quote}
+% That means the file is encoded in UTF-8 and can
+% be converted to the given \meta{one-byte-encoding}.
+% The available encodings for \meta{one-byte-encoding} are
+% listed in section ``1.2 Supported encodings'' of
+% package \xpackage{stringenc}'s documentation \cite{stringenc}.
+% Of course, the encoding must encode its characters with
+% one byte exactly. This excludes the unicode encodings
+% (\xoption{utf8}, \xoption{utf16}, \dots).
+%
+% Only \cs{lstinputlisting} is supported by the syntax extension
+% of key \xoption{inputencoding}.
+%
+% Internally package \xpackage{listingsutf8} reads the file as binary file
+% via primitives of \pdfTeX\ (\cs{pdffiledump}). Then the file
+% contents is converted as string using package \xpackage{stringenc} and
+% finally the string is read as virtual file by \eTeX's \cs{scantokens}.
+%
+% \subsection{Future}
+%
+% Workarounds are not provided for
+% \begin{itemize}
+% \item \cs{lstinline}
+% \item Environment |lstlisting|.
+% \item Environments defined by \cs{lstnewenvironment}.
+% \end{itemize}
+% Perhaps someone will find time to extend package \xpackage{listings}
+% with full native support for UTF-8. Then this package would become obsolete.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Catcodes and identification}
+%
+% \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 lstU@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\lstU@AtEnd{%
+ \lstU@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{36}{3}% $
+\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}{8}% _ (subscript)
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{124}{12}% |
+\TMP@EnsureCode{126}{13}% ~ (active)
+\edef\lstU@AtEnd{\lstU@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{listingsutf8}%
+ [2016/05/16 v1.3 Allow UTF-8 in listings input (HO)]
+% \end{macrocode}
+%
+% \subsection{Package options}
+%
+% Just pass options to package listings.
+%
+% \begin{macrocode}
+\DeclareOption*{%
+ \PassOptionsToPackage\CurrentOption{listings}%
+}
+\ProcessOptions*
+% \end{macrocode}
+% Key \xoption{inputencoding} was introduced in version
+% 2002/04/01 v1.0 of package \xpackage{listings}.
+% \begin{macrocode}
+\RequirePackage{listings}[2002/04/01]
+% \end{macrocode}
+% Ensure that \cs{inputencoding} is provided.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifundefined{inputencoding}{%
+ \RequirePackage{inputenc}%
+ }{}%
+}
+% \end{macrocode}
+%
+% \subsection{Check prerequisites}
+%
+% \begin{macrocode}
+\RequirePackage{pdftexcmds}[2011/04/22]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\lstU@temp#1#2{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname #1\endcsname\relax
+ \PackageWarningNoLine{listingsutf8}{%
+ Package loading is aborted because of missing %
+ \@backslashchar#1.\MessageBreak
+ #2%
+ }%
+ \expandafter\lstU@AtEnd
+ \fi
+}
+\lstU@temp{scantokens}{It is provided by e-TeX}%
+\lstU@temp{pdf@unescapehex}{It is provided by pdfTeX >= 1.30}%
+\lstU@temp{pdf@filedump}{It is provided by pdfTeX >= 1.30}%
+\lstU@temp{pdf@filesize}{It is provided by pdfTeX >= 1.30}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{stringenc}[2010/03/01]
+% \end{macrocode}
+%
+% \subsection{Add support for UTF-8}
+%
+% \begin{macro}{\iflstU@utfviii}
+% \begin{macrocode}
+\newif\iflstU@utfviii
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lstU@inputenc}
+% \begin{macrocode}
+\def\lstU@inputenc#1{%
+ \expandafter\lstU@@inputenc#1utf8/utf8/\@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\lstU@@inputenc}
+\def\lstU@@inputenc#1utf8/#2utf8/#3\@nil{%
+ \ifx\\#1\\%
+ \lstU@utfviiitrue
+ \def\lst@inputenc{#2}%
+ \else
+ \lstU@utfviiifalse
+ \fi
+}
+% \begin{macrocode}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\lst@Key{inputencoding}\relax{%
+ \def\lst@inputenc{#1}%
+ \lstU@inputenc{#1}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Conversion}
+%
+% \begin{macro}{\lstU@input}
+% \begin{macrocode}
+\def\lstU@input#1{%
+ \iflstU@utfviii
+ \edef\lstU@text{%
+ \pdf@unescapehex{%
+ \pdf@filedump{0}{\pdf@filesize{#1}}{#1}%
+ }%
+ }%
+ \lstU@CRLFtoLF\lstU@text
+ \StringEncodingConvert\lstU@text\lstU@text{utf8}\lst@inputenc
+ \def\lstU@temp{%
+ \scantokens\expandafter{\lstU@text}%
+ }%
+ \else
+ \def\lstU@temp{%
+ \input{#1}%
+ }%
+ \fi
+ \lstU@temp
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Convert CR/LF pairs to LF}
+%
+% \begin{macro}{\lstU@CRLFtoLF}
+% \begin{macrocode}
+\begingroup
+ \endlinechar=-1 %
+ \@makeother\^^J %
+ \@makeother\^^M %
+ \gdef\lstU@CRLFtoLF#1{%
+ \edef#1{%
+ \expandafter\lstU@CRLFtoLF@aux#1^^M^^J\@nil
+ }%
+ }%
+ \gdef\lstU@CRLFtoLF@aux#1^^M^^J#2\@nil{%
+ #1%
+ \ifx\relax#2\relax
+ \@car
+ \fi
+ ^^J%
+ \lstU@CRLFtoLF@aux#2\@nil
+ }%
+\endgroup %
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Patch \cs{lst@InputListing}}
+%
+% \begin{macrocode}
+\def\lstU@temp#1\def\lst@next#2#3\@nil{%
+ \def\lst@InputListing##1{%
+ #1%
+ \def\lst@next{\lstU@input{##1}}%
+ #3%
+ }%
+}
+\expandafter\lstU@temp\lst@InputListing{#1}\@nil
+% \end{macrocode}
+%
+% \begin{macrocode}
+\lstU@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Catcode checks for loading}
+%
+% \begin{macrocode}
+%<*test1>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\makeatletter
+\def\RestoreCatcodes{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@\@ne
+\repeat
+
+\def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@\@ne
+ \repeat
+}
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{127}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\[=12 %
+ \catcode`\]=12 %
+ \catcode`\%=14 %
+ \catcode`\ =10 %
+ \catcode13=5 %
+ \RequirePackage{listingsutf8}[2016/05/16]\relax
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test example for latin1}
+%
+% \begin{macrocode}
+%<*test2>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\usepackage{filecontents}
+\def\do#1{%
+ \ifx#1\^%
+ \else
+ \noexpand\do\noexpand#1%
+ \fi
+}
+\expandafter\let\expandafter\dospecials\expandafter\empty
+\expandafter\edef\expandafter\dospecials\expandafter{\dospecials}
+\begin{filecontents*}{ExampleUTF8.java}
+public class ExampleUTF8 {
+ public static String testString =
+ "Umlauts: " +
+ "^^c3^^84^^c3^^96^^c3^^9c^^c3^^a4^^c3^^b6^^c3^^bc^^c3^^9f";
+ public static void main(String[] args) {
+ System.out.println(testString);
+ }
+}
+\end{filecontents*}
+\usepackage{listingsutf8}[2016/05/16]
+\def\Text{%
+ Umlauts: %
+ ^^c3^^84^^c3^^96^^c3^^9c^^c3^^a4^^c3^^b6^^c3^^bc^^c3^^9f%
+}
+\begin{document}
+\lstinputlisting[%
+ language=Java,%
+ inputencoding=utf8/latin1,%
+]{ExampleUTF8.java}
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/listingsutf8}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/listingsutf8.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/listingsutf8.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[\CTAN{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 listingsutf8.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@{}}
+% listingsutf8.sty & tex/latex/oberdiek/listingsutf8.sty\\
+% listingsutf8.pdf & doc/latex/oberdiek/listingsutf8.pdf\\
+% test/listingsutf8-test1.tex & doc/latex/oberdiek/test/listingsutf8-test1.tex\\
+% test/listingsutf8-test2.tex & doc/latex/oberdiek/test/listingsutf8-test2.tex\\
+% test/listingsutf8-test3.tex & doc/latex/oberdiek/test/listingsutf8-test3.tex\\
+% test/listingsutf8-test4.tex & doc/latex/oberdiek/test/listingsutf8-test4.tex\\
+% test/listingsutf8-test5.tex & doc/latex/oberdiek/test/listingsutf8-test5.tex\\
+% listingsutf8.dtx & source/latex/oberdiek/listingsutf8.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk listingsutf8.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{listingsutf8.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 listingsutf8.dtx
+%makeindex -s gind.ist listingsutf8.idx
+%pdflatex listingsutf8.dtx
+%makeindex -s gind.ist listingsutf8.idx
+%pdflatex listingsutf8.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{listingsutf8.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='listingsutf8'>
+ <name>listingsutf8</name>
+ <caption>Allow UTF-8 in listings input.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ Package <xref refid='listings'>listings</xref> does not support files
+ with multi-byte encodings such as UTF-8. In the case of
+ <tt>\lstinputlisting</tt>, a simple workaround is possible if a
+ one-byte encoding exists that the file can be converted to. The
+ package requires the e-TeX extensions under pdfTeX (in either PDF
+ or DVI output mode).
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/listingsutf8.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/listingsutf8.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{inputenc}
+% Alan Jeffrey, Frank Mittelbach,
+% \textit{inputenc.sty}, 2006/05/05 v1.1b.
+% \CTAN{macros/latex/base/inputenc.dtx}
+%
+% \bibitem{listings}
+% Carsten Heinz, Brooks Moses:
+% \textit{The \xpackage{listings} package};
+% 2007/02/22;\\
+% \CTAN{macros/latex/contrib/listings/}.
+%
+% \bibitem{stringenc}
+% Heiko Oberdiek:
+% \textit{The \xpackage{stringenc} package};
+% 2007/10/22;\\
+% \CTAN{macros/latex/contrib/oberdiek/stringenc.pdf}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/10/22 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.1}
+% \item
+% Use of package \xpackage{pdftexcmds}.
+% \end{Version}
+% \begin{Version}{2011/11/10 v1.2}
+% \item
+% DOS line ends CR/LF normalized to LF to avoid empty lines
+% (Bug report of Thomas Benkert in de.comp.text.tex).
+% \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/listingsutf8.pdf b/macros/latex/contrib/oberdiek/listingsutf8.pdf
new file mode 100644
index 0000000000..01caba1aca
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/listingsutf8.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/ltxcmds.dtx b/macros/latex/contrib/oberdiek/ltxcmds.dtx
new file mode 100644
index 0000000000..77f96cb44d
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ltxcmds.dtx
@@ -0,0 +1,3359 @@
+% \iffalse meta-comment
+%
+% File: ltxcmds.dtx
+% Version: 2016/05/16 v1.23
+% Info: LaTeX kernel commands for general use
+%
+% Copyright (C) 2009-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 ltxcmds.dtx
+% and the derived files
+% ltxcmds.sty, ltxcmds.pdf, ltxcmds.ins, ltxcmds.drv,
+% ltxcmds-test1.tex, ltxcmds-test-gobble.tex,
+% ltxcmds-test-ifempty.tex, ltxcmds-test-zapspace.tex,
+% ltxcmds-test-ifboxempty.tex, ltxcmds-test-nextchar.tex,
+% ltxcmds-test-carcdr.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/ltxcmds.dtx
+% CTAN:macros/latex/contrib/oberdiek/ltxcmds.pdf
+%
+% Unpacking:
+% (a) If ltxcmds.ins is present:
+% tex ltxcmds.ins
+% (b) Without ltxcmds.ins:
+% tex ltxcmds.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{ltxcmds.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If ltxcmds.drv is present:
+% latex ltxcmds.drv
+% (b) Without ltxcmds.drv:
+% latex ltxcmds.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 ltxcmds.dtx
+% makeindex -s gind.ist ltxcmds.idx
+% pdflatex ltxcmds.dtx
+% makeindex -s gind.ist ltxcmds.idx
+% pdflatex ltxcmds.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/ltxcmds.sty
+% TDS:doc/latex/oberdiek/ltxcmds.pdf
+% TDS:doc/latex/oberdiek/test/ltxcmds-test1.tex
+% TDS:doc/latex/oberdiek/test/ltxcmds-test-gobble.tex
+% TDS:doc/latex/oberdiek/test/ltxcmds-test-ifempty.tex
+% TDS:doc/latex/oberdiek/test/ltxcmds-test-zapspace.tex
+% TDS:doc/latex/oberdiek/test/ltxcmds-test-ifboxempty.tex
+% TDS:doc/latex/oberdiek/test/ltxcmds-test-nextchar.tex
+% TDS:doc/latex/oberdiek/test/ltxcmds-test-carcdr.tex
+% TDS:source/latex/oberdiek/ltxcmds.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: ltxcmds
+Version: 2016/05/16 v1.23
+
+Copyright (C) 2009-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 ltxcmds.dtx
+and the derived files
+ ltxcmds.sty, ltxcmds.pdf, ltxcmds.ins, ltxcmds.drv,
+ ltxcmds-test1.tex, ltxcmds-test-gobble.tex,
+ ltxcmds-test-ifempty.tex, ltxcmds-test-zapspace.tex,
+ ltxcmds-test-ifboxempty.tex, ltxcmds-test-nextchar.tex,
+ ltxcmds-test-carcdr.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{ltxcmds.ins}{\from{ltxcmds.dtx}{install}}%
+ \file{ltxcmds.drv}{\from{ltxcmds.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{ltxcmds.sty}{\from{ltxcmds.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{ltxcmds-test1.tex}{\from{ltxcmds.dtx}{test1}}%
+% \file{ltxcmds-test-gobble.tex}{\from{ltxcmds.dtx}{test-gobble}}%
+% \file{ltxcmds-test-ifempty.tex}{\from{ltxcmds.dtx}{test-ifempty}}%
+% \file{ltxcmds-test-zapspace.tex}{\from{ltxcmds.dtx}{test-zapspace}}%
+% \file{ltxcmds-test-ifboxempty.tex}{\from{ltxcmds.dtx}{test-ifboxempty}}%
+% \file{ltxcmds-test-nextchar.tex}{\from{ltxcmds.dtx}{test-nextchar}}%
+% \file{ltxcmds-test-carcdr.tex}{\from{ltxcmds.dtx}{test-carcdr}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{ltxcmds.xml}{\from{ltxcmds.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{* ltxcmds.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `ltxcmds.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{ltxcmds.drv}%
+ [2016/05/16 v1.23 LaTeX kernel commands for general use (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{zref-savepos}
+\usepackage{paralist}
+\hfuzz=1pt
+\begin{document}
+ \DocInput{ltxcmds.dtx}%
+\end{document}
+%</driver>
+% \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{ltxcmds.drv}
+%
+% \title{The \xpackage{ltxcmds} package}
+% \date{2016/05/16 v1.23}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package \xpackage{ltxcmds} exports some utility macros
+% from the \LaTeX\ kernel into a separate namespace and
+% also provides them for other formats such as plain-\TeX.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newcounter{to}
+% \renewcommand*{\theto}{to\arabic{to}}
+% \newlength\tolength
+% \tolength=\dimexpr .5\linewidth+\oddsidemargin+1in+15mm\relax
+% \newcommand*{\TO}{^^A
+% \quad
+% \stepcounter{to}^^A
+% \zsavepos\theto
+% \ifdim\zposx\theto sp>0pt
+% \ifdim\zposx\theto sp<\tolength
+% \kern\dimexpr\tolength-\zposx\theto sp\relax
+% \fi
+% \fi
+% $\rightarrow$\quad
+% \ignorespaces
+% }
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% Many of my packages also support other formats such as plain-\TeX.
+% Because I am rather familiar with the utility macros from
+% \LaTeX's kernel (e.g. \cs{@gobble}, \cs{@firstoftwo}), I found
+% myself rewriting them again and again, because they are lacking
+% in plain-\TeX.
+%
+% Therefore this package provides often used macros and similar
+% ones with the name prefix \cs{ltx@}. This avoids also faulty
+% redefinitions. I remember an example where a package redefined
+% \cs{@firstoftwo} with forgetting \cs{long}.
+%
+% \subsection{Numbers}
+%
+% \begin{declcs}{ltx@zero} \TO 0\\
+% \cs{ltx@one} \TO 1\\
+% \cs{ltx@two} \TO 2\\
+% \cs{ltx@cclv} \TO 255\\
+% \cs{ltx@minusone} \TO -1
+% \end{declcs}
+% These commands are numbers 0, 1, 2, 255 and -1. They are not digits
+% and a space is not gobbled afterwards. Macro \cs{ltx@minusone}
+% is available since version 2010/12/12 v1.15.
+%
+% \subsection{Scratch registers}
+%
+% Following the conventions of \hologo{plainTeX} and \hologo{LaTeX}
+% the first ten registers are free to use. Even numbered registers
+% are for local, odd numbered for global use.
+%
+% \begin{declcs}{ltx@(Loc,Glob)(Toks,Dimen,Skip)(A,B,C,D,E)}
+% \end{declcs}
+% The name consists of the prefix \cs{ltx@}, then
+% \texttt{Loc} or \texttt{Glob} for local or global usage follows.
+% The register type is given by \texttt{Toks} for token register,
+% \texttt{Dimen} for dimen register and \texttt{Skip} for skip
+% register. As last part the registers are numbered from \texttt{A}
+% to \texttt{E}. Example: \cs{ltx@LocToksA}.
+%
+% Since 2011/04/14 v1.19.
+%
+% \subsection{Argument killers}
+%
+% \begin{declcs}{ltx@gobble} \M{1} \TO\\
+% \cs{ltx@gobbletwo} \M{1} \M{2} \TO\\
+% \cs{ltx@gobblethree} \M{1} \M{2} \M{3} \TO\\
+% \cs{ltx@gobblefour} \M{1} \M{2} \M{3} \M{4} \TO
+% \end{declcs}
+%
+% \begin{declcs}{ltx@GobbleNum} \M{num} \M{1} \M{2} \dots\space
+% \M{\meta{num}} \TO
+% \end{declcs}
+% The first argument \meta{num} of macro \cs{ltx@GobbleNum} specifies,
+% how many following arguments are eaten. Macro \cs{ltx@GobbleNum}
+% is expandable in exact two expansion steps.
+%
+% \subsection{Argument grabbers}
+%
+% \begin{declcs}{ltx@firstofone} \M{1} \TO \meta{1}\\[1ex]
+% \cs{ltx@firstoftwo} \M{1} \M{2} \TO \meta{1}\\
+% \cs{ltx@secondoftwo} \M{1} \M{2} \TO \meta{2}\\[1ex]
+% \cs{ltx@firstofthree} \M{1} \M{2} \M{3} \TO \meta{1}\\
+% \cs{ltx@secondofthree} \M{1} \M{2} \M{3} \TO \meta{2}\\
+% \cs{ltx@thirdofthree} \M{1} \M{2} \M{3} \TO \meta{3}\\
+% \cs{ltx@firstoffour} \M{1} \M{2} \M{3} \M{4} \TO \meta{1}\\
+% \cs{ltx@secondoffour} \M{1} \M{2} \M{3} \M{4} \TO \meta{2}\\
+% \cs{ltx@thirdoffour} \M{1} \M{2} \M{3} \M{4} \TO \meta{3}\\
+% \cs{ltx@fourthoffour} \M{1} \M{2} \M{3} \M{4} \TO \meta{4}
+% \end{declcs}
+% Macros \cs{ltx@firstofthree}, \cs{ltx@secondofthree}
+% and \cs{ltx@thirdofthree} were added in version
+% 2010/11/12 v1.11.
+% Macros \cs{ltx@firstoffour}, \dots, \cs{ltx@fourthoffour}
+% were added in version 2011/02/04 v1.16.
+%
+% \subsection{List helpers}
+%
+% \begin{declcs}{ltx@carzero} \dots\ \cs{@nil} \TO\\
+% \cs{ltx@cdrzero} \dots\ \cs{@nil} \TO \dots
+% \end{declcs}
+%
+% \begin{declcs}{ltx@car} \M{1} \dots\ \cs{@nil} \TO \meta{1}\\
+% \cs{ltx@cdr} \M{1} \dots\ \cs{@nil} \TO \dots
+% \end{declcs}
+%
+% \begin{declcs}{ltx@cartwo} \M{1} \M{2} \dots\ \cs{@nil}
+% \TO \meta{1}\meta{2}\\
+% \cs{ltx@carsecond} \M{1} \M{2} \dots\ \cs{@nil} \TO \meta{2}\\
+% \cs{ltx@cdrtwo} \M{1} \M{2} \dots\ \cs{@nil} \TO \dots
+% \end{declcs}
+%
+% \begin{declcs}{ltx@carthree} \M{1} \M{2} \M{3} \dots\ \cs{@nil}
+% \TO \meta{1}\meta{2}\meta{3}\\
+% \cs{ltx@carthird} \M{1} \M{2} \M{3} \dots\ \cs{@nil}
+% \TO \meta{3}\\
+% \cs{ltx@cdrthree} \M{1} \M{2} \M{3} \dots\ \cs{@nil} \TO \dots
+% \end{declcs}
+%
+% \begin{declcs}{ltx@carfour} \M{1} \M{2} \M{3} \M{4} \dots\ \cs{@nil}
+% \TO \meta{1}\meta{2}\meta{3}\meta{4}\\
+% \cs{ltx@carfourth} \M{1} \M{2} \M{3} \M{4} \dots\ \cs{@nil}
+% \TO \meta{4}\\
+% \cs{ltx@cdrfour} \M{1} \M{2} \M{3} \M{4} \dots\ \cs{@nil} \TO \dots
+% \end{declcs}
+%
+% \begin{declcs}{ltx@CarNum} \M{num} \M{1} \dots\ \M{\meta{num}}
+% \M{\meta{num}+1} \dots\ \cs{@nil}\\
+% \TO \M{1} \dots\ \M{\meta{num}} \dots\\
+% \cs{ltx@CarNumth} \M{num} \M{1} \dots\ \M{\meta{num}}
+% \M{\meta{num}+1} \dots\ \cs{@nil}\\
+% \TO \M{\meta{num}} \dots\\
+% \cs{ltx@CdrNum} \M{num} \M{1} \dots\ \M{\meta{num}}
+% \M{\meta{num}+1} \dots\ \cs{@nil}\\
+% \TO \M{\meta{num}+1} \dots
+% \end{declcs}
+%
+% Macros with uppercase letters are expandable in two expansion steps.
+% Changes in version 2016/05/16 v1.23:
+% \begin{itemize}
+% \item
+% Macros \cs{ltx@carsecond}, \cs{ltx@carthird}, \cs{ltx@carfourth},
+% \cs{ltx@CarNumth} added.
+% \item
+% Macros \cs{ltx@cdr}, \cs{ltx@cdrtwo}, \cs{ltx@cdrthree}, \cs{ltx@cdrfour},
+% \cs{ltx@CdrNum} are expandable in two expansion steps and retain
+% spaces and braces after the first gobbled arguments.
+% \end{itemize}
+%
+% \subsection{Tail recursion}
+%
+% \begin{declcs}{ltx@ReturnAfterFi} \M{1} \cs{fi} \TO \cs{fi} \meta{1}\\
+% \cs{ltx@ReturnAfterElseFi} \M{1} \cs{else} \M{2} \cs{fi}
+% \TO \cs{fi} \meta{1}
+% \end{declcs}
+%
+% \subsection{Empty macro}
+%
+% \begin{declcs}{ltx@empty} \TO
+% \end{declcs}
+%
+% \subsection{Characters}
+%
+% \begin{declcs}{ltx@space} \TO \verb*| |\\
+% \cs{ltx@percentchar} \TO \texttt{\%}\\
+% \cs{ltx@backslashchar} \TO
+% \makeatletter\texttt{\@backslashchar}\\
+% \cs{ltx@hashchar} \TO \texttt{\#}\qquad(since v1.7)\\
+% \cs{ltx@leftbracechar} \TO \texttt{\textbraceleft}\qquad(since v1.8)\\
+% \cs{ltx@rightbracechar} \TO \texttt{\textbraceright}\qquad(since v1.8)
+% \end{declcs}
+%
+% \subsection{Boolean switch}
+%
+% \begin{declcs}{ltx@newif} \M{cmd}
+% \end{declcs}
+% \cs{ltx@newif} defines a new boolean switch \meta{cmd} like \cs{newif}.
+% Unlike \plainTeX's \cs{newif}, \cs{ltx@newif} is not \cs{outer}.
+% The command \meta{cmd} must start with the two characters |if|.
+%
+% \begin{declcs}{ltx@newglobalif} \M{cmd}
+% \end{declcs}
+% \cs{ltx@newglobalif} defines a new boolean switch \meta{cmd}
+% like \cs{ltx@newif}. However the switch setting commands,
+% \meta{cmd} without the prefix |if| and followed by |true| or |false|
+% are acting globally.
+%
+% \subsection{Command definitions}
+%
+% \begin{declcs}{ltx@ifundefined} \M{cmd} \M{yes} \M{no}
+% \end{declcs}
+% If \eTeX\ is available, \cs{ifcsname} is used that does
+% not have the side effect of defining undefined commands
+% with meaning of \cs{relax}. This command is always expandable.
+% Change in version 1.1: Also the meaning \cs{relax} is
+% always considered ``undefined''.
+%
+% \begin{declcs}{ltx@IfUndefined} \M{cmd} \M{yes} \M{no}
+% \end{declcs}
+% If \eTeX\ is available, \cs{ifcsname} is used that does
+% not have the side effect of defining undefined commands
+% with meaning of \cs{relax}. Also it always checks for
+% the meaning of \cs{relax} and considers this as undefined.
+% This macro is not expandable without \eTeX.
+%
+% \begin{declcs}{ltx@LocalExpandAfter}
+% \end{declcs}
+% It expands the token after the next token but in a local
+% context. That is the difference to \cs{expandafter}.
+% The local context discards the side effect of \cs{csname}
+% and let the command undefined after the expansion step.
+%
+% \subsection{Stripping}
+%
+% \begin{declcs}{ltx@RemovePrefix}\\
+% \cs{ltx@StripPrefix}
+% \end{declcs}
+% All tokens up to and including the next available character
+% `\textgreater' are thrown away. Usually it is used to strip
+% the first part of the output of the commands \cs{meaning}
+% or \cs{pdflastmatch}. Macro \cs{ltx@RemovePrefix}
+% has the same meaning as \LaTeX's \cs{strip@prefix}, whereas
+% macro \cs{ltx@StripPrefix} expands the next token
+% once before stripping the prefix.
+%
+% \begin{declcs}{ltx@onelevel@sanitize} \M{macro}
+% \end{declcs}
+% Macro \cs{ltx@onelevel@sanitize} provides \hologo{LaTeX}'s
+% \cs{@onelevel@sanitize}. The macro is expanded once and
+% the contents is converted to characters with catcode 12 (other)
+% and space tokens with catcode 10 (space). Then then sanitized
+% contents is stored into the macro again. Since version 1.12.
+%
+% \subsection{File management}
+%
+% All macros in this section are expandable like
+% the counterparts of the \LaTeX\ kernel. Also they
+% can be used after the preamble.
+%
+% \subsubsection{File extensions}
+%
+% \begin{declcs}{ltx@clsextension}\\
+% \cs{ltx@pkgextension}
+% \end{declcs}
+% Macros \cs{ltx@clsextension} and \cs{ltx@styextension}
+% stores the strings |cls| and |sty|. In opposite to \hologo{LaTeX}'s
+% \cs{@clsextension} and \cs{@styextension} they can also be
+% used after |\begin{document}|.
+%
+% \subsubsection{Load check}
+%
+% \begin{declcs}{ltx@ifclassloaded} \M{class} \M{yes} \M{no}\\
+% \cs{ltx@ifpackageloaded} \M{package} \M{yes} \M{no}
+% \end{declcs}
+% Macros \cs{ltx@ifclassloaded}\slash\cs{ltx@ifpackageloaded}
+% execute \meta{yes}, if the \meta{class} or \meta{package} is loaded,
+% otherwise \meta{no} is called.
+% Both \meta{class} and \meta{package} are specified without
+% extension. The macros can also be used after |\begin{document}|.
+%
+% \begin{declcs}{ltx@iffileloaded} \M{file} \M{yes} \M{no}
+% \end{declcs}
+% If \LaTeX's \cs{ProvidesFile} macro was called before
+% using \meta{file} as argument, then \cs{ltx@iffileloaded}
+% calls \meta{yes}, otherwise \meta{no}.
+% Therefore it is possible
+% that the \meta{file} is loaded, but \meta{no} is executed because
+% of a missing \cs{ProvidesFile}. The \LaTeX\ kernel does not have
+% a counterpart of \cs{ltx@iffileloaded}.
+%
+% Note that the file name used in \cs{ProvidesFile} and
+% \cs{ltx@iffileloaded} must match. For example, if \TeX's
+% default extension \xext{tex} was given in the first command,
+% then it must also specified in the latter command and vice versa.
+%
+% \subsubsection{Version date check}
+%
+% \begin{declcs}{ltx@ifclasslater} \M{class} \M{date} \M{yes} \M{no}\\
+% \cs{ltx@ifpackagelater} \M{package} \M{date} \M{yes} \M{no}\\
+% \cs{ltx@iffilelater} \M{file} \M{date} \M{yes} \M{no}
+% \end{declcs}
+% If a \cs{ProvidesClass}\slash\cs{ProvidesPackage}\slash
+% \cs{ProvidesFile} command with exact the same class\slash package\slash
+% file was executed before with an optional
+% argument that starts with a \LaTeX\ version date, then
+% this version date is compared with the argument \meta{date}.
+% If they are equal or if the version date is the later date,
+% then \meta{yes} is called. In all other cases \meta{no} is executed.
+%
+% A \LaTeX\ date has the format |YYYY/MM/DD| with |YYYY| as year
+% with four digits, |MM| as month with two digits and |DD| as day
+% with two digits. If \pdfTeX's \cs{pdfmatch} is available, then
+% it is used to detect the version date, to reject invalid
+% date formats and to reject some invalid dates.
+% Dates before 1994/01/01 are always invalid, because version
+% dates are introduced with \LaTeXe\ in 1994.
+%
+% \subsection{Macro additions}
+%
+% \begin{declcs}{ltx@GlobalAppendToMacro} \M{cmd} \M{addition}\\
+% \cs{ltx@LocalAppendToMacro} \M{cmd} \M{addition}
+% \end{declcs}
+% The \meta{addition} is appended to the parameterless macro \meta{cmd}.
+% If \meta{cmd} is undefined or has the meaning \cs{relax}, then
+% it will be initialized as empty macro beforehand. Due to a bug \meta{addition}
+% must not contain \cs{par} before version 2010/10/25 v1.9.
+%
+% \begin{declcs}{ltx@GlobalPrependToMacro} \M{cmd} \M{addition}\\
+% \cs{ltx@LocalPrependToMacro} \M{cmd} \M{addition}
+% \end{declcs}
+% The \meta{addition} is prepended to the parameterless macro \meta{cmd}.
+% If \meta{cmd} is undefined or has the meaning \cs{relax}, then
+% it will be initialized as empty macro beforehand. The macros
+% were added in version 2011/08/22 v1.21.
+%
+% \subsection{Next character detection}
+%
+% \begin{declcs}{ltx@ifnextchar} \M{char} \M{yes} \M{no}
+% \end{declcs}
+% If next character is \meta{char} then \meta{yes} is called,
+% otherwise \meta{no}. The character is not removed.
+% Spaces are silently removed when looking for \meta{char}
+% as \hologo{LaTeX}'s version \cs{kernel@ifnextchar} does.
+% But there are also small differences:
+% \begin{itemize}
+% \item The space can be used as \meta{char}. In this case
+% optional spaces before \meta{char} are not supported of course.
+% \item If the optional space is a command that is a character
+% (defined by \cs{let} or \cs{futurelet}), then
+% \cs{kernel@ifnextchar} breaks with an \hologo{TeX} error.
+% \cs{ltx@ifnextchar} silently removes this token as
+% optional space.
+% \end{itemize}
+% Since 2010/03/01 v1.3.
+%
+% \begin{declcs}{ltx@ifnextchar@nospace} \M{char} \M{yes} \M{no}
+% \end{declcs}
+% Macro \cs{ltx@ifnextchar@nospace} behaves like
+% macro \cs{ltx@ifnextchar} with the exception that
+% optional spaces are not supported before \meta{char}.
+% Since 2011/04/14 v1.19.
+%
+% \subsection{\cs{ltx@leavevmode}, \cs{ltx@mbox}}
+%
+% \begin{declcs}{ltx@leavevmode}
+% \end{declcs}
+% Macro \cs{ltx@leavevmode} calls \hologo{pdfTeX}'s \cs{quitvmode}.
+% Otherwise \cs{leavevmode} is used and defined if it is necessary.
+%
+% \begin{declcs}{ltx@mbox}
+% \end{declcs}
+% Macro \cs{ltx@mbox} reimplements \cs{mbox} with two changes.
+% Instead of \cs{leavevmode} it uses \cs{ltx@leavevmode} and
+% stops right after \cs{hbox}. Especially it does not grab
+% the argument and allows the extended syntax of \cs{hbox}.
+%
+% \subsection{Expandable test for emptiness}
+%
+% \begin{declcs}{ltx@ifempty} \M{stuff} \M{yes} \M{no}
+% \end{declcs}
+% Macro \cs{ltx@ifempty} checks in exact two expansion steps
+% whether \meta{stuff}
+% is empty or contains token. Depending on the result
+% \meta{yes} or \meta{no} is executed. The token in \meta{stuff}
+% may contain \cs{par} and unmatched conditionals (\cs{if}, \cs{else},
+% \cs{fi}, \dots). Since version 2010/11/12 v1.11.
+%
+% \begin{declcs}{ltx@ifblank} \M{stuff} \M{yes} \M{no}
+% \end{declcs}
+% Macro \cs{ltx@ifblank} tests in exact two expansion steps
+% if \meta{stuff} is empty or contain only blank spaces.
+% In this case argument \meta{yes} is called. If \meta{stuff}
+% contains other tokens than spaces then \meta{no} is executed.
+% Since version 2010/12/04 v1.13.
+%
+% \subsection{Stripping spaces}
+%
+% \begin{declcs}{ltx@zapspace} \M{stuff}
+% \end{declcs}
+% Macro \cs{ltx@zapspace} strips spaces from \meta{stuff}
+% that are not hidden inside curly braces. Like \hologo{LaTeX}'s
+% \cs{zap@space} it is expandable. Differences:
+% \begin{itemize}
+% \item
+% Syntax: \cs{zap@space} also expects a space token
+% and \cs{@empty} after \meta{stuff}.
+% \item
+% Macro \cs{ltx@zapspace} is expandable in exact two
+% expansion steps.
+% \item
+% Macro \cs{ltx@zapspace} always retains curly braces.
+% \item
+% Macro \cs{zap@space} has a bug. It stops stripping spaces
+% after a token group in curly braces if the first two tokens
+% inside the group are equal.
+% \item
+% Macro \cs{ltx@zapspace} also works with \cs{par}
+% and conditionals (\cs{if}, \cs{else}, \cs{fi}, \dots).
+% \end{itemize}
+% Macro \cs{ltx@zapspace} is available since version
+% 2010/12/07 v1.14.
+%
+% \subsection{Check for emptiness of boxes}
+%
+% \begin{declcs}{ltx@IfBoxEmpty} \M{box register number}
+% \M{yes} \M{no}
+% \end{declcs}
+% Macro \cs{ltx@IfBoxEmpty} calls \meta{yes} if
+% the box exists (\cs{ifvoid} returns false) and the box
+% does not contain any content. Otherwise if the box
+% is void or contains something, then \meta{no} is executed.
+% Thus being empty means that the box exists and is either
+% an \cs{hbox} or a \cs{vbox} and may even have dimensions other than
+% 0.0\,pt, but the box does not contain anything.
+% Macro \cs{ltx@IfBoxEmpty} is available since 2010/02/04 v1.16.
+%
+% \begin{declcs}{ltx@IfBoxVoidOrEmpty} \M{box register number}
+% \M{yes} \M{no}
+% \end{declcs}
+% Macro \cs{ltx@IfBoxVoidOrEmpty} calls \meta{yes} if
+% the box is either void or does not contain any content.
+% Otherwise \meta{no} is executed.
+% Macro \cs{ltx@IfBoxVoidOrEmpty} is available since 2010/02/04 v1.16.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@ltxcmds.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{ltxcmds}{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@ltxcmds.sty\endcsname
+\ProvidesPackage{ltxcmds}%
+ [2016/05/16 v1.23 LaTeX kernel commands for general use (HO)]%
+% \end{macrocode}
+%
+% \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 LTXcmds@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\LTXcmds@AtEnd{%
+ \LTXcmds@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{36}{3}% $
+\TMP@EnsureCode{38}{4}% &
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{12}% ^ (superscript) (!)
+\TMP@EnsureCode{124}{12}% |
+\edef\LTXcmds@AtEnd{\LTXcmds@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Numbers}
+%
+% \begin{macro}{\ltx@zero}
+% \begin{macrocode}
+\chardef\ltx@zero=0 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@one}
+% \begin{macrocode}
+\chardef\ltx@one=1 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@two}
+% \begin{macrocode}
+\chardef\ltx@two=2 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@active}
+% \begin{macrocode}
+\chardef\ltx@active=13 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@cclv}
+% \begin{macrocode}
+\chardef\ltx@cclv=255 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@minusone}
+% \begin{macrocode}
+\def\ltx@minusone{%
+ -\ltx@one
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Scratch registers}
+%
+% \begin{macro}{\ltx@LocToksA}
+% \begin{macrocode}
+\toksdef\ltx@LocToksA=0 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocToksB}
+% \begin{macrocode}
+\toksdef\ltx@LocToksB=2 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocToksC}
+% \begin{macrocode}
+\toksdef\ltx@LocToksC=4 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocToksD}
+% \begin{macrocode}
+\toksdef\ltx@LocToksD=6 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocToksE}
+% \begin{macrocode}
+\toksdef\ltx@LocToksE=8 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@GlobToksA}
+% \begin{macrocode}
+\toksdef\ltx@GlobToksA=1 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobToksB}
+% \begin{macrocode}
+\toksdef\ltx@GlobToksB=3 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobToksC}
+% \begin{macrocode}
+\toksdef\ltx@GlobToksC=5 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobToksD}
+% \begin{macrocode}
+\toksdef\ltx@GlobToksD=7 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobToksE}
+% \begin{macrocode}
+\toksdef\ltx@GlobToksE=9 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@LocDimenA}
+% \begin{macrocode}
+\dimendef\ltx@LocDimenA=0 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocDimenB}
+% \begin{macrocode}
+\dimendef\ltx@LocDimenB=2 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocDimenC}
+% \begin{macrocode}
+\dimendef\ltx@LocDimenC=4 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocDimenD}
+% \begin{macrocode}
+\dimendef\ltx@LocDimenD=6 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocDimenE}
+% \begin{macrocode}
+\dimendef\ltx@LocDimenE=8 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@GlobDimenA}
+% \begin{macrocode}
+\dimendef\ltx@GlobDimenA=1 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobDimenB}
+% \begin{macrocode}
+\dimendef\ltx@GlobDimenB=3 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobDimenC}
+% \begin{macrocode}
+\dimendef\ltx@GlobDimenC=5 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobDimenD}
+% \begin{macrocode}
+\dimendef\ltx@GlobDimenD=7 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobDimenE}
+% \begin{macrocode}
+\dimendef\ltx@GlobDimenE=9 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@LocSkipA}
+% \begin{macrocode}
+\skipdef\ltx@LocSkipA=0 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocSkipB}
+% \begin{macrocode}
+\skipdef\ltx@LocSkipB=2 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocSkipC}
+% \begin{macrocode}
+\skipdef\ltx@LocSkipC=4 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocSkipD}
+% \begin{macrocode}
+\skipdef\ltx@LocSkipD=6 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocSkipE}
+% \begin{macrocode}
+\skipdef\ltx@LocSkipE=8 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@GlobSkipA}
+% \begin{macrocode}
+\skipdef\ltx@GlobSkipA=1 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobSkipB}
+% \begin{macrocode}
+\skipdef\ltx@GlobSkipB=3 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobSkipC}
+% \begin{macrocode}
+\skipdef\ltx@GlobSkipC=5 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobSkipD}
+% \begin{macrocode}
+\skipdef\ltx@GlobSkipD=7 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@GlobSkipE}
+% \begin{macrocode}
+\skipdef\ltx@GlobSkipE=9 %
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Argument killers}
+%
+% \begin{macro}{\ltx@gobble}
+% \begin{macrocode}
+\long\def\ltx@gobble#1{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@gobbletwo}
+% \begin{macrocode}
+\long\def\ltx@gobbletwo#1#2{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@gobblethree}
+% \begin{macrocode}
+\long\def\ltx@gobblethree#1#2#3{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@gobblefour}
+% \begin{macrocode}
+\long\def\ltx@gobblefour#1#2#3#4{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@GobbleNum}
+% \begin{macrocode}
+\def\ltx@GobbleNum#1{%
+ \romannumeral
+ \csname ltx@zero%
+ \expandafter\LTXcmds@GobbleNum
+ \romannumeral\LTXcmds@num{#1}000{m\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@GobbleNum}
+% \begin{macrocode}
+\def\LTXcmds@GobbleNum#1{%
+ \csname LTXcmds@G#1\LTXcmds@GobbleNum
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@Gm}
+% \begin{macrocode}
+\long\def\LTXcmds@Gm#1{%
+ \endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Argument grabbers}
+%
+% \begin{macro}{\ltx@firstofone}
+% \begin{macrocode}
+\long\def\ltx@firstofone#1{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@firstoftwo}
+% \begin{macrocode}
+\long\def\ltx@firstoftwo#1#2{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@secondoftwo}
+% \begin{macrocode}
+\long\def\ltx@secondoftwo#1#2{#2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@firstofthree}
+% \begin{macrocode}
+\long\def\ltx@firstofthree#1#2#3{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@secondofthree}
+% \begin{macrocode}
+\long\def\ltx@secondofthree#1#2#3{#2}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@thirdofthree}
+% \begin{macrocode}
+\long\def\ltx@thirdofthree#1#2#3{#3}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@firstoffour}
+% \begin{macrocode}
+\long\def\ltx@firstoffour#1#2#3#4{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@secondoffour}
+% \begin{macrocode}
+\long\def\ltx@secondoffour#1#2#3#4{#2}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@thirdoffour}
+% \begin{macrocode}
+\long\def\ltx@thirdoffour#1#2#3#4{#3}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@fourthoffour}
+% \begin{macrocode}
+\long\def\ltx@fourthoffour#1#2#3#4{#4}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{List helpers}
+%
+% \begin{macro}{\ltx@carzero}
+% \begin{macrocode}
+\long\def\ltx@carzero#1\@nil{}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@cdrzero}
+% \begin{macrocode}
+\long\def\LTXcmds@cdrzero#1\@nil{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@cdrzero}
+% \begin{macrocode}
+\def\ltx@cdrzero{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@car}
+% \begin{macrocode}
+\long\def\ltx@car#1#2\@nil{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@cdr}
+% \begin{macrocode}
+\long\def\ltx@cdr#1{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@cartwo}
+% \begin{macrocode}
+\long\def\ltx@cartwo#1#2#3\@nil{#1#2}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@carsecond}
+% \begin{macrocode}
+\long\def\ltx@carsecond#1#2#3\@nil{#2}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@cdrtwo}
+% \begin{macrocode}
+\long\def\ltx@cdrtwo#1#2{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@carthree}
+% \begin{macrocode}
+\long\def\ltx@carthree#1#2#3#4\@nil{#1#2#3}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@carthird}
+% \begin{macrocode}
+\long\def\ltx@carthird#1#2#3#4\@nil{#3}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@cdrthree}
+% \begin{macrocode}
+\long\def\ltx@cdrthree#1#2#3{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@carfour}
+% \begin{macrocode}
+\long\def\ltx@carfour#1#2#3#4#5\@nil{#1#2#3#4}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@carfourth}
+% \begin{macrocode}
+\long\def\ltx@carfourth#1#2#3#4#5\@nil{#4}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@cdrfour}
+% \begin{macrocode}
+\long\def\ltx@cdrfour#1#2#3#4{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@CarNum}
+% \begin{macrocode}
+\def\ltx@CarNum#1{%
+ \romannumeral
+ \csname LTXcmds@CarNumFinish%
+ \expandafter\LTXcmds@CarNum
+ \romannumeral\LTXcmds@num{#1}000{x\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@CarNum}
+% \begin{macrocode}
+\def\LTXcmds@CarNum#1{%
+ \csname LTXcmds@C#1\LTXcmds@CarNum
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@Cm}
+% \begin{macrocode}
+\long\def\LTXcmds@Cm#1#2{%
+ \endcsname{#1#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@Cx}
+% \begin{macrocode}
+\def\LTXcmds@Cx#1{%
+ \endcsname{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@CarNumFinish}
+% \begin{macrocode}
+\long\def\LTXcmds@CarNumFinish#1#2\@nil{%
+ \ltx@zero
+ #1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@CarNumth}
+% \begin{macrocode}
+\def\ltx@CarNumth#1{%
+ \romannumeral
+ \expandafter\expandafter\expandafter
+ \LTXcmds@CarNumth
+ \ltx@GobbleNum{#1}{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@CarNumth}
+% \begin{macrocode}
+\long\def\LTXcmds@CarNumth#1#2\@nil{%
+ \ltx@zero
+ #1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@CdrNum}
+% \begin{macrocode}
+\def\ltx@CdrNum#1{%
+ \romannumeral%
+ \expandafter\expandafter\expandafter\ltx@cdrzero
+ \expandafter\expandafter\expandafter\ltx@zero
+ \ltx@GobbleNum{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Tail recursion}
+%
+% \begin{macro}{\ltx@ReturnAfterFi}
+% \begin{macrocode}
+\long\def\ltx@ReturnAfterFi#1\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@ReturnAfterElseFi}
+% \begin{macrocode}
+\long\def\ltx@ReturnAfterElseFi#1\else#2\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Empty macro}
+%
+% \begin{macro}{\ltx@empty}
+% \begin{macrocode}
+\def\ltx@empty{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Characters}
+%
+% \begin{macro}{\ltx@space}
+% \begin{macrocode}
+\def\ltx@space{ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@percentchar}
+% \begin{macrocode}
+\begingroup
+ \lccode`0=`\%\relax
+\lowercase{\endgroup
+ \def\ltx@percentchar{0}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@backslashchar}
+% \begin{macrocode}
+\begingroup
+ \lccode`0=`\\\relax
+\lowercase{\endgroup
+ \def\ltx@backslashchar{0}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@hashchar}
+% \begin{macrocode}
+\begingroup
+ \lccode`0=`\#\relax
+\lowercase{\endgroup
+ \def\ltx@hashchar{0}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\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}
+%
+% \subsection{Boolean switch}
+%
+% \begin{macro}{\ltx@newif}
+% \begin{macrocode}
+\def\ltx@newif#1{%
+ \begingroup
+ \escapechar=-1 %
+ \expandafter\endgroup
+ \expandafter\LTXcmds@newif\string#1\@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@newif}
+% \begin{macrocode}
+\begingroup
+ \escapechar=-1 %
+\expandafter\endgroup
+\expandafter\def\expandafter\LTXcmds@newif\string\if#1\@nil{%
+ \expandafter\edef\csname#1true\endcsname{%
+ \let
+ \expandafter\noexpand\csname if#1\endcsname
+ \noexpand\iftrue
+ }%
+ \expandafter\edef\csname#1false\endcsname{%
+ \let
+ \expandafter\noexpand\csname if#1\endcsname
+ \noexpand\iffalse
+ }%
+ \csname#1false\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@newglobalif}
+% \begin{macrocode}
+\def\ltx@newglobalif#1{%
+ \begingroup
+ \escapechar=-1 %
+ \expandafter\endgroup
+ \expandafter\LTXcmds@newglobalif\string#1\@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@newglobalif}
+% \begin{macrocode}
+\begingroup
+ \escapechar=-1 %
+\expandafter\endgroup
+\expandafter
+\def\expandafter\LTXcmds@newglobalif\string\if#1\@nil{%
+ \expandafter\edef\csname#1true\endcsname{%
+ \global\let
+ \expandafter\noexpand\csname if#1\endcsname
+ \noexpand\iftrue
+ }%
+ \expandafter\edef\csname#1false\endcsname{%
+ \global\let
+ \expandafter\noexpand\csname if#1\endcsname
+ \noexpand\iffalse
+ }%
+ \csname#1false\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Command definitions}
+%
+% \begin{macro}{\ltx@LocalExpandAfter}
+% \begin{macrocode}
+\def\ltx@LocalExpandAfter{%
+ \begingroup
+ \expandafter\expandafter\expandafter
+ \endgroup
+ \expandafter
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ltx@LocalExpandAfter
+\ifx\csname ifcsname\endcsname\relax
+% \end{macrocode}
+% \begin{macro}{\ltx@ifundefined}
+% \begin{macrocode}
+ \def\ltx@ifundefined#1{%
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\ltx@firstoftwo
+ \else
+ \expandafter\ltx@secondoftwo
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@IfUndefined}
+% \begin{macrocode}
+ \def\ltx@IfUndefined#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\ltx@firstoftwo
+ \else
+ \expandafter\ltx@secondoftwo
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \expandafter\ltx@gobble
+\else
+ \expandafter\ltx@firstofone
+\fi
+{%
+% \end{macrocode}
+% \begin{macro}{\ltx@ifundefined}
+% \begin{macrocode}
+ \def\ltx@ifundefined#1{%
+ \ifcsname #1\endcsname
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\expandafter\expandafter\ltx@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\ltx@secondoftwo
+ \fi
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@IfUndefined}
+% \begin{macrocode}
+ \let\ltx@IfUndefined\ltx@ifundefined
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Stripping}
+%
+% \begin{macro}{\ltx@RemovePrefix}
+% \begin{macrocode}
+\def\ltx@RemovePrefix#1>{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@StripPrefix}
+% \begin{macrocode}
+\def\ltx@StripPrefix{%
+ \expandafter\ltx@RemovePrefix
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@onelevel@sanitize}
+% \begin{macrocode}
+\def\ltx@onelevel@sanitize#1{%
+ \edef#1{%
+ \expandafter
+ \ltx@RemovePrefix\meaning#1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{File management}
+%
+% \subsubsection{File extensions}
+%
+% \begin{macro}{\ltx@clsextension}
+% \begin{macrocode}
+\def\ltx@clsextension{cls}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@pkgextension}
+% \begin{macrocode}
+\def\ltx@pkgextension{sty}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Load check}
+%
+% \begin{macro}{\ltx@iffileloaded}
+% \begin{macrocode}
+\def\ltx@iffileloaded#1{%
+ \ltx@ifundefined{ver@#1}\ltx@secondoftwo\ltx@firstoftwo
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@ifclassloaded}
+% \begin{macrocode}
+\def\ltx@ifclassloaded#1{%
+ \ltx@iffileloaded{#1.\ltx@clsextension}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@ifpackageloaded}
+% \begin{macrocode}
+\def\ltx@ifpackageloaded#1{%
+ \ltx@iffileloaded{#1.\ltx@pkgextension}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Version date check}
+%
+% \begin{macro}{\ltx@iffilelater}
+% \begin{macrocode}
+\def\ltx@iffilelater#1#2{%
+ \ltx@iffileloaded{#1}{%
+ \expandafter\LTXcmds@IfLater\expandafter{%
+ \number
+ \expandafter\expandafter\expandafter\LTXcmds@ParseVersion
+ \expandafter\expandafter\expandafter{%
+ \csname ver@#1\endcsname
+ }%
+ \expandafter}\expandafter{%
+ \number
+ \expandafter\LTXcmds@ParseVersion\expandafter{#2}%
+ }%
+ }\ltx@secondoftwo
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@IfLater}
+% \begin{macrocode}
+\def\LTXcmds@IfLater#1#2{%
+ \ifcase 0%
+ \ifnum#1<19940101 %
+ \else
+ \ifnum#2<19940101 %
+ \else
+ \ifnum#2>#1 %
+ \else
+ 1%
+ \fi
+ \fi
+ \fi
+ \ltx@space
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@ifclasslater}
+% \begin{macrocode}
+\def\ltx@ifclasslater#1{%
+ \ltx@iffilelater{#1.\ltx@clsextension}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@ifpackagelater}
+% \begin{macrocode}
+\def\ltx@ifpackagelater#1{%
+ \ltx@iffilelater{#1.\ltx@pkgextension}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ltx@IfUndefined{pdfmatch}{%
+% \end{macrocode}
+% \begin{macro}{\LTXcmds@ParseVersion}
+% \begin{macrocode}
+ \def\LTXcmds@ParseVersion#1{%
+ \LTXcmds@@ParseVersion#10000/00/00\@nil
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@@ParseVersion}
+% \begin{macrocode}
+ \def\LTXcmds@@ParseVersion#1#2#3#4/#5#6/#7#8#9\@nil{%
+ #1#2#3#4#5#6#7#8%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% \begin{macro}{\LTXcmds@ParseVersion}
+% \begin{macrocode}
+ \def\LTXcmds@ParseVersion#1{%
+ \ifnum\pdfmatch{%
+ ^%
+ (199[4-9]|[2-9][0-9][0-9][0-9])/%
+ (0[1-9]|1[0-2])/%
+ (0[1-9]|[1-2][0-9]|3[0-1])%
+ }{#1}=1 %
+ \ltx@StripPrefix\pdflastmatch1 %
+ \ltx@StripPrefix\pdflastmatch2 %
+ \ltx@StripPrefix\pdflastmatch3 %
+ \else
+ 0%
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{Macro additions}
+%
+% \begin{macro}{\ltx@GlobalAppendToMacro}
+% \begin{macrocode}
+\long\def\ltx@GlobalAppendToMacro#1#2{%
+ \ifx\ltx@undefined#1%
+ \let#1\ltx@empty
+ \else
+ \ifx\relax#1%
+ \let#1\ltx@empty
+ \fi
+ \fi
+ \begingroup
+ \ltx@LocToksA\expandafter{#1#2}%
+ \xdef#1{\the\ltx@LocToksA}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocalAppendToMacro}
+% \begin{macrocode}
+\long\def\ltx@LocalAppendToMacro#1#2{%
+ \global\let\LTXcmds@gtemp#1%
+ \ifx\ltx@undefined\LTXcmds@gtemp
+ \global\let\LTXcmds@gtemp\ltx@empty
+ \else
+ \ifx\relax\LTXcmds@gtemp
+ \global\letLTXcmds@gtemp\ltx@empty
+ \fi
+ \fi
+ \begingroup
+ \ltx@LocToksA\expandafter{\LTXcmds@gtemp#2}%
+ \xdef\LTXcmds@gtemp{\the\ltx@LocToksA}%
+ \endgroup
+ \let#1\LTXcmds@gtemp
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@GlobalPrependToMacro}
+% \begin{macrocode}
+\long\def\ltx@GlobalPrependToMacro#1#2{%
+ \ifx\ltx@undefined#1%
+ \let#1\ltx@empty
+ \else
+ \ifx\relax#1%
+ \let#1\ltx@empty
+ \fi
+ \fi
+ \begingroup
+ \ltx@LocToksA{#2}%
+ \ltx@LocToksB\expandafter{#1}%
+ \xdef#1{\the\ltx@LocToksA\the\ltx@LocToksB}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocalPrependToMacro}
+% \begin{macrocode}
+\long\def\ltx@LocalPrependToMacro#1#2{%
+ \global\let\LTXcmds@gtemp#1%
+ \ifx\ltx@undefined\LTXcmds@gtemp
+ \global\let\LTXcmds@gtemp\ltx@empty
+ \else
+ \ifx\relax\LTXcmds@gtemp
+ \global\letLTXcmds@gtemp\ltx@empty
+ \fi
+ \fi
+ \begingroup
+ \ltx@LocToksA{#2}%
+ \ltx@LocToksB\expandafter{\LTXcmds@gtemp}%
+ \xdef\LTXcmds@gtemp{\the\ltx@LocToksA\the\ltx@LocToksB}%
+ \endgroup
+ \let#1\LTXcmds@gtemp
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Next character detection}
+%
+% \begin{macro}{\ltx@ifnextchar}
+% \begin{macrocode}
+\long\def\ltx@ifnextchar#1#2#3{%
+ \begingroup
+ \let\LTXcmds@CharToken= #1\relax
+ \ltx@LocToksA{\endgroup#2}%
+ \ltx@LocToksB{\endgroup#3}%
+ \futurelet\LTXcmds@LetToken\LTXcmds@ifnextchar
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@ifnextchar}
+% \begin{macrocode}
+\def\LTXcmds@ifnextchar{%
+ \ifx\LTXcmds@LetToken\LTXcmds@CharToken
+ \the\expandafter\ltx@LocToksA
+ \else
+ \expandafter
+ \ifx\csname LTXcmds@LetToken\endcsname\LTXcmds@SpaceToken
+ \expandafter\expandafter\expandafter\LTXcmds@@ifnextchar
+ \else
+ \the\expandafter\expandafter\expandafter\ltx@LocToksB
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@@ifnextchar}
+% \cs{futurelet} does not distinguish between a
+% character and a command that is a character
+% (defined by using \cs{let} or \cs{futurelet}).
+% Therefore the space is catched by \cs{romannumeral}
+% with negative character constant that gobbles one
+% optional space.
+% \begin{macrocode}
+\def\LTXcmds@@ifnextchar{%
+ \expandafter\futurelet
+ \expandafter\LTXcmds@LetToken
+ \expandafter\LTXcmds@ifnextchar
+ \romannumeral-`\.%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@SpaceToken}
+% \begin{macrocode}
+\ltx@firstofone{\let\LTXcmds@SpaceToken= } %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@ifnextchar@nospace}
+% \begin{macrocode}
+\long\def\ltx@ifnextchar@nospace#1#2#3{%
+ \begingroup
+ \let\LTXcmds@CharToken= #1\relax
+ \ltx@LocToksA{\endgroup#2}%
+ \ltx@LocToksB{\endgroup#3}%
+ \futurelet\LTXcmds@LetToken\LTXcmds@ifnextchar@nospace
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@ifnextchar@nospace}
+% \begin{macrocode}
+\def\LTXcmds@ifnextchar@nospace{%
+ \the
+ \ifx\LTXcmds@LetToken\LTXcmds@CharToken
+ \expandafter\ltx@LocToksA
+ \else
+ \expandafter\ltx@LocToksB
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \subsection{\cs{ltx@leavevmode}, \cs{ltx@mbox}}
+%
+% \begin{macro}{\ltx@leavevmode}
+% \begin{macrocode}
+\ltx@IfUndefined{quitvmode}{%
+ \ltx@IfUndefined{leavevmode}{%
+ \ltx@IfUndefined{voidb@x}{%
+ \ltx@IfUndefined{newbox}{%
+ \def\ltx@leavevmode{%
+ \begingroup
+ \setbox\ltx@zero=\hbox{}%
+ \begingroup
+ \setbox\ltx@zero=\hbox{\box\ltx@zero}%
+ \endgroup
+ \unhbox\ltx@zero
+ \endgroup
+ }%
+ }{%
+ \csname newbox\endcsname\LTXcmds@VoidBox
+ \ifvoid\LTXcmds@VoidBox
+ \else
+ \setbox\LTXcmds@VoidBox=\hbox{}%
+ \begingroup
+ \setbox\LTXcmds@VoidBox=\hbox{\box\LTXcmds@VoidBox}%
+ \endgroup
+ \fi
+ \def\ltx@leavevmode{\unhbox\LTXcmds@VoidBox}%
+ }%
+ }{%
+ \def\ltx@leavevmode{\unhbox\voidb@x}%
+ }%
+ }{%
+ \let\ltx@leavevmode\leavevmode
+ }%
+}{%
+ \let\ltx@leavevmode\quitvmode
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@mbox}
+% \begin{macrocode}
+\def\ltx@mbox{%
+ \ltx@leavevmode
+ \hbox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Help macros}
+%
+% \begin{macro}{\LTXcmds@num}
+% \begin{macrocode}
+\ltx@IfUndefined{numexpr}{%
+ \def\LTXcmds@num#1{%
+ \expandafter\ltx@firstofone\expandafter{%
+ \number#1%
+ }%
+ }%
+}{%
+ \def\LTXcmds@num#1{%
+ \expandafter\ltx@firstofone\expandafter{%
+ \the\numexpr#1%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Expandable test for emptiness}
+%
+% \begin{macrocode}
+\ltx@IfUndefined{detokenize}{%
+% \end{macrocode}
+%
+% \subsubsection{Vanilla \hologo{TeX}}
+%
+% \begin{macro}{\ltx@ifempty}
+% The macro is based on \cs{@ifempty} of Robert R. Schneck
+% \cite{ifempty:schneck}
+% and \cs{@ifnull} of Ulrich Diez \cite{ifnull:diez}.
+% There are three cases to consider:
+% \begin{compactenum}
+% \item |#1| is empty,
+% \item |#1| is not empty and the first token
+% is not a begingroup character,
+% \item |#1| starts with a begingroup character (catcode 1).
+% \end{compactenum}
+% \begin{macrocode}
+ \def\LTXcmds@temp#1{%
+ \long\def\ltx@ifempty##1{%
+ \romannumeral0%
+ \iffalse{\fi
+ \expandafter\ltx@gobble\expandafter{%
+ \expandafter{\string##1}%
+ \expandafter\ltx@gobble\string
+ }%
+ \expandafter\ltx@firstofthree\expandafter
+ {\iffalse}\fi
+ \expandafter#1\ltx@secondoftwo
+ }%
+ \expandafter#1\ltx@firstoftwo
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@ifblank}
+% \begin{macrocode}
+ \long\def\ltx@ifblank##1{%
+ \romannumeral0%
+ \iffalse{\fi
+ \expandafter\expandafter\expandafter\ltx@gobble
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\string\ltx@gobble##1.%
+ }%
+ \expandafter\ltx@gobble\string
+ }%
+ \expandafter\ltx@firstofthree\expandafter
+ {\iffalse}\fi
+ \expandafter#1\ltx@secondoftwo
+ }%
+ \expandafter#1\ltx@firstoftwo
+ }%
+ }%
+ \LTXcmds@temp{ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+%
+% \subsubsection{With \cs{detokenize}}
+%
+% Ahmed Musa provided \cs{ifstrempty} using \cs{detokenize}
+% and \cs{pdfstrcmp} \cite{ifstrempty:musa}. Ulrich Diez, GL,
+% Heiko Oberdiek
+% improved it further by removing \cs{pdfstrcmp} and
+% taking three arguments
+% \cite{ifstrempty:diez1,ifstrempty:diez2,ifstrempty:diez3,^^A
+% ifstrempty:gl,ifstrempty:ho}.
+%
+% \begin{macro}{\ltx@ifempty}
+% \begin{macrocode}
+ \long\def\ltx@ifempty#1{%
+ \romannumeral%
+ \csname
+ LTXcmds@ifempty%
+ \ifcat$\detokenize{#1}$%
+ @%
+ \fi
+ \endcsname
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@ifempty@}
+% \begin{macrocode}
+ \long\def\LTXcmds@ifempty@#1#2{0 #1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@ifempty}
+% \begin{macrocode}
+ \long\def\LTXcmds@ifempty#1#2{0 #2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{ltx@ifblank}}
+%
+% \begin{macro}{\ltx@ifblank}
+% \begin{macrocode}
+ \long\def\ltx@ifblank#1{%
+ \romannumeral%
+ \csname
+ LTXcmds@ifempty%
+ \ifcat$\detokenize\expandafter{\ltx@gobble#1.}$%
+ @%
+ \fi
+ \endcsname
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsection{\cs{ltx@zapspace}}
+%
+% \begin{macro}{\ltx@zapspace}
+% \begin{macrocode}
+\long\def\ltx@zapspace#1{%
+ \romannumeral
+ \LTXcmds@zapspace\ltx@zero#1 \@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LTXcmds@zapspace}
+% \begin{macrocode}
+\long\def\LTXcmds@zapspace#1 #2\@nil{%
+ \ltx@ifempty{#2}{%
+ #1%
+ }{%
+ \LTXcmds@zapspace#1#2\@nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{ltx@IfBoxEmpty}}
+%
+% In case of \hologo{eTeX} the test for an empty box
+% is done via \cs{lastnodetype} as suggested
+% by David Kastrup \cite{ifboxempty:dak}.
+% \begin{macrocode}
+\ltx@IfUndefined{lastnodetype}{%
+ \catcode`\$=9 %
+ \catcode`\&=14 %
+}{%
+ \catcode`\$=14 %
+ \catcode`\&=9 %
+}
+% \end{macrocode}
+% \begin{macro}{\ltx@IfBoxEmpty}
+% \begin{macrocode}
+\def\ltx@IfBoxEmpty#1{%
+ \ifvoid#1\relax
+ \expandafter\ltx@secondoftwo
+ \else
+% \end{macrocode}
+% Implementation using \hologo{eTeX}'s \cs{lastnodetype}.
+% \begin{macrocode}
+& \begingroup
+& \setbox\ltx@zero=\ifhbox#1\hbox\else\vbox\fi{%
+& \ifhmode\unhcopy\else\unvcopy\fi#1\relax
+& \expandafter
+& }%
+& \expandafter\endgroup
+& \ifnum\lastnodetype<\ltx@zero
+& \expandafter\expandafter\expandafter\ltx@firstoftwo
+& \else
+& \expandafter\expandafter\expandafter\ltx@secondoftwo
+& \fi
+% \end{macrocode}
+% Implementation without \hologo{eTeX} using a signature
+% at the beginning of the test box.
+% \begin{macrocode}
+$ \begingroup
+$ \setbox\ltx@zero=\ifhbox#1\hbox\else\vbox\fi{%
+$ \penalty\ltx@one
+$ \ifhmode\unhcopy\else\unvcopy\fi#1\relax
+$ \expandafter
+$ }%
+$ \ifnum\lastpenalty=\ltx@one
+% \end{macrocode}
+% Box 0 has been changed and is restored by
+% closing the group.
+% \begin{macrocode}
+$ \endgroup
+$ \begingroup
+$ \setbox\ltx@zero=\ifhbox#1\hbox\else\vbox\fi{%
+$ \penalty\ltx@two
+$ \ifhmode\unhcopy\else\unvcopy\fi#1\relax
+$ \expandafter
+$ }%
+$ \ifnum\lastpenalty=\ltx@two
+$ \def\next{\endgroup\expandafter\ltx@firstoftwo}%
+$ \else
+$ \def\next{\endgroup\expandafter\ltx@secondoftwo}%
+$ \fi
+$ \else
+$ \def\next{\endgroup\expandafter\ltx@secondoftwo}%
+$ \fi
+$ \next
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@IfBoxVoidOrEmpty}
+% \begin{macrocode}
+\def\ltx@IfBoxVoidOrEmpty#1{%
+ \ifvoid#1\relax
+ \expandafter\ltx@thirdoffour
+ \fi
+ \ltx@IfBoxEmpty{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\LTXcmds@AtEnd%
+%</package>
+% \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 ltxcmds.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test \cs{ltx@GobbleNum}}
+%
+% \begin{macrocode}
+%<*test-gobble>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2016/05/16]%
+\fi
+\catcode`\@=11 %
+\def\msg#{\immediate\write16}%
+\msg{[Test \string\ltx@GobbleNum]}%
+\long\def\Test#1=#2\\{%
+ \edef\StrA{\ltx@GobbleNum#1}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\StrAA
+ \expandafter\expandafter\expandafter{\ltx@GobbleNum#1}%
+ \edef\StrB{#2}%
+ \ifx\StrA\StrB
+ \ifx\StrAA\StrB
+ \msg{* ok.}%
+ \else
+ \msg{StrAA: \StrAA}%
+ \msg{StrB: \StrB}%
+ \errhelp{Test: #1=#2}%
+ \errmessage{Test (two expansions) failed}%
+ \fi
+ \else
+ \msg{StrA: \StrA}%
+ \msg{StrB: \StrB}%
+ \errhelp{Test: #1=#2}%
+ \errmessage{Test (edef) failed!}%
+ \fi
+}
+\Test0abc=abc\\
+\Test1abc=bc\\
+\Test2abc=c\\
+\Test3abcd=d\\
+\Test4abcde=e\\
+\Test5abcdef=f\\
+\Test6abcdefg=g\\
+\Test7abcdefgh=h\\
+\Test8abcdefghi=i\\
+\Test9abcdefghij=j\\
+\Test{10}0123456789X=X\\
+\Test{12}abcdefghijklm=m\\
+\Test{700}%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+X=X\\
+\Test{-1}abc=abc\\
+\Test2\par\par\relax=\relax\\
+
+\begingroup
+ \count1=2 %
+ \Test{\count1}abc=c\\%
+\endgroup
+
+\ltx@IfUndefined{numexpr}{%
+}{%
+ \Test{1+1}abc=c\\%
+}
+
+\msg{[Test \string\ltx@CdrNum]}%
+\long\def\Test#1=#2\\{%
+ \edef\StrA{\ltx@CdrNum#1\@nil}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\StrAA
+ \expandafter\expandafter\expandafter{\ltx@CdrNum#1\@nil}%
+ \edef\StrB{#2}%
+ \ifx\StrA\StrB
+ \ifx\StrAA\StrB
+ \msg{* ok.}%
+ \else
+ \msg{StrAA: \meaning\StrAA}%
+ \msg{StrB: \meaning\StrB}%
+ \errhelp{Test: #1=#2}%
+ \errmessage{Test (two expansions) failed}%
+ \fi
+ \else
+ \msg{StrA: \StrA}%
+ \msg{StrB: \StrB}%
+ \errhelp{Test: #1=#2}%
+ \errmessage{Test (edef) failed!}%
+ \fi
+}
+\Test0abc=abc\\
+\Test1abc=bc\\
+\Test2abc=c\\
+\Test3abcd=d\\
+\Test4abcde=e\\
+\Test5abcdef=f\\
+\Test6abcdefg=g\\
+\Test7abcdefgh=h\\
+\Test8abcdefghi=i\\
+\Test9abcdefghij=j\\
+\Test{10}0123456789X=X\\
+\Test{12}abcdefghijklm=m\\
+\Test{700}%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+X=X\\
+\Test{-1}abc=abc\\
+\Test2\par\par\relax=\relax\\
+
+\msg{[Test \string\ltx@CarNum]}%
+\long\def\Test#1=#2\\{%
+ \edef\StrA{\ltx@CarNum#1\@nil}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\StrAA
+ \expandafter\expandafter\expandafter{\ltx@CarNum#1\@nil}%
+ \edef\StrB{#2}%
+ \ifx\StrA\StrB
+ \ifx\StrAA\StrB
+ \msg{* ok.}%
+ \else
+ \msg{StrAA: \meaning\StrAA}%
+ \msg{StrB: \meaning\StrB}%
+ \errhelp{Test: #1=#2}%
+ \errmessage{Test (two expansions) failed}%
+ \fi
+ \else
+ \msg{StrA: \StrA}%
+ \msg{StrB: \StrB}%
+ \errhelp{Test: #1=#2}%
+ \errmessage{Test (edef) failed!}%
+ \fi
+}
+\Test0abc=\\
+\Test1abc=a\\
+\Test2abc=ab\\
+\Test3abc=abc\\
+\Test3abcd=abc\\
+\Test4abcde=abcd\\
+\Test{10}0123456789X=0123456789\\
+\Test{12}abcdefghijklm=abcdefghijkl\\
+\Test{700}%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+X=%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+0123456789012345678901234567890123456789012345678901234567890123456789%
+\\
+\Test{-1}abc=\\
+\Test2\par\par\relax=\par\par\\
+\csname @@end\endcsname\end
+%</test-gobble>
+% \end{macrocode}
+%
+% \subsection{Test \cs{ltx@ifempty}}
+%
+% \begin{macrocode}
+%<*test-ifempty>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\errorcontextlines=1000 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2016/05/16]%
+\fi
+\def\msg#{\immediate\write16}
+\def\TestY{\Y}
+\def\TestN{\N}
+\msg{* \string\ltx@ifempty}
+\long\def\test#1{%
+ \begingroup
+ % Calculate expected test result via macro definition
+ \def\Stuff{#1}%
+ \ifx\Stuff\ltx@empty
+ \def\StuffEmpty{\Y}%
+ \else
+ \def\StuffEmpty{\N}%
+ \fi
+ % Test \ltx@ifempty
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestEmpty
+ \expandafter\expandafter\expandafter{%
+ \ltx@ifempty{#1}{\Y}{\N}%
+ }%
+ \ifx\StuffEmpty\TestEmpty
+ \msg{* Test OK}%
+ \else
+ \ltx@IfUndefined{detokenize}{}{%
+ \msg{Stuff: [\detokenize{\Stuff}]}%
+ }%
+ \errmessage{Test failed!}%
+ \fi
+ \endgroup
+}
+\test{}
+\test{a}
+\test{abc}
+\test{\par}
+\test{ }
+\test{\if}
+\test{{\if}}
+\test{\else}
+\test{{\else}}
+\test{\fi}
+\test{{}\fi}
+\test{\or\ifcase}
+\test{{}}
+\test{{a}}
+\test{{}abc}
+\test{{\par}}
+\test{{}\par}
+% \end{macrocode}
+% \begin{macrocode}
+\def\SpaceTwo#1{%
+ \def\SpaceTwo{#1#1}%
+}\SpaceTwo{ }
+\msg{* \string\ltx@ifblank}
+\long\def\test#1{%
+ \begingroup
+ % Calculate expected test result via macro definition
+ \def\Stuff{#1}%
+ \ifx\Stuff\ltx@empty
+ \def\StuffEmpty{\Y}%
+ \else
+ \ifx\Stuff\ltx@space
+ \def\StuffEmpty{\Y}%
+ \else
+ \ifx\Stuff\SpaceTwo
+ \def\StuffEmpty{\Y}%
+ \else
+ \def\StuffEmpty{\N}%
+ \fi
+ \fi
+ \fi
+ % Test \ltx@ifblank
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestEmpty
+ \expandafter\expandafter\expandafter{%
+ \ltx@ifblank{#1}{\Y}{\N}%
+ }%
+ \ifx\StuffEmpty\TestEmpty
+ \msg{* Test OK}%
+ \else
+ \ltx@IfUndefined{detokenize}{}{%
+ \msg{Stuff: [\detokenize{\Stuff}]}%
+ }%
+ \errmessage{Test failed!}%
+ \fi
+ \endgroup
+}
+\test{}
+\test{a}
+\test{\if}
+\test{\else}
+\test{\fi}
+\test{ \fi}
+\test{\par}
+\test{ \par}
+\test{{}}
+\test{ {}}
+\def\x#1{%
+ \test{#1#1}%
+ \test{#1#1{}}%
+ \test{#1#1\par}%
+ \test{#1#1\else}%
+}\x{ }
+\csname @@end\endcsname\end
+%</test-ifempty>
+% \end{macrocode}
+%
+% \subsection{Test \cs{ltx@zap@space}}
+%
+% \begin{macrocode}
+%<*test-zapspace>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\errorcontextlines=1000 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2016/05/16]%
+\fi
+\def\msg#{\immediate\write16}
+\def\space{ }
+\def\empty{}
+\msg{* \string\ltx@zapspace}
+\long\def\test#1#2{%
+ \begingroup
+ \def\TestInput{#1}%
+ \def\TestExpected{#2}%
+ % Test \ltx@zapspace
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestResult
+ \expandafter\expandafter\expandafter{%
+ \ltx@zapspace{#1}%
+ }%
+ \ifx\TestResult\TestExpected
+ \msg{* Test OK}%
+ \else
+ \ltx@onelevel@sanitize\TestInput
+ \ltx@onelevel@sanitize\TestExpected
+ \ltx@onelevel@sanitize\TestResult
+ \msg{* Input: \space\space\space[\TestInput]}%
+ \msg{ \space Result: \space\space[\TestResult]}%
+ \msg{ \space Expected: [\TestExpected]}%
+ \errmessage{Test failed!}%
+ \fi
+ \endgroup
+}
+\long\def\etest#1#2{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\test{#1}{#2}%
+ }%
+ \x
+}
+\catcode`\~=13 %
+\let~\noexpand
+% \end{macrocode}
+% \begin{macrocode}
+\test{}{}
+\test{{}}{{}}
+\test{ {}}{{}}
+\test{{ }}{{ }}
+\test{{} }{{}}
+\test{ {} }{{}}
+\test{ { } }{{ }}
+\test{a {b} c}{a{b}c}
+\test{a bb ccc}{abbccc}
+\test{{a} {bb} {ccc}}{{a}{bb}{ccc}}
+\test{\par}{\par}
+\test{\if}{\if}
+\test{\space}{\space}
+\etest{\par\space\par}{\par\par}
+\etest{~\empty\space~\empty}{~\empty~\empty}
+\etest{~\fi\space~\else\space}{~\fi~\else}
+% \end{macrocode}
+% \begin{macrocode}
+\csname @@end\endcsname\end
+%</test-zapspace>
+% \end{macrocode}
+%
+% \subsection{Test \cs{ltx@IfBoxEmpty}}
+%
+% \begin{macrocode}
+%<*test-ifboxempty>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2016/05/16]%
+\fi
+\def\msg#{\immediate\write16}
+ % make box 0 void
+\begingroup
+ \setbox0=\box0 %
+\endgroup
+\ifvoid0 %
+\else
+ \errmessage{Voiding box 0 failed}%
+\fi
+\setbox2=\box0 %
+\def\test#1#2{%
+ \@test{#1}{#2}%
+ \@@test{#1}{#2}%
+ \chardef\x=#1%
+ \@test\x{#2}%
+ \@@test\x{#2}%
+}
+\def\@test#1#2{%
+ \begingroup
+ \setbox9=\hbox{%
+ \def\TestExpected{#2}%
+ \ltx@IfBoxEmpty{#1}{%
+ \def\TestResult{Y}%
+ }{%
+ \def\TestResult{N}%
+ }%
+ \ifx\TestExpected\TestResult
+ \msg{* Test passed.}%
+ \else
+ \errmessage{Test failed!}%
+ \fi
+ }%
+ \ifdim\wd9=0pt %
+ \else
+ \errmessage{Unwanted space?}%
+ \fi
+ \endgroup
+}
+\def\@@test#1#2{%
+ \begingroup
+ \setbox9=\hbox{%
+ \def\TestExpected{#2}%
+ \ifvoid#1\def\TestExpected{Y}\fi
+ \ltx@IfBoxVoidOrEmpty{#1}{%
+ \def\TestResult{Y}%
+ }{%
+ \def\TestResult{N}%
+ }%
+ \ifx\TestExpected\TestResult
+ \msg{* Test passed.}%
+ \else
+ \errmessage{Test failed!}%
+ \fi
+ }%
+ \ifdim\wd9=0pt %
+ \else
+ \errmessage{Unwanted space?}%
+ \fi
+ \endgroup
+}
+\test0N
+\test2N
+\setbox0=\hbox{}
+\test0Y
+\setbox2=\hbox{}
+\test2Y
+\setbox0=\vbox{}
+\test0Y
+\setbox2=\vbox{}
+\test0Y
+\setbox0=\hbox{ }%
+\test0N
+\setbox2=\hbox{ }%
+\test2N
+\setbox0=\hbox{\penalty1}%
+\test0N
+\setbox2=\hbox{\penalty1}%
+\test2N
+\csname @@end\endcsname\end
+%</test-ifboxempty>
+% \end{macrocode}
+%
+% \subsection{Test for next character detection}
+%
+% \begin{macrocode}
+%<*test-nextchar>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+ \input eolgrab.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2016/05/16]%
+ \RequirePackage{eolgrab}[2011/01/12]%
+\fi
+\def\msg#{\immediate\write16}
+\begingroup
+ \def\x#1{%
+ \endgroup
+ \let\TestSpaceToken= #1\relax
+ }%
+\x{ }
+\def\TestSpace{ }
+\begingroup
+ \lccode32=65 % space -> A
+\lowercase{%
+ \endgroup
+ \def\TestSpaceA{ }%
+}
+\def\TestCatch{%
+ \eolgrab\@TestCatch
+}
+\def\@TestCatch#1{%
+ \begingroup
+ \def\x{#1}%
+ \ifx\x\ltx@empty
+ \else
+ \ltx@onelevel@sanitize\x
+ \errmessage{Unparsed stuff on line [\x]}%
+ \fi
+ \endgroup
+}
+\def\TestCmdM#1{%
+ \TestCheckType{M}%
+ \TestCatch
+}
+\def\TestCmdOM[#1]#2{%
+ \TestCheckType{O}%
+ \TestCatch
+}
+\def\TestCheckType#1{%
+ \if\TestCmdType#1\relax
+ \else
+ \errmessage{Wrong type #1, expected: \TestCmdType}%
+ \fi
+}
+\def\TestCmd#1{%
+ \def\TestCmdType{#1}%
+ \ltx@ifnextchar[\TestCmdOM\TestCmdM
+}
+\def\TestCmdExp#1{%
+ \expandafter\TestCmd\expandafter#1%
+}
+\outer\def\TestOuter{}
+\TestCmd O[o]{m}
+\TestCmd M{m}
+\TestCmd O [o]{m}
+\TestCmd M {m}
+\def\x#1{\def\x{#1#1}}\x{ }
+\TestCmdExp O\x[o]{m}
+\TestCmdExp M\x{m}
+\def\x#1{\def\x{#1#1#1#1}}\x{ }
+\TestCmdExp O\x[o]{m}
+\TestCmdExp M\x{m}
+\def\x{\TestSpaceToken}
+\TestCmdExp O\x[o]{m}
+\TestCmdExp M\x{m}
+\def\x{\TestSpaceToken\TestSpaceToken\TestSpaceToken}
+\TestCmdExp O\x[o]{m}
+\TestCmdExp M\x{m}
+\TestCmd M\TestSpace
+\TestOuter
+\TestCmd M \TestSpace
+\TestOuter
+\TestCmd M\iftrue
+\TestOuter
+\TestCmd M\iffalse
+\TestOuter
+\TestCmd M\else
+\TestOuter
+\TestCmd M\fi
+\TestOuter
+\TestCmd M \iftrue
+\TestOuter
+\TestCmd M \iffalse
+\TestOuter
+\TestCmd M \else
+\TestOuter
+%
+\def\TestCmd#1{%
+ \def\TestCmdType{#1}%
+ \ltx@ifnextchar@nospace[\TestCmdOM\TestCmdM
+}
+\TestCmd O[o]{m}
+\TestCmd M{m}
+\TestCmd M [
+\TestOuter
+\TestCmd M {m}
+\TestCmd M\iftrue
+\TestOuter
+\TestCmd M\iffalse
+\TestOuter
+\TestCmd M\else
+\TestCmd M\fi
+\TestOuter
+\TestOuter
+%
+\def\TestCmd#1{%
+ \def\TestCmdType{#1}%
+ \ltx@ifnextchar(\TestCmdPM\TestCmdM
+}
+\def\TestCmdPM(#1)#2{%
+ \TestCheckType{P}%
+ \TestCatch
+}
+\TestCmd P(p){m}
+\TestCmd M{m}
+\TestCmd P (p){m}
+\TestCmd M {m}
+%
+\def\TestCmd#1{%
+ \def\TestCmdType{#1}%
+ \ltx@ifnextchar{ }\TestCmdSM\TestCmdM
+}
+\def\TestCmdSM#1#{%
+ \TestCheckType{S}%
+ \begingroup
+ \let\x= #1\relax
+ \ifx\x\TestSpaceToken
+ \else
+ \errmessage{unexpected space token: \meaning#1}%
+ \fi
+ \endgroup
+ \def\TestCmdType{M}%
+ \TestCmdM
+}
+\TestCmd S {m}
+\TestCmd M{m}
+\def\x#1{\def\x{#1#1}}\x{ }
+\TestCmdExp S\x{m}
+%
+\def\TestCmd#1{%
+ \def\TestCmdType{#1}%
+ \ltx@ifnextchar\iffalse\TestCmdIM\TestCmdM
+}
+\def\TestCmdIM\iffalse#1{%
+ \TestCheckType{I}%
+ \TestCatch
+}
+\TestCmd M\iftrue
+\TestOuter
+\TestCmd M \iftrue
+\TestCmd I\iffalse\iffalse
+\TestCmd I \iffalse\iffalse
+\TestOuter
+%
+\def\TestCmd#1{%
+ \def\TestCmdType{#1}%
+ \ltx@ifnextchar@nospace\iffalse\TestCmdIM\TestCmdM
+}
+\TestCmd M\iftrue
+\TestOuter
+\TestCmd I\iffalse\iffalse
+\TestOuter
+\csname @@end\endcsname\end
+%</test-nextchar>
+% \end{macrocode}
+%
+% \subsection{Test for list helpers}
+%
+% \begin{macrocode}
+%<*test-carcdr>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+ \input eolgrab.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2016/05/16]%
+ \RequirePackage{eolgrab}[2011/01/12]%
+\fi
+\def\msg#{\immediate\write16}
+\def\space{ }
+\long\def\Test#1#2#3{%
+ \begingroup
+ \def\TestExpected{#3}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestResult
+ \expandafter\expandafter\expandafter{%
+ #1#2\@nil
+ }%
+ \ifx\TestResult\TestExpected
+ \else
+ \msg{\string\TestExpected: [\meaning\TestExpected]}%
+ \msg{\string\TestResult: \space\space[\meaning\TestResult]}%
+ \errmessage{Test failed!}%
+ \fi
+ \endgroup
+}
+\Test\ltx@carzero{abc}{}
+\Test\ltx@carzero{}{}
+\Test\ltx@carzero{\par\par}{}
+\Test\ltx@cdrzero{}{}
+\Test\ltx@cdrzero{abc}{abc}
+\Test\ltx@cdrzero{ \par}{ \par}
+\Test\ltx@cdrzero{\@empty}{\@empty}
+\Test\ltx@cdrzero{{}}{{}}
+\Test\ltx@car{abc}{a}
+\Test\ltx@car{\par}{\par}
+\Test\ltx@cdr{abc}{bc}
+\Test\ltx@cdr{a \par}{ \par}
+\Test\ltx@cdr{a\@empty}{\@empty}
+\Test\ltx@cartwo{abc}{ab}
+\Test\ltx@cartwo{\par\@empty}{\par\@empty}
+\Test\ltx@carsecond{abc}{b}
+\Test\ltx@carsecond{\@empty b\@empty}{b}
+\Test\ltx@carsecond{\par\par\par}{\par}
+\Test\ltx@cdrtwo{abc}{c}
+\Test\ltx@cdrtwo{ab \par}{ \par}
+\Test\ltx@cdrtwo{ab\@empty}{\@empty}
+\Test\ltx@cdrtwo{ab{}}{{}}
+\Test\ltx@cdrthree{abcdefg}{defg}
+\Test\ltx@cdrfour{abcdefg}{efg}
+\Test{\ltx@CdrNum{5}}{abcdefg}{fg}
+\Test{\ltx@CdrNum{0}}{\par}{\par}
+\Test{\ltx@CdrNum{0}}{\@empty}{\@empty}
+\Test{\ltx@CdrNum{0}}{{}}{{}}
+\Test{\ltx@CdrNum{0}}{ }{ }
+\Test{\ltx@CdrNum{2}}{abcd}{cd}
+\Test{\ltx@CdrNum{2}}{\vbox\par\hbox\par}{\hbox\par}
+\Test{\ltx@carthree}{abcdefg}{abc}
+\Test{\ltx@carfour}{abcdefg}{abcd}
+\Test{\ltx@CarNum{5}}{abcdefg}{abcde}
+\Test{\ltx@CarNum{2}}{\@empty\par}{\@empty\par}
+\Test\ltx@carthird{abcdefg}{c}
+\Test\ltx@carfourth{abcdefg}{d}
+\Test{\ltx@CarNumth{5}}{abcdefg}{e}
+\Test{\ltx@CarNumth{2}}{\@empty\@empty\@empty}{\@empty}
+\Test{\ltx@CarNumth{2}}{\par\par\par}{\par}
+\Test{\ltx@CarNumth{2}}{ab}{b}
+\csname @@end\endcsname\end
+%</test-carcdr>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/ltxcmds}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/ltxcmds.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/ltxcmds.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[\CTAN{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 ltxcmds.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@{}}
+% ltxcmds.sty & tex/generic/oberdiek/ltxcmds.sty\\
+% ltxcmds.pdf & doc/latex/oberdiek/ltxcmds.pdf\\
+% test/ltxcmds-test1.tex & doc/latex/oberdiek/test/ltxcmds-test1.tex\\
+% test/ltxcmds-test-gobble.tex & doc/latex/oberdiek/test/ltxcmds-test-gobble.tex\\
+% test/ltxcmds-test-ifempty.tex & doc/latex/oberdiek/test/ltxcmds-test-ifempty.tex\\
+% test/ltxcmds-test-zapspace.tex & doc/latex/oberdiek/test/ltxcmds-test-zapspace.tex\\
+% test/ltxcmds-test-ifboxempty.tex & doc/latex/oberdiek/test/ltxcmds-test-ifboxempty.tex\\
+% test/ltxcmds-test-nextchar.tex & doc/latex/oberdiek/test/ltxcmds-test-nextchar.tex\\
+% test/ltxcmds-test-carcdr.tex & doc/latex/oberdiek/test/ltxcmds-test-carcdr.tex\\
+% ltxcmds.dtx & source/latex/oberdiek/ltxcmds.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk ltxcmds.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{ltxcmds.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 ltxcmds.dtx
+%makeindex -s gind.ist ltxcmds.idx
+%pdflatex ltxcmds.dtx
+%makeindex -s gind.ist ltxcmds.idx
+%pdflatex ltxcmds.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{ltxcmds.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='ltxcmds'>
+ <name>ltxcmds</name>
+ <caption>Some LaTeX kernel commands for general use.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.23'/>
+ <description>
+ This package exports some utility macros
+ from the LaTeX kernel into a separate namespace and
+ also makes them available for other formats such as plain TeX.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/ltxcmds.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/ltxcmds.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+%
+% \bibitem{ifempty:schneck}
+% Robert R. Schneck:
+% \textit{Re: \cs{ifempty} solution %
+% (was Macro puzzle: maximally general \cs{ifempty})};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:3eef1ada_6@corp.newsgroups.com},
+% 2003-06-17.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/be03a159ec374895}}
+%
+% \bibitem{ifnull:diez}
+% Ulrich Diez:
+% \textit{Re: TeX refuses to strip outer braces in argument};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:ibk3t8$ee7$1@news.albasani.net},
+% 2010-11-12.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/803bd57221a04996}}
+%
+% \bibitem{ifstrempty:musa}
+% Ahmed Musa:
+% \textit{Re: TeX refuses to strip outer braces in argument};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:f5496afe-40ed-42bd-b629-a2419ecf7c0d@o14g2000prn.googlegroups.com},
+% 2010-12-03.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/fbf7d61a0c3a807d}}
+%
+% \bibitem{ifstrempty:diez1}
+% Ulrich Diez:
+% \textit{Re: TeX refuses to strip outer braces in argument};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:idbo94$uka$1@four.albasani.net},
+% 2010-12-03.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/0c230ee479487962}}
+%
+% \bibitem{ifstrempty:diez2}
+% Ulrich Diez:
+% \textit{Re: TeX refuses to strip outer braces in argument};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:idbpu4$cg1$1@news.albasani.net},
+% 2010-12-03.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/bbef4263390d647b}}
+%
+% \bibitem{ifstrempty:diez3}
+% Ulrich Diez:
+% \textit{Re: TeX refuses to strip outer braces in argument};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:idd4ga$r83$1@four.albasani.net},
+% 2010-12-04.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/00dfd1ec103cd272}}
+%
+% \bibitem{ifstrempty:gl}
+% GL:
+% \textit{Re: TeX refuses to strip outer braces in argument};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:4cfa2e27$0$7389$426a74cc@news.free.fr},
+% 2010-12-04.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/d3a75995c1cf267e}}
+%
+% \bibitem{ifstrempty:ho}
+% Heiko Oberdiek:
+% \textit{Re: TeX refuses to strip outer braces in argument};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:iddhq1$3kj$1@news.eternal-september.org},
+% 2010-12-04.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/5f7a23e3ab70e347}}
+%
+% \bibitem{ifboxempty:dak}
+% David Kastrup:
+% \textit{How to detect if \cs{vbox} is empty};
+% newsgroup \xnewsgroup{comp.text.tex},
+% 2011-02-04.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/8d3cb89496a4d86d}}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2009/08/05 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2009/12/12 v1.1}
+% \item
+% Short title shortened.
+% \item
+% \cs{ltx@IfUndefined} added.
+% \end{Version}
+% \begin{Version}{2010/01/28 v1.2}
+% \item
+% \cs{ltx@RemovePrefix} and \cs{ltx@StripPrefix} added.
+% \item
+% \cs{ltx@ifclassloaded}, \cs{ltx@ifpackageloaded},
+% \cs{ltx@iffileloaded},
+% \cs{ltx@ifclasslater}, \cs{ltx@ifpackagelater},
+% \cs{ltx@iffilelater},
+% \cs{ltx@clsextension}, \cs{ltx@pkgextension} added.
+% \item
+% \cs{ltx@GlobalAppendToMacro}, \cs{ltx@LocalAppendToMacro} added.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.3}
+% \item
+% \cs{ltx@newif} added.
+% \item
+% \cs{ltx@ifnextchar} added.
+% \item
+% Numbers \cs{ltx@zero}, \cs{ltx@one}, \cs{ltx@two}, \cs{ltx@cclv} added.
+% \end{Version}
+% \begin{Version}{2010/03/09 v1.4}
+% \item
+% \cs{ltx@pkgextension} and \cs{ltx@clsextension} are hardcoded to
+% avoid trouble with \cs{@onlypreamble}.
+% \end{Version}
+% \begin{Version}{2010/04/08 v1.5}
+% \item
+% \cs{ltx@cartwo}, \cs{ltx@cdrtwo},
+% \cs{ltx@carthree}, \cs{ltx@cdrthree},
+% \cs{ltx@carfour}, \cs{ltx@cdrfour} added.
+% \item
+% \cs{ltx@ReturnAfterFi} and \cs{ltx@ReturnAfterElseFi} fixed.
+% \end{Version}
+% \begin{Version}{2010/04/16 v1.6}
+% \item
+% \cs{ltx@leavevmode}, \cs{ltx@mbox} added.
+% \end{Version}
+% \begin{Version}{2010/04/26 v1.7}
+% \item
+% \cs{ltx@GobbleNum}, \cs{ltx@CdrNum}, \cs{ltx@CarNum} added.
+% \item
+% \cs{ltx@carzero}, \cs{ltx@cdrzero} added.
+% \item
+% \cs{ltx@hashchar} added.
+% \end{Version}
+% \begin{Version}{2010/09/11 v1.8}
+% \item
+% \cs{ltx@leftbracechar}, \cs{ltx@rightbracechar} added.
+% \end{Version}
+% \begin{Version}{2010/10/25 v1.9}
+% \item
+% \cs{ltx@LocalAppendToMacro} and \cs{ltx@GlobalAppendToMacro} are
+% now \cs{long}.
+% \end{Version}
+% \begin{Version}{2010/10/31 v1.10}
+% \item
+% \cs{ltx@newglobalif} added.
+% \end{Version}
+% \begin{Version}{2010/11/12 v1.11}
+% \item
+% \cs{ltx@ifempty} added.
+% \item
+% \cs{ltx@firstofthree}, \cs{ltx@secondofthree}, \cs{ltx@thirdofthree}
+% added.
+% \end{Version}
+% \begin{Version}{2010/12/02 v1.12}
+% \item
+% \cs{ltx@onelevel@sanitize} added.
+% \item
+% \cs{LTXcmds@num} fixed for the case with \cs{numexpr}
+% (bug found by GL).
+% \end{Version}
+% \begin{Version}{2010/12/04 v1.13}
+% \item
+% \cs{ltx@ifblank} added.
+% \item
+% Optimization for \cs{ltx@ifempty}.
+% \end{Version}
+% \begin{Version}{2010/12/07 v1.14}
+% \item
+% \cs{ltx@zapspace} added.
+% \end{Version}
+% \begin{Version}{2010/12/12 v1.15}
+% \item
+% \cs{ltx@minusone} added.
+% \end{Version}
+% \begin{Version}{2011/02/04 v1.16}
+% \item
+% \cs{ltx@IfBoxEmpty} and \cs{ltx@IfBoxVoidOrEmpty} added.
+% \item
+% \cs{ltx@firstoffour}, \dots, \cs{ltx@fourthoffour} added.
+% \end{Version}
+% \begin{Version}{2011/02/05 v1.17}
+% \item
+% \cs{ltx@IfBoxEmpty}: an empty box may have non-zero dimensions.
+% \end{Version}
+% \begin{Version}{2011/03/16 v1.18}
+% \item
+% \cs{ltx@ifclasslater} fixed.
+% \end{Version}
+% \begin{Version}{2011/04/14 v1.19}
+% \item
+% \cs{ltx@ifnextchar}: detection of optional spaces modified.
+% \item
+% \cs{ltx(Loc,Glob)(Toks,Dimen,Skip)(A,B,C,D,E)} added.
+% \end{Version}
+% \begin{Version}{2011/04/18 v1.20}
+% \item
+% \cs{ltx@ifnextchar} with conditional support (thanks GL for
+% bug report).
+% \end{Version}
+% \begin{Version}{2011/08/22 v1.21}
+% \item
+% \cs{ltx@GlobalPrependToMacro}, \cs{ltx@LocalPrependToMacro} added
+% (feature request of Martin M\"unch).
+% \end{Version}
+% \begin{Version}{2011/11/09 v1.22}
+% \item
+% \cs{ltx@carsecond}, \cs{ltx@carthird}, \cs{ltx@carfourth},
+% \cs{ltx@CarNumth} added.
+% \item
+% \cs{ltx@cdrzero}, \cs{ltx@cdr}, \cs{ltx@cdrtwo}, cs{ltx@cdrthree},
+% \cs{ltx@cdrfour}, \cs{ltx@CdrNum} modified to retain braces and spaces.
+% They are expandable in two expansion steps.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.23}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/ltxcmds.pdf b/macros/latex/contrib/oberdiek/ltxcmds.pdf
new file mode 100644
index 0000000000..bf2f6678b9
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/ltxcmds.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/luacolor.dtx b/macros/latex/contrib/oberdiek/luacolor.dtx
new file mode 100644
index 0000000000..11bff2e38d
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/luacolor.dtx
@@ -0,0 +1,1293 @@
+% \iffalse meta-comment
+%
+% File: luacolor.dtx
+% Version: 2019/07/25 v1.12
+% Info: Color support via LuaTeX's attributes
+%
+% Copyright (C) 2007, 2009-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file luacolor.dtx
+% and the derived files
+% luacolor.sty, luacolor.pdf, luacolor.ins, luacolor.drv,
+% luacolor-test1.tex, luacolor-test2.tex, luacolor-test3.tex,
+% oberdiek.luacolor.lua, luacolor.lua,
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/luacolor.dtx
+% CTAN:macros/latex/contrib/oberdiek/luacolor.pdf
+%
+% Unpacking:
+% (a) If luacolor.ins is present:
+% tex luacolor.ins
+% (b) Without luacolor.ins:
+% tex luacolor.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{luacolor.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If luacolor.drv is present:
+% latex luacolor.drv
+% (b) Without luacolor.drv:
+% latex luacolor.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 luacolor.dtx
+% makeindex -s gind.ist luacolor.idx
+% pdflatex luacolor.dtx
+% makeindex -s gind.ist luacolor.idx
+% pdflatex luacolor.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/luacolor.sty
+% TDS:scripts/oberdiek/oberdiek.luacolor.lua
+% TDS:scripts/oberdiek/luacolor.lua
+% TDS:doc/latex/oberdiek/luacolor.pdf
+% TDS:doc/latex/oberdiek/test/luacolor-test1.tex
+% TDS:doc/latex/oberdiek/test/luacolor-test2.tex
+% TDS:doc/latex/oberdiek/test/luacolor-test3.tex
+% TDS:source/latex/oberdiek/luacolor.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: luacolor 2019/07/25 v1.12 Color support via LuaTeX's attributes (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: luacolor
+Version: 2019/07/25 v1.12
+
+Copyright (C) 2007, 2009-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file luacolor.dtx
+and the derived files
+ luacolor.sty, luacolor.pdf, luacolor.ins, luacolor.drv,
+ luacolor-test1.tex, luacolor-test2.tex, luacolor-test3.tex,
+ luacolor.lua,
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{luacolor.ins}{\from{luacolor.dtx}{install}}%
+ \file{luacolor.drv}{\from{luacolor.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{luacolor.sty}{\from{luacolor.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{luacolor-test1.tex}{\from{luacolor.dtx}{test1}}%
+% \file{luacolor-test2.tex}{\from{luacolor.dtx}{test2}}%
+% \file{luacolor-test3.tex}{\from{luacolor.dtx}{test3}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{luacolor.xml}{\from{luacolor.dtx}{catalogue}}%
+}
+\def\MetaPrefix{-- }
+\def\defaultpostamble{%
+ \MetaPrefix^^J%
+ \MetaPrefix\space End of File `\outFileName'.%
+}
+\def\currentpostamble{\defaultpostamble}%
+\generate{%
+ \usedir{scripts/oberdiek}%
+% \file{oberdiek.luacolor.lua}{\from{luacolor.dtx}{lua}}%
+ \file{luacolor.lua}{\from{luacolor.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{* luacolor.sty}
+\Msg{*}
+\Msg{* And install the following script files:}
+\Msg{*}
+\Msg{* oberdiek.luacolor.lua, luacolor.lua,}
+\Msg{*}
+\Msg{* To produce the documentation run the file `luacolor.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{luacolor.drv}%
+ [2019/07/25 v1.12 Color support via LuaTeX's attributes (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{paralist}
+\makeatletter
+\g@addto@macro\MakePrivateLetters{%
+ \@makeother\_%
+}
+\makeatother
+\begin{document}
+ \DocInput{luacolor.dtx}%
+\end{document}
+%</driver>
+% \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{luacolor.drv}
+%
+% \title{The \xpackage{luacolor} package}
+% \date{2019/07/25 v1.12}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{luacolor} implements color support based
+% on \LuaTeX's node attributes.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% This package uses a \LuaTeX's attribute register to
+% to annotate nodes with color information.
+% If a color is set, then the attribute register
+% is set to this color and all nodes created in its scope
+% (current group) are annotated with this attribute.
+% Now the color property behaves much the same way
+% as the font property.
+%
+% \subsection{Usage}
+%
+% Package \xpackage{color} is loaded automatically by this
+% package \xpackage{luacolor}. If you need a special driver
+% option or you prefer package \xpackage{xcolor}, then load
+% it before package \xpackage{luacolor}, for example:
+% \begin{quote}
+% |\usepackage[dvipdfmx]{xcolor}|
+% \end{quote}
+% The package \xpackage{luacolor} is loaded without options:
+% \begin{quote}
+% |\usepackage{luacolor}|
+% \end{quote}
+% It is able to detect PDF mode and DVI drivers are
+% differentiated by its color specials. Therefore the
+% package do need driver options.
+%
+% Then it redefines the color setting commands to set
+% attributes instead of whatsits for color.
+%
+% At last the attribute annotations of the nodes in the
+% output box must be analyzed to insert the necessary color whatsits.
+% Currently \LuaTeX\ lacks an appropriate callback function.
+% Therefore package \xpackage{atbegshi} is used to get control
+% before a box is shipped out.
+%
+% \begin{declcs}{luacolorProcessBox} \M{box}
+% \end{declcs}
+% Macro \cs{luacolorProcessBox} processes the box \meta{box}
+% in the previously described manner. It is automatically
+% called for pages, but not for XForm objects.
+% Before passing a box to \cs{pdfxform}, call \cs{luacolorProcessBox}
+% first.
+%
+% \subsection{Limitations}
+%
+% \begin{description}
+% \item[Ligatures with different colored components:]
+% Package \xpackage{luacolor} sees the ligature after
+% the paragraph building and page breaking, when a
+% page is to be shipped out. Therefore it cannot
+% break ligatures, because the components might occupy
+% different space. Therefore it is the respondibility
+% of the ligature forming process to deal with different
+% colored glyphs that form a ligature. The user can avoid
+% the problem entirely by explicitly breaking the ligature
+% at the places where the color changes.
+% \item \dots
+% \end{description}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Catcodes and identification}
+%
+% \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 LuaCol@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\LuaCol@AtEnd{%
+ \LuaCol@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{34}{12}% "
+\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{95}{12}% _ (other!)
+\TMP@EnsureCode{96}{12}% `
+\edef\LuaCol@AtEnd{\LuaCol@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{luacolor}%
+ [2019/07/25 v1.12 Color support via LuaTeX's attributes (HO)]
+% \end{macrocode}
+%
+% \subsection{Check for \LuaTeX}
+%
+% Without \LuaTeX\ there is no point in using this package.
+% \begin{macrocode}
+\RequirePackage{infwarerr}[2010/04/08]%
+\RequirePackage{ifluatex}[2010/03/01]%
+\RequirePackage{ifpdf}[2011/01/30]%
+\RequirePackage{ltxcmds}[2011/04/18]%
+\RequirePackage{color}
+% \end{macrocode}
+% require ltluatex rather than luatex package support for \LuaTeX\ allocations.
+% \begin{macrocode}
+\ifluatex
+ \ifx\newattribute\@undefined
+ \RequirePackage{ltluatex}%
+ \fi
+\else
+ \@PackageError{luacolor}{%
+ This package may only be run using LuaTeX%
+ }\@ehc
+ \expandafter\LuaCol@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \begin{macro}{\LuaCol@directlua}
+% \begin{macrocode}
+ \let\LuaCol@directlua\directlua
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Check for disabled colors}
+%
+% \begin{macrocode}
+\ifcolors@
+\else
+ \@PackageWarningNoLine{luacolor}{%
+ Colors are disabled by option `monochrome'%
+ }%
+ \def\set@color{}%
+ \def\reset@color{}%
+ \def\set@page@color{}%
+ \def\define@color#1#2{}%
+ \expandafter\LuaCol@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Load module and check version}
+%
+% \begin{macrocode}
+\LuaCol@directlua{%
+ require("luacolor")%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\begingroup
+ \edef\x{\LuaCol@directlua{tex.write("2019/07/25 v1.12")}}%
+ \edef\y{%
+ \LuaCol@directlua{%
+ if oberdiek.luacolor.getversion then %
+ oberdiek.luacolor.getversion()%
+ end%
+ }%
+ }%
+ \ifx\x\y
+ \else
+ \@PackageError{luacolor}{%
+ Wrong version of lua module.\MessageBreak
+ Package version: \x\MessageBreak
+ Lua module: \y
+ }\@ehc
+ \fi
+\endgroup
+% \end{macrocode}
+%
+% \subsection{Find driver}
+%
+% \begin{macrocode}
+\ifpdf
+\else
+ \begingroup
+ \def\current@color{}%
+ \def\reset@color{}%
+ \setbox\z@=\hbox{%
+ \begingroup
+ \set@color
+ \endgroup
+ }%
+ \edef\reserved@a{%
+ \LuaCol@directlua{%
+ oberdiek.luacolor.dvidetect()%
+ }%
+ }%
+ \ifx\reserved@a\@empty
+ \@PackageError{luacolor}{%
+ DVI driver detection failed because of\MessageBreak
+ unrecognized color \string\special
+ }\@ehc
+ \endgroup
+ \expandafter\expandafter\expandafter\LuaCol@AtEnd
+ \else
+ \@PackageInfoNoLine{luacolor}{%
+ Type of color \string\special: \reserved@a
+ }%
+ \fi%
+ \endgroup
+\fi
+% \end{macrocode}
+%
+% \subsection{Attribute setting}
+%
+% \begin{macro}{\LuaCol@Attribute}
+% \begin{macrocode}
+\ltx@IfUndefined{newluatexattribute}{%
+ \newattribute\LuaCol@Attribute
+}{%
+ \newluatexattribute\LuaCol@Attribute
+}
+\ltx@IfUndefined{setluatexattribute}{%
+ \let\LuaCol@setattribute\setattribute
+}{%
+ \let\LuaCol@setattribute\setluatexattribute
+}
+\LuaCol@directlua{%
+ oberdiek.luacolor.setattribute(\number\allocationnumber)%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\set@color}
+% \begin{macrocode}
+\protected\def\set@color{%
+ \LuaCol@setattribute\LuaCol@Attribute{%
+ \LuaCol@directlua{%
+ oberdiek.luacolor.get("\luaescapestring{\current@color}")%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\reset@color}
+% \begin{macrocode}
+\def\reset@color{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Whatsit insertion}
+%
+% \begin{macro}{\luacolorProcessBox}
+% \begin{macrocode}
+\def\luacolorProcessBox#1{%
+ \LuaCol@directlua{%
+ oberdiek.luacolor.process(\number#1)%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\RequirePackage{atbegshi}[2011/01/30]
+\AtBeginShipout{%
+ \luacolorProcessBox\AtBeginShipoutBox
+}
+% \end{macrocode}
+%
+% Set default color.
+% \begin{macrocode}
+\set@color
+% \end{macrocode}
+%
+% \subsection{\cs{pdfxform} support}
+%
+% \begin{macrocode}
+\ifpdf
+ \ifx\pdfxform\@undefined
+ \let\pdfxform\saveboxresource
+ \fi
+ \ltx@IfUndefined{pdfxform}{%
+ \directlua{%
+ tex.enableprimitives('',{%
+ 'pdfxform','pdflastxform','pdfrefxform'%
+ })%
+ }%
+ }{}%
+ \ltx@IfUndefined{protected}{%
+ \directlua{tex.enableprimitives('',{'protected'})}%
+ }{}%
+ \ltx@IfUndefined{pdfxform}{%
+ \@PackageWarning{luacolor}{\string\pdfxform\space not found}%
+ }{%
+ \let\LuaCol@org@pdfxform\pdfxform
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname protected\endcsname\relax
+ \@PackageWarning{luacolor}{\string\protected\space not found}%
+ \else
+ \expandafter\protected
+ \fi
+ \def\pdfxform{%
+ \begingroup
+ \afterassignment\LuaCol@pdfxform
+ \count@=%
+ }%
+ \def\LuaCol@pdfxform{%
+ \luacolorProcessBox\count@
+ \LuaCol@org@pdfxform\count@
+ \endgroup
+ }%
+ }%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\LuaCol@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \subsection{Lua module}
+%
+% \begin{macrocode}
+%<*lua>
+% \end{macrocode}
+% Box zero contains a \cs{hbox} with the color \cs{special}.
+% That is analyzed to get the prefix for the color setting
+% \cs{special}.
+% \begin{macrocode}
+oberdiek = oberdiek or {}
+local luacolor = oberdiek.luacolor or {}
+oberdiek.luacolor = luacolor
+% \end{macrocode}
+% \begin{macro}{getversion()}
+% \begin{macrocode}
+function luacolor.getversion()
+ tex.write("2019/07/25 v1.12")
+end
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Driver detection}
+%
+% \begin{macrocode}
+local ifpdf = tonumber(tex.outputmode or tex.pdfoutput) > 0
+local prefix
+local prefixes = {
+ dvips = "color ",
+ dvipdfm = "pdf:sc ",
+ truetex = "textcolor:",
+ pctexps = "ps::",
+}
+local patterns = {
+ ["^color "] = "dvips",
+ ["^pdf: *begincolor "] = "dvipdfm",
+ ["^pdf: *bcolor "] = "dvipdfm",
+ ["^pdf: *bc "] = "dvipdfm",
+ ["^pdf: *setcolor "] = "dvipdfm",
+ ["^pdf: *scolor "] = "dvipdfm",
+ ["^pdf: *sc "] = "dvipdfm",
+ ["^textcolor:"] = "truetex",
+ ["^ps::"] = "pctexps",
+}
+% \end{macrocode}
+% \begin{macro}{info()}
+% \begin{macrocode}
+local function info(msg, term)
+ local target = "log"
+ if term then
+ target = "term and log"
+ end
+ texio.write_nl(target, "Package luacolor info: " .. msg .. ".")
+ texio.write_nl(target, "")
+end
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{dvidetect()}
+% \begin{macrocode}
+function luacolor.dvidetect()
+ local v = tex.box[0]
+ assert(v.id == node.id("hlist"))
+ for v in node.traverse_id(node.id("whatsit"), v.head) do
+ if v and v.subtype == node.subtype("special") then
+ local data = v.data
+ for pattern, driver in pairs(patterns) do
+ if string.find(data, pattern) then
+ prefix = prefixes[driver]
+ tex.write(driver)
+ return
+ end
+ end
+ info("\\special{" .. data .. "}", true)
+ return
+ end
+ end
+ info("Missing \\special", true)
+end
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Color strings}
+%
+% \begin{macrocode}
+local map = {
+ n = 0,
+}
+% \end{macrocode}
+% \begin{macro}{get()}
+% \begin{macrocode}
+function luacolor.get(color)
+ tex.write("" .. luacolor.getvalue(color))
+end
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{getvalue()}
+% \begin{macrocode}
+function luacolor.getvalue(color)
+ local n = map[color]
+ if not n then
+ n = map.n + 1
+ map.n = n
+ map[n] = color
+ map[color] = n
+ end
+ return n
+end
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Attribute register}
+%
+% \begin{macro}{setattribute()}
+% \begin{macrocode}
+local attribute
+function luacolor.setattribute(attr)
+ attribute = attr
+end
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{getattribute()}
+% \begin{macrocode}
+function luacolor.getattribute()
+ return attribute
+end
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Whatsit insertion}
+%
+% \begin{macrocode}
+local LIST = 1
+local LIST_LEADERS = 2
+local LIST_DISC = 3
+local COLOR = 4
+local RULE = node.id("rule")
+local node_types = {
+ [node.id("hlist")] = LIST,
+ [node.id("vlist")] = LIST,
+ [node.id("rule")] = COLOR,
+ [node.id("glyph")] = COLOR,
+ [node.id("disc")] = LIST_DISC,
+ [node.id("whatsit")] = {
+ [node.subtype("special")] = COLOR,
+ [node.subtype("pdf_literal")] = COLOR,
+ [node.subtype("pdf_save")] = COLOR,
+ [node.subtype("pdf_restore")] = COLOR, -- probably not needed
+-- TODO (DPC) [node.subtype("pdf_refximage")] = COLOR,
+ },
+ [node.id("glue")] =
+ function(n)
+ if n.subtype >= 100 then -- leaders
+ if n.leader.id == RULE then
+ return COLOR
+ else
+ return LIST_LEADERS
+ end
+ end
+ end,
+}
+% \end{macrocode}
+% \begin{macro}{get_type()}
+% \begin{macrocode}
+local function get_type(n)
+ local ret = node_types[n.id]
+ if type(ret) == 'table' then
+ ret = ret[n.subtype]
+ end
+ if type(ret) == 'function' then
+ ret = ret(n)
+ end
+ return ret
+end
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+local mode = 2 -- luatex.pdfliteral.direct
+local WHATSIT = node.id("whatsit")
+local SPECIAL = node.subtype("special")
+local PDFLITERAL = node.subtype("pdf_literal")
+local DRY_FALSE = false
+local DRY_TRUE = true
+% \end{macrocode}
+% \begin{macro}{traverse()}
+% \begin{macrocode}
+local function traverse(list, color, dry)
+ if not list then
+ return color
+ end
+ local head
+ if get_type(list) == LIST then
+ head = list.head
+ elseif get_type(list) == LIST_DISC then
+ head = list.replace
+ else
+ texio.write_nl("!!! Error: Wrong list type: " .. node.type(list.id))
+ return color
+ end
+%<debug>texio.write_nl("traverse: " .. node.type(list.id))
+ for n in node.traverse(head) do
+%<debug>texio.write_nl(" node: " .. node.type(n.id))
+ local t = get_type(n)
+%<debug>texio.write_nl("TYPE "..tostring(t).. " "..tostring(node.type(node.getid(n))).." ".. tostring(node.getsubtype(n)))
+ if t == LIST or t == LIST_DISC then
+ color = traverse(n, color, dry)
+ elseif t == LIST_LEADERS then
+ local color_after = traverse(n.leader, color, DRY_TRUE)
+ if color == color_after then
+ traverse(n.leader, color, DRY_FALSE or dry)
+ else
+ traverse(n.leader, '', DRY_FALSE or dry)
+% The color status is unknown here, because the leader box
+% will or will not be set.
+ color = ''
+ end
+ elseif t == COLOR then
+ local v = node.has_attribute(n, attribute)
+ if v then
+ local newColor = map[v]
+ if newColor ~= color then
+ color = newColor
+ if dry == DRY_FALSE then
+ local newNode
+ if ifpdf then
+ newNode = node.new(WHATSIT, PDFLITERAL)
+ newNode.mode = mode
+ newNode.data = color
+ else
+ newNode = node.new(WHATSIT, SPECIAL)
+ newNode.data = prefix .. color
+ end
+ head = node.insert_before(head, n, newNode)
+ end
+ end
+ end
+ end
+ end
+ if get_type(list) == LIST then
+ list.head = head
+ else
+ list.replace = head
+ end
+ return color
+end
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{process()}
+% \begin{macrocode}
+function luacolor.process(box)
+ local color = ""
+ local list = tex.getbox(box)
+ traverse(list, color, DRY_FALSE)
+end
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</lua>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \begin{macrocode}
+%<*test1>
+\documentclass{article}
+\usepackage{color}
+%</test1>
+% \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 luacolor.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Driver detection}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\ifcsname driver\endcsname
+ \expandafter\PassOptionsToPackage\expandafter{\driver}{color}%
+ \pdfoutput=0 %
+\fi
+\documentclass{minimal}
+\usepackage{luacolor}[2018/11/01]
+\csname @@end\endcsname
+\end
+%</test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test3>
+\NeedsTeXFormat{LaTeX2e}
+% \end{macrocode}
+% \begin{macrocode}
+\documentclass{minimal}
+\usepackage{luacolor}[2018/11/01]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\makeatletter
+% \end{macrocode}
+% \begin{macrocode}
+\@@end
+%</test3>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/luacolor}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/luacolor.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/luacolor.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[\CTAN{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 luacolor.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@{}}
+% luacolor.sty & tex/latex/oberdiek/luacolor.sty\\
+% luacolor.lua & scripts/oberdiek/luacolor.lua\\
+% luacolor.pdf & doc/latex/oberdiek/luacolor.pdf\\
+% luacolor.dtx & source/latex/oberdiek/luacolor.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk luacolor.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{luacolor.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 luacolor.dtx
+%makeindex -s gind.ist luacolor.idx
+%pdflatex luacolor.dtx
+%makeindex -s gind.ist luacolor.idx
+%pdflatex luacolor.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{luacolor.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='luacolor'>
+ <name>luacolor</name>
+ <caption>Color support based on LuaTeX's node attributes.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.11'/>
+ <description>
+ This package implements color support based on LuaTeX's node
+ attributes.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/luacolor.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/luacolor.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/12/12 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2009/04/10 v1.1}
+% \item
+% Fixes for changed syntax of \cs{directlua} in \LuaTeX\ 0.36.
+% \end{Version}
+% \begin{Version}{2010/03/09 v1.2}
+% \item
+% Adaptation for package \xpackage{luatex} 2010/03/09 v0.4.
+% \end{Version}
+% \begin{Version}{2010/12/13 v1.3}
+% \item
+% Support for \cs{pdfxform} added.
+% \item
+% Loaded package \xpackage{luatexbase-attr} recognized.
+% \item
+% Update for \hologo{LuaTeX}: `list' fields renamed to `head' in v0.65.0.
+% \end{Version}
+% \begin{Version}{2011/03/29 v1.4}
+% \item
+% Avoid whatsit insertion if option \xoption{monochrome} is used
+% (thanks Manuel P\'egouri\'e-Gonnard).
+% \end{Version}
+% \begin{Version}{2011/04/22 v1.5}
+% \item
+% Bug fix by Manuel P\'egouri\'e-Gonnard: A typo prevented the
+% detection of whatsits and applying color changes for
+% \cs{pdfliteral} and \cs{special} nodes that might contain
+% typesetting material.
+% \item
+% Bug fix by Manuel P\'egouri\'e-Gonnard: Now colors are also
+% applied to leader boxes.
+% \item
+% Unnecessary color settings are removed for leaders boxes,
+% if after the leader box the color has not changed.
+% The costs are a little runtime, leader boxes are processed twice.
+% \item
+% Additional whatsits that are colored: \texttt{pdf\_refximage}.
+% \item
+% Workaround for bug with \texttt{node.insert\_before}
+% removed for the version after \hologo{LuaTeX} 0.65, because
+% bug was fixed in 0.27. (Thanks Manuel P\'egouri\'e-Gonnard.)
+% \end{Version}
+% \begin{Version}{2011/04/23 v1.6}
+% \item
+% Bug fix for nested leader boxes.
+% \item
+% Bug fix for leader boxes that change color, but
+% are not set because of missing place.
+% \item
+% Version check for Lua module added.
+% \end{Version}
+% \begin{Version}{2011/10/22 v1.7}
+% \item
+% Lua functions \texttt{getattribute} and \texttt{getvalue}
+% added to tell other external Lua functions
+% the attribute register number for coloring.
+% \end{Version}
+% \begin{Version}{2011/11/01 v1.8}
+% \item
+% Use of \texttt{node.subtype} instead of magic numbers.
+% \end{Version}
+% \begin{Version}{2016/05/13 v1.9}
+% \item
+% More use of \texttt{node.subtype} instead of magic numbers.
+% \item luatex 85 updates
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.10}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2018/11/22 v1.11}
+% \item
+% handle issue 43.
+% \item
+% removed pre-0.65 stuff
+% \end{Version}
+% \begin{Version}{2019/07/25 v1.12}
+% \item
+% removed uses of module function, see PR70
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/luacolor.pdf b/macros/latex/contrib/oberdiek/luacolor.pdf
new file mode 100644
index 0000000000..006f0d2e99
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/luacolor.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/luatex.dtx b/macros/latex/contrib/oberdiek/luatex.dtx
new file mode 100644
index 0000000000..ef111a4efa
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/luatex.dtx
@@ -0,0 +1,1967 @@
+% \iffalse meta-comment
+%
+% File: luatex.dtx
+% Version: 2019/07/25 v0.7
+% Info: LuaTeX basic definition package
+%
+% Copyright (C) 2007, 2009, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 2016, 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 luatex.dtx
+% and the derived files
+% luatex.sty, luatex.pdf, luatex.ins, luatex.drv, luatex-loader.sty,
+% luatex-test1.tex, luatex-test2.tex, luatex-test3.tex,
+% luatex-test4.tex, luatex-test5.tex, oberdiek.luatex.lua.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/luatex.dtx
+% CTAN:macros/latex/contrib/oberdiek/luatex.pdf
+%
+% Unpacking:
+% (a) If luatex.ins is present:
+% tex luatex.ins
+% (b) Without luatex.ins:
+% tex luatex.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{luatex.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If luatex.drv is present:
+% latex luatex.drv
+% (b) Without luatex.drv:
+% latex luatex.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 luatex.dtx
+% makeindex -s gind.ist luatex.idx
+% pdflatex luatex.dtx
+% makeindex -s gind.ist luatex.idx
+% pdflatex luatex.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/luatex.sty
+% TDS:tex/generic/oberdiek/luatex-loader.sty
+% TDS:scripts/oberdiek/oberdiek.luatex.lua
+% TDS:doc/latex/oberdiek/luatex.pdf
+% TDS:doc/latex/oberdiek/test/luatex-test1.tex
+% TDS:doc/latex/oberdiek/test/luatex-test2.tex
+% TDS:doc/latex/oberdiek/test/luatex-test3.tex
+% TDS:doc/latex/oberdiek/test/luatex-test4.tex
+% TDS:doc/latex/oberdiek/test/luatex-test5.tex
+% TDS:source/latex/oberdiek/luatex.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: luatex 2019/07/25 v0.7 LuaTeX basic definition package (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: luatex
+Version: 2019/07/25 v0.7
+
+Copyright (C) 2007, 2009, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 luatex.dtx
+and the derived files
+ luatex.sty, luatex.pdf, luatex.ins, luatex.drv, luatex-loader.sty,
+ luatex-test1.tex, luatex-test2.tex, luatex-test3.tex,
+ luatex-test4.tex, luatex-test5.tex, oberdiek.luatex.lua.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{luatex.ins}{\from{luatex.dtx}{install}}%
+ \file{luatex.drv}{\from{luatex.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{luatex.sty}{\from{luatex.dtx}{package}}%
+ \file{luatex-loader.sty}{\from{luatex.dtx}{loader}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{luatex-test1.tex}{\from{luatex.dtx}{test1}}%
+% \file{luatex-test2.tex}{\from{luatex.dtx}{test1,test2}}%
+% \file{luatex-test3.tex}{\from{luatex.dtx}{test1,test3}}%
+% \file{luatex-test4.tex}{\from{luatex.dtx}{test4}}%
+% \file{luatex-test5.tex}{\from{luatex.dtx}{test5}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{luatex.xml}{\from{luatex.dtx}{catalogue}}%
+}
+\def\MetaPrefix{-- }
+\def\defaultpostamble{%
+ \MetaPrefix^^J%
+ \MetaPrefix\space End of File `\outFileName'.%
+}
+\def\currentpostamble{\defaultpostamble}%
+\generate{%
+ \usedir{scripts/oberdiek}%
+ \file{oberdiek.luatex.lua}{\from{luatex.dtx}{lua}}%
+}
+
+\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{* luatex.sty, luatex-loader.sty}
+\Msg{*}
+\Msg{* And install the following script file:}
+\Msg{*}
+\Msg{* oberdiek.luatex.lua}
+\Msg{*}
+\Msg{* To produce the documentation run the file `luatex.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{luatex.drv}%
+ [2019/07/25 v0.7 LuaTeX basic definition package (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{paralist}
+\begin{document}
+ \DocInput{luatex.dtx}%
+\end{document}
+%</driver>
+% \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{luatex.drv}
+%
+% \title{The \xpackage{luatex} package}
+% \date{2019/07/25 v0.7}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package manages the new and extended features and resources
+% that \LuaTeX\ provides. Examples are attributes and catcode
+% tables.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% \TeX\ provides global resources such as registers.
+% But it does not provide an interface for managing these resources.
+% For example, two packages want to use a counter register.
+% If they take the same register
+% number, then the use of both packages will conflict and they cannot
+% be used together.
+% Therefore formats such as \plainTeX\ or \LaTeX\ implement
+% an allocation scheme for registers. A package reserves with
+% \cs{newcount} an unused register number for its own exclusive use.
+%
+% Nowadays \TeX\ is not alone anymore: \eTeX, \pdfTeX\ and other
+% compilers for \TeX\ are developed that extend and add new
+% features and resources.
+%
+% Now \LuaTeX\ has reached beta state. It inherits most of
+% \pdfTeX's features including \eTeX. Also it implements
+% new concepts such as attributes or catcode tables.
+%
+% \subsubsection{\LaTeX}
+%
+% Since 2015 Lua\LaTeX\ includes support for luatex by default and so
+% this package is essentially obsolete now, however it is kept for
+% backwards compatibility.
+%
+% \subsubsection{\plainTeX}
+%
+% \LaTeX\ has inherited its resource handling from \plainTeX.
+% The interface is basically the same: \cs{newcount}, \dots
+% Therefore this package tries to follow this tradition by
+% providing compatibility to \plainTeX. It can be loaded
+% with \plainTeX\ and defines at least some of the
+% features that this packages provides for \LaTeX.
+%
+% \subsection{Register allocation}
+%
+% \subsubsection{Register with 16 bit}
+%
+% Because \LuaTeX\ is a super set of \eTeX\ regarding registers,
+% the register allocation scheme should not conflict with
+% package \xpackage{etex}. Therefore this package is loaded
+% to inherit its allocation scheme. The only change is currently
+% that the limit is increased to 65536 registers for the following
+% register classes:
+% \begin{compactitem}
+% \item count
+% \item dimen
+% \item skip
+% \item muskip
+% \item marks
+% \item toks
+% \item box
+% \end{compactitem}
+% This affects the number of global and local registers.
+% Because it is done in a package and not in the kernel,
+% it is possible that someone loads package \xpackage{etex}
+% before uses the local allocation variants. This will prevent
+% the extension for this register class. If more registers are
+% needed, just load package \xpackage{luatex} earlier.
+%
+% \subsubsection{Insertions}
+%
+% Insertions need four registers \cs{count}, \cs{dimen}, \cs{skip},
+% and \cs{box} with the same number. Usually they are allocated
+% downwards from 254, 253, \dots Also \cs{newcount}, \cs{newdimen}, \dots
+% fill up these register numbers from below before switching to
+% higher register numbers by package \xpackage{etex}.
+% When this occurs, no insertions can be allocated anymore.
+%
+% Therefore \cs{newcount}, \cs{newdimen}, \cs{newskip}, and
+% \cs{newbox} are replaced by their global variants (\cs{globcount}, \dots)
+% that use the higher numbers immediately, leaving the room for insertions.
+% There should not be an efficiency penalty because \LuaTeX\ stores
+% the registers of a class in the same Lua table unlike \eTeX, where
+% registers below 256 are stored in an array and higher numbers
+% are put in a tree structure.
+%
+% \subsection{Attributes}
+%
+% Nodes can have custom attributes in \LuaTeX. These attributes
+% are organized by a new register class. As the other registers
+% up to $2^{16}$ attributes are supported. An attribute value
+% can be negative that means the attribute is not set. Otherwise
+% \TeX's range of non-negative integers up to $2^31$ are available.
+%
+% \begin{declcs}{newattribute} \M{cmd}
+% \end{declcs}
+% Macro \cs{newattribute} defines command \meta{cmd} using \cs{attributedef}
+% using an new attribute number. The new attribute is initially unset.
+%
+% \begin{declcs}{setattribute} \M{cmd} \M{value}
+% \end{declcs}
+% Macro \cs{setattribute} locally sets attribute command \meta{cmd}
+% to the number \meta{value}. Valid values range from $-1$ until $2^31$
+% (the upper limit is the same as for other \TeX\ integer numbers).
+%
+% \begin{declcs}{unsetattribute} \M{cmd}
+% \end{declcs}
+% Macro \cs{unsettattribute} clears the attribute command \meta{cmd}.
+%
+% \subsection{Catcode tables}
+%
+% \LuaTeX\ introduces catcode tables as new feature, see documentation.
+% There is need for discussion, how to deal best:
+% \begin{itemize}
+% \item \cs{initcatcodetable} and \cs{setcatcodetable} act globally.
+% \item \cs{catcodetable} causes an error if used with an uninitialized
+% catcode table.
+% \item Large catcode table numbers should be avoided because of
+% performance breakdown.
+% \item Use case \LaTeX\ package:
+% The package must not be surprised by changed catcodes and
+% must not surprise by changing catcodes accidently.
+% Catcode tables could offer a solution. At the begin
+% a catcode regime with standard catcodes is established
+% and the old one is restored afterwards.
+% \item Use case: \LuaTeX's |tex.print| might be used with
+% a catcode table number, for example a table where all
+% entries have catcode ``other''.
+% \item Readonly catcode tables.
+% \item Is there is a need for local allocations?
+% (Package \xpackage{etex}'s \cs{loc} variants are not used in
+% \TeX\ Live 2007.)
+% \end{itemize}
+%
+% \subsubsection{Interface proposal}
+%
+% The idea: \cs{newcatcodetable} allocates odd numbered catcode
+% tables. Even numbered tables are managed as stack.
+% Also some catcode tables are defined. These must not be
+% changed.
+%
+% \begin{declcs}{newcatcodetable} \M{cmd}
+% \end{declcs}
+% Macro \cs{newcatcodetable} reserves a new catcode table and
+% remembers its number in \meta{cmd}. The catcode table is
+% initialized with \iniTeX's catcodes.
+%
+% \begin{declcs}{CatcodeTableIniTeX}\\
+% \cs{CatcodeTableString}\\
+% \cs{CatcodeTableOther}\\
+% \cs{CatcodeTableLaTeX}\\
+% \end{declcs}
+% These are catcode tables and must not be changed.
+% \cs{CatcodeTableIniTeX} contains the catcode settings of \iniTeX.
+% \cs{CatcodeTableString} follows \TeX's convention of
+% \cs{string}, \cs{meaning} and friends. The space gets catcode
+% 10 (space), the other characters have catcode 12 (other).
+% In \cs{CatcodeTableOther} all entries have catcode 12 (other).
+% \cs{CatcodeTableLaTeX} contains the setting of a pure \LaTeX\ format
+% (`at' is other).
+%
+% \begin{declcs}{CatcodeTableStack}\\
+% \cs{IncCatcodeTableStack}\\
+% \cs{DecCatcodeTableStack}
+% \end{declcs}
+% \cs{CatcodeTableStack} is the stack pointer. Initially
+% it is catcode table zero. \cs{IncCatcodeTableStack} and
+% \cs{DecCatcodeTableStack} increments and decrements the
+% stack pointer. Currently \cs{IncCatcodeTableStack} does not
+% initialize a new catcode table. Both increment and decrement
+% operations do not set a catcode table.
+%
+% \begin{declcs}{PushCatcodeTableNumStack}\\
+% \cs{PopCatcodeTableNumStack}
+% \end{declcs}
+% It can be handy to have a global stack for catcode table
+% numbers to deal with the global assignment property of
+% \cs{initcatcodetable} and \cs{savecatcodetable}.
+% \cs{PushCatcodeTableNumStack} pushes the current catcode table
+% on the stack.
+% \cs{PopCatcodeTableNumStack} pops the topmost number off the number
+% stack to set the current catcode table. Catcode table zero is
+% used in case of an empty stack.
+%
+% \begin{declcs}{BeginCatcodeRegime} \M{catcodetable}\\
+% \cs{EndCatcodeRegime}
+% \end{declcs}
+% \cs{BeginCatcodeRegime} remembers the current catcode table number.
+% Then it creates and uses a fresh catcode table on the stack
+% that is initialized by \meta{catcodetable}:
+% \begin{quote}\ttfamily
+% \cs{PushCatcodeTableNumStack}\\
+% \cs{catcodetable}\meta{catcodetable}||
+% \cs{IncCatcodeTableStack}\\
+% \cs{savecatcodetable}\cs{CatcodeTableStack}\\
+% \cs{catcodetable}\cs{CatcodeTableStack}
+% \end{quote}
+% \cs{EndCatcodeRegime} drops the catcode table, created by
+% \cs{BeginCatcodeRegime} and sets the catcode table that was
+% active before:
+% \begin{quote}
+% \cs{DecCatcodeTableStack}\\
+% \cs{PopCatcodeTableNumStack}
+% \end{quote}
+% These macros solve the use case, described earlier for a \LaTeX\ package:
+% \begin{quote}
+% |% package foobar.sty|\\
+% |\BeginCatcodeRegime\CatcodeTableLaTeX|\\
+% |\makeatletter|\\
+% |% ... package contents ...|\\
+% |\EndCatcodeRegime|\\
+% |% end of package|
+% \end{quote}
+% If the package wants to change catcodes after its loading,
+% \cs{AtBeginDocument} or \cs{AtEndOfPackage} can be used.
+%
+% \begin{declcs}{SetCatcodeRange} \M{from} \M{to} \M{catcode}
+% \end{declcs}
+% The catcodes of characters in range from \meta{from}
+% to inclusive \meta{to} are set to \meta{catcode}.
+%
+% \subsection{Lua module loading}
+%
+% Currently \LuaTeX\ (version 0.20) does not support Lua script
+% files inside \xfile{TDS:scripts//}, because Lua's mechanism
+% for module loading does not use the \textsf{kpathsea} library.
+% Therefore this packages appends a kpse loader to the list of
+% Lua's module loaders. It finds the module \meta{module} by
+% \begin{quote}
+% \ttfamily |kpse.find_file("|\meta{module}|.lua", "texmfscripts")|
+% \end{quote}
+% Unhappily \textsf{kpathsea} does not support directory components
+% in a file name. Therefore the Lua convention is not followed to
+% replace dots in the module name by the directory separator.
+%
+% Example:
+% A Lua script of a package \xpackage{foobar} wants the following
+% modules:
+% \begin{quote}
+% |require("foobar.hello.world")|\\
+% |require("org.somewhere.xyz")|
+% \end{quote}
+% Then they can be find in:
+% \begin{quote}
+% |TDS:scripts/foobar/foobar.hello.world.lua|\\
+% |TDS:scripts/foobar/org.somewhere.xyz.lua|
+% \end{quote}
+% I would have preferred the following locations, following lua conventions,
+% e.\,g.:
+% \begin{quote}
+% |TDS:scripts/foobar/hello/world.lua|\\
+% |TDS:scripts/foobar/org/somewhere/xyz.lua|
+% \end{quote}
+% But I do not know, how to achieve this in a reliable way using
+% \textsf{kpathsea}.
+%
+% \subsubsection{Package \xpackage{luatex-loader}}
+%
+% If someone do not need or want package \xpackage{luatex} but
+% it's extension for module loading, then he can use
+% package \xpackage{luatex-loader}. Both \plainTeX\ and \LaTeX\ are
+% supported.
+%
+% \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@luatex.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{luatex}{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@luatex.sty\endcsname
+\ProvidesPackage{luatex}%
+ [2019/07/25 v0.7 LuaTeX basic definition package (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 LuT@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\LuT@AtEnd{%
+ \LuT@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{34}{12}% "
+\TMP@EnsureCode{36}{3}% $
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{95}{12}% _ (other!)
+\TMP@EnsureCode{96}{12}% `
+\edef\LuT@AtEnd{\LuT@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Check for \LuaTeX}
+%
+% Without \LuaTeX\ there is no point in using this package.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+ \input ifluatex.sty\relax
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{ifluatex}[2009/04/10]%
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\ifluatex
+\else
+ \@PackageError{luatex}{%
+ This package may only be run using LuaTeX%
+ }\@ehc
+ \expandafter\LuT@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Provide Lua\TeX\ primitives}
+%
+% \begin{macrocode}
+\ifnum\luatexversion<36 %
+ \def\LuT@MakePrimitive#1{%
+ \expandafter\let\csname luatex#1\expandafter\endcsname
+ \csname #1\endcsname
+ }%
+\else
+ \def\LuT@MakeLuatexPrimitive#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname luatex#1\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname #1\endcsname\relax
+ \else
+ \expandafter\let
+ \csname luatex#1\expandafter\endcsname
+ \csname #1\endcsname
+ \fi
+ \fi
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname luatex#1\endcsname\relax
+ \begingroup
+ \expandafter\let\csname luatex#1\endcsname\@undefined
+ \ifnum0%
+ \directlua{%
+ if tex.enableprimitives then %
+ tex.enableprimitives('luatex',{'#1'})%
+ tex.print('1')%
+ end%
+ }%
+ \expandafter\ifx\csname luatex#1\endcsname\relax\else1\fi
+ =11 %
+ \global\expandafter\let
+ \csname luatex#1\expandafter\endcsname
+ \csname luatex#1\endcsname
+ \else
+ \@PackageError{luatex}{%
+ tex.enableprimitives failed for `#1'%
+ }\@ehc
+ \fi
+ \endgroup
+ \fi
+ }%
+ \def\LuT@MakePrimitive#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname#1\endcsname\relax
+ \begingroup
+ \expandafter\let\csname#1\endcsname\@undefined
+ \ifnum0%
+ \directlua{%
+ if tex.enableprimitives then %
+ tex.enableprimitives('',{'#1'})%
+ tex.print('1')%
+ end%
+ }%
+ \expandafter\ifx\csname#1\endcsname\relax\else1\fi
+ =11 %
+ \global\expandafter\let
+ \csname#1\expandafter\endcsname
+ \csname#1\endcsname
+ \else
+ \@PackageError{luatex}{%
+ tex.enableprimitives failed for `#1'%
+ }\@ehc
+ \fi
+ \endgroup
+ \fi
+ }%
+\fi
+\LuT@MakeLuatexPrimitive{attribute}
+\LuT@MakeLuatexPrimitive{attributedef}
+\LuT@MakeLuatexPrimitive{catcodetable}
+\LuT@MakeLuatexPrimitive{initcatcodetable}
+\LuT@MakeLuatexPrimitive{luaescapestring}
+\LuT@MakeLuatexPrimitive{savecatcodetable}
+\LuT@MakePrimitive{numexpr}
+% \end{macrocode}
+%
+% \subsection{Inherit support for \eTeX}
+%
+% Package \xpackage{etex} is not compatible for \plainTeX.
+% But it could be present if a format is used that is based
+% on \xfile{etex.src}. Therefore we only load the package
+% in case of \LaTeX\ and tests its presence independently
+% of the format by looking for \cs{et@xins}.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+\else
+ \RequirePackage{etex}[1998/03/26]%
+\fi
+% \end{macrocode}
+%
+% \subsection{Adaption of \eTeX's register allocation}
+%
+% \eTeX has increased the number of \TeX\ registers
+% from $2^8$ (256) to $2^{15}$ (32768) for a register class.
+% \LuaTeX\ extends the limit further to $2^16$ (65536).
+% The allocation scheme of package \xpackage{etex} is not
+% changed. But this can be subject for discussion.
+%
+% If a register class hasn't registered any local registers
+% yet, then the limit can safely be pushed to 65536.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname et@xins\endcsname\relax
+ \@PackageWarningNoLine{luatex}{%
+ Support for eTeX is not loaded (etex.src)%
+ }%
+\else
+ \def\LuT@temp#1{%
+ \ifnum\count27#1=32768 %
+ \count27#1=65536 %
+ \fi
+ }%
+ \LuT@temp0%
+ \LuT@temp1%
+ \LuT@temp2%
+ \LuT@temp3%
+ \LuT@temp4%
+ \LuT@temp5%
+ \LuT@temp6%
+% \end{macrocode}
+%
+% \eTeX\ uses an array for the first 256 registers and then a tree
+% structure. \LuaTeX\ stores all registers of a class in one Lua table.
+% There shouldn't be large performance differences.
+% This allows starting immediately in the extended
+% area, leaving room for insertions.
+% \begin{macrocode}
+ \let\newcount\globcount
+ \let\newdimen\globdimen
+ \let\newskip\globskip
+ \let\newbox\globbox
+\fi
+% \end{macrocode}
+%
+% \subsection{\plainTeX\ compatibility}
+%
+% \begin{macro}{\@empty}
+% \begin{macrocode}
+\expandafter\ifx\csname @empty\endcsname\relax
+ \def\@empty{}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@gobble}
+% \begin{macrocode}
+\expandafter\ifx\csname @gobble\endcsname\relax
+ \long\def\@gobble#1{}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@firstofone}
+% \begin{macrocode}
+\expandafter\ifx\csname @firstofone\endcsname\relax
+ \long\def\@firstofone#1{#1}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@firstoftwo}
+% \begin{macrocode}
+\expandafter\ifx\csname @firstoftwo\endcsname\relax
+ \long\def\@firstoftwo#1#2{#1}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@car}
+% \begin{macrocode}
+\expandafter\ifx\csname @car\endcsname\relax
+ \def\@car#1#2\@nil{#1}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@cdr}
+% \begin{macrocode}
+\expandafter\ifx\csname @cdr\endcsname\relax
+ \def\@cdr#1#2\@nil{#2}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ifstar}
+% \begin{macrocode}
+\expandafter\ifx\csname @ifstar\endcsname\relax
+ \def\@ifstar#1{%
+ \@ifnextchar*{\@firstoftwo{#1}}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ifnextchar}
+% \begin{macrocode}
+ \long\def\@ifnextchar#1#2#3{%
+ \let\reserved@d=#1%
+ \def\reserved@a{#2}%
+ \def\reserved@b{#3}%
+ \futurelet\@let@token\@ifnch
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@ifnch}
+% \begin{macrocode}
+ \def\@ifnch{%
+ \ifx\@let@token\@sptoken
+ \let\reserved@c\@xifnch
+ \else
+ \ifx\@let@token\reserved@d
+ \let\reserved@c\reserved@a
+ \else
+ \let\reserved@c\reserved@b
+ \fi
+ \fi
+ \reserved@c
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@sptoken}
+% \begin{macrocode}
+ \let\LuT@temp\:%
+ \def\:{\let\@sptoken= }%
+ \: % explicit space
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@xifnch}
+% \begin{macrocode}
+ \def\:{\@xifnch}%
+ \expandafter\def\: {%
+ \futurelet\@let@token\@ifnch
+ }%
+ \let\:\LuT@temp
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tempcnta}
+% \begin{macrocode}
+\expandafter\ifx\csname @tempcnta\endcsname\relax
+ \csname newcount\endcsname\@tempcnta
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tempcntb}
+% \begin{macrocode}
+\expandafter\ifx\csname @tempcntb\endcsname\relax
+ \csname newcount\endcsname\@tempcntb
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LuT@newcommand}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname newcommand\endcsname\relax
+ \def\LuT@newcommand#1[#2]#3{%
+ \ifx#1\@undefined
+ \let#1\relax
+ \else
+ \ifx#1\relax
+ \else
+ \@PackageError{luatex}{%
+ \string#1 is already defined.\MessageBreak
+ Redefinition is skipped%
+ }\@ehc
+ \fi
+ \fi
+ \ifx#1\relax
+ \ifcase#2 %
+ \def#1{#3}%
+ \or
+ \def#1##1{#3}%
+ \or
+ \def#1##1##2{#3}%
+ \or
+ \def#1##1##2##3{#3}%
+ \or
+ \@INTERNAL@ERROR
+ \fi
+ \fi
+ }%
+\else
+ \def\LuT@newcommand{\newcommand*}%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Attributes}
+%
+% \subsubsection{Allocation}
+%
+% \begin{macro}{\LuT@AllocAttribute}
+% \begin{macrocode}
+\newcount\LuT@AllocAttribute
+\LuT@AllocAttribute=\m@ne
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\newattribute}
+% \begin{macrocode}
+\ifx\newattribute\@undefined
+\LuT@newcommand\newattribute[1]{%
+ \ifnum\LuT@AllocAttribute<65535 %
+ \global\advance\LuT@AllocAttribute\@ne
+ \allocationnumber\LuT@AllocAttribute
+ \global\luatexattributedef#1=\allocationnumber
+ \unsetattribute{#1}%
+ \wlog{\string#1=\string\attribute\the\allocationnumber}%
+ \else
+ \errmessage{No room for a new \string\attribute}%
+ \fi
+}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Interface}
+%
+% \begin{macro}{\setattribute}
+% \begin{macrocode}
+\ifx\setattribute\@undefined
+\LuT@newcommand\setattribute[2]{%
+ #1=\numexpr#2\relax
+}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\unsetattribute}
+% \begin{macrocode}
+\ifx\unsetattribute\@undefined
+\ifnum\luatexversion<37
+ \LuT@newcommand\LuT@UnsetAttributeValue[0]{}%
+ \let\LuT@UnsetAttributeValue\m@ne
+\else
+ \LuT@newcommand\LuT@UnsetAttributeValue[0]{-2147483647 }%
+\fi
+\LuT@newcommand\unsetattribute[1]{%
+ #1=\LuT@UnsetAttributeValue
+}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Catcode tables}
+%
+% \subsubsection{Allocation}
+%
+% \begin{macro}{\LuT@AllocCatcodeTable}
+% \begin{macrocode}
+\newcount\LuT@AllocCatcodeTable
+\LuT@AllocCatcodeTable=\m@ne
+\newcount\CatcodeTableStack
+\CatcodeTableStack=\z@
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\newcatcodetable}
+% \begin{macrocode}
+\ifx\newcatcodetable\@undefined
+\LuT@newcommand\newcatcodetable[1]{%
+ \ifnum\LuT@AllocCatcodeTable<1114110 % 0x10FFFF is maximal \chardef
+ % or < 268435455 % 2^28 - 1
+ \global\advance\LuT@AllocCatcodeTable by\tw@
+ \allocationnumber=\LuT@AllocCatcodeTable
+ \global\chardef#1=\allocationnumber
+ \wlog{%
+ \string#1=\string\catcodetable\the\allocationnumber
+ }%
+ \else
+ \errmessage{No room for a new \string\catcodetable}%
+ \fi
+}%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IncCatcodeTableStack}
+% \begin{macrocode}
+\LuT@newcommand\IncCatcodeTableStack[0]{%
+ \ifnum\CatcodeTableStack<268435454 %
+ \global\advance\CatcodeTableStack by\tw@
+ \else
+ \@PackageError{luatex}{%
+ Catcode table stack overflow%
+ }\@ehd
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DecCatcodeTableStack}
+% \begin{macrocode}
+\LuT@newcommand\DecCatcodeTableStack[0]{%
+ \ifnum\CatcodeTableStack>\z@
+ \global\advance\CatcodeTableStack by-2 %
+ \else
+ \@PackageError{luatex}{%
+ Catcode table stack is empty%
+ }\@ehd
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\cs{SetCatcodeRange}}
+%
+% \begin{macro}{\SetCatcodeRange}
+% \begin{macrocode}
+\LuT@newcommand\SetCatcodeRange[3]{%
+ \edef\LuT@temp{%
+ \noexpand\@tempcnta=\the\@tempcnta
+ \noexpand\@tempcntb=\the\@tempcntb
+ \noexpand\count@=\the\count@
+ \relax
+ }%
+ \@tempcnta=\numexpr#1\relax
+ \@tempcntb=\numexpr#2\relax
+ \count@=\numexpr#3\relax
+ \loop
+ \unless\ifnum\@tempcnta>\@tempcntb
+ \catcode\@tempcnta=\count@
+ \advance\@tempcnta by \@ne
+ \repeat
+ \LuT@temp
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Predefined catcode tables}
+%
+% \begin{macrocode}
+\newcatcodetable\CatcodeTableIniTeX
+\newcatcodetable\CatcodeTableString
+\newcatcodetable\CatcodeTableOther
+\newcatcodetable\CatcodeTableLaTeX
+% \end{macrocode}
+%
+% \begin{macrocode}
+\luatexinitcatcodetable\CatcodeTableIniTeX
+\begingroup
+ \def\@makeother#1{\catcode#1=12\relax}%
+ \@firstofone{%
+ \luatexcatcodetable\CatcodeTableIniTeX
+ \begingroup
+ \SetCatcodeRange{0}{8}{15}%
+ \catcode9=10 % tab
+ \catcode11=15 %
+ \catcode12=13 % form feed
+ \SetCatcodeRange{14}{31}{15}%
+ \catcode35=6 % hash
+ \catcode36=3 % dollar
+ \catcode38=4 % ampersand
+ \catcode94=7 % circumflex
+ \catcode95=8 % underscore
+ \catcode123=1 % brace left
+ \catcode125=2 % brace right
+ \catcode126=13 % tilde
+ \catcode127=15 %
+ \luatexsavecatcodetable\CatcodeTableLaTeX
+ \endgroup
+ \@makeother{0}% nul
+ \@makeother{13}% carriage return
+ \@makeother{37}% percent
+ \@makeother{92}% backslash
+ \@makeother{127}%
+ \SetCatcodeRange{65}{90}{12}% A-Z
+ \SetCatcodeRange{97}{122}{12}% a-z
+ \luatexsavecatcodetable\CatcodeTableString
+ \@makeother{32}% space
+ \luatexsavecatcodetable\CatcodeTableOther
+ \endgroup
+}%
+% \end{macrocode}
+%
+% \subsubsection{Number stack}
+%
+% \begin{macro}{\LuT@NumStackEmpty}
+% A special empty stack value because of \cs{@cdr}'s brace removal.
+% \begin{macrocode}
+\def\LuT@NumStackEmpty{0}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LuT@NumStack}
+% \begin{macrocode}
+\let\LuT@NumStack\LuT@NumStackEmpty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PushCatcodeTableNumStack}
+% \begin{macrocode}
+\LuT@newcommand\PushCatcodeTableNumStack[0]{%
+ \xdef\LuT@NumStack{%
+ {\the\luatexcatcodetable}\LuT@NumStack
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PopCatcodeTableNumStack}
+% \begin{macrocode}
+\LuT@newcommand\PopCatcodeTableNumStack[0]{%
+ \ifx\LuT@NumStack\LuT@NumStackEmpty
+ \@PackageWarning{luatex}{Empty catcode table number stack}%
+ \luatexcatcodetable\z@
+ \else
+ \luatexcatcodetable=\expandafter\@car\LuT@NumStack\@nil\relax
+ \xdef\LuT@NumStack{%
+ \expandafter\@cdr\LuT@NumStack\@nil
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Catcode regime macros}
+%
+% \begin{macro}{\BeginCatcodeRegime}
+% \begin{macrocode}
+\LuT@newcommand\BeginCatcodeRegime[1]{%
+ \PushCatcodeTableNumStack
+ \luatexcatcodetable=\numexpr#1\relax
+ \IncCatcodeTableStack
+ \luatexsavecatcodetable\CatcodeTableStack
+ \luatexcatcodetable\CatcodeTableStack
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EndCatcodeRegime}
+% \begin{macrocode}
+\LuT@newcommand\EndCatcodeRegime[0]{%
+ \DecCatcodeTableStack
+ \PopCatcodeTableNumStack
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Lua module loader}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input luatex-loader.sty\relax
+\else
+ \RequirePackage{luatex-loader}[2010/03/09]%
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\LuT@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*loader>
+% \end{macrocode}
+%
+% 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@luatex-loader.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{luatex-loader}{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@luatex-loader.sty\endcsname
+\ProvidesPackage{luatex-loader}%
+ [2019/07/25 v0.7 Lua module loader (HO)]%
+% \end{macrocode}
+% \begin{macrocode}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5\endlinechar=13\relax%
+ \catcode10=12 % ^^J
+ \catcode34=12 % "
+ \catcode39=12 % '
+ \catcode40=12 % (
+ \catcode41=12 % )
+ \catcode44=12 % ,
+ \catcode46=12 % .
+ \catcode60=12 % <
+ \catcode61=12 % =
+ \catcode95=12 % _ (other!)
+ \catcode96=12 % `
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \endlinechar=10 %
+ \ifnum\luatexversion<36 %
+ \directlua0%
+ \else %
+ \expandafter\directlua %
+ \fi %
+ {%
+ do
+ local script = "oberdiek.luatex.lua"
+ local file = kpse.find_file(script, "texmfscripts")
+ if file then
+ texio.write_nl("(" .. file .. ")")
+ dofile(file)
+ else
+ error("File `" .. script .. "' not found")
+ end
+ end
+ }%
+\endgroup\endinput%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</loader>
+% \end{macrocode}
+%
+% \subsection{Lua script}
+%
+% Currently \LuaTeX\ does not use KPSE when searching for module
+% files. The following Lua script implements a workaround.
+% It extends |package.loader| by another search method.
+% Modules are found by the module name with extension \xext{lua}
+% similar to
+% \begin{quote}
+% \ttfamily |kpsewhich --format=texmfscripts| \meta{module}|.lua|
+% \end{quote}
+% Unhappily \textsf{kpsewhich} does not support directory components
+% in the file name. Therefore a module |a.b.c| cannot be installed
+% as \xfile{a/b/c.lua}. The script must be named \xfile{a.b.c.lua}.
+% \begin{macrocode}
+%<*lua>
+% \end{macrocode}
+% \begin{macrocode}
+local function kpse_module_loader(module)
+ local script = module .. ".lua"
+ local file = kpse.find_file(script, "texmfscripts")
+ if file then
+ local loader, error = loadfile(file)
+ if loader then
+ texio.write_nl("(" .. file .. ")")
+ return loader
+ end
+ return "\n\t[oberdiek.luatex.kpse_module_loader] Loading error:\n\t"
+ .. error
+ end
+ return "\n\t[oberdiek.luatex.kpse_module_loader] Search failed"
+end
+% \end{macrocode}
+% following line changed to use package.searchers instead of
+% package.loaders for current luatex; this is the only change in the
+% code. eroux, 28apr13, (or package.loaders), 29mar14.
+% \begin{macrocode}
+table.insert(package.searchers or package.loaders, kpse_module_loader)
+% \end{macrocode}
+% \begin{macrocode}
+%</lua>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \begin{macrocode}
+%<*test2>
+\documentclass{article}
+\def\LoadCommand{%
+ \RequirePackage{luatex}[2010/03/09]%
+}
+%</test2>
+% \end{macrocode}
+% \begin{macrocode}
+%<*test3>
+\documentclass{article}
+\def\LoadCommand{%
+ \RequirePackage{luatex-loader}[2010/03/09]%
+}
+%</test3>
+% \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 luatex.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Catcode tables}
+%
+% \subsubsection{Predefined catcode tables}
+%
+% \begin{macrocode}
+%<*test4>
+\NeedsTeXFormat{LaTeX2e}
+% \end{macrocode}
+% Remember \LaTeX's initial catcodes in count registers
+% starting at \cs{TestLaTeX}.
+% \begin{macrocode}
+\count0=0 %
+\chardef\TestLaTeX=1000 %
+\chardef\TestMax=300 %
+\loop
+ \count\numexpr\TestLaTeX+\count0\relax=\catcode\count0 %
+\ifnum\count0<\TestMax
+ \advance\count0 by 1 %
+\repeat
+\documentclass{minimal}
+\usepackage{luatex}[2010/03/09]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\makeatletter
+\def\Check#1{%
+ \Expect*{\the\count@=\the\catcode\count@}%
+ *{\the\count@=#1}%
+}
+\newcount\scratch
+\def\Test#1#2{%
+ \begin{qstest}{CatcodeTable#1}{CatcodeTable#1}%
+ \luatexcatcodetable\csname CatcodeTable#1\endcsname
+ \count@=\z@
+ \loop
+ \scratch=#2\relax
+ \Expect*{\the\count@=\the\catcode\count@}%
+ *{\the\count@=\the\scratch}%
+ \ifnum\count@<\TestMax
+ \advance\count@\@ne
+ \repeat
+ \end{qstest}%
+}
+\begingroup
+ % luatex-unicode-letters.tex makes some slots to letters
+ \def\TestMax{169}%
+ \Test{LaTeX}{\the\count\numexpr\TestLaTeX+\count@}%
+\endgroup
+\Test{String}{\ifnum\count@=32 10\else 12\fi}
+\Test{Other}{12}
+\luatexinitcatcodetable99 %
+\Test{IniTeX}{%
+ 0\relax
+ \begingroup
+ \luatexcatcodetable99 %
+ \global\scratch=\the\catcode\count@
+ \endgroup
+}
+% \end{macrocode}
+%
+% \subsubsection{Catcode table number stack}
+%
+% \begin{macrocode}
+\begin{qstest}{CatcodeTableNumStack}{CatcodeTableNumStack}
+ \def\TestStack#1{%
+ \Expect*{\LuT@NumStack}{#1}%
+ }%
+ \TestStack{0}%
+ \PushCatcodeTableNumStack
+ \TestStack{{0}0}%
+ \@firstofone{%
+ \begingroup
+ \luatexinitcatcodetable12 %
+ \luatexcatcodetable12 %
+ \PushCatcodeTableNumStack
+ \TestStack{{12}{0}0}%
+ \PopCatcodeTableNumStack
+ \TestStack{{0}0}%
+ \PopCatcodeTableNumStack
+ \TestStack{0}%
+ \def\TestWarning{Missing empty stack warning}%
+ \def\@PackageWarning#1#2{\def\TestWarning{empty stack}}%
+ \PopCatcodeTableNumStack
+ \TestStack{0}%
+ \Expect*{\TestWarning}{empty stack}%
+ \endgroup
+ }%
+\end{qstest}
+% \end{macrocode}
+%
+% \subsubsection{Catcode table stack}
+%
+% \begin{macrocode}
+\begin{qstest}{CatcodeTableStack}{CatcodeTableStack}
+ \def\TestStack#1{%
+ \Expect*{\the\CatcodeTableStack}{#1}%
+ }%
+ \TestStack{0}%
+ \IncCatcodeTableStack
+ \TestStack{2}%
+ \IncCatcodeTableStack
+ \TestStack{4}%
+ \begingroup
+ \IncCatcodeTableStack
+ \TestStack{6}%
+ \endgroup
+ \TestStack{6}%
+ \begingroup
+ \DecCatcodeTableStack
+ \TestStack{4}%
+ \endgroup
+ \TestStack{4}%
+ \DecCatcodeTableStack
+ \TestStack{2}%
+ \DecCatcodeTableStack
+ \TestStack{0}%
+ \begingroup
+ \def\TestError{Missing error}%
+ \def\@PackageError#1#2#3{%
+ \def\TestError{Empty stack}%
+ }%
+ \DecCatcodeTableStack
+ \TestStack{0}%
+ \Expect*{\TestError}{Empty stack}%
+ \endgroup
+\end{qstest}
+% \end{macrocode}
+%
+% \subsubsection{Catcode regime macros}
+%
+% \begin{macrocode}
+\begin{qstest}{CatcodeRegime}{CatcodeRegime}
+ \def\TestStacks#1#2#3{%
+ \Expect*{\the\luatexcatcodetable}{#1}%
+ \Expect*{\the\CatcodeTableStack}{#2}%
+ \Expect*{\LuT@NumStack}{#3}%
+ }%
+ \TestStacks{0}{0}{0}%
+ \catcode`\|=7 %
+ \BeginCatcodeRegime\CatcodeTableLaTeX
+ \TestStacks{2}{2}{{0}0}%
+ \Expect*{\the\catcode`\|}{12}%
+ \EndCatcodeRegime
+ \TestStacks{0}{0}{0}%
+ \Expect*{\the\catcode`\|}{7}%
+\end{qstest}
+% \end{macrocode}
+%
+% \subsection{Attribute allocation}
+%
+% \begin{macrocode}
+\begin{qstest}{Attributes}{Attributes}
+ \newattribute\TestAttr
+ \Expect*{\meaning\TestAttr}%
+ *{\string\attribute\number\allocationnumber}%
+ \Expect*{\the\allocationnumber}{0}%
+ \begingroup
+ \newattribute\TestAttr
+ \Expect*{\the\allocationnumber}{1}%
+ \endgroup
+ \Expect*{\the\allocationnumber}{0}%
+ \Expect*{\meaning\TestAttr}*{\string\attribute1}%
+ \Expect*{\the\TestAttr}*{\number\LuT@UnsetAttributeValue}%
+ \def\Test#1{%
+ \setattribute\TestAttr{#1}%
+ \Expect*{\the\TestAttr}{#1}%
+ }%
+ \Test{0}%
+ \Test{1}%
+ \Test{-1}%
+ \Test{123}%
+ \unsetattribute\TestAttr
+ \Expect*{\the\TestAttr}*{\number\LuT@UnsetAttributeValue}%
+ \begingroup
+ \Expect*{\the\TestAttr}*{\number\LuT@UnsetAttributeValue}%
+ \Test{1234}%
+ \endgroup
+ \Expect*{\the\TestAttr}*{\number\LuT@UnsetAttributeValue}%
+\end{qstest}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@@end
+%</test4>
+% \end{macrocode}
+%
+% \subsection{Short test for \plainTeX}
+%
+% \begin{macrocode}
+%<*test5>
+\input luatex.sty\relax
+\newattribute\TestAttr
+\setattribute\TestAttr{10}
+\unsetattribute\TestAttr
+\newcatcodetable\TestCTa
+\begingroup
+ \SetCatcodeRange{`A}{`Z}{12}%
+\endgroup
+\BeginCatcodeRegime\CatcodeTableLaTeX
+\EndCatcodeRegime
+\end
+%</test5>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/luatex}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/luatex.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/luatex.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[\CTAN{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 luatex.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@{}}
+% luatex.sty & tex/generic/oberdiek/luatex.sty\\
+% luatex-loader.sty & tex/generic/oberdiek/luatex-loader.sty\\
+% oberdiek.luatex.lua & scripts/oberdiek/oberdiek.luatex.lua\\
+% luatex.pdf & doc/latex/oberdiek/luatex.pdf\\
+% test/luatex-test1.tex & doc/latex/oberdiek/test/luatex-test1.tex\\
+% test/luatex-test2.tex & doc/latex/oberdiek/test/luatex-test2.tex\\
+% test/luatex-test3.tex & doc/latex/oberdiek/test/luatex-test3.tex\\
+% test/luatex-test4.tex & doc/latex/oberdiek/test/luatex-test4.tex\\
+% test/luatex-test5.tex & doc/latex/oberdiek/test/luatex-test5.tex\\
+% luatex.dtx & source/latex/oberdiek/luatex.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk luatex.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{luatex.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 luatex.dtx
+%makeindex -s gind.ist luatex.idx
+%pdflatex luatex.dtx
+%makeindex -s gind.ist luatex.idx
+%pdflatex luatex.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{luatex.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='luatex'>
+ <name>luatex</name>
+ <caption>The LuaTeX engine.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2009,2010'/>
+ <license type='lppl1.3'/>
+ <version number='0.6'/>
+ <description>
+ LuaTeX is an extended version of pdfTeX using Lua as an embedded
+ scripting language. The LuaTeX project&#x2019;s main objective
+ is to provide an open and configurable variant of TeX while at the
+ same time offering downward compatibility.
+ <p/>
+ LuaTeX uses Unicode (as UTF-8) as its default input encoding, and
+ is able to use modern (OpenType) fonts (for both text and mathematics).
+ <p/>
+ It should be noted that LuaTeX is still under development; its
+ specification has been declared stable, but absolute stability
+ may not in practice be assumed.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/luatex.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/luatex.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/12/12 v0.1}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2009/04/10 v0.2}
+% \item
+% Requires package \xpackage{ifluatex} in version 2.0 to ensure
+% \cs{luatexversion}.
+% \item
+% Updates the call of \cs{directlua}, the syntax has changed
+% in \LuaTeX\ 0.36.
+% \end{Version}
+% \begin{Version}{2009/12/02 v0.3}
+% \item
+% Unsetting of attributes updated for \LuaTeX\ 0.37.
+% \end{Version}
+% \begin{Version}{2010/03/09 v0.4}
+% \item
+% Support for lua states removed.
+% \item
+% Calling tex.enableprimitives for used primitives.
+% \end{Version}
+% \begin{Version}{2016/05/10 v0.5}
+% \item
+% Use package.searchers
+% \item only conditionally define commands such as
+% \verb|\newcatcodetable|
+% that are now defined in the Lua\LaTeX\ format.
+% \end{Version}
+% \begin{Version}{2016/05/16 v0.6}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2019/07/25 v0.7}
+% \item
+% remove uses of module function, see PR70
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/luatex.pdf b/macros/latex/contrib/oberdiek/luatex.pdf
new file mode 100644
index 0000000000..8316f3e950
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/luatex.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/magicnum.dtx b/macros/latex/contrib/oberdiek/magicnum.dtx
new file mode 100644
index 0000000000..7c24944fed
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/magicnum.dtx
@@ -0,0 +1,1604 @@
+% \iffalse meta-comment
+%
+% File: magicnum.dtx
+% Version: 2019/07/25 v1.6
+% Info: Magic numbers
+%
+% Copyright (C) 2007, 2009-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 2016, 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 magicnum.dtx
+% and the derived files
+% magicnum.sty, magicnum.pdf, magicnum.ins, magicnum.drv, magicnum.txt,
+% magicnum-test1.tex, magicnum-test2.tex, magicnum-test3.tex,
+% magicnum-test4.tex, magicnum.lua, oberdiek.magicnum.lua.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/magicnum.dtx
+% CTAN:macros/latex/contrib/oberdiek/magicnum.pdf
+%
+% Unpacking:
+% (a) If magicnum.ins is present:
+% tex magicnum.ins
+% (b) Without magicnum.ins:
+% tex magicnum.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{magicnum.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If magicnum.drv is present:
+% latex magicnum.drv
+% (b) Without magicnum.drv:
+% latex magicnum.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 magicnum.dtx
+% makeindex -s gind.ist magicnum.idx
+% pdflatex magicnum.dtx
+% makeindex -s gind.ist magicnum.idx
+% pdflatex magicnum.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/magicnum.sty
+% TDS:scripts/oberdiek/magicnum.lua
+% TDS:scripts/oberdiek/oberdiek.magicnum.lua
+% TDS:doc/latex/oberdiek/magicnum.pdf
+% TDS:doc/latex/oberdiek/magicnum.txt
+% TDS:doc/latex/oberdiek/test/magicnum-test1.tex
+% TDS:doc/latex/oberdiek/test/magicnum-test2.tex
+% TDS:doc/latex/oberdiek/test/magicnum-test3.tex
+% TDS:doc/latex/oberdiek/test/magicnum-test4.tex
+% TDS:source/latex/oberdiek/magicnum.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: magicnum 2019/07/25 v1.6 Magic numbers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: magicnum
+Version: 2019/07/25 v1.6
+
+Copyright (C) 2007, 2009-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 magicnum.dtx
+and the derived files
+ magicnum.sty, magicnum.pdf, magicnum.ins, magicnum.drv, magicnum.txt,
+ magicnum-test1.tex, magicnum-test2.tex, magicnum-test3.tex,
+ magicnum-test4.tex, magicnum.lua, oberdiek.magicnum.lua.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{magicnum.ins}{\from{magicnum.dtx}{install}}%
+ \file{magicnum.drv}{\from{magicnum.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{magicnum.sty}{\from{magicnum.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{magicnum-test1.tex}{\from{magicnum.dtx}{test1}}%
+% \file{magicnum-test2.tex}{\from{magicnum.dtx}{testplain,testdata}}%
+% \file{magicnum-test3.tex}{\from{magicnum.dtx}{testlatex,testdata}}%
+% \file{magicnum-test4.tex}{\from{magicnum.dtx}{test4}}%
+ \nopreamble
+ \nopostamble
+ \usedir{doc/latex/oberdiek}%
+ \file{magicnum.txt}{\from{magicnum.dtx}{data}}%
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{magicnum.xml}{\from{magicnum.dtx}{catalogue}}%
+}
+\def\MetaPrefix{-- }
+\def\defaultpostamble{%
+ \MetaPrefix^^J%
+ \MetaPrefix\space End of File `\outFileName'.%
+}
+\def\currentpostamble{\defaultpostamble}%
+\generate{%
+ \usedir{scripts/oberdiek}%
+ \file{magicnum.lua}{\from{magicnum.dtx}{lua}}%
+ \file{oberdiek.magicnum.lua}{\from{magicnum.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{* magicnum.sty}
+\Msg{*}
+\Msg{* And install the following script files:}
+\Msg{*}
+\Msg{* magicnum.lua, oberdiek.magicnum.lua}
+\Msg{*}
+\Msg{* To produce the documentation run the file `magicnum.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{magicnum.drv}%
+ [2019/07/25 v1.6 Magic numbers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{array}
+\begin{document}
+ \DocInput{magicnum.dtx}%
+\end{document}
+%</driver>
+% \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{magicnum.drv}
+%
+% \title{The \xpackage{magicnum} package}
+% \date{2019/07/25 v1.6}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This packages allows to access magic numbers by a hierarchical
+% name system.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \hypersetup{bookmarksopenlevel=2}
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% Especially since \eTeX\ there are many integer values
+% with special meanings, such as catcodes, group types, \dots
+% Package \xpackage{etex}, enabled by options, defines
+% macros in the user namespace for these values.
+%
+% This package goes another approach for storing the names and values.
+% \begin{itemize}
+% \item If \LuaTeX\ is available, they
+% are stored in Lua tables.
+% \item Without \LuaTeX\ they are remembered using internal
+% macros.
+% \end{itemize}
+%
+% \subsection{User interface}
+%
+% The integer values and names are organized in a hierarchical
+% scheme of categories with the property names as leaves.
+% Example: \eTeX's \cs{currentgrouplevel} reports |2| for a
+% group caused by \cs{hbox}. This package has choosen to organize
+% the group types in a main category |etex| and its subcategory
+% |grouptype|:
+% \begin{quote}
+% |etex.grouptype.hbox| = |2|
+% \end{quote}
+% The property name |hbox| in category |etex.grouptype| has value |2|.
+% Dots are used to separate components.
+%
+% If you want to have the value, the access key is constructed by
+% the category with all its components and the property name.
+% For the opposite the value is used instead of the property name.
+%
+% Values are always integers (including negative numbers).
+%
+% \subsubsection{\cs{magicnum}}
+%
+% \begin{declcs}{magicnum} \M{access key}
+% \end{declcs}
+% Macro \cs{magicnum} expects an access key as argument and
+% expands to the requested data. The macro is always expandable.
+% In case of errors the expansion result is empty.
+%
+% The same macro is also used for getting a property name.
+% In this case the property name part in the access key is
+% replaced by the value.
+%
+% The catcodes
+% of the resulting numbers and strings follow \TeX's tradition of
+% \cs{string}, \cs{meaning}, \dots: The space has catcode 10
+% (|tex.catcode.space|) and the other characters have catcode
+% 12 (|tex.catcode.other|).
+%
+% Examples:
+% \begin{quote}
+% |\magicnum{etex.grouptype.hbox}| $\Rightarrow$ |2|\\
+% |\magicnum{tex.catcode.14}| $\Rightarrow$ |comment|\\
+% |\magicnum{tex.catcode.undefined}| $\Rightarrow$ $\emptyset$
+% \end{quote}
+%
+% \subsubsection{Properties}
+%
+% \begin{itemize}
+% \item The components of a category are either subcategories or
+% key value pairs, but not both.
+% \item The full specified property names are unique and thus
+% has one integer value exactly.
+% \item Also the values inside a category are unique.
+% This condition is a prerequisite for the reverse mapping
+% of \cs{magicnum}.
+% \item All names start with a letter. Only letters or digits
+% may follow.
+% \end{itemize}
+%
+% \subsection{Data}
+%
+% \subsubsection{\texorpdfstring{Category }{}\texttt{tex.catcode}}
+%
+% \begin{quote}
+% \begin{tabular}{@{}>{\ttfamily}l>{\ttfamily}l@{}}
+% tex.catcode.escape & 0\\
+% tex.catcode.begingroup & 1\\
+% tex.catcode.endgroup & 2\\
+% tex.catcode.math & 3\\
+% tex.catcode.align & 4\\
+% tex.catcode.eol & 5\\
+% tex.catcode.parameter & 6\\
+% tex.catcode.superscript & 7\\
+% tex.catcode.subscript & 8\\
+% tex.catcode.ignore & 9\\
+% tex.catcode.space & 10\\
+% tex.catcode.letter & 11\\
+% tex.catcode.other & 12\\
+% tex.catcode.active & 13\\
+% tex.catcode.comment & 14\\
+% tex.catcode.invalid & 15\\
+% \end{tabular}
+% \end{quote}
+%
+% \subsubsection{\texorpdfstring{Category }{}\texttt{etex.grouptype}}
+%
+% \begin{quote}
+% \begin{tabular}{@{}>{\ttfamily}l>{\ttfamily}l@{}}
+% etex.grouptype.bottomlevel & 0\\
+% etex.grouptype.simple & 1\\
+% etex.grouptype.hbox & 2\\
+% etex.grouptype.adjustedhbox & 3\\
+% etex.grouptype.vbox & 4\\
+% etex.grouptype.align & 5\\
+% etex.grouptype.noalign & 6\\
+% etex.grouptype.output & 8\\
+% etex.grouptype.math & 9\\
+% etex.grouptype.disc & 10\\
+% etex.grouptype.insert & 11\\
+% etex.grouptype.vcenter & 12\\
+% etex.grouptype.mathchoice & 13\\
+% etex.grouptype.semisimple & 14\\
+% etex.grouptype.mathshift & 15\\
+% etex.grouptype.mathleft & 16\\
+% \end{tabular}
+% \end{quote}
+%
+% \subsubsection{\texorpdfstring{Category }{}\texttt{etex.iftype}}
+%
+% \begin{quote}
+% \begin{tabular}{@{}>{\ttfamily}l>{\ttfamily}l@{}}
+% etex.iftype.none & 0\\
+% etex.iftype.char & 1\\
+% etex.iftype.cat & 2\\
+% etex.iftype.num & 3\\
+% etex.iftype.dim & 4\\
+% etex.iftype.odd & 5\\
+% etex.iftype.vmode & 6\\
+% etex.iftype.hmode & 7\\
+% etex.iftype.mmode & 8\\
+% etex.iftype.inner & 9\\
+% etex.iftype.void & 10\\
+% etex.iftype.hbox & 11\\
+% etex.iftype.vbox & 12\\
+% etex.iftype.x & 13\\
+% etex.iftype.eof & 14\\
+% etex.iftype.true & 15\\
+% etex.iftype.false & 16\\
+% etex.iftype.case & 17\\
+% etex.iftype.defined & 18\\
+% etex.iftype.csname & 19\\
+% etex.iftype.fontchar & 20\\
+% \end{tabular}
+% \end{quote}
+%
+% \subsubsection{\texorpdfstring{Category }{}\texttt{etex.nodetype}}
+%
+% \begin{quote}
+% \begin{tabular}{@{}>{\ttfamily}l>{\ttfamily}l@{}}
+% etex.nodetype.none & -1\\
+% etex.nodetype.char & 0\\
+% etex.nodetype.hlist & 1\\
+% etex.nodetype.vlist & 2\\
+% etex.nodetype.rule & 3\\
+% etex.nodetype.ins & 4\\
+% etex.nodetype.mark & 5\\
+% etex.nodetype.adjust & 6\\
+% etex.nodetype.ligature & 7\\
+% etex.nodetype.disc & 8\\
+% etex.nodetype.whatsit & 9\\
+% etex.nodetype.math & 10\\
+% etex.nodetype.glue & 11\\
+% etex.nodetype.kern & 12\\
+% etex.nodetype.penalty & 13\\
+% etex.nodetype.unset & 14\\
+% etex.nodetype.maths & 15\\
+% \end{tabular}
+% \end{quote}
+%
+% \subsubsection{\texorpdfstring{Category }{}\texttt{etex.interactionmode}}
+%
+% \begin{quote}
+% \begin{tabular}{@{}>{\ttfamily}l>{\ttfamily}l@{}}
+% etex.interactionmode.batch & 0\\
+% etex.interactionmode.nonstop & 1\\
+% etex.interactionmode.scroll & 2\\
+% etex.interactionmode.errorstop & 3\\
+% \end{tabular}
+% \end{quote}
+%
+% \subsubsection{\texorpdfstring{Category }{}\texttt{luatex.pdfliteral.mode}}
+%
+% \begin{quote}
+% \begin{tabular}{@{}>{\ttfamily}l>{\ttfamily}l@{}}
+% luatex.pdfliteral.mode.setorigin & 0\\
+% luatex.pdfliteral.mode.page & 1\\
+% luatex.pdfliteral.mode.direct & 2\\
+% \end{tabular}
+% \end{quote}
+%
+%
+% \hypersetup{bookmarksopenlevel=1}
+%
+% \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@magicnum.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{magicnum}{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@magicnum.sty\endcsname
+\ProvidesPackage{magicnum}%
+ [2019/07/25 v1.6 Magic numbers (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 magicnum@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\magicnum@AtEnd{%
+ \magicnum@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{34}{12}% "
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\magicnum@AtEnd{\magicnum@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Check for previous definition}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname newcommand\endcsname\relax
+ \expandafter\ifx\csname magicnum\endcsname\relax
+ \else
+ \input infwarerr.sty\relax
+ \@PackageError{magicnum}{%
+ \string\magicnum\space is already defined%
+ }\@ehc
+ \fi
+\else
+ \newcommand*{\magicnum}{}%
+\fi
+% \end{macrocode}
+%
+% \subsection{Without \LuaTeX}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname directlua\endcsname\relax
+% \end{macrocode}
+%
+% \begin{macro}{\magicnum}
+% \begin{macrocode}
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname ifcsname\endcsname\relax
+ \def\magicnum#1{%
+ \expandafter\ifx\csname MG@#1\endcsname\relax
+ \else
+ \csname MG@#1\endcsname
+ \fi
+ }%
+ \else
+ \begingroup
+ \edef\x{\endgroup
+ \def\noexpand\magicnum##1{%
+ \expandafter\noexpand\csname
+ ifcsname\endcsname MG@##1\noexpand\endcsname
+ \noexpand\csname MG@##1%
+ \noexpand\expandafter\noexpand\endcsname
+ \expandafter\noexpand\csname fi\endcsname
+ }%
+ }%
+ \x
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% \subsection{With \LuaTeX}
+%
+% \begin{macrocode}
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ifluatex.sty\relax
+ \input infwarerr.sty\relax
+ \else
+ \RequirePackage{ifluatex}[2010/03/01]%
+ \RequirePackage{infwarerr}[2010/04/08]%
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\magicnum@directlua}
+% \begin{macrocode}
+ \ifnum\luatexversion<36 %
+ \def\magicnum@directlua{\directlua0 }%
+ \else
+ \let\magicnum@directlua\directlua
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \magicnum@directlua{%
+ require("magicnum")%
+ }%
+ \begingroup
+ \def\x{2019/07/25 v1.6}%
+ \def\StripPrefix#1>{}%
+ \edef\x{\expandafter\StripPrefix\meaning\x}%
+ \edef\y{%
+ \magicnum@directlua{%
+ if oberdiek.magicnum.getversion then %
+ oberdiek.magicnum.getversion()%
+ end%
+ }%
+ }%
+ \ifx\x\y
+ \else
+ \@PackageError{magicnum}{%
+ Wrong version of lua module.\MessageBreak
+ Package version: \x\MessageBreak
+ Lua module: \y
+ }\@ehc
+ \fi
+ \endgroup
+% \end{macrocode}
+% \begin{macro}{\luaescapestring}
+% \begin{macrocode}
+ \begingroup
+ \expandafter\ifx\csname luaescapestring\endcsname\relax
+ \directlua{%
+ if tex.enableprimitives then %
+ tex.enableprimitives('magicnum@', {'luaescapestring'})%
+ end%
+ }%
+ \global\let\luaescapestring\magicnum@luaescapestring
+ \fi
+ \expandafter\ifx\csname luaescapestring\endcsname\relax
+ \escapechar=92 %
+ \@PackageError{magicnum}{%
+ Missing \string\luaescapestring
+ }\@ehc
+ \fi
+ \endgroup
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\magicnum}
+% \begin{macrocode}
+ \def\magicnum#1{%
+ \magicnum@directlua{%
+ oberdiek.magicnum.get("\luaescapestring{#1}")%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \expandafter\magicnum@AtEnd
+\fi%
+%</package>
+% \end{macrocode}
+%
+% \subsection{Data}
+%
+% \subsubsection{Plain data}
+%
+% \begin{macrocode}
+%<*data>
+tex.catcode
+ escape = 0
+ begingroup = 1
+ endgroup = 2
+ math = 3
+ align = 4
+ eol = 5
+ parameter = 6
+ superscript = 7
+ subscript = 8
+ ignore = 9
+ space = 10
+ letter = 11
+ other = 12
+ active = 13
+ comment = 14
+ invalid = 15
+etex.grouptype
+ bottomlevel = 0
+ simple = 1
+ hbox = 2
+ adjustedhbox = 3
+ vbox = 4
+ align = 5
+ noalign = 6
+ output = 8
+ math = 9
+ disc = 10
+ insert = 11
+ vcenter = 12
+ mathchoice = 13
+ semisimple = 14
+ mathshift = 15
+ mathleft = 16
+etex.iftype
+ none = 0
+ char = 1
+ cat = 2
+ num = 3
+ dim = 4
+ odd = 5
+ vmode = 6
+ hmode = 7
+ mmode = 8
+ inner = 9
+ void = 10
+ hbox = 11
+ vbox = 12
+ x = 13
+ eof = 14
+ true = 15
+ false = 16
+ case = 17
+ defined = 18
+ csname = 19
+ fontchar = 20
+etex.nodetype
+ none = -1
+ char = 0
+ hlist = 1
+ vlist = 2
+ rule = 3
+ ins = 4
+ mark = 5
+ adjust = 6
+ ligature = 7
+ disc = 8
+ whatsit = 9
+ math = 10
+ glue = 11
+ kern = 12
+ penalty = 13
+ unset = 14
+ maths = 15
+etex.interactionmode
+ batch = 0
+ nonstop = 1
+ scroll = 2
+ errorstop = 3
+luatex.pdfliteral.mode
+ setorigin = 0
+ page = 1
+ direct = 2
+%</data>
+% \end{macrocode}
+%
+% \subsubsection{Data for \TeX}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% \begin{macro}{\magicnum@add}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname detokenize\endcsname\relax
+ \def\magicnum@add#1#2#3{%
+ \expandafter\magicnum@@add
+ \csname MG@#1.#2\expandafter\endcsname
+ \csname MG@#1.#3\endcsname
+ {#3}{#2}%
+ }%
+ \def\magicnum@@add#1#2#3#4{%
+ \def#1{#3}%
+ \def#2{#4}%
+ \edef#1{%
+ \expandafter\strip@prefix\meaning#1%
+ }%
+ \edef#2{%
+ \expandafter\strip@prefix\meaning#2%
+ }%
+ }%
+ \expandafter\ifx\csname strip@prefix\endcsname\relax
+ \def\strip@prefix#1->{}%
+ \fi
+\else
+ \def\magicnum@add#1#2#3{%
+ \expandafter\edef\csname MG@#1.#2\endcsname{%
+ \detokenize{#3}%
+ }%
+ \expandafter\edef\csname MG@#1.#3\endcsname{%
+ \detokenize{#2}%
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\magicnum@add{tex.catcode}{escape}{0}
+\magicnum@add{tex.catcode}{begingroup}{1}
+\magicnum@add{tex.catcode}{endgroup}{2}
+\magicnum@add{tex.catcode}{math}{3}
+\magicnum@add{tex.catcode}{align}{4}
+\magicnum@add{tex.catcode}{eol}{5}
+\magicnum@add{tex.catcode}{parameter}{6}
+\magicnum@add{tex.catcode}{superscript}{7}
+\magicnum@add{tex.catcode}{subscript}{8}
+\magicnum@add{tex.catcode}{ignore}{9}
+\magicnum@add{tex.catcode}{space}{10}
+\magicnum@add{tex.catcode}{letter}{11}
+\magicnum@add{tex.catcode}{other}{12}
+\magicnum@add{tex.catcode}{active}{13}
+\magicnum@add{tex.catcode}{comment}{14}
+\magicnum@add{tex.catcode}{invalid}{15}
+\magicnum@add{etex.grouptype}{bottomlevel}{0}
+\magicnum@add{etex.grouptype}{simple}{1}
+\magicnum@add{etex.grouptype}{hbox}{2}
+\magicnum@add{etex.grouptype}{adjustedhbox}{3}
+\magicnum@add{etex.grouptype}{vbox}{4}
+\magicnum@add{etex.grouptype}{align}{5}
+\magicnum@add{etex.grouptype}{noalign}{6}
+\magicnum@add{etex.grouptype}{output}{8}
+\magicnum@add{etex.grouptype}{math}{9}
+\magicnum@add{etex.grouptype}{disc}{10}
+\magicnum@add{etex.grouptype}{insert}{11}
+\magicnum@add{etex.grouptype}{vcenter}{12}
+\magicnum@add{etex.grouptype}{mathchoice}{13}
+\magicnum@add{etex.grouptype}{semisimple}{14}
+\magicnum@add{etex.grouptype}{mathshift}{15}
+\magicnum@add{etex.grouptype}{mathleft}{16}
+\magicnum@add{etex.iftype}{none}{0}
+\magicnum@add{etex.iftype}{char}{1}
+\magicnum@add{etex.iftype}{cat}{2}
+\magicnum@add{etex.iftype}{num}{3}
+\magicnum@add{etex.iftype}{dim}{4}
+\magicnum@add{etex.iftype}{odd}{5}
+\magicnum@add{etex.iftype}{vmode}{6}
+\magicnum@add{etex.iftype}{hmode}{7}
+\magicnum@add{etex.iftype}{mmode}{8}
+\magicnum@add{etex.iftype}{inner}{9}
+\magicnum@add{etex.iftype}{void}{10}
+\magicnum@add{etex.iftype}{hbox}{11}
+\magicnum@add{etex.iftype}{vbox}{12}
+\magicnum@add{etex.iftype}{x}{13}
+\magicnum@add{etex.iftype}{eof}{14}
+\magicnum@add{etex.iftype}{true}{15}
+\magicnum@add{etex.iftype}{false}{16}
+\magicnum@add{etex.iftype}{case}{17}
+\magicnum@add{etex.iftype}{defined}{18}
+\magicnum@add{etex.iftype}{csname}{19}
+\magicnum@add{etex.iftype}{fontchar}{20}
+\magicnum@add{etex.nodetype}{none}{-1}
+\magicnum@add{etex.nodetype}{char}{0}
+\magicnum@add{etex.nodetype}{hlist}{1}
+\magicnum@add{etex.nodetype}{vlist}{2}
+\magicnum@add{etex.nodetype}{rule}{3}
+\magicnum@add{etex.nodetype}{ins}{4}
+\magicnum@add{etex.nodetype}{mark}{5}
+\magicnum@add{etex.nodetype}{adjust}{6}
+\magicnum@add{etex.nodetype}{ligature}{7}
+\magicnum@add{etex.nodetype}{disc}{8}
+\magicnum@add{etex.nodetype}{whatsit}{9}
+\magicnum@add{etex.nodetype}{math}{10}
+\magicnum@add{etex.nodetype}{glue}{11}
+\magicnum@add{etex.nodetype}{kern}{12}
+\magicnum@add{etex.nodetype}{penalty}{13}
+\magicnum@add{etex.nodetype}{unset}{14}
+\magicnum@add{etex.nodetype}{maths}{15}
+\magicnum@add{etex.interactionmode}{batch}{0}
+\magicnum@add{etex.interactionmode}{nonstop}{1}
+\magicnum@add{etex.interactionmode}{scroll}{2}
+\magicnum@add{etex.interactionmode}{errorstop}{3}
+\magicnum@add{luatex.pdfliteral.mode}{setorigin}{0}
+\magicnum@add{luatex.pdfliteral.mode}{page}{1}
+\magicnum@add{luatex.pdfliteral.mode}{direct}{2}
+% \end{macrocode}
+% \begin{macrocode}
+\magicnum@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \subsubsection{Lua module}
+%
+% \begin{macrocode}
+%<*lua>
+% \end{macrocode}
+% \begin{macrocode}
+oberdiek = oberdiek or {}
+local magicnum = oberdiek.magicnum or {}
+oberdiek.magicnum = magicnum
+% \end{macrocode}
+% \begin{macrocode}
+function magicnum.getversion()
+ tex.write("2019/07/25 v1.6")
+end
+% \end{macrocode}
+% \begin{macrocode}
+local data = {
+ ["tex.catcode"] = {
+ [0] = "escape",
+ [1] = "begingroup",
+ [2] = "endgroup",
+ [3] = "math",
+ [4] = "align",
+ [5] = "eol",
+ [6] = "parameter",
+ [7] = "superscript",
+ [8] = "subscript",
+ [9] = "ignore",
+ [10] = "space",
+ [11] = "letter",
+ [12] = "other",
+ [13] = "active",
+ [14] = "comment",
+ [15] = "invalid",
+ ["active"] = 13,
+ ["align"] = 4,
+ ["begingroup"] = 1,
+ ["comment"] = 14,
+ ["endgroup"] = 2,
+ ["eol"] = 5,
+ ["escape"] = 0,
+ ["ignore"] = 9,
+ ["invalid"] = 15,
+ ["letter"] = 11,
+ ["math"] = 3,
+ ["other"] = 12,
+ ["parameter"] = 6,
+ ["space"] = 10,
+ ["subscript"] = 8,
+ ["superscript"] = 7
+ },
+ ["etex.grouptype"] = {
+ [0] = "bottomlevel",
+ [1] = "simple",
+ [2] = "hbox",
+ [3] = "adjustedhbox",
+ [4] = "vbox",
+ [5] = "align",
+ [6] = "noalign",
+ [8] = "output",
+ [9] = "math",
+ [10] = "disc",
+ [11] = "insert",
+ [12] = "vcenter",
+ [13] = "mathchoice",
+ [14] = "semisimple",
+ [15] = "mathshift",
+ [16] = "mathleft",
+ ["adjustedhbox"] = 3,
+ ["align"] = 5,
+ ["bottomlevel"] = 0,
+ ["disc"] = 10,
+ ["hbox"] = 2,
+ ["insert"] = 11,
+ ["math"] = 9,
+ ["mathchoice"] = 13,
+ ["mathleft"] = 16,
+ ["mathshift"] = 15,
+ ["noalign"] = 6,
+ ["output"] = 8,
+ ["semisimple"] = 14,
+ ["simple"] = 1,
+ ["vbox"] = 4,
+ ["vcenter"] = 12
+ },
+ ["etex.iftype"] = {
+ [0] = "none",
+ [1] = "char",
+ [2] = "cat",
+ [3] = "num",
+ [4] = "dim",
+ [5] = "odd",
+ [6] = "vmode",
+ [7] = "hmode",
+ [8] = "mmode",
+ [9] = "inner",
+ [10] = "void",
+ [11] = "hbox",
+ [12] = "vbox",
+ [13] = "x",
+ [14] = "eof",
+ [15] = "true",
+ [16] = "false",
+ [17] = "case",
+ [18] = "defined",
+ [19] = "csname",
+ [20] = "fontchar",
+ ["case"] = 17,
+ ["cat"] = 2,
+ ["char"] = 1,
+ ["csname"] = 19,
+ ["defined"] = 18,
+ ["dim"] = 4,
+ ["eof"] = 14,
+ ["false"] = 16,
+ ["fontchar"] = 20,
+ ["hbox"] = 11,
+ ["hmode"] = 7,
+ ["inner"] = 9,
+ ["mmode"] = 8,
+ ["none"] = 0,
+ ["num"] = 3,
+ ["odd"] = 5,
+ ["true"] = 15,
+ ["vbox"] = 12,
+ ["vmode"] = 6,
+ ["void"] = 10,
+ ["x"] = 13
+ },
+ ["etex.nodetype"] = {
+ [-1] = "none",
+ [0] = "char",
+ [1] = "hlist",
+ [2] = "vlist",
+ [3] = "rule",
+ [4] = "ins",
+ [5] = "mark",
+ [6] = "adjust",
+ [7] = "ligature",
+ [8] = "disc",
+ [9] = "whatsit",
+ [10] = "math",
+ [11] = "glue",
+ [12] = "kern",
+ [13] = "penalty",
+ [14] = "unset",
+ [15] = "maths",
+ ["adjust"] = 6,
+ ["char"] = 0,
+ ["disc"] = 8,
+ ["glue"] = 11,
+ ["hlist"] = 1,
+ ["ins"] = 4,
+ ["kern"] = 12,
+ ["ligature"] = 7,
+ ["mark"] = 5,
+ ["math"] = 10,
+ ["maths"] = 15,
+ ["none"] = -1,
+ ["penalty"] = 13,
+ ["rule"] = 3,
+ ["unset"] = 14,
+ ["vlist"] = 2,
+ ["whatsit"] = 9
+ },
+ ["etex.interactionmode"] = {
+ [0] = "batch",
+ [1] = "nonstop",
+ [2] = "scroll",
+ [3] = "errorstop",
+ ["batch"] = 0,
+ ["errorstop"] = 3,
+ ["nonstop"] = 1,
+ ["scroll"] = 2
+ },
+ ["luatex.pdfliteral.mode"] = {
+ [0] = "setorigin",
+ [1] = "page",
+ [2] = "direct",
+ ["direct"] = 2,
+ ["page"] = 1,
+ ["setorigin"] = 0
+ }
+}
+% \end{macrocode}
+% \begin{macrocode}
+function magicnum.get(name)
+ local startpos, endpos, category, entry =
+ string.find(name, "^(%a[%a%d%.]*)%.(-?[%a%d]+)$")
+ if not entry then
+ return
+ end
+ local node = data[category]
+ if not node then
+ return
+ end
+ local num = tonumber(entry)
+ local value
+ if num then
+ value = node[num]
+ if not value then
+ return
+ end
+ else
+ value = node[entry]
+ if not value then
+ return
+ end
+ value = "" .. value
+ end
+ tex.write(value)
+end
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</lua>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Catcode checks for loading}
+%
+% \begin{macrocode}
+%<*test1>
+% \end{macrocode}
+% \begin{macrocode}
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\expandafter\ifx\csname count@\endcsname\relax
+ \countdef\count@=255 %
+\fi
+\expandafter\ifx\csname @gobble\endcsname\relax
+ \long\def\@gobble#1{}%
+\fi
+\expandafter\ifx\csname @firstofone\endcsname\relax
+ \long\def\@firstofone#1{#1}%
+\fi
+\expandafter\ifx\csname loop\endcsname\relax
+ \expandafter\@firstofone
+\else
+ \expandafter\@gobble
+\fi
+{%
+ \def\loop#1\repeat{%
+ \def\body{#1}%
+ \iterate
+ }%
+ \def\iterate{%
+ \body
+ \let\next\iterate
+ \else
+ \let\next\relax
+ \fi
+ \next
+ }%
+ \let\repeat=\fi
+}%
+\def\RestoreCatcodes{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@ 1 %
+\repeat
+
+\def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@ 1 %
+ \repeat
+}
+\def\RangeCatcodeCheck#1#2#3{%
+ \count@=#1\relax
+ \loop
+ \ifnum#3=\catcode\count@
+ \else
+ \errmessage{%
+ Character \the\count@\space
+ with wrong catcode \the\catcode\count@\space
+ instead of \number#3%
+ }%
+ \fi
+ \ifnum\count@<#2\relax
+ \advance\count@ 1 %
+ \repeat
+}
+\def\space{ }
+\expandafter\ifx\csname LoadCommand\endcsname\relax
+ \def\LoadCommand{\input magicnum.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test data}
+%
+% \begin{macrocode}
+%<*testplain>
+\input magicnum.sty\relax
+\def\Test#1#2{%
+ \edef\result{\magicnum{#1}}%
+ \edef\expect{#2}%
+ \edef\expect{\expandafter\stripprefix\meaning\expect}%
+ \ifx\result\expect
+ \else
+ \errmessage{%
+ Failed: [#1] % hash-ok
+ returns [\result] instead of [\expect]%
+ }%
+ \fi
+}
+\def\stripprefix#1->{}
+%</testplain>
+% \end{macrocode}
+% \begin{macrocode}
+%<*testlatex>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\usepackage{magicnum}[2016/05/16]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\newcommand*{\Test}[2]{%
+ \Expect*{\magicnum{#1}}{#2}%
+}
+\begin{qstest}{magicnum}{magicnum}
+%</testlatex>
+% \end{macrocode}
+% \begin{macrocode}
+%<*testdata>
+\Test{tex.catcode.escape}{0}
+\Test{tex.catcode.invalid}{15}
+\Test{tex.catcode.unknown}{}
+\Test{tex.catcode.0}{escape}
+\Test{tex.catcode.15}{invalid}
+\Test{etex.iftype.true}{15}
+\Test{etex.iftype.false}{16}
+\Test{etex.iftype.15}{true}
+\Test{etex.iftype.16}{false}
+\Test{etex.nodetype.none}{-1}
+\Test{etex.nodetype.-1}{none}
+\Test{luatex.pdfliteral.mode.direct}{2}
+\Test{luatex.pdfliteral.mode.1}{page}
+\Test{}{}
+\Test{unknown}{}
+\Test{unknown.foo.bar}{}
+\Test{unknown.foo.4}{}
+%</testdata>
+% \end{macrocode}
+% \begin{macrocode}
+%<*testplain>
+\csname @@end\endcsname
+\end
+%</testplain>
+%<*testlatex>
+\end{qstest}
+\csname @@end\endcsname
+%</testlatex>
+% \end{macrocode}
+%
+% \subsection{Small test for \hologo{iniTeX}}
+%
+% \begin{macrocode}
+%<*test4>
+\catcode`\{=1
+\catcode`\}=2
+\catcode`\#=6
+\input magicnum.sty\relax
+\edef\x{\magicnum{tex.catcode.15}}
+\edef\y{invalid}
+\def\Strip#1>{}
+\edef\y{\expandafter\Strip\meaning\y}
+\ifx\x\y
+ \immediate\write16{Ok}%
+\else
+ \errmessage{\x<>\y}%
+\fi
+\csname @@end\endcsname\end
+%</test4>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/magicnum}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/magicnum.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/magicnum.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[\CTAN{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 magicnum.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@{}}
+% magicnum.sty & tex/generic/oberdiek/magicnum.sty\\
+% magicnum.lua & scripts/oberdiek/magicnum.lua\\
+% oberdiek.magicnum.lua & scripts/oberdiek/oberdiek.magicnum.lua\\
+% magicnum.pdf & doc/latex/oberdiek/magicnum.pdf\\
+% magicnum.txt & doc/latex/oberdiek/magicnum.txt\\
+% test/magicnum-test1.tex & doc/latex/oberdiek/test/magicnum-test1.tex\\
+% test/magicnum-test2.tex & doc/latex/oberdiek/test/magicnum-test2.tex\\
+% test/magicnum-test3.tex & doc/latex/oberdiek/test/magicnum-test3.tex\\
+% test/magicnum-test4.tex & doc/latex/oberdiek/test/magicnum-test4.tex\\
+% magicnum.dtx & source/latex/oberdiek/magicnum.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk magicnum.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{magicnum.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 magicnum.dtx
+%makeindex -s gind.ist magicnum.idx
+%pdflatex magicnum.dtx
+%makeindex -s gind.ist magicnum.idx
+%pdflatex magicnum.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{magicnum.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='magicnum'>
+ <name>magicnum</name>
+ <caption>Access TeX systems' "magic numbers".</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.6'/>
+ <description>
+ This package allows access to the various parameter values in
+ TeX (catcode values), e-TeX (group, if and node types, and
+ interaction mode), and LuaTeX (pdfliteral mode) by a hierarchical
+ name system.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/magicnum.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/magicnum.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/12/12 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2009/04/10 v1.1}
+% \item
+% Adaptation to \LuaTeX\ 0.40.
+% \end{Version}
+% \begin{Version}{2010/03/09 v1.2}
+% \item
+% Adaptation to package \xpackage{luatex} 0.4.
+% \end{Version}
+% \begin{Version}{2011/03/24 v1.3}
+% \item
+% Catcode fixes.
+% \end{Version}
+% \begin{Version}{2011/04/10 v1.4}
+% \item
+% Compatibility for \hologo{iniTeX}.
+% \item
+% Dependency from package \xpackage{luatex} removed.
+% \item
+% Version check for lua module.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2019/07/25 v1.6}
+% \item
+% remove uses of module function, see PR70
+% \end{Version}
+
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/magicnum.pdf b/macros/latex/contrib/oberdiek/magicnum.pdf
new file mode 100644
index 0000000000..692defe8ab
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/magicnum.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/makerobust.dtx b/macros/latex/contrib/oberdiek/makerobust.dtx
new file mode 100644
index 0000000000..e63b5e5c53
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/makerobust.dtx
@@ -0,0 +1,553 @@
+% \iffalse meta-comment
+%
+% File: makerobust.dtx
+% Version: 2016/05/16 v1.1
+% Info: Make existing macro robust
+%
+% Copyright (C) 2006 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file makerobust.dtx
+% and the derived files
+% makerobust.sty, makerobust.pdf, makerobust.ins, makerobust.drv,
+% makerobust-example.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/makerobust.dtx
+% CTAN:macros/latex/contrib/oberdiek/makerobust.pdf
+%
+% Unpacking:
+% (a) If makerobust.ins is present:
+% tex makerobust.ins
+% (b) Without makerobust.ins:
+% tex makerobust.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{makerobust.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If makerobust.drv is present:
+% latex makerobust.drv
+% (b) Without makerobust.drv:
+% latex makerobust.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 makerobust.dtx
+% makeindex -s gind.ist makerobust.idx
+% pdflatex makerobust.dtx
+% makeindex -s gind.ist makerobust.idx
+% pdflatex makerobust.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/makerobust.sty
+% TDS:doc/latex/oberdiek/makerobust.pdf
+% TDS:doc/latex/oberdiek/makerobust-example.tex
+% TDS:source/latex/oberdiek/makerobust.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: makerobust 2016/05/16 v1.1 Make existing macro robust (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: makerobust
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2006 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file makerobust.dtx
+and the derived files
+ makerobust.sty, makerobust.pdf, makerobust.ins, makerobust.drv,
+ makerobust-example.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{makerobust.ins}{\from{makerobust.dtx}{install}}%
+ \file{makerobust.drv}{\from{makerobust.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{makerobust.sty}{\from{makerobust.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{makerobust-example.tex}{\from{makerobust.dtx}{example}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{makerobust.xml}{\from{makerobust.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{* makerobust.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `makerobust.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{makerobust.drv}%
+ [2016/05/16 v1.1 Make existing macro robust (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{makerobust.dtx}%
+\end{document}
+%</driver>
+% \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{makerobust.drv}
+%
+% \title{The \xpackage{makerobust} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{makerobust} provides \cs{MakeRobustCommand}
+% that converts an existing macro to a robust one.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% \LaTeX\ offers \cs{DeclareRobustCommand} to define a robust macro
+% that does not break if it is used in moving arguments.
+% Sometimes a macro is already defined, but not robust. For
+% example, \cs{(} and \cs{)} are not robust, inside \cs{section}
+% the user must use \cs{protect} explicitly. This could be
+% avoided by making \cs{(} and \cs{)} robust.
+%
+% \begin{declcs}{MakeRobustCommand}\M{cmd}
+% \end{declcs}
+% \cs{MakeRobustCommand} redefines the macro \meta{cmd}
+% by using \cs{DeclareRobustCommand} and the existing definition
+% of the macro \meta{cmd}.
+% \begin{itemize}
+% \item It is an error if \meta{cmd} is undefined. If you want to
+% define a robust command, then you can use \cs{DeclareRobustCommand}
+% directly.
+% \item If the macro has previously been
+% defined by \cs{DeclareRobustCommand} then the redefinition of
+% \cs{MakeRobustCommand} is omitted, because the macro is already robust.
+% Only an information entry is written to the \xfile{.log} file.
+% Thus you do not get a warning or an error if the macro is already
+% robust because of an updated LaTeX or package that defines the macro.
+% \item Two macros are defined for a macro, defined
+% by \cs{DeclareRobustCommand}. Example:
+% \begin{quote}
+% |\DeclareRobustCommand{\foobar}{definition text}|
+% \end{quote}
+% Then the macro ``\cs{foobar}'' contains the protection code
+% and, depending on the protection mode,
+% calls the internal macro ``\cs{foobar }''. Notice the space
+% at the end of the macro name.
+% This internal macro ``\cs{foobar }'' now contains the definition
+% ``|definition text|'', given in \cs{DeclareRobustCommand}.
+%
+% Sometimes it can happen, that the internal macro already exists.
+% This can be caused by a previous \cs{DeclareRobustCommand} followed
+% by \cs{renewcommand}. Then the redefinition by \cs{MakeRobustCommand}
+% would be safe.
+%
+% However, it can also be possible that the macro is already robust,
+% using the internal macro, but with a different protection code.
+% The redefinition by \cs{MakeRobustCommand} would then generate
+% an infinite loop.
+%
+% Therefore \cs{MakeRobustCommand} raises an error message,
+% if the internal macro (with space at the end) already exists.
+% \end{itemize}
+%
+% \subsection{Example}
+%
+% \begin{macrocode}
+%<*example>
+\documentclass{article}
+\usepackage{makerobust}
+\MakeRobustCommand\(
+\MakeRobustCommand\)
+\pagestyle{headings}
+\begin{document}
+\tableofcontents
+\section{Einstein: \(E=mc^2\)}
+\newpage
+Second page.
+\end{document}
+%</example>
+% \end{macrocode}
+%
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{makerobust}%
+ [2016/05/16 v1.1 Make existing macro robust (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\MakeRobustCommand#1{%
+ \begingroup
+ \@ifundefined{\expandafter\@gobble\string#1}{%
+ \endgroup
+ \PackageError{makerobust}{%
+ Macro \string`\string#1\string' is not defined%
+ }\@ehc
+ }{%
+ \global\let\MR@gtemp#1%
+ \let#1\@undefined
+ \expandafter\let\expandafter\MR@temp
+ \csname\expandafter\@gobble\string#1 \endcsname
+ \DeclareRobustCommand#1{}%
+ \ifx#1\MR@gtemp
+ \endgroup
+ \PackageInfo{makerobust}{%
+ \string`\string#1\string' is already robust%
+ }%
+ \else
+ \@ifundefined{MR@temp}{%
+ \global\let\MR@gtemp#1%
+ \endgroup
+ \expandafter\let\csname\expandafter\@gobble\string#1 \endcsname#1%
+ \let#1\MR@gtemp
+ }{%
+ \endgroup
+ \PackageError{makerobust}{%
+ Internal macro \string`\string#1 \string' already exists%
+ }\@ehc
+ }%
+ \fi
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/makerobust}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/makerobust.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/makerobust.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[\CTAN{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 makerobust.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@{}}
+% makerobust.sty & tex/latex/oberdiek/makerobust.sty\\
+% makerobust.pdf & doc/latex/oberdiek/makerobust.pdf\\
+% makerobust-example.tex & doc/latex/oberdiek/makerobust-example.tex\\
+% makerobust.dtx & source/latex/oberdiek/makerobust.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk makerobust.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{makerobust.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 makerobust.dtx
+%makeindex -s gind.ist makerobust.idx
+%pdflatex makerobust.dtx
+%makeindex -s gind.ist makerobust.idx
+%pdflatex makerobust.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{makerobust.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='makerobust'>
+ <name>makerobust</name>
+ <caption>Making a macro robust.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ This package provides the command MakeRobustCommand
+ that converts an existing macro to a robust one.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/makerobust.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/makerobust.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2006/03/18 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/makerobust.pdf b/macros/latex/contrib/oberdiek/makerobust.pdf
new file mode 100644
index 0000000000..c78a449ac2
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/makerobust.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/mleftright.dtx b/macros/latex/contrib/oberdiek/mleftright.dtx
new file mode 100644
index 0000000000..46880ecb0e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/mleftright.dtx
@@ -0,0 +1,996 @@
+% \iffalse meta-comment
+%
+% File: mleftright.dtx
+% Version: 2016/05/16 v1.1
+% Info: Math left/right delim. as open/close
+%
+% Copyright (C) 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 mleftright.dtx
+% and the derived files
+% mleftright.sty, mleftright.pdf, mleftright.ins, mleftright.drv,
+% mleftright-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/mleftright.dtx
+% CTAN:macros/latex/contrib/oberdiek/mleftright.pdf
+%
+% Unpacking:
+% (a) If mleftright.ins is present:
+% tex mleftright.ins
+% (b) Without mleftright.ins:
+% tex mleftright.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{mleftright.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If mleftright.drv is present:
+% latex mleftright.drv
+% (b) Without mleftright.drv:
+% latex mleftright.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 mleftright.dtx
+% makeindex -s gind.ist mleftright.idx
+% pdflatex mleftright.dtx
+% makeindex -s gind.ist mleftright.idx
+% pdflatex mleftright.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/mleftright.sty
+% TDS:doc/latex/oberdiek/mleftright.pdf
+% TDS:doc/latex/oberdiek/test/mleftright-test1.tex
+% TDS:source/latex/oberdiek/mleftright.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: mleftright 2016/05/16 v1.1 Math left/right delim. as open/close (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: mleftright
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 mleftright.dtx
+and the derived files
+ mleftright.sty, mleftright.pdf, mleftright.ins, mleftright.drv,
+ mleftright-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{mleftright.ins}{\from{mleftright.dtx}{install}}%
+ \file{mleftright.drv}{\from{mleftright.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{mleftright.sty}{\from{mleftright.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{mleftright-test1.tex}{\from{mleftright.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{mleftright.xml}{\from{mleftright.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{* mleftright.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `mleftright.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{mleftright.drv}%
+ [2016/05/16 v1.1 Math left/right delim. as open/close (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{mleftright}[2016/05/16]
+\begin{document}
+ \DocInput{mleftright.dtx}%
+\end{document}
+%</driver>
+% \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{mleftright.drv}
+%
+% \title{The \xpackage{mleftright} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% \TeX\ sets subformulas by \cs{left} and \cs{right} as inner formulas
+% with additional surrounding spaces in some situations. This package
+% provides \cs{mleft} and \cs{mright} that call \cs{left} and \cs{right},
+% but the delimiters will act as normal \cs{mathopen} and \cs{mathclose}
+% delimiters without the additional space of an inner formula.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% The package is a result of a thread in the newsgroup \textsf{comp.text.tex}
+% with the subject \textit{spacing after \cs{right}\texttt{)}
+% and before \cs{left}\texttt{)}} \cite{dave}.
+% The problem: \cs{left} and \cs{right} adjust the size of the
+% delimiters automatically. However, \TeX\ treats the whole expression
+% as inner formula. In some circumstances \TeX\ adds extra space
+% before or after an inner formula.
+% Example:
+% \begin{quote}
+% \thinmuskip=1.5\thinmuskip
+% \begin{tabular}{@{}l@{\quad$\Rightarrow$\quad}l@{}}
+% |$\sin(x^2), x$|
+% & $\sin(x^2), x$\\
+% |$\sin\left(x^2\right), x$|
+% & $\sin\left(x^2\right), x$\\
+% ^^A \multicolumn{1}{@{}r@{\quad$\Rightarrow$\quad}}{^^A
+% ^^A \itshape with exaggerated spacing^^A
+% ^^A }
+% ^^A & $\thinmuskip=4\thinmuskip
+% ^^A \sin\left(x^2\right){,}\mskip.25\thinmuskip x$\\
+% |$\sin\mleft(x^2\mright), x$|
+% & $\sin\mleft(x^2\mright), x$\\
+% \end{tabular}\\*[.5ex]
+% (\cs{mleft} and \cs{mright} are provided by this package.)
+% \end{quote}
+%
+% In the newsgroup Donald Arseneau answered with clever macros \cite{arseneau}:
+% \begin{quote}
+%\begin{verbatim}
+%\newcommand\lft{\mathopen{}\left}
+%\newcommand\rgt{\aftergroup\mathclose\aftergroup{\aftergroup}\right}
+%\end{verbatim}
+% \end{quote}
+% However one problem remains, a following subscript or superscript
+% is not applied to the right delimiter but the empty
+% \cs{mathclose}.
+% Thus Philipp Stephani provided an improvement \cite{stephani}:
+%\begin{quote}
+%\begin{verbatim}
+%\mathopen{} \mathclose{\left\| A^2 \right\|}_2
+%\end{verbatim}
+%\end{quote}
+% Heiko Oberdiek converted this into macro form \cite{oberdiek}:
+%\begin{quote}
+%\begin{verbatim}
+%\newcommand\lft{\mathopen{}\mathclose\bgroup\left}
+%\newcommand\rgt{\aftergroup\egroup\right}
+%\end{verbatim}
+%\end{quote}
+%
+% The package uses longer macro names \cs{mleft} and \cs{mright}
+% to avoid name clashes. Also it adds some checks for error conditions.
+%
+% \subsection{Use}
+%
+% \begin{declcs}{mleft}\meta{delimL} \dots\unkern\ \cs{mright}\meta{delimR}
+% \end{declcs}
+% Macros \cs{mleft} and \cs{mright} are used in the same way as
+% \cs{left} and \cs{right}. Also \cs{middle} can be used inbetween if
+% \eTeX\ is present.
+%
+% \begin{declcs}{mleftright}
+% \end{declcs}
+% Macro \cs{mleftright} redefines \cs{left} as \cs{mleft} and
+% \cs{right} as \cs{mright}. The redefinition is local to the group.
+%
+% \begin{declcs}{mleftrightrestore}
+% \end{declcs}
+% Macro \cs{mleftright} restores \cs{left} and \cs{right} with
+% the original meaning if they were previously redefined by
+% \cs{mleftright} (also locally).
+%
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@mleftright.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{mleftright}{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@mleftright.sty\endcsname
+\ProvidesPackage{mleftright}%
+ [2016/05/16 v1.1 Math left/right delim. as open/close (HO)]%
+% \end{macrocode}
+%
+% \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 mleftright@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\mleftright@AtEnd{%
+ \mleftright@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\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{60}{12}% <
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\edef\mleftright@AtEnd{%
+ \mleftright@AtEnd
+ \escapechar\the\escapechar\relax
+ \noexpand\endinput
+}
+\escapechar=92 %
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+ \input ltxcmds.sty\relax
+\else
+ \RequirePackage{infwarerr}[2010/04/08]%
+ \RequirePackage{ltxcmds}[2010/04/26]%
+\fi
+% \end{macrocode}
+%
+% The original commands \cs{left} and \cs{right}
+% are saved and later used in \cs{mleft} and
+% \cs{mright} in order to deal with:
+% \begin{quote}
+%\begin{verbatim}
+%\let\left\mleft
+%\let\right\mright
+%\end{verbatim}
+% \end{quote}
+% \begin{macro}{\mleftright@OrgLeft}
+% \begin{macrocode}
+\let\mleftright@OrgLeft\left
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mleftright@OrgRight}
+% \begin{macrocode}
+\let\mleftright@OrgRight\right
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mleftright@Def}
+% Macro \cs{mleftright@Def} defines a macro as robust macro
+% if \eTeX\ or \LaTeX\ is available.
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\mleftright@Def{\def}%
+ }{%
+ \def\mleftright@Def{\DeclareRobustCommand*}%
+ }%
+}{%
+ \def\mleftright@Def{\protected\def}%
+}
+\edef\mleftright@Def#1{%
+ \noexpand\ltx@IfUndefined{%
+ \noexpand\expandafter\noexpand\ltx@gobble\noexpand\string#1%
+ }{%
+ \expandafter\noexpand\mleftright@Def#1%
+ }{%
+ \noexpand\@PackageError{mleftright}{%
+ Command \noexpand\string#1 already defined%
+ }\noexpand\@ehd
+ \noexpand\ltx@gobble
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% In case of \eTeX\ the group status after the left symbol
+% is saved and later checked at the beginning of \cs{mright}.
+% \begin{macrocode}
+\ltx@IfUndefined{currentgrouplevel}{%
+ \catcode38=14 % & = comment
+}{%
+ \catcode38=9 % & = ignore
+}
+% \end{macrocode}
+%
+% \begin{macro}{\mleftright@GroupLevel}
+% \begin{macrocode}
+& \def\mleftright@GroupLevel{-1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mleftright@WrongGroup}
+% \begin{macrocode}
+& \def\mleftright@WrongGroup#1(#2){%
+& \ifnum\mleftright@GroupLevel<\ltx@zero
+& \@PackageError{mleftright}{%
+& Missing previous \string\mleft
+& }\@ehc
+& \else
+& \@PackageError{mleftright}{%
+& Unexpected group status for \string\mright%
+& \ifnum\mleftright@GroupLevel=#1 %
+& \else
+& .\MessageBreak
+& Group level is #1, %
+& expected is \mleftright@GroupLevel
+& \fi
+& \ifnum16=#2 %
+& \else
+& .\MessageBreak
+& Group type is #2 (%
+& \ifcase#2 %
+& bottom level%
+& \expandafter\expandafter\expandafter\ltx@gobblefour
+& \expandafter\ltx@gobbletwo
+& \or simple%
+& \or hbox%
+& \or adjusted hbox%
+& \or vbox%
+& \or vtop%
+& \or align%
+& \or no align%
+& \or output%
+& \or math%
+& \or disc%
+& \or insert%
+& \or vcenter%
+& \or math choice%
+& \or semi simple%
+& \or math shift%
+& \or math left%
+& \else
+& unknown%
+& \fi
+& \space group),\MessageBreak
+& expected is 16 (math left group)%
+& \fi
+& }\@ehd
+& \fi
+& }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mleft}
+% \begin{macrocode}
+\mleftright@Def\mleft{%
+ \mathopen{}\mathclose\bgroup
+& \edef\mleftright@GroupLevel{\the\numexpr\the\currentgrouplevel+1}%
+ \mleftright@OrgLeft
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mright}
+% \begin{macrocode}
+\mleftright@Def\mright{%
+& \ifnum\mleftright@GroupLevel=\currentgrouplevel
+& \ifnum16=\currentgrouptype
+ \aftergroup\egroup
+& \else
+& \expandafter\mleftright@WrongGroup
+& \the\expandafter\currentgrouplevel
+& \expandafter(\the\currentgrouptype)%
+& \fi
+& \else
+& \expandafter\mleftright@WrongGroup
+& \the\expandafter\currentgrouplevel
+& \expandafter(\the\currentgrouptype)%
+& \fi
+ \mleftright@OrgRight
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mleftright}
+% \begin{macrocode}
+\mleftright@Def\mleftright{%
+ \let\left\mleft
+ \let\right\mright
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mleftrightrestore}
+% \begin{macrocode}
+\mleftright@Def\mleftrightrestore{%
+ \ifx\left\mleft
+ \let\left\mleftright@OrgLeft
+ \fi
+ \ifx\right\mright
+ \let\right\mleftright@OrgRight
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\mleftright@AtEnd%
+%</package>
+% \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 mleftright.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/mleftright}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/mleftright.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/mleftright.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[\CTAN{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 mleftright.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@{}}
+% mleftright.sty & tex/generic/oberdiek/mleftright.sty\\
+% mleftright.pdf & doc/latex/oberdiek/mleftright.pdf\\
+% test/mleftright-test1.tex & doc/latex/oberdiek/test/mleftright-test1.tex\\
+% mleftright.dtx & source/latex/oberdiek/mleftright.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk mleftright.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{mleftright.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 mleftright.dtx
+%makeindex -s gind.ist mleftright.idx
+%pdflatex mleftright.dtx
+%makeindex -s gind.ist mleftright.idx
+%pdflatex mleftright.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{mleftright.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='mleftright'>
+ <name>mleftright</name>
+ <caption>Variants of delimiters that act as maths open/close.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ The package defines variants <tt>\mleft</tt> and <tt>\mright</tt>
+ of <tt>\left</tt> and <tt>\right</tt>, that make the delimiters
+ act as <tt>\mathopen</tt> and <tt>\mathclose</tt>. These commands
+ address spacing difficulties in subformulas.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/mleftright.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/mleftright.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \section{Acknowledgement}
+%
+% \begin{description}
+% \item[Donald Arsenau:]
+% He provided the main trick and the first macros.
+% \item[Philipp Stephani:]
+% He solved the subscript problem.
+% \end{description}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+% \bibitem{dave}
+% Dave94705,
+% \textit{spacing after \cs{right}\texttt{)} and before \cs{left}\texttt{)}},
+% newsgroup comp.text.tex,
+% Message-ID: \texttt{\small 5d264909-7c3d-4c9d-9b22-434178b2bf90@g21g2000prn.googlegroups.com},
+% 2010-08-12.
+% \newblock
+% {\small\url{http://groups.google.com/group/comp.text.tex/msg/e5b6833da7dc29bf}}
+%
+% \bibitem{arseneau}
+% Donald Arseneau,
+% \textit{Re: spacing after \cs{right}\texttt) and before \cs{left}\texttt)},
+% newsgroup comp.text.tex,
+% Message-ID: \texttt{\small yfivd6svl8y.fsf@mutant.triumf.ca},
+% 2010-08-30.
+% \newblock
+% {\small\url{http://groups.google.com/group/comp.text.tex/msg/e0b2e4386e5d04e4}}
+%
+% \bibitem{stephani}
+% Philipp Stephani,
+% \textit{Re: spacing after \cs{right}\texttt) and before \cs{left}\texttt)},
+% newsgroup comp.text.tex,
+% Message-ID: \texttt{\small 4c8c8c1e\$0\$6981\$9b4e6d93@newsspool4.arcor-online.net},
+% 2010-09-12.
+% \newblock
+% {\small\url{http://groups.google.com/group/comp.text.tex/msg/87ac1f61321de3ef}}
+%
+% \bibitem{oberdiek}
+% Heiko Oberdiek,
+% \textit{Re: spacing after \cs{right}\texttt) and before \cs{left}\texttt)},
+% newsgroup comp.text.tex,
+% Message-ID: \texttt{\small i6jcc2\$8of\$1@news.eternal-september.org},
+% 2010-09-12.
+% \newblock
+% {\small\url{http://groups.google.com/group/comp.text.tex/msg/257aa6119bef878b}}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2010/09/25 v1.0}
+% \item
+% The first version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/mleftright.pdf b/macros/latex/contrib/oberdiek/mleftright.pdf
new file mode 100644
index 0000000000..a6d21046e7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/mleftright.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/oberdiek.pdf b/macros/latex/contrib/oberdiek/oberdiek.pdf
new file mode 100644
index 0000000000..5831c69462
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/oberdiek.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/oberdiek.tex b/macros/latex/contrib/oberdiek/oberdiek.tex
new file mode 100644
index 0000000000..f8e9fc10f9
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/oberdiek.tex
@@ -0,0 +1,1345 @@
+\NeedsTeXFormat{LaTeX2e}
+
+\newcommand*{\Title}{Overview}
+\newcommand*{\CTANdir}{macros/latex/contrib/oberdiek/}
+\newcommand*{\CTANroot}{http://mirror.ctan.org/}
+\newcommand*{\Subject}{CTAN:\CTANdir}
+\newcommand*{\Author}{Heiko Oberdiek}
+\newcommand*{\Email}{ho-tex at tug.org}
+\newcommand*{\Date}{2019/07/27}
+
+% Copyright (C) 2006-2019 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+%
+% 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 Heiko Oberdiek.
+%
+% This work consists of the overview "oberdiek.pdf", its source
+% "oberdiek.tex", and the installation script "oberdiek.ins"
+% for the projects in CTAN:macros/latex/contrib/oberdiek/.
+%
+\documentclass[a4paper,12pt]{article}
+
+\usepackage{ifluatex}
+\ifluatex
+ \usepackage{fontspec}[2011/09/18]%
+ \usepackage{unicode-math}[2011/09/19]%
+ \setmathfont{latinmodern-math.otf}%
+\fi
+
+\usepackage[
+ ignorehead,
+ top=1in,
+]{geometry}
+\usepackage{longtable}
+\usepackage{color}
+\usepackage[ngerman,english]{babel}
+\usepackage{hologo}
+\usepackage{biblatex}% for internals in .toc files
+
+\definecolor{link}{rgb}{1,0,0}% red
+\definecolor{file}{rgb}{0,0,1}% blue
+\definecolor{url}{cmyk}{0.1,1,0,0.1}
+
+\definecolor{file}{rgb}{1,0,0}% red
+\definecolor{url}{rgb}{0,0,1}% blue
+\definecolor{link}{rgb}{0,0.75,0}%
+
+\usepackage[
+ colorlinks,
+]{hyperref}[2006/02/12]
+\hypersetup{
+ pdftitle={CTAN:\CTANdir},
+ pdfsubject={Package Overview},
+ pdfauthor={\Author\ <\Email>},
+ bookmarksnumbered,
+ bookmarksopen,
+ bookmarksopenlevel=2,
+ bookmarksdepth=2,
+ filecolor=file,
+ urlcolor=url,
+ linkcolor=link,
+}
+\usepackage{bookmark}
+\usepackage{hypdestopt}
+\setcounter{tocdepth}{1}
+\setcounter{secnumdepth}{1}
+
+\title{%
+ \href{\CTANroot\CTANdir}{CTAN:\CTANdir}%
+}
+\author{%
+ \Author\\
+ \textless
+ \href{mailto:\Email}{\texttt{\Email}}%
+ \textgreater
+}
+\date{\Date}
+
+\providecommand*{\pdfTeX}{pdf\TeX}
+\providecommand*{\plainTeX}{\mbox{plain-\TeX}}
+\providecommand*{\iniTeX}{\mbox{ini-\TeX}}
+\providecommand*{\VTeX}{V\TeX}
+\providecommand*{\eTeX}{$\csname m@th\endcsname\varepsilon$-\TeX}
+\providecommand*{\LuaTeX}{%
+ L\textsc{ua}\TeX
+}
+\newcommand*{\xpackage}[1]{\textsf{#1}}
+\newcommand*{\xmodule}[1]{\textsf{#1}}
+\newcommand*{\xfile}[1]{\texttt{#1}}
+\newcommand*{\xext}[1]{\texttt{.#1}}
+\newcommand*{\xoption}[1]{\textsf{#1}}
+\newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
+\newcommand*{\meta}[1]{%
+ \ensuremath\langle
+ \textit{#1}%
+ \ensuremath\rangle
+}
+
+\makeatletter
+\g@addto@macro\abstract{\noindent\ignorespaces}
+
+\newcommand*{\tocinclude}[1]{%
+ \setcounter{tocdepth}{3}%
+ \begingroup
+ \makeatletter
+ \def\@prj{#1}%
+ \let\contentsline\foreign@contentsline
+ \input{\@prj.toc}%
+ \endgroup
+}
+\def\foreign@contentsline#1#2#3#4{%
+ \ifx\\#4\\%
+ \csname l@#1\endcsname{#2}{#3}%
+ \else
+ \ifHy@linktocpage
+ \csname l@#1\endcsname{{#2}}{%
+ \hyper@linkfile{#3}{\@prj.pdf}{#4}%
+ }%
+ \else
+ \csname l@#1\endcsname{%
+ \hyper@linkfile{#2}{\@prj.pdf}{#4}%
+ }{#3}%
+ \fi
+ \fi
+}%
+
+\newenvironment{overview}{%
+ \setlength{\tabcolsep}{0.8\tabcolsep}%
+ \setlength{\LTleft}{0pt}%
+ \longtable{@{}llll@{}}
+}{%
+ \endlongtable
+}
+\newcommand*{\entry}[4]{%
+ \href{file:#1.pdf}{%
+ \bfseries\xpackage{#1}%
+ }%
+ & #2%
+ & v#3%
+ & \href{\CTANroot\CTANdir #1.pdf}{[pdf]} %
+ \href{\CTANroot\CTANdir #1.dtx}{[dtx]}
+ \\*%
+ \hyperref[{#1}]{\small (contents)}%
+ &
+ \multicolumn{2}{l}{%
+ #4%
+ }%
+ \\%
+}
+\newcommand*{\entrysep}{1.5ex}
+
+\newcommand*{\pkgsectformat}[1]{%
+ \texorpdfstring{%
+ \textcolor{link}{The} %
+ \xpackage{#1} %
+ \textcolor{link}{package}%
+ }{#1}%
+}
+
+\makeatother
+
+\begin{document}
+\maketitle
+
+\section{Overview}
+\begin{overview}
+\entry{accsupp}{2010/01/16}{0.3}{Accessibility support by marked content}%
+[\entrysep]
+\entry{aliascnt}{2009/09/08}{1.3}{Alias counters}%
+[\entrysep]
+\entry{alphalph}{2011/05/13}{2.4}{Convert numbers to letters}%
+[\entrysep]
+\entry{askinclude}{2011/12/02}{2.2}{Interactive asking of included files}%
+[\entrysep]
+\entry{atbegshi}{2011/10/05}{1.16}{At begin shipout hook}%
+[\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}%
+[\entrysep]
+\entry{bigintcalc}{2012/04/08}{1.3}{Expandable calculations on big integers}%
+[\entrysep]
+\entry{bitset}{2011/01/30}{1.1}{Handle bit-vector datatype}%
+[\entrysep]
+\entry{bmpsize}{2009/09/04}{1.6}{Extract size/resolution from bitmap files}%
+[\entrysep]
+\entry{bookmark}{2011/12/02}{1.24}{PDF bookmarks}%
+[\entrysep]
+\entry{catchfile}{2011/03/01}{1.6}{Catch the contents of a file}%
+[\entrysep]
+\entry{centernot}{2011/07/11}{1.3}{Centers the not symbol horizontally}%
+[\entrysep]
+\entry{chemarr}{2006/02/20}{1.2}{Arrows for chemical reactions}%
+[\entrysep]
+\entry{classlist}{2011/10/17}{1.4}{Record classes used in a document}%
+[\entrysep]
+\entry{colonequals}{2006/08/01}{1.0}{Colon equals symbols}%
+[\entrysep]
+\entry{dvipscol}{2008/08/11}{1.2}{Alter the usage of the dvips color stack}%
+[\entrysep]
+\entry{embedfile}{2011/04/13}{2.6}{Embed files into PDF}%
+[\entrysep]
+\entry{engord}{2010/03/01}{1.8}{Provides English ordinal numbers}%
+[\entrysep]
+\entry{enparen}{2012/01/07}{1.0}{Parentheses nesting}%
+[\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}%
+[\entrysep]
+\entry{flags}{2007/09/30}{0.4}{Setting/clearing of flags in bit fields}%
+[\entrysep]
+\entry{gettitlestring}{2010/12/03}{1.4}{Cleanup title references}%
+[\entrysep]
+\entry{grfext}{2010/08/19}{1.1}{Manage graphics extensions}%
+[\entrysep]
+\entry{grffile}{2012/04/05}{1.16}{Extended file name support for graphics}%
+[\entrysep]
+\entry{hobsub}{2012/04/25}{1.12}{Construct package bundles}%
+[\entrysep]
+\entry{hologo}{2012/04/26}{1.10}{A logo collection with bookmark support}%
+[\entrysep]
+\entry{holtxdoc}{2012/03/21}{0.24}{Private additional ltxdoc support}%
+[\entrysep]
+\entry{hopatch}{2011/06/24}{1.1}{Wrapper for package hooks}%
+[\entrysep]
+\entry{hycolor}{2011/01/30}{1.7}{Color options for hyperref/bookmark}%
+[\entrysep]
+\entry{hypbmsec}{2007/04/11}{2.4}{Bookmarks in sectioning commands}%
+[\entrysep]
+\entry{hypcap}{2011/02/16}{1.11}{Adjusting the anchors of captions}%
+[\entrysep]
+\entry{hypdestopt}{2011/05/13}{2.3}{Hyperref destination optimizer}%
+[\entrysep]
+\entry{hypdoc}{2011/08/19}{1.11}{Hyper extensions for doc.sty}%
+[\entrysep]
+\entry{hypgotoe}{2007/10/30}{0.1}{Links to embedded files}%
+[\entrysep]
+\entry{hyphsubst}{2008/06/09}{0.2}{Substitute hyphenation patterns}%
+[\entrysep]
+\entry{ifdraft}{2008/08/11}{1.3}{Detect class options draft and final}%
+[\entrysep]
+\entry{iflang}{2007/11/11}{1.5}{Checks for the current language}%
+[\entrysep]
+\entry{ifluatex}{2010/03/01}{1.3}{Provides the ifluatex switch}%
+[\entrysep]
+\entry{ifpdf}{2011/01/30}{2.3}{Provides the ifpdf switch}%
+[\entrysep]
+\entry{ifvtex}{2010/03/01}{1.5}{Detect \hologo{VTeX} and its facilities}%
+[\entrysep]
+\entry{infwarerr}{2010/04/08}{1.3}{Providing info/warning/error messages}%
+[\entrysep]
+\entry{inputenx}{2011/05/27}{1.10}{Enhanced input encoding handling}%
+[\entrysep]
+\entry{intcalc}{2007/09/27}{1.1}{Expandable calculations with integers}%
+[\entrysep]
+\entry{kvdefinekeys}{2011/04/07}{1.3}{Define keys}%
+[\entrysep]
+\entry{kvoptions}{2011/06/30}{3.11}{Key value format for package options}%
+[\entrysep]
+\entry{kvsetkeys}{2012/04/25}{1.16}{Key value parser}%
+[\entrysep]
+\entry{letltxmacro}{2010/09/02}{1.4}{Let assignment for \hologo{LaTeX} macros}%
+[\entrysep]
+\entry{listingsutf8}{2011/11/10}{1.2}{Allow UTF-8 in listings input}%
+[\entrysep]
+\entry{ltxcmds}{2011/11/09}{1.22}{\hologo{LaTeX} kernel commands for general use}%
+[\entrysep]
+\entry{luacolor}{2019/07/25}{1.12}{Color support via \hologo{LuaTeX}'s attributes}%
+[\entrysep]
+\entry{luatex}{2019/07/25}{0.7}{\hologo{LuaTeX} basic definition package}%
+[\entrysep]
+\entry{magicnum}{2019/07/25}{1.6}{Magic numbers}%
+[\entrysep]
+\entry{makerobust}{2006/03/18}{1.0}{Make existing macro robust}%
+[\entrysep]
+\entry{mleftright}{2010/09/25}{1.0}{Math left/right delim.\@ as open/close}%
+[\entrysep]
+\entry{pagegrid}{2009/12/04}{1.4}{Print page grid in background}%
+[\entrysep]
+\entry{pagesel}{2008/08/11}{1.8}{Select pages of a document for output}%
+[\entrysep]
+\entry{pdfcol}{2007/12/12}{1.2}{Handle new color stacks for \hologo{pdfTeX}}%
+[\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}%
+[\entrysep]
+\entry{pdfcrypt}{2007/04/26}{1.0}{Allows the setting of PDF encryption}%
+[\entrysep]
+\entry{pdfescape}{2011/11/25}{1.13}{Implements \hologo{pdfTeX}'s escape features}%
+[\entrysep]
+\entry{pdflscape}{2008/08/11}{0.10}{Display of landscape pages in PDF}%
+[\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}%
+[\entrysep]
+\entry{protecteddef}{2011/01/31}{1.0}{Define protected commands}%
+[\entrysep]
+\entry{refcount}{2011/10/16}{3.4}{Data extraction from label references}%
+[\entrysep]
+\entry{rerunfilecheck}{2011/04/15}{1.7}{Rerun checks for auxiliary files}%
+[\entrysep]
+\entry{resizegather}{2010/03/01}{1.2}{Resize overly large equations}%
+[\entrysep]
+\entry{rotchiffre}{2010/11/12}{1.0}{Perform simple rotation ciphers}%
+[\entrysep]
+\entry{scrindex}{2008/08/11}{1.1}{Package index with \hologo{KOMAScript} classes}%
+[\entrysep]
+\entry{selinput}{2007/09/09}{1.2}{Semi-automatic input encoding detection}%
+[\entrysep]
+\entry{setouterhbox}{2007/09/09}{1.7}{Set hbox in outer horizontal mode}%
+[\entrysep]
+\entry{settobox}{2008/08/11}{1.4}{Assign box dimensions to length registers}%
+[\entrysep]
+\entry{soulutf8}{2007/09/09}{1.0}{Permit use of UTF-8 characters in soul}%
+[\entrysep]
+\entry{stackrel}{2007/11/11}{1.2}{Adding subscript option to stackrel}%
+[\entrysep]
+\entry{stampinclude}{2008/07/14}{1.0}{Include files based on time stamps}%
+[\entrysep]
+\entry{stringenc}{2011/12/02}{1.10}{Convert strings between diff.\@ encodings}%
+[\entrysep]
+\entry{tabularht}{2007/04/11}{2.5}{Tabular with height specified}%
+[\entrysep]
+\entry{tabularkv}{2006/02/20}{1.1}{Tabular with key value interface}%
+[\entrysep]
+\entry{telprint}{2008/08/11}{1.10}{Format German phone numbers}%
+[\entrysep]
+\entry{thepdfnumber}{2011/11/24}{1.0}{Print PDF numbers with minimal digits}%
+[\entrysep]
+\entry{transparent}{2007/01/08}{1.0}{Transparency via \hologo{pdfTeX}'s color stack}%
+[\entrysep]
+\entry{twoopt}{2008/08/11}{1.5}{Definitions with two optional arguments}%
+[\entrysep]
+\entry{uniquecounter}{2011/01/30}{1.2}{Provide unlimited unique counter}%
+[\entrysep]
+\entry{zref}{2012/04/04}{2.24}{A new reference scheme for \hologo{LaTeX}}%
+\end{overview}
+
+\section{Packages}
+\hypersetup{bookmarksnumbered=false}
+
+\subsection{\pkgsectformat{accsupp}}
+\label{accsupp}
+\begin{abstract}
+Since PDF 1.5 portions of a page can be marked for better
+accessibility support.
+For example, replacement texts or expansions of abbreviations can be
+provided. Package \xpackage{accsupp} starts with providing a minimal
+low-level interface for programmers. Status is experimental.
+\end{abstract}
+\tocinclude{accsupp}
+
+\newpage
+\subsection{\pkgsectformat{aliascnt}}
+\label{aliascnt}
+\begin{abstract}
+Package \xpackage{aliascnt} introduces \emph{alias counters} that
+share the same counter register and clear list.
+\end{abstract}
+\tocinclude{aliascnt}
+
+\newpage
+\subsection{\pkgsectformat{alphalph}}
+\label{alphalph}
+\begin{abstract}
+The package provides methods to represent numbers with a limited
+set of symbols. Both \hologo{LaTeX} and \hologo{plainTeX} are supported.
+\end{abstract}
+\tocinclude{alphalph}
+
+\newpage
+\subsection{\pkgsectformat{askinclude}}
+\label{askinclude}
+\begin{abstract}
+This package replaces \cs{includeonly} by an interactive user
+interface.
+\end{abstract}
+\tocinclude{askinclude}
+
+\newpage
+\subsection{\pkgsectformat{atbegshi}}
+\label{atbegshi}
+\begin{abstract}
+This package is a modern reimplementation of package \xpackage{everyshi}
+without the burden of compatibility. It makes use of \eTeX's if available.
+Both \LaTeX\ and \plainTeX\ are supported.
+\end{abstract}
+\tocinclude{atbegshi}
+
+\newpage
+\subsection{\pkgsectformat{atenddvi}}
+\label{atenddvi}
+\begin{abstract}
+\LaTeX\ offers \cs{AtBeginDvi}. This package \xpackage{atenddvi}
+provides the counterpart \cs{AtEndDvi}. The execution of its
+argument is delayed to the end of the document at the end of the
+last page. Thus \cs{special} and \cs{write} remain effective, because
+they are put into the last page. This is the main difference
+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}
+\begin{abstract}
+This \LaTeX\ package provides two hooks for \verb|\end{document}|
+that are executed after the hook of \cs{AtEndDocument}.
+\cs{AfterLastShipout} can be used for code that is to be executed
+right after the last \cs{clearpage} before the \xext{aux} file
+is closed. \cs{AtVeryEndDocument} is used for code after closing
+and final reading of the \xext{aux} file.
+\end{abstract}
+\tocinclude{atveryend}
+
+\newpage
+\subsection{\pkgsectformat{auxhook}}
+\label{auxhook}
+\begin{abstract}
+Package \xpackage{auxhook} provides hooks for adding stuff at
+the begin of \xfile{.aux} files.
+\end{abstract}
+\tocinclude{auxhook}
+
+\newpage
+\subsection{\pkgsectformat{bigintcalc}}
+\label{bigintcalc}
+\begin{abstract}
+This package provides expandable arithmetic operations
+with big integers that can exceed \TeX's number limits.
+\end{abstract}
+\tocinclude{bigintcalc}
+
+\newpage
+\subsection{\pkgsectformat{bitset}}
+\label{bitset}
+\begin{abstract}
+This package defines and implements the data type bit set,
+a vector of bits. The size of the vector may grow dynamically.
+Individual bits can be manipulated.
+\end{abstract}
+\tocinclude{bitset}
+
+\newpage
+\subsection{\pkgsectformat{bmpsize}}
+\label{bmpsize}
+\begin{abstract}
+Package \xpackage{bmpsize} analyzes bitmap images to extract
+size and resolution data. It adds this feature to the graphics package
+that now do not need separate bounding box files for bitmap images.
+Additionally the implementation for the inclusion of bitmap images
+in some drivers of package \xpackage{graphicx} are rewritten to support
+options \xoption{viewport}, \xoption{trim} and \xoption{clip}.
+\end{abstract}
+\tocinclude{bmpsize}
+
+\newpage
+\subsection{\pkgsectformat{bookmark}}
+\label{bookmark}
+\begin{abstract}
+This package implements a new bookmark (outline) organization for
+package \xpackage{hyperref}. Bookmark properties such
+as style and color can now be set. Other action types
+are available (URI, GoToR, Named). The bookmarks are
+generated in the first compile run. Package \xpackage{hyperref}
+uses two runs.
+\end{abstract}
+\tocinclude{bookmark}
+
+\newpage
+\subsection{\pkgsectformat{catchfile}}
+\label{catchfile}
+\begin{abstract}
+This package catches the contents of a file and puts it in a macro.
+It requires \eTeX. Both \LaTeX\ and \plainTeX\ are supported.
+\end{abstract}
+\tocinclude{catchfile}
+
+\newpage
+\subsection{\pkgsectformat{centernot}}
+\label{centernot}
+\begin{abstract}
+This package provides \cs{centernot} that prints the symbol
+\cs{not} on the following argument. Unlike \cs{not} the symbol
+is horizontally centered.
+\end{abstract}
+\tocinclude{centernot}
+
+\newpage
+\subsection{\pkgsectformat{chemarr}}
+\label{chemarr}
+\begin{abstract}
+Very often chemists need a longer version
+of reaction arrows (\cs{rightleftharpoons}) with
+the possibility to put text above and below.
+Analogous to \xpackage{amsmath}'s \cs{xrightarrow} and
+\cs{xleftarrow} this package provides the macro
+\cs{xrightleftharpoons}.
+\end{abstract}
+\tocinclude{chemarr}
+
+\newpage
+\subsection{\pkgsectformat{classlist}}
+\label{classlist}
+\begin{abstract}
+This package records the loaded classes and stores
+them in a list.
+\end{abstract}
+\tocinclude{classlist}
+
+\newpage
+\subsection{\pkgsectformat{colonequals}}
+\label{colonequals}
+\begin{abstract}
+Package \xpackage{colonequals} defines poor man's symbols
+for math relation symbols such as ``colon equals''.
+The colon is centered around the horizontal math axis.
+\end{abstract}
+\tocinclude{colonequals}
+
+\newpage
+\subsection{\pkgsectformat{dvipscol}}
+\label{dvipscol}
+\begin{abstract}
+Color support for dvips in \xfile{dvips.def} involves the
+color stack of dvips. The package tries to remove unnecessary
+uses of the stack to avoid the error ``out of coor stack space''.
+\end{abstract}
+\tocinclude{dvipscol}
+
+\newpage
+\subsection{\pkgsectformat{embedfile}}
+\label{embedfile}
+\begin{abstract}
+This package embeds files to a PDF document.
+Currently the only supported driver is \pdfTeX\ $>=$ 1.30 in PDF mode.
+\end{abstract}
+\tocinclude{embedfile}
+
+\newpage
+\subsection{\pkgsectformat{engord}}
+\label{engord}
+\begin{abstract}
+The package generates the suffix of English ordinal numbers.
+It can be used with plain and \LaTeX\ formats.
+\end{abstract}
+\tocinclude{engord}
+
+\newpage
+\subsection{\pkgsectformat{enparen}}
+\label{enparen}
+\begin{abstract}
+The package defines macros to set parentheses that automatically
+change the symbols from inner to outer fences.
+\end{abstract}
+\tocinclude{enparen}
+
+\newpage
+\subsection{\pkgsectformat{eolgrab}}
+\label{eolgrab}
+\begin{abstract}
+This package implements a generic argument grabber
+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}
+\begin{abstract}
+New primitive commands are introduced in \eTeX. Sometimes the
+names collide with existing macros. This package solves this
+name clashes by adding a prefix to \eTeX's commands. For example,
+\eTeX's \cs{unexpanded} is provided as \cs{etex@unexpanded}.
+\end{abstract}
+\tocinclude{etexcmds}
+
+\newpage
+\subsection{\pkgsectformat{fibnum}}
+\label{fibnum}
+\begin{abstract}
+The package \xpackage{fibnum} provides expandable fibonacci
+numbers for both \hologo{LaTeX} and \hologo{plainTeX}.
+\end{abstract}
+\tocinclude{fibnum}
+
+\newpage
+\subsection{\pkgsectformat{flags}}
+\label{flags}
+\begin{abstract}
+Package \xpackage{flags} allows the setting and clearing
+of flags in bit fields and converts the bit field into a
+decimal number. Currently the bit field is limited to 31 bits.
+\end{abstract}
+\tocinclude{flags}
+
+\newpage
+\subsection{\pkgsectformat{gettitlestring}}
+\label{gettitlestring}
+\begin{abstract}
+The \LaTeX\ package addresses packages that are dealing with
+references to titles (\cs{section}, \cs{caption}, \dots).
+The package tries to remove \cs{label} and other
+commands from title strings.
+\end{abstract}
+\tocinclude{gettitlestring}
+
+\newpage
+\subsection{\pkgsectformat{grfext}}
+\label{grfext}
+\begin{abstract}
+This package provides macros for adding and reordering
+graphics extensions of package \xpackage{graphics}.
+\end{abstract}
+\tocinclude{grfext}
+
+\newpage
+\subsection{\pkgsectformat{grffile}}
+\label{grffile}
+\begin{abstract}
+The package extends the file name processing of package \xpackage{graphics}
+to support a larger range of file names. For example, the file name
+may contain several dots. Or in case of \pdfTeX\ in PDF mode the file name may
+contain spaces.
+\end{abstract}
+\tocinclude{grffile}
+
+\newpage
+\subsection{\pkgsectformat{hobsub}}
+\label{hobsub}
+\begin{abstract}
+Package \xpackage{hobsub} implements the idea of loading
+several packages in one big collection package.
+\end{abstract}
+\tocinclude{hobsub}
+
+\newpage
+\subsection{\pkgsectformat{hologo}}
+\label{hologo}
+\begin{abstract}
+This package starts a collection of logos with support for bookmarks
+strings.
+\end{abstract}
+\tocinclude{hologo}
+
+\newpage
+\subsection{\pkgsectformat{holtxdoc}}
+\label{holtxdoc}
+\begin{abstract}
+The package is used for the documentation of my packages in
+DTX format. It contains some private macros and setup for
+my needs. Thus do not use it. I have separated the part
+that may be useful for others in package \xpackage{hypdoc}.
+\end{abstract}
+\tocinclude{holtxdoc}
+
+\newpage
+\subsection{\pkgsectformat{hopatch}}
+\label{hopatch}
+\begin{abstract}
+This packages provides a wrapper to various package hooks
+provided by other packages or classes, but does not define
+own hooks.
+\end{abstract}
+\tocinclude{hopatch}
+
+\newpage
+\subsection{\pkgsectformat{hycolor}}
+\label{hycolor}
+\begin{abstract}
+Package \xpackage{hycolor} implements the color option stuff that
+is used by packages \xpackage{hyperref} and \xpackage{bookmark}.
+It is not intended as package for the user.
+\end{abstract}
+\tocinclude{hycolor}
+
+\newpage
+\subsection{\pkgsectformat{hypbmsec}}
+\label{hypbmsec}
+\begin{abstract}
+This package expands the syntax of the sectioning commands. If the
+argument of the sectioning commands isn't usable as outline entry,
+a replacement for the bookmarks can be given.
+\end{abstract}
+\tocinclude{hypbmsec}
+
+\newpage
+\subsection{\pkgsectformat{hypcap}}
+\label{hypcap}
+\begin{abstract}
+This package tries a solution of the problem with
+hyperref, that links to floats points below the
+caption and not at the beginning of the float.
+Therefore this package divides the task into two
+part, the link setting with \cs{capstart} or
+automatically at the beginning of a float and
+the rest in the \cs{caption} command.
+\end{abstract}
+\tocinclude{hypcap}
+
+\newpage
+\subsection{\pkgsectformat{hypdestopt}}
+\label{hypdestopt}
+\begin{abstract}
+Package \xpackage{hypdestopt} supports \xpackage{hyperref}'s
+\xoption{pdftex} driver. It removes unnecessary destinations
+and shortens the destination names or uses numbered destinations
+to get smaller PDF files.
+\end{abstract}
+\tocinclude{hypdestopt}
+
+\newpage
+\subsection{\pkgsectformat{hypdoc}}
+\label{hypdoc}
+\begin{abstract}
+This package adds hyper features to the package
+\xpackage{doc} that is used in the documentation
+system of \LaTeXe. Bookmarks are added and references
+are linked as far as possible.
+\end{abstract}
+\tocinclude{hypdoc}
+
+\newpage
+\subsection{\pkgsectformat{hypgotoe}}
+\label{hypgotoe}
+\begin{abstract}
+Experimental package for links to embedded files.
+\end{abstract}
+\tocinclude{hypgotoe}
+
+\newpage
+\subsection{\pkgsectformat{hyphsubst}}
+\label{hyphsubst}
+\begin{abstract}
+A \TeX\ format file may include alternative hyphenation patterns
+for a language with a different name. If the naming convention
+follows \xpackage{babel's} rules, then the hyphenation patterns
+for a language can be replaced by the alternative hyphenation patterns,
+provided in the format file.
+\end{abstract}
+\tocinclude{hyphsubst}
+
+\newpage
+\subsection{\pkgsectformat{ifdraft}}
+\label{ifdraft}
+\begin{abstract}
+The package provides an interface for selecting code depending
+on the options \xoption{draft} and \xoption{final}.
+\end{abstract}
+\tocinclude{ifdraft}
+
+\newpage
+\subsection{\pkgsectformat{iflang}}
+\label{iflang}
+\begin{abstract}
+This package provides expandible checks for the current language
+based on macro \cs{languagename} or hyphenation patterns.
+\end{abstract}
+\tocinclude{iflang}
+
+\newpage
+\subsection{\pkgsectformat{ifluatex}}
+\label{ifluatex}
+\begin{abstract}
+This package looks for \LuaTeX\ regardless of its mode
+and provides the switch \cs{ifluatex}. Also it makes
+\cs{luatexversion} available if it is not present.
+It works with \plainTeX\ or \LaTeX.
+\end{abstract}
+\tocinclude{ifluatex}
+
+\newpage
+\subsection{\pkgsectformat{ifpdf}}
+\label{ifpdf}
+\begin{abstract}
+This package looks for \pdfTeX\ in pdf mode and
+implements and sets the switch \cs{ifpdf}.
+The detection is based on \cs{pdfoutput} and
+the package will not change this value.
+It works with plain or \LaTeX\ formats.
+\end{abstract}
+\tocinclude{ifpdf}
+
+\newpage
+\subsection{\pkgsectformat{ifvtex}}
+\label{ifvtex}
+\begin{abstract}
+This package looks for \VTeX, implements
+and sets the switches \cs{ifvtex}, \cs{ifvtex}\texttt{\meta{mode}},
+\cs{ifvtexgex}. It works with plain or \LaTeX\ formats.
+\end{abstract}
+\tocinclude{ifvtex}
+
+\newpage
+\subsection{\pkgsectformat{infwarerr}}
+\label{infwarerr}
+\begin{abstract}
+This package provides a complete set of macros for informations,
+warnings and error messages with support for \plainTeX.
+\end{abstract}
+\tocinclude{infwarerr}
+
+\newpage
+\subsection{\pkgsectformat{inputenx}}
+\label{inputenx}
+\begin{abstract}
+This package provides input encodings using
+standard mappings and covers nearly all slots. Thus it
+serves as more uptodate replacement for package \xpackage{inputenc}.
+\end{abstract}
+\tocinclude{inputenx}
+
+\newpage
+\subsection{\pkgsectformat{intcalc}}
+\label{intcalc}
+\begin{abstract}
+This package provides expandable arithmetic operations
+with integers.
+\end{abstract}
+\tocinclude{intcalc}
+
+\newpage
+\subsection{\pkgsectformat{kvdefinekeys}}
+\label{kvdefinekeys}
+\begin{abstract}
+Package \xpackage{kvdefinekeys} provides \cs{kv@define@key} to define
+keys the same way as \xpackage{keyval}'s \cs{define@key}. However, it
+works also using \iniTeX.
+\end{abstract}
+\tocinclude{kvdefinekeys}
+
+\newpage
+\subsection{\pkgsectformat{kvoptions}}
+\label{kvoptions}
+\begin{abstract}
+This package is intended for package authors who want to
+use options in key value format for their package options.
+\end{abstract}
+\tocinclude{kvoptions}
+
+\newpage
+\subsection{\pkgsectformat{kvsetkeys}}
+\label{kvsetkeys}
+\begin{abstract}
+Package \xpackage{kvsetkeys} provides \cs{kvsetkeys}, a variant
+of package \xpackage{keyval}'s \cs{setkeys}. It allows to specify
+a handler that deals with unknown options. Active commas and equal
+signs may be used (e.g. see \xpackage{babel}'s shorthands) and
+only one level of curly braces is removed from the values.
+\end{abstract}
+\tocinclude{kvsetkeys}
+
+\newpage
+\subsection{\pkgsectformat{letltxmacro}}
+\label{letltxmacro}
+\begin{abstract}
+\TeX's \cs{let} assignment does not work for \LaTeX\ macros
+with optional arguments or for macros that are defined
+as robust macros by \cs{DeclareRobustCommand}. This package
+defines \cs{LetLtxMacro} that also takes care of the involved
+internal macros.
+\end{abstract}
+\tocinclude{letltxmacro}
+
+\newpage
+\subsection{\pkgsectformat{listingsutf8}}
+\label{listingsutf8}
+\begin{abstract}
+Package \xpackage{listings} does not support files with multi-byte
+encodings such as UTF-8. In case of \cs{lstinputlisting} a simple
+workaround is possible if an one-byte encoding exists that the file
+can be converted to. Also \eTeX\ and \pdfTeX\ regardless of its mode
+are required.
+\end{abstract}
+\tocinclude{listingsutf8}
+
+\newpage
+\subsection{\pkgsectformat{ltxcmds}}
+\label{ltxcmds}
+\begin{abstract}
+The package \xpackage{ltxcmds} exports some utility macros
+from the \LaTeX\ kernel into a separate namespace and
+also provides them for other formats such as plain-\TeX.
+\end{abstract}
+\tocinclude{ltxcmds}
+
+\newpage
+\subsection{\pkgsectformat{luacolor}}
+\label{luacolor}
+\begin{abstract}
+Package \xpackage{luacolor} implements color support based
+on \LuaTeX's node attributes.
+\end{abstract}
+\tocinclude{luacolor}
+
+\newpage
+\subsection{\pkgsectformat{luatex}}
+\label{luatex}
+\begin{abstract}
+This package manages the new and extended features and resources
+that \LuaTeX\ provides. Examples are attributes and catcode
+tables.
+\end{abstract}
+\tocinclude{luatex}
+
+\newpage
+\subsection{\pkgsectformat{magicnum}}
+\label{magicnum}
+\begin{abstract}
+This packages allows to access magic numbers by a hierarchical
+name system.
+\end{abstract}
+\tocinclude{magicnum}
+
+\newpage
+\subsection{\pkgsectformat{makerobust}}
+\label{makerobust}
+\begin{abstract}
+Package \xpackage{makerobust} provides \cs{MakeRobustCommand}
+that converts an existing macro to a robust one.
+\end{abstract}
+\tocinclude{makerobust}
+
+\newpage
+\subsection{\pkgsectformat{mleftright}}
+\label{mleftright}
+\begin{abstract}
+\TeX\ sets subformulas by \cs{left} and \cs{right} as inner formulas
+with additional surrounding spaces in some situations. This package
+provides \cs{mleft} and \cs{mright} that call \cs{left} and \cs{right},
+but the delimiters will act as normal \cs{mathopen} and \cs{mathclose}
+delimiters without the additional space of an inner formula.
+\end{abstract}
+\tocinclude{mleftright}
+
+\newpage
+\subsection{\pkgsectformat{pagegrid}}
+\label{pagegrid}
+\begin{abstract}
+The \LaTeX\ package prints a page grid in the background.
+\end{abstract}
+\tocinclude{pagegrid}
+
+\newpage
+\subsection{\pkgsectformat{pagesel}}
+\label{pagesel}
+\begin{abstract}
+Single pages or page areas can be selected for output.
+\end{abstract}
+\tocinclude{pagesel}
+
+\newpage
+\subsection{\pkgsectformat{pdfcol}}
+\label{pdfcol}
+\begin{abstract}
+Since version 1.40 \pdfTeX\ supports color stacks.
+The driver file \xfile{pdftex.def} for package \xpackage{color}
+defines and uses a main color stack since version v0.04b.
+Package \xpackage{pdfcol} is intended for package writers.
+It defines macros for setting and maintaining new color stacks.
+\end{abstract}
+\tocinclude{pdfcol}
+
+\newpage
+\subsection{\pkgsectformat{pdfcolfoot}}
+\label{pdfcolfoot}
+\begin{abstract}
+Since version 1.40 \pdfTeX\ supports several color stacks. This
+package uses a separate color stack for footnotes that can break
+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}
+\begin{abstract}
+This packages fixes bugs in \xpackage{parallel} and
+improves color support by using several color stacks
+that are provided by \pdfTeX\ since version 1.40.
+\end{abstract}
+\tocinclude{pdfcolparallel}
+
+\newpage
+\subsection{\pkgsectformat{pdfcolparcolumns}}
+\label{pdfcolparcolumns}
+\begin{abstract}
+Since version 1.40 \pdfTeX\ supports several color stacks.
+This package uses them to fix color problems in
+package \xpackage{parcolumns}.
+\end{abstract}
+\tocinclude{pdfcolparcolumns}
+
+\newpage
+\subsection{\pkgsectformat{pdfcrypt}}
+\label{pdfcrypt}
+\begin{abstract}
+This package supports the setting of pdf encryption options
+for \VTeX\ and some older versions of \pdfTeX.
+\end{abstract}
+\tocinclude{pdfcrypt}
+
+\newpage
+\subsection{\pkgsectformat{pdfescape}}
+\label{pdfescape}
+\begin{abstract}
+This package implements \pdfTeX's escape features
+(\cs{pdfescapehex}, \cs{pdfunescapehex}, \cs{pdfescapename},
+\cs{pdfescapestring}) using \TeX\ or \eTeX.
+\end{abstract}
+\tocinclude{pdfescape}
+
+\newpage
+\subsection{\pkgsectformat{pdflscape}}
+\label{pdflscape}
+\begin{abstract}
+Package \xpackage{pdflscape} adds PDF support to the
+environment \texttt{landscape} of package \xpackage{lscape}
+by setting the PDF page attribute \texttt{/Rotate}.
+\end{abstract}
+\tocinclude{pdflscape}
+
+\newpage
+\subsection{\pkgsectformat{pdfrender}}
+\label{pdfrender}
+\begin{abstract}
+The PDF format has some graphics parameter like
+line width or text rendering mode. This package
+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}}
+\label{picture}
+\begin{abstract}
+There are macro and environment arguments that expect numbers
+that will internally be multiplicated with \cs{unitlength}.
+This package extends the syntax of these arguments that
+dimens with calculation support can be added for these arguments.
+\end{abstract}
+\tocinclude{picture}
+
+\newpage
+\subsection{\pkgsectformat{pmboxdraw}}
+\label{pmboxdraw}
+\begin{abstract}
+Package \xpackage{pmboxdraw} declares box drawings characters of
+old code pages, e.g. cp437. It uses rules instead of using a font.
+\end{abstract}
+\tocinclude{pmboxdraw}
+
+\newpage
+\subsection{\pkgsectformat{protecteddef}}
+\label{protecteddef}
+\begin{abstract}
+This packages provides \cs{ProtectedDef} for defining
+robust macros for both \hologo{plainTeX} and \hologo{LaTeX}.
+First \hologo{eTeX}'s \cs{protected} is tried, then
+\hologo{LaTeX}'s \cs{DeclareRobustCommand} is used.
+Otherwise the macro is not made robust.
+\end{abstract}
+\tocinclude{protecteddef}
+
+\newpage
+\subsection{\pkgsectformat{refcount}}
+\label{refcount}
+\begin{abstract}
+References are not numbers, however they often store numerical
+data such as section or page numbers. \cs{ref} or \cs{pageref}
+cannot be used for counter assignments or calculations because
+they are not expandable, generate warnings, or can even be links.
+The package provides expandable macros to extract the data
+from references. Packages \xpackage{hyperref}, \xpackage{nameref},
+\xpackage{titleref}, and \xpackage{babel} are supported.
+\end{abstract}
+\tocinclude{refcount}
+
+\newpage
+\subsection{\pkgsectformat{rerunfilecheck}}
+\label{rerunfilecheck}
+\begin{abstract}
+The package provides additional rerun warnings if some
+auxiliary files have changed. It is based on MD5 checksum,
+provided by \pdfTeX.
+\end{abstract}
+\tocinclude{rerunfilecheck}
+
+\newpage
+\subsection{\pkgsectformat{resizegather}}
+\label{resizegather}
+\begin{abstract}
+Equations that are too large are resized to fit the available
+space. The environment \textsf{gather} of package \xpackage{amsmath}
+is supported. Also the environments \textsf{equation} and
+\textsf{displaymath} are redefined using \textsf{gather}
+and its starred version.
+\end{abstract}
+\tocinclude{resizegather}
+
+\newpage
+\subsection{\pkgsectformat{rotchiffre}}
+\label{rotchiffre}
+\begin{abstract}
+This package implements chiffres ROT13 with its variants
+ROT5, ROT18, and ROT47.
+\end{abstract}
+\tocinclude{rotchiffre}
+
+\newpage
+\subsection{\pkgsectformat{scrindex}}
+\label{scrindex}
+\begin{abstract}
+This package redefines environment `theindex' of package \xpackage{index},
+if a class from KOMA-Script is loaded. Also option \xoption{idxtotoc}
+is supported. Index preambles can be given either by means of package
+\xpackage{index} or via the interface provided by KOMA-Script.
+\end{abstract}
+\tocinclude{scrindex}
+
+\newpage
+\subsection{\pkgsectformat{selinput}}
+\label{selinput}
+\begin{abstract}
+This package selects the input encoding by specifying between
+input characters and their glyph names.
+\end{abstract}
+\tocinclude{selinput}
+
+\newpage
+\subsection{\pkgsectformat{setouterhbox}}
+\label{setouterhbox}
+\begin{abstract}
+If math stuff is set in an \cs{hbox}, then TeX
+performs some optimization and omits the implicite
+penalties \cs{binoppenalty} and \cs{relpenalty}.
+This packages tries to put stuff into an \cs{hbox}
+without getting lost of those penalties.
+\end{abstract}
+\tocinclude{setouterhbox}
+
+\newpage
+\subsection{\pkgsectformat{settobox}}
+\label{settobox}
+\begin{abstract}
+Commands are defined for getting box sizes similar
+to \LaTeX's \cs{settowidth} commands.
+\end{abstract}
+\tocinclude{settobox}
+
+\newpage
+\subsection{\pkgsectformat{soulutf8}}
+\label{soulutf8}
+\begin{abstract}
+This package extends package \xpackage{soul} and adds some support
+for UTF-8. Namely the input encodings \xfile{utf8.def}
+from package \xpackage{inputenc} and
+package \xpackage{ucs}'s \xfile{utf8x.def} are supported.
+\end{abstract}
+\tocinclude{soulutf8}
+
+\newpage
+\subsection{\pkgsectformat{stackrel}}
+\label{stackrel}
+\begin{abstract}
+This package adds an optional argument to \cs{stackrel} for
+putting something below the relational symbol and defines
+\cs{stackbin} for binary symbols.
+\end{abstract}
+\tocinclude{stackrel}
+
+\newpage
+\subsection{\pkgsectformat{stampinclude}}
+\label{stampinclude}
+\begin{abstract}
+The package replaces \cs{includeonly} and selects the files for
+\cs{include} by inspecting the time stamp of the \xext{aux} file.
+The file is selected for inclusion if the \xext{aux} file does
+not yet exist or is older than the corresponding \xext{tex} file.
+\end{abstract}
+\tocinclude{stampinclude}
+
+\newpage
+\subsection{\pkgsectformat{stringenc}}
+\label{stringenc}
+\begin{abstract}
+This package provides \cs{StringEncodingConvert} for converting
+a string between different encodings.
+Both \LaTeX\ and \plainTeX\ are supported.
+\end{abstract}
+\tocinclude{stringenc}
+
+\newpage
+\subsection{\pkgsectformat{tabularht}}
+\label{tabularht}
+\begin{abstract}
+This package defines some environments that adds
+a height specification to tabular and array.
+\end{abstract}
+\tocinclude{tabularht}
+
+\newpage
+\subsection{\pkgsectformat{tabularkv}}
+\label{tabularkv}
+\begin{abstract}
+This package adds a key value interface for tabular
+by the new environment \texttt{tabularkv}. Thus the
+\TeX\ source code looks better by named parameters,
+especially if package \xpackage{tabularht} is used.
+\end{abstract}
+\tocinclude{tabularkv}
+
+\newpage
+\subsection{\pkgsectformat{telprint}}
+\label{telprint}
+\begin{abstract}
+Package \xpackage{telprint} provides \cs{telprint} for formatting
+German phone numbers.
+\end{abstract}
+\tocinclude{telprint}
+
+\newpage
+\subsection{\pkgsectformat{thepdfnumber}}
+\label{thepdfnumber}
+\begin{abstract}
+The package converts real numbers to a minimal representation
+that is stripped from leading or trailing zeros,
+plus signs and decimal point if not necessary.
+\end{abstract}
+\tocinclude{thepdfnumber}
+
+\newpage
+\subsection{\pkgsectformat{transparent}}
+\label{transparent}
+\begin{abstract}
+Since version 1.40 \pdfTeX\ supports several color stacks. This
+package shows, how a separate color stack can be used for transparency,
+a property besides color.
+\end{abstract}
+\tocinclude{transparent}
+
+\newpage
+\subsection{\pkgsectformat{twoopt}}
+\label{twoopt}
+\begin{abstract}
+This package provides commands to define macros with two
+optional arguments.
+\end{abstract}
+\tocinclude{twoopt}
+
+\newpage
+\subsection{\pkgsectformat{uniquecounter}}
+\label{uniquecounter}
+\begin{abstract}
+This package provides a kind of counter that provides unique
+number values. Several counters can be created by different names.
+The numeric values are not limited.
+\end{abstract}
+\tocinclude{uniquecounter}
+
+\newpage
+\subsection{\pkgsectformat{zref}}
+\label{zref}
+\begin{abstract}
+Package \xpackage{zref} tries to get rid of the restriction
+in \hologo{LaTeX}'s reference system that only two properties are
+supported. The package implements an extensible referencing
+system, where properties are handled in a more flexible way.
+It offers an interface for macro programmers for the access
+to the system and some applications that uses the new
+reference scheme.
+\end{abstract}
+\tocinclude{zref}
+\end{document}
diff --git a/macros/latex/contrib/oberdiek/pagegrid.dtx b/macros/latex/contrib/oberdiek/pagegrid.dtx
new file mode 100644
index 0000000000..adfda784a3
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pagegrid.dtx
@@ -0,0 +1,1144 @@
+% \iffalse meta-comment
+%
+% File: pagegrid.dtx
+% Version: 2016/05/16 v1.5
+% Info: Print page grid in background
+%
+% Copyright (C) 2009 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file pagegrid.dtx
+% and the derived files
+% pagegrid.sty, pagegrid.pdf, pagegrid.ins, pagegrid.drv,
+% pagegrid-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pagegrid.dtx
+% CTAN:macros/latex/contrib/oberdiek/pagegrid.pdf
+%
+% Unpacking:
+% (a) If pagegrid.ins is present:
+% tex pagegrid.ins
+% (b) Without pagegrid.ins:
+% tex pagegrid.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pagegrid.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pagegrid.drv is present:
+% latex pagegrid.drv
+% (b) Without pagegrid.drv:
+% latex pagegrid.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 pagegrid.dtx
+% makeindex -s gind.ist pagegrid.idx
+% pdflatex pagegrid.dtx
+% makeindex -s gind.ist pagegrid.idx
+% pdflatex pagegrid.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/pagegrid.sty
+% TDS:doc/latex/oberdiek/pagegrid.pdf
+% TDS:doc/latex/oberdiek/test/pagegrid-test1.tex
+% TDS:source/latex/oberdiek/pagegrid.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pagegrid 2016/05/16 v1.5 Print page grid in background (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pagegrid
+Version: 2016/05/16 v1.5
+
+Copyright (C) 2009 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file pagegrid.dtx
+and the derived files
+ pagegrid.sty, pagegrid.pdf, pagegrid.ins, pagegrid.drv,
+ pagegrid-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pagegrid.ins}{\from{pagegrid.dtx}{install}}%
+ \file{pagegrid.drv}{\from{pagegrid.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{pagegrid.sty}{\from{pagegrid.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pagegrid-test1.tex}{\from{pagegrid.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pagegrid.xml}{\from{pagegrid.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{* pagegrid.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pagegrid.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pagegrid.drv}%
+ [2016/05/16 v1.5 Print page grid in background (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{pagegrid.dtx}%
+\end{document}
+%</driver>
+% \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{pagegrid.drv}
+%
+% \title{The \xpackage{pagegrid} package}
+% \date{2016/05/16 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The \LaTeX\ package prints a page grid in the background.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% The package puts a grid on the paper. It was written for
+% developers of a class or package
+% who have to put elements on definite locations on a page
+% (e.g. letter class). The grid allows a faster optical check,
+% whether the positions are correct. If the previewer already
+% offers features for measuring, the package might be obsolete.
+% Otherwise it saves the developer from printing the page and
+% measuring by hand.
+%
+% \subsection{Options}
+%
+% Options are evaluated in the following order:
+% \begin{enumerate}
+% \item
+% Configuration file \xfile{pagegrid.cfg} using \cs{pagegridsetup}
+% if the file exists.
+% \item
+% Package options given for \cs{usepackage}.
+% \item
+% Later calls of \cs{pagegridsetup}.
+% \end{enumerate}
+% \begin{declcs}{pagegridsetup}\M{option list}
+% \end{declcs}
+% The options are key value options. Boolean options are enabled by
+% default (without value) or by using the explicit value \texttt{true}.
+% Value \texttt{false} disable the option.
+%
+% \subsubsection{Options \xoption{enable}, \xoption{disable}}
+%
+% \begin{description}
+% \item[\xoption{enable}:] This boolean option controls whether the page grid
+% is drawn. As default the page grid drawing is activated.
+% \item[\xoption{disable}:] It is the opposite
+% of option \xoption{enable}. It was added for convenience and
+% allows the abbreviation \texttt{disable} for \texttt{enable=false}.
+% \end{description}
+%
+% \subsubsection{Grid origins}
+%
+% The package supports up to two grids on a page allowing
+% measurement from opposite directions. As default two grids are drawn,
+% the first from bottom left to top right. The origin of the second
+% grid is at the opposite top right corner.
+% The origins are controlled by the following options.
+% The number of grids (one or two) depend on the number of these options
+% in one call of \cs{pagegridsetup}.
+% The following frame shows a paper and in its corners are the
+% corresponding options. At the left and right side alias names
+% are given for the options inside the paper.
+% \begin{quote}
+% \begin{tabular}{@{}r|@{\,}l@{\qquad}r@{\,}|l@{}}
+% \cline{2-3}
+% \xoption{left-top}, \xoption{lt}, \xoption{top-left}
+% & \vphantom{\"U}\xoption{tl} & \xoption{tr}
+% & \xoption{top-right}, \xoption{rt}, \xoption{right-top}\\
+% &&&\\
+% \xoption{left-bottom}, \xoption{lb}, \xoption{bottom-left}
+% & \xoption{bl} & \xoption{br}
+% & \xoption{bottom-right}, \xoption{rb}, \xoption{right-bottom}\\
+% \cline{2-3}
+% \end{tabular}
+% \end{quote}
+% Examples:
+% \begin{quote}
+% |\pagegridsetup{bl,tr}|
+% \end{quote}
+% This is the default setting with two grids as described previously.
+% The following setups one grid only. Its origin is the upper left
+% corner:
+% \begin{quote}
+% |\pagegridsetup{top-left}|
+% \end{quote}
+%
+% \subsubsection{Grid unit}
+%
+% \begin{description}
+% \item[\xoption{step}] This option takes a length and
+% setups the unit for the grid. The page width and page height
+% should be multiples of this unit.
+% Currently the default is \texttt{1mm}. But this might change
+% later by a heuristic based on the paper size.
+% \end{description}
+%
+% \subsubsection{Color options}
+%
+% The basic grid lines are drawn as ultra thin help lines and is only
+% drawn for the first grid.
+% Each tenth and fiftyth line of the basic net is drawn thicker in a special
+% color for the two grids.
+% \begin{description}
+% \item[\xoption{firstcolor}:] Color for the thicker lines and the arrows
+% of the first grid. Default value is \texttt{red}.
+% \item[\xoption{secondcolor}:] Color for the thicker lines and the arrows
+% of the second grid. Default value is \texttt{blue}.
+% \end{description}
+% Use a color specification that package \xpackage{tikz} understands.
+% (The grid is drawn with \xpackage{pgf}/\xpackage{tikz}.)
+%
+% \subsubsection{Arrow options}
+%
+% Arrows are put at the origin at the grid to show the grid start
+% and the direction of the grid.
+% \begin{description}
+% \item[\xoption{arrows}:] This boolean option turns the arrows on or off.
+% As default arrows are enabled.
+% \item[\xoption{arrowlength}:] The length given as value is the
+% length of the edge of a square at the origin within the
+% arrow is put as diagonal. Default is 10 times the grid unit (10\,mm).
+% The real arrow length is this length multiplied by $\sqrt2$.
+% \end{description}
+%
+% \subsubsection{Miscellaneous options}
+%
+% \begin{description}
+% \item[\xoption{double}:] The output page is doubled, one without page
+% grid and the other with page grid. Possible values are shown in the
+% following table:
+% \begin{quote}
+% \begin{tabular}{ll}
+% Option & Meaning\\
+% \hline
+% |false| & Turns option off.\\
+% |first| & Grid page comes first.\\
+% |last| & Grid page comes after the page without grid.\\
+% |true| & Same as |last|.\\
+% \meta{no value} & Same as |true|.\\
+% \end{tabular}
+% \end{quote}
+% \textbf{Note:}
+% The double output of the page has side effects.
+% All whatits are executed twice, for example: file writing
+% and anchor setting. Some unwanted actions are catched such
+% as multiple \cs{label} definitions, duplicate entries in
+% the table of contents. For bookmarks, use package \xpackage{bookmarks}.
+% \item[\xoption{foreground}:] Boolean option, default is \texttt{false}.
+% Sometimes there might be elements on the page (e.g. large images)
+% that hide the grid. Then option \xoption{foreground} puts the grids
+% over the current output page.
+% \end{description}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@pagegrid.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{pagegrid}{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@pagegrid.sty\endcsname
+\ProvidesPackage{pagegrid}%
+ [2016/05/16 v1.5 Print page grid in background (HO)]%
+% \end{macrocode}
+%
+% \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 pagegrid@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\pagegrid@AtEnd{%
+ \pagegrid@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{9}{10}% (tab)
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{34}{12}% "
+\TMP@EnsureCode{36}{3}% $
+\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{59}{12}% ;
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{63}{12}% ?
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^ (superscript)
+\TMP@EnsureCode{95}{8}% _ (subscript)
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{124}{12}% |
+\edef\pagegrid@AtEnd{\pagegrid@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{tikz}
+\RequirePackage{atbegshi}[2009/12/02]
+\RequirePackage{kvoptions}[2009/07/17]
+% \end{macrocode}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname stockwidth\endcsname\relax
+ \def\pagegrid@width{\paperwidth}%
+ \def\pagegrid@height{\paperheight}%
+\else
+ \def\pagegrid@width{\stockwidth}%
+ \def\pagegrid@height{\stockheight}%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\SetupKeyvalOptions{%
+ family=pagegrid,%
+ prefix=pagegrid@,%
+}
+\def\pagegrid@init{%
+ \let\pagegrid@origin@a\@empty
+ \let\pagegrid@origin@b\@empty
+ \let\pagegrid@init\relax
+}
+\let\pagegrid@@init\pagegrid@init
+\def\pagegrid@origin@a{bl}
+\def\pagegrid@origin@b{tr}
+\def\pagegrid@SetOrigin#1{%
+ \pagegrid@init
+ \ifx\pagegrid@origin@a\@empty
+ \def\pagegrid@origin@a{#1}%
+ \else
+ \ifx\pagegrid@origin@b\@empty
+ \else
+ \let\pagegrid@origin@a\pagegrid@origin@b
+ \fi
+ \def\pagegrid@origin@b{#1}%
+ \fi
+}
+\def\pagegrid@temp#1{%
+ \DeclareVoidOption{#1}{\pagegrid@SetOrigin{#1}}%
+ \@namedef{pagegrid@N@#1}{#1}%
+}
+\pagegrid@temp{bl}
+\pagegrid@temp{br}
+\pagegrid@temp{tl}
+\pagegrid@temp{tr}
+\def\pagegrid@temp#1#2{%
+ \DeclareVoidOption{#2}{\pagegrid@SetOrigin{#1}}%
+}%
+\pagegrid@temp{bl}{lb}
+\pagegrid@temp{br}{rb}
+\pagegrid@temp{tl}{lt}
+\pagegrid@temp{tr}{rt}
+\pagegrid@temp{bl}{bottom-left}
+\pagegrid@temp{br}{bottom-right}
+\pagegrid@temp{tl}{top-left}
+\pagegrid@temp{tr}{top-right}
+\pagegrid@temp{bl}{left-bottom}
+\pagegrid@temp{br}{right-bottom}
+\pagegrid@temp{tl}{left-top}
+\pagegrid@temp{tr}{right-top}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareBoolOption[true]{enable}
+\DeclareComplementaryOption{disable}{enable}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareBoolOption{foreground}
+% \end{macrocode}
+% \begin{macrocode}
+\newlength{\pagegrid@step}
+\define@key{pagegrid}{step}{%
+ \setlength{\pagegrid@step}{#1}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareStringOption[red]{firstcolor}
+\DeclareStringOption[blue]{secondcolor}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareBoolOption[true]{arrows}
+\newlength\pagegrid@arrowlength
+\pagegrid@arrowlength=\z@
+\define@key{pagegrid}{arrowlength}{%
+ \setlength{\pagegrid@arrowlength}{#1}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\define@key{pagegrid}{double}[true]{%
+ \@ifundefined{pagegrid@double@#1}{%
+ \PackageWarning{pagegrid}{%
+ Unsupported value `#1' for option `double'.\MessageBreak
+ Known values are:\MessageBreak
+ `false', `first', `last', `true'.\MessageBreak
+ Now `false' is used%
+ }%
+ \chardef\pagegrid@double\z@
+ }{%
+ \chardef\pagegrid@double\csname pagegrid@double@#1\endcsname\relax
+ }%
+}
+\@namedef{pagegrid@double@false}{0}
+\@namedef{pagegrid@double@first}{1}
+\@namedef{pagegrid@double@last}{2}
+\@namedef{pagegrid@double@true}{2}
+\chardef\pagegrid@double\z@
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*{\pagegridsetup}{%
+ \let\pagegrid@init\pagegrid@@init
+ \setkeys{pagegrid}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\pagegridsetup{%
+ step=1mm%
+}
+\InputIfFileExists{pagegrid.cfg}{}%
+\ProcessKeyvalOptions*\relax
+\AtBeginDocument{%
+ \ifdim\pagegrid@arrowlength>\z@
+ \else
+ \pagegrid@arrowlength=10\pagegrid@step
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\pagegridShipoutDoubleBegin{%
+ \begingroup
+ \let\newlabel\@gobbletwo
+ \let\zref@newlabel\@gobbletwo
+ \let\@writefile\@gobbletwo
+ \let\select@language\@gobble
+}
+\def\pagegridShipoutDoubleEnd{%
+ \endgroup
+}
+\def\pagegrid@WriteDouble#1#2{%
+ \immediate\write#1{%
+ \@backslashchar csname %
+ pagegridShipoutDouble#2%
+ \@backslashchar endcsname%
+ }%
+}
+\def\pagegrid@ShipoutDouble#1{%
+ \begingroup
+ \if@filesw
+ \pagegrid@WriteDouble\@mainaux{Begin}%
+ \ifx\@auxout\@partaux
+ \pagegrid@WriteDouble\@partaux{Begin}%
+ \def\pagegrid@temp{%
+ \pagegrid@WriteDouble\@mainaux{End}%
+ \pagegrid@WriteDouble\@partaux{End}%
+ }%
+ \else
+ \def\pagegrid@temp{%
+ \pagegrid@WriteDouble\@mainaux{End}%
+ }%
+ \fi
+ \else
+ \def\pagegrid@temp{}%
+ \fi
+ \let\protect\noexpand
+ \AtBeginShipoutOriginalShipout\copy#1\relax
+ \pagegrid@temp
+ \endgroup
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\AtBeginShipout{%
+ \ifdim\pagegrid@step>\z@
+ \else
+ \pagegrid@enablefalse
+ \fi
+ \ifpagegrid@enable
+ \ifnum\pagegrid@double=\@ne
+ \pagegrid@ShipoutDouble\AtBeginShipoutBox
+ \else
+ \ifnum\pagegrid@double=\tw@
+ \@ifundefined{pagegrid@DoubleBox}{%
+ \newbox\pagegrid@DoubleBox
+ }{}%
+ \setbox\pagegrid@DoubleBox=\copy\AtBeginShipoutBox
+ \fi
+ \fi
+ \ifpagegrid@foreground
+ \expandafter\AtBeginShipoutUpperLeftForeground
+ \else
+ \expandafter\AtBeginShipoutUpperLeft
+ \fi
+ {%
+ \put(0,0){%
+ \makebox(0,0)[lt]{%
+ \begin{tikzpicture}[%
+ bl/.style={},%
+ br/.style={xshift=\pagegrid@width,xscale=-1},%
+ tl/.style={yshift=\pagegrid@height,yscale=-1},%
+ tr/.style={xshift=\pagegrid@width,%
+ yshift=\pagegrid@height,scale=-1}%
+ ]%
+ \useasboundingbox
+ (0mm,\pagegrid@height) rectangle (0mm,\pagegrid@height);%
+ \draw[%
+ \pagegrid@origin@a,%
+ step=\pagegrid@step,%
+ style=help lines,%
+ ultra thin%
+ ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);%
+ \ifx\pagegrid@origin@b\@empty
+ \else
+ \draw[%
+ \pagegrid@origin@b,%
+ step=10\pagegrid@step,%
+ {\pagegrid@secondcolor},%
+ very thin%
+ ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);%
+ \fi
+ \draw[%
+ \pagegrid@origin@a,%
+ step=10\pagegrid@step,%
+ {\pagegrid@firstcolor},%
+ very thin%
+ ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);%
+ \ifx\pagegrid@origin@b\@empty
+ \else
+ \draw[%
+ \pagegrid@origin@b,%
+ step=50\pagegrid@step,%
+ {\pagegrid@secondcolor},%
+ thick%
+ ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);%
+ \fi
+ \draw[%
+ \pagegrid@origin@a,%
+ step=50\pagegrid@step,%
+ {\pagegrid@firstcolor},%
+ thick%
+ ] (0mm,0mm) grid (\pagegrid@width,\pagegrid@height);%
+ \ifpagegrid@arrows
+ \ifx\pagegrid@origin@b\@empty
+ \else
+ \draw[%
+ \pagegrid@origin@b,%
+ {\pagegrid@secondcolor},%
+ stroke,%
+ line width=1pt,%
+ line cap=round%
+ ] (0mm,0mm) %
+ -- (\pagegrid@arrowlength,\pagegrid@arrowlength) %
+ (\pagegrid@arrowlength,.5\pagegrid@arrowlength) %
+ -- (\pagegrid@arrowlength,\pagegrid@arrowlength) %
+ -- (.5\pagegrid@arrowlength,\pagegrid@arrowlength);%
+ \fi
+ \draw[%
+ \pagegrid@origin@a,%
+ {\pagegrid@firstcolor},%
+ stroke,%
+ line width=1pt,%
+ line cap=round%
+ ] (0mm,0mm) %
+ -- (\pagegrid@arrowlength,\pagegrid@arrowlength) %
+ (\pagegrid@arrowlength,.5\pagegrid@arrowlength) %
+ -- (\pagegrid@arrowlength,\pagegrid@arrowlength) %
+ -- (.5\pagegrid@arrowlength,\pagegrid@arrowlength);%
+ \fi
+ \end{tikzpicture}%
+ }%
+ }%
+ }%
+ \ifnum\pagegrid@double=\tw@
+ \pagegrid@ShipoutDouble\pagegrid@DoubleBox
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\pagegrid@AtEnd%
+%</package>
+% \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 pagegrid.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pagegrid}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pagegrid.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pagegrid.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[\CTAN{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 pagegrid.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@{}}
+% pagegrid.sty & tex/latex/oberdiek/pagegrid.sty\\
+% pagegrid.pdf & doc/latex/oberdiek/pagegrid.pdf\\
+% test/pagegrid-test1.tex & doc/latex/oberdiek/test/pagegrid-test1.tex\\
+% pagegrid.dtx & source/latex/oberdiek/pagegrid.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pagegrid.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pagegrid.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 pagegrid.dtx
+%makeindex -s gind.ist pagegrid.idx
+%pdflatex pagegrid.dtx
+%makeindex -s gind.ist pagegrid.idx
+%pdflatex pagegrid.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pagegrid.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pagegrid'>
+ <name>pagegrid</name>
+ <caption>Print page grid in background.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2009'/>
+ <license type='lppl1.3'/>
+ <version number='1.5'/>
+ <description>
+ This package puts a grid on the paper. It was written for
+ developers of a class or package
+ who have to put elements on definite locations on a page
+ (e.g. letter class). The grid allows a faster optical check,
+ whether the positions are correct. If the previewer already
+ offers features for measuring, the package might be unnecessary.
+ Otherwise it saves the developer from printing the page and
+ measuring by hand.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pagegrid.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pagegrid.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \section{Acknowledgement}
+%
+% \begin{description}
+% \item[Klaus Braune:]
+% He provided the idea and the first \xpackage{tikz} code.
+% \end{description}
+%
+% \begin{History}
+% \begin{Version}{2009/11/06 v1.0}
+% \item
+% The first version.
+% \end{Version}
+% \begin{Version}{2009/11/06 v1.1}
+% \item
+% Option \xoption{foreground} added.
+% \end{Version}
+% \begin{Version}{2009/12/02 v1.2}
+% \item
+% Color options, arrow options added.
+% \item
+% Names for origin options changed.
+% \end{Version}
+% \begin{Version}{2009/12/03 v1.3}
+% \item
+% Option \xoption{double} added.
+% \item
+% First CTAN release.
+% \end{Version}
+% \begin{Version}{2009/12/04 v1.4}
+% \item
+% Option \xoption{double}: Some unwanted side effects removed.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pagegrid.pdf b/macros/latex/contrib/oberdiek/pagegrid.pdf
new file mode 100644
index 0000000000..bcb35b5bf6
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pagegrid.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pagesel.dtx b/macros/latex/contrib/oberdiek/pagesel.dtx
new file mode 100644
index 0000000000..54b650226e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pagesel.dtx
@@ -0,0 +1,925 @@
+% \iffalse meta-comment
+%
+% File: pagesel.dtx
+% Version: 2016/05/16 v1.9
+% Info: Select pages of a document for output
+%
+% Copyright (C) 1999, 2003, 2006-2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file pagesel.dtx
+% and the derived files
+% pagesel.sty, pagesel.pdf, pagesel.ins, pagesel.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pagesel.dtx
+% CTAN:macros/latex/contrib/oberdiek/pagesel.pdf
+%
+% Unpacking:
+% (a) If pagesel.ins is present:
+% tex pagesel.ins
+% (b) Without pagesel.ins:
+% tex pagesel.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pagesel.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pagesel.drv is present:
+% latex pagesel.drv
+% (b) Without pagesel.drv:
+% latex pagesel.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 pagesel.dtx
+% makeindex -s gind.ist pagesel.idx
+% pdflatex pagesel.dtx
+% makeindex -s gind.ist pagesel.idx
+% pdflatex pagesel.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/pagesel.sty
+% TDS:doc/latex/oberdiek/pagesel.pdf
+% TDS:source/latex/oberdiek/pagesel.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pagesel 2016/05/16 v1.9 Select pages of a document for output (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pagesel
+Version: 2016/05/16 v1.9
+
+Copyright (C) 1999, 2003, 2006-2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file pagesel.dtx
+and the derived files
+ pagesel.sty, pagesel.pdf, pagesel.ins, pagesel.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pagesel.ins}{\from{pagesel.dtx}{install}}%
+ \file{pagesel.drv}{\from{pagesel.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{pagesel.sty}{\from{pagesel.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pagesel.xml}{\from{pagesel.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{* pagesel.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pagesel.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pagesel.drv}%
+ [2016/05/16 v1.9 Select pages of a document for output (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{pagesel.dtx}%
+\end{document}
+%</driver>
+% \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{pagesel.drv}
+%
+% \title{The \xpackage{pagesel} package}
+% \date{2016/05/16 v1.9}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Single pages or page areas can be selected for output.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newenvironment{param}{^^A
+% \newcommand{\entry}[1]{\meta{\###1}:&}^^A
+% \begin{tabular}[t]{@{}l@{ }l@{}}^^A
+% }{^^A
+% \end{tabular}^^A
+% }
+%
+% \newcommand*{\Option}[1]{\textsf{#1}}
+%
+% \section{Usage}
+% The package \Package{pagesel} is a \LaTeXe\ package:
+% \begin{quote}
+% |\usepackage|\oarg{options}|{pagesel}|
+% \end{quote}
+% (For plain\TeX\ and \LaTeX\,2.09 the similar package
+% \URL{\Package{selectp}}^^A
+% {http://ctan.org/pkg/selectp}
+% from \NameEmail{Donald Arsenau}{asnd@triumf.ca} can be used.)
+%
+% Depending on the options the package works in two modes:
+% \begin{enumerate}
+% \item If no page selecting option is present, so the package
+% ignores the other options and finishes itself. So no
+% page will be suppressed by the package and auxiliary files
+% will be written.
+% \item With at least one page selecting option the specified
+% pages are selected and the other are suppressed.
+% The default for this mode is that auxiliary will not be
+% overwritten. (This can be changed by an option.)
+% \end{enumerate}
+%
+% \subsection{Page selecting}
+% The package \Package{pagesel} sets up a new counter that is
+% incremented by each \cmd{\shipout}.
+% In this way the package counts the output pages regardless the value
+% of the page counter. So each page can individually by addressed,
+% even if there are several pages with the same page number.
+%
+% \subsubsection{Options\texorpdfstring{ for selecting pages}{}}
+% \begin{description}
+% \item[\Option{odd}:] The output pages must have an odd number.
+% All even output pages are suppressed. If there are no
+% page areas specified so all odd pages are print. With
+% page areas only the odd pages in this areas are selected.
+% \item[\Option{even}:] The opposite of option \Option{odd}.
+% \item[Page area:] A page area consists of three elements:
+% the starting output page number, an ``area'' hyphen, and
+% the output page number of the last page in this area.
+% Each component is optional, so there are four kinds
+% to spezify a page area:
+% \begin{description}
+% \item[\meta{m}\Option{-}\meta{n}:] All pages between
+% \meta{m} and \meta{n} inclusive.
+% \item[\Option{-}\meta{n}:] All pages until \meta{n} inclusive.
+% \item[\meta{m}\Option{-}:] The page area starts with \meta{m}
+% and all pages to the end of document are selected.
+% \item[\Option{-}:] All pages (not very useful).
+% \item[\meta{s}:] The single page \meta{s}.
+% \end{description}
+% \end{description}
+%
+% \subsubsection{Examples}
+% \newcommand*{\exam}[1]{\texttt{\strut[#1]}}^^A hash-ok
+% \begin{tabular}{ll}
+% Options & Output pages\\
+% \hline
+% \exam{1, 4, 9}& 1, 4, and 9\\
+% \exam{7-10, 3}& 3, 7, 8, 9, and 10\\
+% \exam{odd, 3-6}& 3, and 5\\
+% \exam{-4, 3, even, 7-8}& 2, 4, and 8\\
+% \end{tabular}
+%
+% \subsection{Auxiliary files}
+% If a page is suppressed, the \cmd{\write} commands are not
+% performed. Labels, index entries, or entries for the
+% table of contents aren't written. So it is likely that
+% the table of contents, registers, and lists are incomplete.
+% \subsubsection{Options\texorpdfstring{ for handling auxiliary files}{}}
+% \begin{description}
+% \item[\Option{nofiles}:] This is the default. Auxiliary files are
+% read but not written or changed. Also the job is aborted
+% after the last selected page for saving time.
+% \item[\Option{nonofiles}/\Option{files}:] Auxiliary files are
+% written.
+% \end{description}
+% \subsubsection{\texorpdfstring{Package }{}\Package{hyperref}}
+% In old versions of \Package{hyperref} [1999/04/12 v6.55] (and below)
+% there is a bug with \cmd{\nofiles}:
+% \begin{itemize}
+% \item Some ``garbage'' appears on terminal and in the log file.
+% This is harmless and can be ignored.
+% \item The outline auxiliary file \cmd{\jobname.out}, however,
+% is opened and truncated to zero bytes.
+% Version 1.0 of this package had
+% loaded a patch file \File{hypnofil.tex}, if it detects
+% \Package{hyperref} to get \cmd{\nofiles} work.
+%
+% With the new version of \Package{hyperref} [1999/04/13 v6.56]
+% \cmd{\nofiles} works now. Therefore the workaround code
+% is no longer needed and removed.
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \subsection{Package}
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pagesel}
+ [2016/05/16 v1.9 Select pages of a document for output (HO)]%
+% \end{macrocode}
+%
+% If the package is loaded twice, the package code does not
+% work. So stop loading the package, if it is already loaded.
+% \begin{macrocode}
+\@ifundefined{ps@makevoid}{}{%
+ \PackageWarningNoLine{pagesel}{Package already loaded.}%
+ \endinput
+}
+% \end{macrocode}
+%
+% \begin{macro}{\ps@makevoid}
+% Macro \cmd{\ps@makevoid} clears the output box. Because
+% nothing is shipped out and this is intended, we reduce
+% the counter \cmd{\deadcycles} in order to avoid problems, if
+% more than \cmd{\maxdeadcycles} pages are omitted.
+% \begin{macrocode}
+\newcommand*{\ps@makevoid}{%
+ \global\setbox\@cclv\copy\voidb@x
+ \begingroup
+ \count@=\deadcycles
+ \advance\count@ by -1\relax
+ \deadcycles=\count@
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@oddpages}
+% \begin{macrocode}
+\newcommand*\ps@oddpages{0}
+\DeclareOption{odd}{\renewcommand*\ps@oddpages{1}}
+\DeclareOption{even}{\renewcommand*\ps@oddpages{2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareOption{nofiles}{\let\ps@nofiles\nofiles}
+\DeclareOption{nonofiles}{\let\ps@nofiles\@empty}
+\DeclareOption{files}{\let\ps@nofiles\@empty}
+\ExecuteOptions{nofiles}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareOption*{%
+ \begingroup
+ \expandafter\ps@checkoption\CurrentOption-\END
+ \edef\x{\endgroup\noexpand\ps@store{\ps@first}{\ps@last}}%
+ \x
+}
+% \end{macrocode}
+%
+% \begin{macro}{\ps@checkoption}
+% \begin{macrocode}
+\newcommand\ps@checkoption{}
+\def\ps@checkoption#1-#2\END{%
+ \ifx\\#2\\%
+ \ifx\\#1\\%
+ % empty option
+ \def\ps@first{\maxdimen}%
+ \def\ps@last{\maxdimen}%
+ \else
+ \edef\ps@first{#1}%
+ \edef\ps@last{#1}%
+ \fi
+ \else
+ \ifx\\#1\\%
+ \def\ps@first{-\maxdimen}%
+ \else
+ \edef\ps@first{#1}%
+ \fi
+ \ps@checklast#2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@checklast}
+% \begin{macrocode}
+\newcommand\ps@checklast{}
+\def\ps@checklast#1-{%
+ \ifx\\#1\\%
+ \def\ps@last{\maxdimen}%
+ \else
+ \edef\ps@last{#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@store}
+% \begin{macrocode}
+\newcommand*{\ps@store}[2]{%
+ \expandafter\def\expandafter\ps@testlist\expandafter{%
+ \ps@testlist\ps@pagetest{#1}{#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@testlist}
+% \begin{macrocode}
+\newcommand*\ps@testlist{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begingroup
+ \edef\x{%
+ \ifnum\ps@oddpages>0 \relax\fi
+ \ifx\ps@testlist\@empty\else\relax\fi
+ }%
+ \ifx\x\@empty
+ \endgroup
+ \PackageInfo{pagesel}{Nothing to do}%
+ \expandafter\endinput
+ \fi
+\endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{everyshi}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ps@nofiles
+% \end{macrocode}
+%
+% \begin{macro}{\c@ps@count}
+% \begin{macrocode}
+\newcounter{ps@count}
+\setcounter{ps@count}{0}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@ReturnAfterElseFi}
+% \begin{macro}{\ps@ReturnAfterFi}
+% \begin{macrocode}
+\long\def\ps@ReturnAfterElseFi#1\else#2\fi{\fi#1}
+\long\def\ps@ReturnAfterFi#1\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\newcommand{\ps@lastpage}{\maxdimen}
+\ifx\ps@nofiles\nofiles
+ \ifx\ps@testlist\@empty
+ \else
+ \def\ps@lastpage{0}%
+ \newcommand*{\ps@pagetest}[2]{%
+ \ifnum#2>\ps@lastpage\relax
+ \def\ps@lastpage{#2}%
+ \fi
+ }%
+ \ps@testlist
+ \let\ps@pagetest\relax
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\ps@ifinset}
+% \begin{macrocode}
+\newcommand*{\ps@ifinset}[4]{%
+ \ifnum#1>\value{ps@count}%
+ \ps@ReturnAfterElseFi{#4}%
+ \else
+ \ps@ReturnAfterFi{%
+ \ifnum#2<\value{ps@count}%
+ \ps@ReturnAfterElseFi{#4}%
+ \else
+ \ps@ReturnAfterFi{#3}%
+ \fi
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@pagetest}
+% \begin{macrocode}
+\newcommand*{\ps@pagetest}[2]{%
+ \ps@ifinset{#1}{#2}{\let\ps@next\@empty}{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\EveryShipout{%
+ \stepcounter{ps@count}%
+ \ifnum\value{ps@count}>\ps@lastpage\relax
+ \global\output{%
+ \ps@cleanup@if
+ \ps@group@message
+ \typeout{%
+ Package pagesel Notice: Aborting LaTeX job %
+ after last selected page (\ps@lastpage).%
+ }%
+ \ps@message@ignore
+ \global\setbox\@cclv\box\voidb@x
+ \deadcycles0\relax
+% \end{macrocode}
+% First leave the output group before ending the job.
+% \begin{macrocode}
+ \aftergroup\@@end
+ }%
+ \fi
+ \let\ps@next\@empty
+ \ifx\ps@testlist\@empty
+ \else
+ \let\ps@next\ps@makevoid
+ \ps@testlist
+ \fi
+ \ifnum\ps@oddpages=1 %
+ \ifodd\value{ps@count}%
+ \else
+ \let\ps@next\ps@makevoid
+ \fi
+ \fi
+ \ifnum\ps@oddpages=2 %
+ \ifodd\value{ps@count}%
+ \let\ps@next\ps@makevoid
+ \else
+ \fi
+ \fi
+ \ps@begindvi
+ \ps@next
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname currentiflevel\endcsname\relax
+ \let\ps@cleanup@if\@empty
+\else
+ \def\ps@cleanup@if{%
+ \ifnum\currentiflevel>\@ne
+ \csname fi\endcsname
+ \expandafter\ps@cleanup@if
+ \fi
+ }%
+\fi
+% \end{macrocode}
+% Because of \cs{aftergroup} it is too dangerous to perform
+% a similar cleanup for groups.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname currentgrouplevel\endcsname\relax
+ \let\ps@group@message\@empty
+ \def\ps@message@ignore{%
+ \typeout{%
+ (pagesel) \space\space\@spaces\@spaces\@spaces
+ Messages (\string\end\space occurred ...) can be ignored.%
+ }%
+ }%
+\else
+ \def\ps@group@message{%
+ \ifnum\currentgrouplevel>\@ne
+ \def\ps@message@ignore{%
+ \typeout{%
+ (pagesel) \space\space\@spaces\@spaces\@spaces
+ Message (\string\end\space occurred ...) %
+ can be ignored.%
+ }%
+ }%
+ \else
+ \let\ps@message@ignore\@empty
+ \fi
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsection{AtBeginDvi hook support}
+%
+% The material of box \cs{@begindvibox} is recorded in parallel
+% in box \cs{ps@begindvibox}.
+% \begin{macrocode}
+\newbox\ps@begindvibox
+\ifvoid\@begindvibox
+\else
+ \global\setbox\ps@begindvibox\vbox{%
+ \unvbox\@begindvibox
+ }%
+\fi
+\let\ps@org@AtBeginDvi\AtBeginDvi
+\def\AtBeginDvi#1{%
+ \global\setbox\ps@begindvibox\vbox{%
+ \unvbox\ps@begindvibox
+ #1%
+ }%
+ \ps@org@AtBeginDvi{#1}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\ps@begindvi}
+% Macro \cs{ps@begindvi} is called the similar way as \cs{@begindvi}.
+% If the first page is printed, then \cs{AtBeginDvi} should work
+% as usual. Otherwise the contents of box \cs{ps@begindvibox} is
+% set on the first selected page.
+% \begin{macrocode}
+\def\ps@begindvi{%
+ \ifx\ps@next\@empty
+ \global\let\ps@begindvi\@empty
+ \else
+ \global\let\ps@begindvi\ps@begindvi@do
+ \fi
+}
+\def\ps@begindvi@do{%
+ \ifx\ps@next\@empty
+ \setbox\@cclv\vbox{%
+ \unvbox\ps@begindvibox
+ \box\@cclv
+ }%
+ \global\let\ps@begindvi\@empty
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pagesel}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pagesel.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pagesel.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[\CTAN{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 pagesel.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@{}}
+% pagesel.sty & tex/latex/oberdiek/pagesel.sty\\
+% pagesel.pdf & doc/latex/oberdiek/pagesel.pdf\\
+% pagesel.dtx & source/latex/oberdiek/pagesel.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pagesel.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pagesel.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 pagesel.dtx
+%makeindex -s gind.ist pagesel.idx
+%pdflatex pagesel.dtx
+%makeindex -s gind.ist pagesel.idx
+%pdflatex pagesel.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pagesel.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pagesel'>
+ <name>pagesel</name>
+ <caption>Select pages of a document for output.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1999,2003,2006-2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.9'/>
+ <description>
+ Selects single pages, ranges of pages, odd pages or even pages
+ for output.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pagesel.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pagesel.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1999/03/01 v0.9}
+% \item
+% The first version was built as a response to a question
+% of \NameEmail{Dirk Kuypers}{dk@comnets.rwth-aachen.de},
+% published in the newsgroup
+% \href{news:de.comp.text.tex}{de.comp.text.tex}:\\
+% \URL{``\link{Re: pdflatex nur fuer bestimmte Seiten?!?}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/6b68c7b3439fb658}
+% \end{Version}
+% \begin{Version}{1999/04/05 v1.0}
+% \item
+% Documentation added in dtx format.
+% \item
+% Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt})
+% \item
+% Options |odd|, |even| added.
+% \item
+% \cmd{\nofiles} added, bug fix for \Package{hyperref}.
+% \item
+% Abort loading of package, if nothing to do.
+% \end{Version}
+% \begin{Version}{1999/04/13 v1.1}
+% \item
+% \cs{nofiles} bug fix removed
+% because of \xpackage{hyperref} 6.55.
+% \item
+% First CTAN release.
+% \end{Version}
+% \begin{Version}{2003/06/05 v1.2}
+% \item
+% \cs{deadcyles} is decremented for omitted pages.
+% \item
+% LPPL 1.2.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.3}
+% \item
+% Code is not changed.
+% \item
+% New DTX framework.
+% \item
+% LPPL 1.3
+% \end{Version}
+% \begin{Version}{2006/03/02 v1.4}
+% \item
+% Support for \cs{AtBeginDvi} added.
+% \end{Version}
+% \begin{Version}{2006/03/07 v1.5}
+% \item
+% Job is aborted after last selected page.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.6}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/04/12 v1.7}
+% \item
+% Hard coded box number 255 replaced by macro \cs{@cclv}.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.8}
+% \item
+% Code is not changed.
+% \item
+% URL updated from \texttt{www.dejanews.com}
+% to \texttt{groups.google.com}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.9}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pagesel.pdf b/macros/latex/contrib/oberdiek/pagesel.pdf
new file mode 100644
index 0000000000..1dad4b4c4e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pagesel.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdfcol.dtx b/macros/latex/contrib/oberdiek/pdfcol.dtx
new file mode 100644
index 0000000000..b48498342e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcol.dtx
@@ -0,0 +1,1192 @@
+% \iffalse meta-comment
+%
+% File: pdfcol.dtx
+% Version: 2018/11/01 v1.5
+% Info: Handle new color stacks for pdfTeX
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 pdfcol.dtx
+% and the derived files
+% pdfcol.sty, pdfcol.pdf, pdfcol.ins, pdfcol.drv, pdfcol-test1.tex,
+% pdfcol-test2.tex, pdfcol-test3.tex, pdfcol-test4.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pdfcol.dtx
+% CTAN:macros/latex/contrib/oberdiek/pdfcol.pdf
+%
+% Unpacking:
+% (a) If pdfcol.ins is present:
+% tex pdfcol.ins
+% (b) Without pdfcol.ins:
+% tex pdfcol.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pdfcol.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pdfcol.drv is present:
+% latex pdfcol.drv
+% (b) Without pdfcol.drv:
+% latex pdfcol.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 pdfcol.dtx
+% makeindex -s gind.ist pdfcol.idx
+% pdflatex pdfcol.dtx
+% makeindex -s gind.ist pdfcol.idx
+% pdflatex pdfcol.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/pdfcol.sty
+% TDS:doc/latex/oberdiek/pdfcol.pdf
+% TDS:doc/latex/oberdiek/test/pdfcol-test1.tex
+% TDS:doc/latex/oberdiek/test/pdfcol-test2.tex
+% TDS:doc/latex/oberdiek/test/pdfcol-test3.tex
+% TDS:doc/latex/oberdiek/test/pdfcol-test4.tex
+% TDS:source/latex/oberdiek/pdfcol.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pdfcol 2018/11/01 v1.5 Handle new color stacks for pdfTeX (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pdfcol
+Version: 2018/11/01 v1.5
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 pdfcol.dtx
+and the derived files
+ pdfcol.sty, pdfcol.pdf, pdfcol.ins, pdfcol.drv, pdfcol-test1.tex,
+ pdfcol-test2.tex, pdfcol-test3.tex, pdfcol-test4.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pdfcol.ins}{\from{pdfcol.dtx}{install}}%
+ \file{pdfcol.drv}{\from{pdfcol.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{pdfcol.sty}{\from{pdfcol.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pdfcol-test1.tex}{\from{pdfcol.dtx}{test1}}%
+% \file{pdfcol-test2.tex}{\from{pdfcol.dtx}{test2}}%
+% \file{pdfcol-test3.tex}{\from{pdfcol.dtx}{test3}}%
+% \file{pdfcol-test4.tex}{\from{pdfcol.dtx}{test4}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pdfcol.xml}{\from{pdfcol.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{* pdfcol.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pdfcol.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfcol.drv}%
+ [2018/11/01 v1.5 Handle new color stacks for pdfTeX (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{pdfcol.dtx}%
+\end{document}
+%</driver>
+% \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{pdfcol.drv}
+%
+% \title{The \xpackage{pdfcol} package}
+% \date{2018/11/01 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Since version 1.40 \pdfTeX\ supports color stacks.
+% The driver file \xfile{pdftex.def} for package \xpackage{color}
+% defines and uses a main color stack since version v0.04b.
+% Package \xpackage{pdfcol} is intended for package writers.
+% It defines macros for setting and maintaining new color stacks.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% Version 1.40 of \pdfTeX\ adds new primitives \cs{pdfcolorstackinit}
+% and \cs{pdfcolorstack}. Now color stacks can be defined and used.
+% A main color stack is maintained by the driver file \xfile{pdftex.def}
+% similar to dvips or dvipdfm. However the number of color stacks
+% is not limited to one in \pdfTeX. Thus further color problems
+% can now be solved, such as footnotes across pages or text
+% that is set in parallel columns (e.g. packages \xpackage{parallel}
+% or \xpackage{parcolumn}). Unlike the main color stack,
+% the support by additional color stacks cannot be done in
+% a transparent manner.
+%
+% This package \xpackage{pdfcol} provides an easier interface to
+% additional color stacks without the need to use the
+% low level primitives.
+%
+% \subsection{Requirements}
+% \label{sec:req}
+%
+% \begin{itemize}
+% \item
+% \pdfTeX\ 1.40 or greater.
+% \item
+% \pdfTeX in PDF mode. (I don't know a DVI driver that
+% support several color stacks.)
+% \item
+% \xfile{pdftex.def} 2007/01/02 v0.04b.
+% \end{itemize}
+% Package \xpackage{pdfcol} checks the requirements and
+% sets switch \cs{ifpdfcolAvailable} accordingly.
+%
+% \subsection{Interface}
+%
+% \begin{declcs}{ifpdfcolAvailable}
+% \end{declcs}
+% If the requirements of section \ref{sec:req} are met the
+% switch \cs{ifpdfcolAvailable} behaves as \cs{iftrue}.
+% Otherwise the other interface macros in this section will
+% be disabled with a message. Also the first use of such a
+% macro will print a message. The messages are print to
+% the \xext{log} file only if \pdfTeX\ is not used in PDF mode.
+%
+% \begin{declcs}{pdfcolErrorNoStacks}
+% \end{declcs}
+% The first call of \cs{pdfcolErrorNoStacks} prints an error
+% message, if color stacks are not available.
+%
+% \begin{declcs}{pdfcolInitStack} \M{name}
+% \end{declcs}
+% A new color stack is initialized by \cs{pdfcolInitStack}.
+% The \meta{name} is used for indentifying the stack. It usually
+% consists of letters and digits. (The name must survive a \cs{csname}.)
+%
+% The intension of the macro is the definition of an additional
+% color stack. Thus the stack is not page bounded like the
+% main color stack. Black (\texttt{0 g 0 G}) is used as initial
+% color value. And colors are written with modifier \texttt{direct}
+% that means without setting the current transfer matrix and changing
+% the current point (see documentation of \pdfTeX\ for
+% |\pdfliteral direct{...}|).
+%
+% \begin{declcs}{pdfcolIfStackExists} \M{name} \M{then} \M{else}
+% \end{declcs}
+% Macro \cs{pdfcolIfStackExists} checks whether color stack \meta{name}
+% exists. In case of success argument \meta{then} is executed
+% and \meta{else} otherwise.
+%
+% \begin{declcs}{pdfcolSwitchStack} \M{name}
+% \end{declcs}
+% Macro \cs{pdfcolSwitchStack} switches the color stack. The color macros
+% of package \xpackage{color} (or \xpackage{xcolor}) now uses the
+% new color stack with name \meta{name}.
+%
+% \begin{declcs}{pdfcolSetCurrentColor}
+% \end{declcs}
+% Macro \cs{pdfcolSetCurrentColor} replaces the topmost
+% entry of the stack by the current color (\cs{current@color}).
+%
+% \begin{declcs}{pdfcolSetCurrent} \M{name}
+% \end{declcs}
+% Macro \cs{pdfcolSetCurrent} sets the color that is read in
+% the top-most entry of color stack \meta{name}. If \meta{name}
+% is empty, the default color stack is used.
+%
+% \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@pdfcol.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{pdfcol}{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@pdfcol.sty\endcsname
+\ProvidesPackage{pdfcol}%
+ [2018/11/01 v1.5 Handle new color stacks for pdfTeX (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 PDFCOL@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\PDFCOL@AtEnd{%
+ \PDFCOL@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{43}{12}% +
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\PDFCOL@AtEnd{\PDFCOL@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Check requirements}
+%
+% \begin{macro}{\PDFCOL@RequirePackage}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \def\PDFCOL@RequirePackage#1[#2]{\input #1.sty\relax}%
+\else
+ \def\PDFCOL@RequirePackage#1[#2]{%
+ \RequirePackage{#1}[{#2}]%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% LuaTeX Compatability
+% \begin{macrocode}
+\ifx\pdfextension\@undefined\else
+ \def\pdfcolorstackinit {\pdffeedback colorstackinit}
+ \protected\def\pdfcolorstack {\pdfextension colorstack}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\PDFCOL@RequirePackage{ltxcmds}[2010/03/01]
+% \end{macrocode}
+%
+% \begin{macro}{ifpdfcolAvailable}
+% \begin{macrocode}
+\ltx@newif\ifpdfcolAvailable
+\pdfcolAvailabletrue
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Check package \xpackage{luacolor}}
+%
+% \begin{macrocode}
+\ltx@newif\ifPDFCOL@luacolor
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ver@luacolor.sty\endcsname\relax
+ \PDFCOL@luacolorfalse
+\else
+ \PDFCOL@luacolortrue
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Check PDF mode}
+%
+% \begin{macrocode}
+\PDFCOL@RequirePackage{infwarerr}[2007/09/09]
+\PDFCOL@RequirePackage{ifpdf}[2007/09/09]
+\ifcase\ifpdf\ifPDFCOL@luacolor 1\fi\else 1\fi0 %
+ \def\PDFCOL@Message{%
+ \@PackageWarningNoLine{pdfcol}%
+ }%
+\else
+ \pdfcolAvailablefalse
+ \def\PDFCOL@Message{%
+ \@PackageInfoNoLine{pdfcol}%
+ }%
+ \PDFCOL@Message{%
+ Interface disabled because of %
+ \ifPDFCOL@luacolor
+ package `luacolor'%
+ \else
+ missing PDF mode of pdfTeX%
+ \fi
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Check version of \pdfTeX}
+%
+% \begin{macrocode}
+\ifpdfcolAvailable
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdfcolorstack\endcsname\relax
+ \pdfcolAvailablefalse
+ \PDFCOL@Message{%
+ Interface disabled because of too old pdfTeX.\MessageBreak
+ Required is version 1.40+ for \string\pdfcolorstack
+ }%
+ \fi
+\fi
+\ifpdfcolAvailable
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdfcolorstack\endcsname\relax
+ \pdfcolAvailablefalse
+ \PDFCOL@Message{%
+ Interface disabled because of too old pdfTeX.\MessageBreak
+ Required is version 1.40+ for \string\pdfcolorstackinit
+ }%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Check \xfile{pdftex.def}}
+%
+% \begin{macrocode}
+\ifpdfcolAvailable
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname @pdfcolorstack\endcsname\relax
+% \end{macrocode}
+% Try to load package color if it is not yet loaded (\LaTeX\ case).
+% \begin{macrocode}
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname ver@color.sty\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname documentclass\endcsname\relax
+ \else
+ \RequirePackage[pdftex]{color}\relax
+ \fi
+ \fi
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname @pdfcolorstack\endcsname\relax
+ \pdfcolAvailablefalse
+ \PDFCOL@Message{%
+ Interface disabled because `pdftex.def'\MessageBreak
+ is not loaded or it is too old.\MessageBreak
+ Required is version 0.04b or greater%
+ }%
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\pdfcolAvailabletrue\relax
+\let\pdfcolAvailablefalse\relax
+% \end{macrocode}
+%
+% \subsection{Enabled interface macros}
+%
+% \begin{macrocode}
+\ifpdfcolAvailable
+% \end{macrocode}
+%
+% \begin{macro}{\pdfcolErrorNoStacks}
+% \begin{macrocode}
+ \let\pdfcolErrorNoStacks\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcol@Value}
+% \begin{macrocode}
+ \expandafter\ifx\csname pdfcol@Value\endcsname\relax
+ \def\pdfcol@Value{0 g 0 G}%
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcol@LiteralModifier}
+% \begin{macrocode}
+ \expandafter\ifx\csname pdfcol@LiteralModifier\endcsname\relax
+ \def\pdfcol@LiteralModifier{direct}%
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolInitStack}
+% \begin{macrocode}
+ \def\pdfcolInitStack#1{%
+ \expandafter\ifx\csname pdfcol@Stack@#1\endcsname\relax
+ \global\expandafter\chardef\csname pdfcol@Stack@#1\endcsname=%
+ \pdfcolorstackinit\pdfcol@LiteralModifier{\pdfcol@Value}%
+ \relax
+ \@PackageInfo{pdfcol}{%
+ New color stack `#1' = \number\csname pdfcol@Stack@#1\endcsname
+ }%
+ \else
+ \@PackageError{pdfcol}{%
+ Stack `#1' is already defined%
+ }\@ehc
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolIfStackExists}
+% \begin{macrocode}
+ \def\pdfcolIfStackExists#1{%
+ \expandafter\ifx\csname pdfcol@Stack@#1\endcsname\relax
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@firstoftwo}
+% \begin{macrocode}
+ \expandafter\ifx\csname @firstoftwo\endcsname\relax
+ \long\def\@firstoftwo#1#2{#1}%
+ \fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@secondoftwo}
+% \begin{macrocode}
+ \expandafter\ifx\csname @secondoftwo\endcsname\relax
+ \long\def\@secondoftwo#1#2{#2}%
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolSwitchStack}
+% \begin{macrocode}
+ \def\pdfcolSwitchStack#1{%
+ \pdfcolIfStackExists{#1}{%
+ \expandafter\let\expandafter\@pdfcolorstack
+ \csname pdfcol@Stack@#1\endcsname
+ }{%
+ \pdfcol@ErrorNoStack{#1}%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolSetCurrentColor}
+% \begin{macrocode}
+ \def\pdfcolSetCurrentColor{%
+ \pdfcolorstack\@pdfcolorstack set{\current@color}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolSetCurrent}
+% \begin{macrocode}
+ \def\pdfcolSetCurrent#1{%
+ \ifx\\#1\\%
+ \pdfcolorstack\@pdfcolorstack current\relax
+ \else
+ \pdfcolIfStackExists{#1}{%
+ \pdfcolorstack\csname pdfcol@Stack@#1\endcsname current\relax
+ }{%
+ \pdfcol@ErrorNoStack{#1}%
+ }%
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcol@ErrorNoStack}
+% \begin{macrocode}
+ \def\pdfcol@ErrorNoStack#1{%
+ \@PackageError{pdfcol}{Stack `#1' does not exists}\@ehc
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Disabled interface macros}
+%
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% \begin{macro}{\pdfcolErrorNoStacks}
+% \begin{macrocode}
+ \def\pdfcolErrorNoStacks{%
+ \@PackageError{pdfcol}{%
+ Color stacks are not available%
+ }{%
+ Update pdfTeX (1.40) and `pdftex.def' (0.04b) %
+ if necessary.\MessageBreak
+ Ensure that `pdftex.def' is loaded %
+ (package `color' or `xcolor').\MessageBreak
+ Further messages can be found in TeX's %
+ protocol file `\jobname.log'.\MessageBreak
+ \MessageBreak
+ \@ehc
+ }%
+ \global\let\pdfcolErrorNoStacks\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PDFCOL@Disabled}
+% \begin{macrocode}
+ \def\PDFCOL@Disabled{%
+ \PDFCOL@Message{%
+ pdfTeX's color stacks are not available%
+ }%
+ \global\let\PDFCOL@Disabled\relax
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolInitStack}
+% \begin{macrocode}
+ \def\pdfcolInitStack#1{%
+ \PDFCOL@Disabled
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolIfStackExists}
+% \begin{macrocode}
+ \long\def\pdfcolIfStackExists#1#2#3{#3}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolSwitchStack}
+% \begin{macrocode}
+ \def\pdfcolSwitchStack#1{%
+ \PDFCOL@Disabled
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolSetCurrentColor}
+% \begin{macrocode}
+ \def\pdfcolSetCurrentColor{%
+ \PDFCOL@Disabled
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pdfcolSetCurrent}
+% \begin{macrocode}
+ \def\pdfcolSetCurrent#1{%
+ \PDFCOL@Disabled
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\PDFCOL@AtEnd%
+%</package>
+% \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 pdfcol.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Very simple test}
+%
+% \begin{macrocode}
+%<*test2|test3>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{article}
+\usepackage{pdfcol}[2018/11/01]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\begin{document}
+ \begin{qstest}{pdfcol}{}%
+ \makeatletter
+%<*test2>
+ \Expect*{\ifpdfcolAvailable true\else false\fi}{false}%
+%</test2>
+%<*test3>
+ \Expect*{\ifpdfcolAvailable true\else false\fi}{true}%
+ \Expect*{\number\@pdfcolorstack}{0}%
+%</test3>
+ \setbox0=\hbox{%
+ \pdfcolInitStack{test}%
+%<*test3>
+ \Expect*{\number\pdfcol@Stack@test}{1}%
+ \Expect*{\number\@pdfcolorstack}{0}%
+%</test3>
+ \pdfcolSwitchStack{test}%
+%<*test3>
+ \Expect*{\number\@pdfcolorstack}{1}%
+%</test3>
+ \pdfcolSetCurrent{test}%
+ \pdfcolSetCurrent{}%
+ }%
+ \Expect*{\the\wd0}{0.0pt}%
+%<*test3>
+ \Expect*{\number\@pdfcolorstack}{0}%
+ \Expect*{\number\pdfcol@Stack@test}{1}%
+ \Expect*{\pdfcolIfStackExists{test}{true}{false}}{true}%
+%</test3>
+ \Expect*{\pdfcolIfStackExists{dummy}{true}{false}}{false}%
+ \end{qstest}%
+\end{document}
+%</test2|test3>
+% \end{macrocode}
+%
+% \subsection{Detection of package \xpackage{luacolor}}
+%
+% \begin{macrocode}
+%<*test4>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{luacolor}
+\usepackage{pdfcol}
+\makeatletter
+\ifpdfcolAvailable
+ \@latex@error{Detection of package luacolor failed}%
+\fi
+\csname @@end\endcsname
+%</test4>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pdfcol}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcol.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcol.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[\CTAN{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 pdfcol.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@{}}
+% pdfcol.sty & tex/generic/oberdiek/pdfcol.sty\\
+% pdfcol.pdf & doc/latex/oberdiek/pdfcol.pdf\\
+% test/pdfcol-test1.tex & doc/latex/oberdiek/test/pdfcol-test1.tex\\
+% test/pdfcol-test2.tex & doc/latex/oberdiek/test/pdfcol-test2.tex\\
+% test/pdfcol-test3.tex & doc/latex/oberdiek/test/pdfcol-test3.tex\\
+% test/pdfcol-test4.tex & doc/latex/oberdiek/test/pdfcol-test4.tex\\
+% pdfcol.dtx & source/latex/oberdiek/pdfcol.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdfcol.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pdfcol.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 pdfcol.dtx
+%makeindex -s gind.ist pdfcol.idx
+%pdflatex pdfcol.dtx
+%makeindex -s gind.ist pdfcol.idx
+%pdflatex pdfcol.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdfcol.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdfcol'>
+ <name>pdfcol</name>
+ <caption>Defines macros fpr maintaining color stacks under pdfTeX.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.5'/>
+ <description>
+ Since version 1.40 pdfTeX supports color stacks.
+ The driver file <tt>pdftex.def</tt> for package
+ <xref refid='color'>color</xref> defines and uses a main color
+ stack since version v0.04b.
+ <p/>
+ This package is intended for package writers.
+ It defines macros for setting and maintaining new color stacks.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdfcol.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdfcol.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/09/09 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/12/09 v1.1}
+% \item
+% \cs{pdfcolSetCurrentColor} added.
+% \end{Version}
+% \begin{Version}{2007/12/12 v1.2}
+% \item
+% Detection for package \xpackage{luacolor} added.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.3}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/05/17 v1.4}
+% \item
+% Use luatex85 package for new luatex compatibility
+% \end{Version}
+% \begin{Version}{2018/11/01 v1.5}
+% \item
+% Remove luatex85 dependency
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pdfcol.pdf b/macros/latex/contrib/oberdiek/pdfcol.pdf
new file mode 100644
index 0000000000..a2f6c7b06e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcol.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdfcolfoot.dtx b/macros/latex/contrib/oberdiek/pdfcolfoot.dtx
new file mode 100644
index 0000000000..20e489bc71
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcolfoot.dtx
@@ -0,0 +1,780 @@
+% \iffalse meta-comment
+%
+% File: pdfcolfoot.dtx
+% Version: 2016/05/16 v1.3
+% Info: Color stack for footnotes with pdfTeX
+%
+% Copyright (C) 2007, 2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file pdfcolfoot.dtx
+% and the derived files
+% pdfcolfoot.sty, pdfcolfoot.pdf, pdfcolfoot.ins, pdfcolfoot.drv,
+% pdfcolfoot-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pdfcolfoot.dtx
+% CTAN:macros/latex/contrib/oberdiek/pdfcolfoot.pdf
+%
+% Unpacking:
+% (a) If pdfcolfoot.ins is present:
+% tex pdfcolfoot.ins
+% (b) Without pdfcolfoot.ins:
+% tex pdfcolfoot.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pdfcolfoot.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pdfcolfoot.drv is present:
+% latex pdfcolfoot.drv
+% (b) Without pdfcolfoot.drv:
+% latex pdfcolfoot.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 pdfcolfoot.dtx
+% makeindex -s gind.ist pdfcolfoot.idx
+% pdflatex pdfcolfoot.dtx
+% makeindex -s gind.ist pdfcolfoot.idx
+% pdflatex pdfcolfoot.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/pdfcolfoot.sty
+% TDS:doc/latex/oberdiek/pdfcolfoot.pdf
+% TDS:doc/latex/oberdiek/test/pdfcolfoot-test1.tex
+% TDS:source/latex/oberdiek/pdfcolfoot.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pdfcolfoot 2016/05/16 v1.3 Color stack for footnotes with pdfTeX (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pdfcolfoot
+Version: 2016/05/16 v1.3
+
+Copyright (C) 2007, 2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file pdfcolfoot.dtx
+and the derived files
+ pdfcolfoot.sty, pdfcolfoot.pdf, pdfcolfoot.ins, pdfcolfoot.drv,
+ pdfcolfoot-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pdfcolfoot.ins}{\from{pdfcolfoot.dtx}{install}}%
+ \file{pdfcolfoot.drv}{\from{pdfcolfoot.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{pdfcolfoot.sty}{\from{pdfcolfoot.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pdfcolfoot-test1.tex}{\from{pdfcolfoot.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pdfcolfoot.xml}{\from{pdfcolfoot.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{* pdfcolfoot.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pdfcolfoot.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfcolfoot.drv}%
+ [2016/05/16 v1.3 Color stack for footnotes with pdfTeX (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{pdfcolfoot.dtx}%
+\end{document}
+%</driver>
+% \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{pdfcolfoot.drv}
+%
+% \title{The \xpackage{pdfcolfoot} package}
+% \date{2016/05/16 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Since version 1.40 \pdfTeX\ supports several color stacks. This
+% package uses a separate color stack for footnotes that can break
+% across pages.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% Just load the package:
+% \begin{quote}
+% |\usepackage{pdfcolfoot}|
+% \end{quote}
+% The package assigns a color stack for footnotes and patches
+% the appropriate internal macros to support this color stack.
+%
+% \subsection{Other packages or classes}
+%
+% This package \xpackage{pdfcolfoot} redefines \cs{@makecol}
+% and \cs{@makefntext}.
+% This can cause conflicts if other packages or classes also change
+% these macro in an incompatible way. Sometimes it can help
+% to change the package order.
+%
+% \section{Interface for package or class writers}
+%
+% Two macros \cs{pdfcolfoot@switch} and \cs{pdfcolfoot@current}
+% need to be added to get support of the color stack for footnotes.
+% This package \xpackage{pdfcolfoot} already patches many macros
+% to add these two macros. If a package or class that deals
+% with \cs{@makefntext} or \cs{@makecol} is not recognized by
+% this package, the package/class author can add these two
+% macros in his package/class.
+%
+% \subsection{Macro \cs{pdfcolfoot@switch}}
+%
+% Color commands inside footnotes should use the special
+% color stack for footnotes. Macro \cs{pdfcolfoot@switch}
+% sets this special color stack. (It can be called several
+% times). But caution, footnotes for minipages should not
+% be affected. This package patches \cs{@makefntext} for
+% this purpose.
+%
+% \subsection{Macro \cs{pdfcolfoot@current}}
+%
+% In \LaTeX\ the footnote stuff goes into box \cs{footins}
+% that is placed on the page (\cs{@makecol}).
+% Two things need consideration:
+% \begin{itemize}
+% \item The footnote area should not interfere with the normal
+% color stack. Macro \cs{normalcolor} inside a group helps
+% it stores the current color of the normal stack and
+% restores it after the group.
+% \item If a footnote is broken across a page boundary, we
+% need the latest color of the footnote area in the previous page.
+% This is set by macro \cs{pdfcolfoot@current}.
+% \end{itemize}
+% As example the changes for \cs{@makecol} are shown (however
+% this macro is already patched by this package):
+%\begin{quote}
+%\begin{verbatim}
+%\gdef\@makcol{%
+% ...
+% \setbox\@outputbox\vbox{% or similar
+% ...
+% \color@begingroup
+% \normalcolor
+% \footnoterule % using normal color (black)
+% \csname pdfcolfoot@current\endcsname
+% \unvbox\footins
+% \color@endgroup
+% }%
+% ...
+%}
+%\end{verbatim}
+%\end{quote}
+% We use \cs{csname} to call macro \cs{pdfcolfoot@current}.
+% If package \xpackage{pdfcolfoot} is not loaded, \cs{pdfcolfoot@current}
+% is not defined. In this case \cs{csname} defines the undefined
+% macro with meaning \cs{relax} and we do not get an error because
+% of undefined command.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pdfcolfoot}%
+ [2016/05/16 v1.3 Color stack for footnotes with pdfTeX (HO)]%
+% \end{macrocode}
+%
+% \subsection{Load package \xpackage{pdfcol}}
+%
+% \begin{macrocode}
+\RequirePackage{pdfcol}[2007/09/09]
+\ifpdfcolAvailable
+\else
+ \PackageInfo{pdfcolfoot}{%
+ Loading aborted, because color stacks are not available%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \subsection{Color stack for footnotes}
+%
+% Version 1.0 has used \cs{current@color} as initial color stack
+% value, since version 1.1 package \xpackage{pdfcol} with its
+% default setting is used.
+% \begin{macrocode}
+\pdfcolInitStack{foot}
+% \end{macrocode}
+%
+% \subsection{Patch \cs{@makefntext}}
+%
+% \begin{macro}{\pdfcolfoot@switch}
+% Macro \cs{pdfcolfoot@switch} switches the color stack. Subsequent
+% color calls uses the color stack for footnotes.
+% \begin{macrocode}
+\newcommand*{\pdfcolfoot@switch}{%
+ \pdfcolSwitchStack{foot}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \newcommand*{\pdfcolfoot@makefntext}{}%
+ \let\pdfcolfoot@makefntext\@makefntext
+ \renewcommand{\@makefntext}[1]{%
+ \pdfcolfoot@makefntext{%
+ \if@minipage
+ \else
+ \pdfcolfoot@switch
+ \fi
+ #1%
+ }%
+ }%
+}
+% \end{macrocode}
+%
+% \subsection{Patch \cs{@makecol}}
+%
+% \begin{macro}{\pdfcolfoot@current}
+% When the footnote area starts, the color should continue with
+% the latest color value of the previous footnote area. This color
+% is available on the current top of the color stack.
+% \begin{macrocode}
+\newcommand*{\pdfcolfoot@current}{%
+ \pdfcolSetCurrent{foot}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% For convenience we use \cs{detokenize} for patching \cs{@makecol}
+% and related macros.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname detokenize\endcsname\relax
+ \PackageWarningNoLine{pdfcolfoot}{%
+ Missing e-TeX for patching \string\@makecol
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newif\ifPCF@result
+\def\pdfcolfoot@patch#1{%
+ \ifx#1\@undefined
+ \else
+ \ifx#1\relax
+ \else
+ \begingroup
+ \toks@{}%
+ \let\on@line\@empty
+ \expandafter\PCF@CheckPatched
+ \detokenize\expandafter{#1pdfcolfoot@current}\@nil
+ \ifPCF@result
+ \PackageInfo{pdfcolfoot}{\string#1\space is already patched}%
+ \else
+ \expandafter\PCF@CanPatch
+ \detokenize\expandafter{%
+ #1\setbox\@outputbox\vbox{\footnoterule}%
+ }%
+ \@nil
+ \ifPCF@result
+ \PackageInfo{pdfcolfoot}{\string#1 is being patched}%
+ \expandafter\PCF@PatchA#1\PCF@nil#1%
+ \else
+ \PackageInfo{pdfcolfoot}{%
+ \string#1\space cannot be patched%
+ }%
+ \fi
+ \fi
+ \expandafter\endgroup
+ \the\toks@
+ \fi
+ \fi
+}
+\expandafter\def\expandafter\PCF@CheckPatched
+ \expandafter#\expandafter1\detokenize{pdfcolfoot@current}#2\@nil{%
+ \ifx\\#2\\%
+ \PCF@resultfalse
+ \else
+ \PCF@resulttrue
+ \fi
+}
+\edef\PCF@BraceLeft{\string{}
+\edef\PCF@BraceRight{\string}}
+\begingroup
+ \edef\x{\endgroup
+ \def\noexpand\PCF@CanPatch
+ ##1\detokenize{\setbox\@outputbox\vbox}\PCF@BraceLeft
+ ##2\detokenize{\footnoterule}##3\PCF@BraceRight
+ }%
+\x#4\@nil{%
+ \ifx\\#2#3#4\\%
+ \PCF@resultfalse
+ \else
+ \PCF@resulttrue
+ \fi
+}
+\def\PCF@PatchA#1\setbox\@outputbox\vbox#2#3\PCF@nil#4{%
+ \PCF@PatchB{#1}#2\PCF@nil{#3}#4%
+}
+\def\PCF@PatchB#1#2\footnoterule#3\PCF@nil#4#5{%
+ \toks@{%
+ \def#5{%
+ #1%
+ \setbox\@outputbox\vbox{%
+ #2%
+ \footnoterule
+ \pdfcolfoot@current
+ #3%
+ }%
+ #4%
+ }%
+ }%
+}
+\def\pdfcolfoot@all#1{%
+ \begingroup
+ \let\on@line\@empty
+ \PackageInfo{pdfcolfoot}{%
+ Patching \string\@makecol\space macros (#1)%
+ }%
+ \endgroup
+% \end{macrocode}
+% \LaTeX\ base macro:
+% \begin{macrocode}
+ \pdfcolfoot@patch\@makecol
+% \end{macrocode}
+% Class \xclass{aastex}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\@makecol@pptt
+% \end{macrocode}
+% Class \xclass{memoir}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\mem@makecol
+ \pdfcolfoot@patch\mem@makecolbf
+ \pdfcolfoot@patch\m@mopfootnote
+% \end{macrocode}
+% Class \xclass{revtex4}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\@combineinserts
+% \end{macrocode}
+% Package \xpackage{changebar}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\ltx@makecol
+% \end{macrocode}
+% Package \xpackage{dblfnote}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\dfn@latex@makecol
+% \end{macrocode}
+% Package \xpackage{fancyhdr}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\latex@makecol
+% \end{macrocode}
+% Package \xpackage{lscape}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\LS@makecol
+% \end{macrocode}
+% Package \xpackage{lineno}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\@LN@orig@makecol
+% \end{macrocode}
+% Package \xpackage{stfloats}:
+% \begin{macrocode}
+ \pdfcolfoot@patch\org@makecol
+ \pdfcolfoot@patch\fn@makecol
+% \end{macrocode}
+% \begin{macrocode}
+}
+\AtBeginDocument{\pdfcolfoot@all{AtBeginDocument}}
+\pdfcolfoot@all{AtEndOfPackage}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \begin{macrocode}
+%<*test1>
+\NeedsTeXFormat{LaTeX2e}
+\AtEndDocument{%
+ \typeout{}%
+ \typeout{**************************************}%
+ \typeout{*** \space Check the PDF file manually! \space ***}%
+ \typeout{**************************************}%
+ \typeout{}%
+}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfcompresslevel\endcsname\relax
+\else
+ \pdfcompresslevel=0 %
+\fi
+\documentclass[12pt,a5paper]{article}
+\usepackage{pdfcolfoot}[2016/05/16]
+\dimen\footins=\baselineskip % for testing
+\begin{document}
+ Black\footnote{Black \textcolor{blue}{Blue\\Blue} Black} %
+ \textcolor{red}{Red\newpage Red} Black%
+\end{document}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pdfcolfoot}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcolfoot.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcolfoot.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[\CTAN{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 pdfcolfoot.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@{}}
+% pdfcolfoot.sty & tex/latex/oberdiek/pdfcolfoot.sty\\
+% pdfcolfoot.pdf & doc/latex/oberdiek/pdfcolfoot.pdf\\
+% test/pdfcolfoot-test1.tex & doc/latex/oberdiek/test/pdfcolfoot-test1.tex\\
+% pdfcolfoot.dtx & source/latex/oberdiek/pdfcolfoot.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdfcolfoot.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pdfcolfoot.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 pdfcolfoot.dtx
+%makeindex -s gind.ist pdfcolfoot.idx
+%pdflatex pdfcolfoot.dtx
+%makeindex -s gind.ist pdfcolfoot.idx
+%pdflatex pdfcolfoot.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdfcolfoot.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdfcolfoot'>
+ <name>pdfcolfoot</name>
+ <caption>Separate color stack for footnotes with pdfTeX.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2012'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ Since version 1.40 <xref refid='pdftex'>pdfTeX</xref> supports
+ several colour stacks. This package uses a separate colour stack
+ for footnotes that can break across pages.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdfcolfoot.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdfcolfoot.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{pdfcol}
+% Heiko Oberdiek: \textit{The \xpackage{pdfcol} package};
+% 2007/09/09;\\
+% \CTAN{macros/latex/contrib/oberdiek/pdfcol.pdf}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/01/08 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.1}
+% \item
+% Use of package \xpackage{pdfcol}.
+% \item
+% Test file added.
+% \end{Version}
+% \begin{Version}{2012/01/02 v1.2}
+% \item
+% Support updated for memoir 2011/03/06 v3.6j.
+% (Thanks Bob for the bug report.)
+% \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/pdfcolfoot.pdf b/macros/latex/contrib/oberdiek/pdfcolfoot.pdf
new file mode 100644
index 0000000000..f864e6772d
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcolfoot.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdfcolmk.dtx b/macros/latex/contrib/oberdiek/pdfcolmk.dtx
new file mode 100644
index 0000000000..baa6f193a4
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcolmk.dtx
@@ -0,0 +1,1058 @@
+% \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 <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file 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
+%</ignore>
+%<*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 <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file 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
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*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}
+%</driver>
+% \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 https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \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}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/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[\CTAN{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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdfcolmk.pdf unpack_files output .|
+% \end{quote}
+%
+% \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}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdfcolmk.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdfcolmk'>
+ <name>pdfcolmk</name>
+ <caption>Improving colour support under pdftex.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2000,2005-2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ The package provides macros that emulate the &#x2018;colour stack&#x2019;
+ functionality of dvips. The colour stack deals with colour
+ manipulations when asynchronous events (like page-breaking) occur;
+ pdftex does not (yet) have such a stack, but dvips does, and the
+ <xref refid='color'>color</xref> package makes extensive use of
+ it.
+ <p/>
+ This package is an experimental solution to the problem, and works
+ best with pdf-e-tex.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdfcolmk.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdfcolmk.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \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
+% {http://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
+% {http://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
new file mode 100644
index 0000000000..8c67c3d1f7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcolmk.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdfcolparallel.dtx b/macros/latex/contrib/oberdiek/pdfcolparallel.dtx
new file mode 100644
index 0000000000..2c5ccfae3d
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcolparallel.dtx
@@ -0,0 +1,1161 @@
+% \iffalse meta-comment
+%
+% File: pdfcolparallel.dtx
+% Version: 2016/05/16 v1.4
+% Info: Color stacks support for parallel
+%
+% Copyright (C) 2007, 2008, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file pdfcolparallel.dtx
+% and the derived files
+% pdfcolparallel.sty, pdfcolparallel.pdf, pdfcolparallel.ins,
+% pdfcolparallel.drv, pdfcolparallel-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pdfcolparallel.dtx
+% CTAN:macros/latex/contrib/oberdiek/pdfcolparallel.pdf
+%
+% Unpacking:
+% (a) If pdfcolparallel.ins is present:
+% tex pdfcolparallel.ins
+% (b) Without pdfcolparallel.ins:
+% tex pdfcolparallel.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pdfcolparallel.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pdfcolparallel.drv is present:
+% latex pdfcolparallel.drv
+% (b) Without pdfcolparallel.drv:
+% latex pdfcolparallel.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 pdfcolparallel.dtx
+% makeindex -s gind.ist pdfcolparallel.idx
+% pdflatex pdfcolparallel.dtx
+% makeindex -s gind.ist pdfcolparallel.idx
+% pdflatex pdfcolparallel.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/pdfcolparallel.sty
+% TDS:doc/latex/oberdiek/pdfcolparallel.pdf
+% TDS:doc/latex/oberdiek/test/pdfcolparallel-test1.tex
+% TDS:source/latex/oberdiek/pdfcolparallel.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pdfcolparallel 2016/05/16 v1.4 Color stacks support for parallel (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pdfcolparallel
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2007, 2008, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file pdfcolparallel.dtx
+and the derived files
+ pdfcolparallel.sty, pdfcolparallel.pdf, pdfcolparallel.ins,
+ pdfcolparallel.drv, pdfcolparallel-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pdfcolparallel.ins}{\from{pdfcolparallel.dtx}{install}}%
+ \file{pdfcolparallel.drv}{\from{pdfcolparallel.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{pdfcolparallel.sty}{\from{pdfcolparallel.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pdfcolparallel-test1.tex}{\from{pdfcolparallel.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pdfcolparallel.xml}{\from{pdfcolparallel.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{* pdfcolparallel.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pdfcolparallel.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfcolparallel.drv}%
+ [2016/05/16 v1.4 Color stacks support for parallel (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{pdfcolparallel.dtx}%
+\end{document}
+%</driver>
+% \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{pdfcolparallel.drv}
+%
+% \title{The \xpackage{pdfcolparallel} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This packages fixes bugs in \xpackage{parallel} and
+% improves color support by using several color stacks
+% that are provided by \pdfTeX\ since version 1.40.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \begin{quote}
+% |\usepackage{pdfcolparallel}|
+% \end{quote}
+% The package \xpackage{pdfcolparallel} loads package \xpackage{parallel}
+% \cite{parallel} and redefines some macros to fix bugs.
+%
+% If color stacks are available then package \xpackage{parallel}
+% is further patched to support them.
+%
+% \subsection{Option \xoption{rulebetweencolor}}
+%
+% Package \xpackage{pdfcolparallel} also fixes the color for the
+% rule between columns.
+% Default color is \cs{normalcolor}. But this can be changed by using
+% option \xoption{rulebetweencolor} for |\setkeys{parallel}|
+% (see package \xpackage{keyval}). The option takes a color specification
+% as value. If the value is empty, then the default (\cs{normalcolor})
+% is used.
+% Examples:
+% \begin{quote}
+% |\setkeys{parallel}{rulebetweencolor=blue}|,\\
+% |\setkeys{parallel}{rulebetweencolor={red}}|,\\
+% |\setkeys{parallel}{rulebetweencolor={}}|,
+% \textit{\% \cs{normalcolor} is used}\\
+% |\setkeys{parallel}{rulebetweencolor=[rgb]{1,0,.5}}|
+% \end{quote}
+%
+% \subsection{Future}
+%
+% If there will be a new version of package \xpackage{parallel}
+% that adds support for color stacks, then this package may become
+% obsolete.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pdfcolparallel}%
+ [2016/05/16 v1.4 Color stacks support for parallel (HO)]%
+% \end{macrocode}
+%
+% \subsection{Load and fix package \xpackage{parallel}}
+%
+% Package \xpackage{parallel} is loaded. Before options of package
+% \xpackage{pdfcolparallel} are passed to package \xpackage{parallel}.
+% \begin{macrocode}
+\DeclareOption*{%
+ \PassoptionsToPackage{\CurrentOption}{parallel}%
+}
+\ProcessOptions\relax
+\RequirePackage{parallel}[2003/04/13]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{infwarerr}[2007/09/09]
+% \end{macrocode}
+%
+% \begin{macro}{\pcp@ColorPatch}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname currentgrouplevel\endcsname\relax
+ \def\pcp@ColorPatch{}%
+\else
+ \def\pcp@ColorPatch{%
+ \@ifundefined{set@color}{%
+ \gdef\pcp@ColorPatch{}%
+ }{%
+ \gdef\pcp@ColorPatch{%
+ \gdef\pcp@ColorResets{}%
+ \bgroup
+ \aftergroup\pcp@ColorResets
+ \aftergroup\egroup
+ \let\pcp@OrgSetColor\set@color
+ \let\set@color\pcp@SetColor
+ \edef\pcp@GroupLevel{\the\currentgrouplevel}%
+ }%
+ }%
+ \pcp@ColorPatch
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcp@SetColor}
+% \begin{macrocode}
+ \def\pcp@SetColor{%
+ \ifnum\pcp@GroupLevel=\currentgrouplevel
+ \let\pcp@OrgAfterGroup\aftergroup
+ \def\aftergroup{%
+ \g@addto@macro\pcp@ColorResets
+ }%
+ \pcp@OrgSetColor
+ \let\aftergroup\pcp@OrgAfterGroup
+ \else
+ \pcp@OrgSetColor
+ \fi
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pcp@CmdCheckRedef}
+% \begin{macrocode}
+\def\pcp@CmdCheckRedef#1{%
+ \begingroup
+ \def\pcp@cmd{#1}%
+ \afterassignment\pcp@CmdDo
+ \long\def\reserved@a
+}
+\def\pcp@CmdDo{%
+ \expandafter\ifx\pcp@cmd\reserved@a
+ \else
+ \edef\x*{\expandafter\string\pcp@cmd}%
+ \@PackageWarningNoLine{pdfcolparallel}{%
+ Command \x* has changed.\MessageBreak
+ Supported versions of package `parallel':\MessageBreak
+ \space\space 2003/04/13\MessageBreak
+ The redefinition of \x* may\MessageBreak
+ not behave correctly depending on the changes%
+ }%
+ \fi
+ \expandafter\endgroup
+ \expandafter\def\pcp@cmd
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\pcp@SwitchStack#1#2{}
+% \end{macrocode}
+% \begin{macrocode}
+\def\pcp@SetCurrent#1{}
+% \end{macrocode}
+%
+% \begin{macro}{\ParallelLText}
+% \begin{macrocode}
+\pcp@CmdCheckRedef\ParallelLText{%
+ \everypar{}%
+ \@restorepar
+ \begingroup
+ \hbadness=3000 %
+ \let\footnote=\ParallelLFootnote
+ \ParallelWhichBox=0 %
+ \global\setbox\ParallelLBox=\vbox\bgroup
+ \hsize=\ParallelLWidth
+ \aftergroup\ParallelAfterText
+ \begingroup
+ \afterassignment\ParallelCheckOpenBrace
+ \let\x=%
+}{%
+ \everypar{}%
+ \@restorepar
+ \@nobreakfalse
+ \begingroup
+ \hbadness=3000 %
+ \let\footnote=\ParallelLFootnote
+ \ParallelWhichBox=0 %
+ \global\setbox\ParallelLBox=\vbox\bgroup
+ \hsize=\ParallelLWidth
+ \linewidth=\ParallelLWidth
+ \pcp@SwitchStack{Left}\ParallelLBox
+ \aftergroup\ParallelAfterText
+ \pcp@ColorPatch
+ \begingroup
+ \afterassignment\ParallelCheckOpenBrace
+ \let\x=%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ParallelRText}
+% \begin{macrocode}
+\pcp@CmdCheckRedef\ParallelRText{%
+ \everypar{}%
+ \@restorepar
+ \begingroup
+ \hbadness=3000 %
+ \ifnum\ParallelFNMode=\@ne
+ \let\footnote=\ParallelRFootnote
+ \else
+ \let\footnote=\ParallelLFootnote
+ \fi
+ \ParallelWhichBox=\@ne
+ \global\setbox\ParallelRBox=\vbox\bgroup
+ \hsize=\ParallelRWidth
+ \aftergroup\ParallelAfterText
+ \begingroup
+ \afterassignment\ParallelCheckOpenBrace
+ \let\x=%
+}{%
+ \everypar{}%
+ \@restorepar
+ \@nobreakfalse
+ \begingroup
+ \hbadness=3000 %
+ \ifnum\ParallelFNMode=\@ne
+ \let\footnote=\ParallelRFootnote
+ \else
+ \let\footnote=\ParallelLFootnote
+ \fi
+ \ParallelWhichBox=\@ne
+ \global\setbox\ParallelRBox=\vbox\bgroup
+ \hsize=\ParallelRWidth
+ \linewidth=\ParallelRWidth
+ \pcp@SwitchStack{Right}\ParallelRBox
+ \aftergroup\ParallelAfterText
+ \pcp@ColorPatch
+ \begingroup
+ \afterassignment\ParallelCheckOpenBrace
+ \let\x=%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ParallelParTwoPages}
+% \begin{macrocode}
+\pcp@CmdCheckRedef\ParallelParTwoPages{%
+ \ifnum\ParallelBoolVar=\@ne
+ \par
+ \begingroup
+ \global\ParallelWhichBox=\@ne
+ \newpage
+ \vbadness=10000 %
+ \vfuzz=3ex %
+ \splittopskip=\z@skip
+ \loop%
+ \ifnum\ParallelBoolVar=\@ne%
+ \ifnum\ParallelWhichBox=\@ne
+ \ifvoid\ParallelLBox
+ \mbox{} %
+ \newpage
+ \else
+ \global\ParallelWhichBox=\z@
+ \fi
+ \else
+ \ifvoid\ParallelRBox
+ \mbox{} %
+ \newpage
+ \else
+ \global\ParallelWhichBox=\@ne
+ \fi
+ \fi
+ \ifnum\ParallelWhichBox=\z@
+ \ifodd\thepage
+ \mbox{} %
+ \newpage
+ \fi
+ \hbox to\textwidth{%
+ \vbox{\vsplit\ParallelLBox to.98\textheight}%
+ }%
+ \else
+ \ifodd\thepage\relax
+ \else
+ \mbox{} %
+ \newpage
+ \fi
+ \hbox to\textwidth{%
+ \vbox{\vsplit\ParallelRBox to.98\textheight}%
+ }%
+ \fi
+ \vspace*{\fill}%
+ \newpage
+ \fi
+ \ifvoid\ParallelLBox
+ \ifvoid\ParallelRBox
+ \global\ParallelBoolVar=\z@
+ \fi
+ \fi
+ \ifnum\ParallelBoolVar=\@ne
+ \repeat
+ \par
+ \endgroup
+ \fi
+}{%
+% \end{macrocode}
+% Additional fixes:
+% \begin{itemize}
+% \item Unnecessary white space removed.
+% \item |\ifodd\thepage| changed to |\ifodd\value{page}|.
+% \end{itemize}
+% \begin{macrocode}
+ \ifnum\ParallelBoolVar=\@ne
+ \par
+ \begingroup
+ \global\ParallelWhichBox=\@ne
+ \newpage
+ \vbadness=10000 %
+ \vfuzz=3ex %
+ \splittopskip=\z@skip
+ \loop%
+ \ifnum\ParallelBoolVar=\@ne%
+ \ifnum\ParallelWhichBox=\@ne
+ \ifvoid\ParallelLBox
+ \mbox{}%
+ \newpage
+ \else
+ \global\ParallelWhichBox=\z@
+ \fi
+ \else
+ \ifvoid\ParallelRBox
+ \null
+ \newpage
+ \else
+ \global\ParallelWhichBox=\@ne
+ \fi
+ \fi
+ \ifnum\ParallelWhichBox=\z@
+ \ifodd\value{page}%
+ \null
+ \newpage
+ \fi
+ \hbox to\textwidth{%
+ \pcp@SetCurrent{Left}%
+ \setbox\z@=\vsplit\ParallelLBox to.98\textheight
+ \vbox to.98\textheight{%
+ \@texttop
+ \unvbox\z@
+ \@textbottom
+ }%
+ }%
+ \else
+ \ifodd\value{page}%
+ \else
+ \mbox{}%
+ \newpage
+ \fi
+ \hbox to\textwidth{%
+ \pcp@SetCurrent{Right}%
+ \setbox\z@=\vsplit\ParallelRBox to.98\textheight
+ \vbox to.98\textheight{%
+ \@texttop
+ \unvbox\z@
+ \@textbottom
+ }%
+ }%
+ \fi
+ \vspace*{\fill}%
+ \newpage
+ \fi
+ \ifvoid\ParallelLBox
+ \ifvoid\ParallelRBox
+ \global\ParallelBoolVar=\z@
+ \fi
+ \fi
+ \ifnum\ParallelBoolVar=\@ne
+ \repeat
+ \par
+ \endgroup
+ \pcp@SetCurrent{}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Color stack support}
+%
+% \begin{macrocode}
+\RequirePackage{pdfcol}[2007/12/12]
+\ifpdfcolAvailable
+\else
+ \PackageInfo{pdfcolparallel}{%
+ Loading aborted, because color stacks are not available%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\pdfcolInitStack{pcp@Left}
+\pdfcolInitStack{pcp@Right}
+% \end{macrocode}
+% \begin{macro}{\pcp@Box}
+% \begin{macrocode}
+\newbox\pcp@Box
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcp@SwitchStack}
+% \begin{macrocode}
+\def\pcp@SwitchStack#1#2{%
+ \pdfcolSwitchStack{pcp@#1}%
+ \global\setbox\pcp@Box=\vbox to 0pt{%
+ \pdfcolSetCurrentColor
+ }%
+ \aftergroup\pcp@FixBox
+ \aftergroup#2%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcp@FixBox}
+% \begin{macrocode}
+\def\pcp@FixBox#1{%
+ \global\setbox#1=\vbox{%
+ \unvbox\pcp@Box
+ \unvbox#1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcp@SetCurrent}
+% \begin{macrocode}
+\def\pcp@SetCurrent#1{%
+ \ifx\\#1\\%
+ \pdfcolSetCurrent{}%
+ \else
+ \pdfcolSetCurrent{pcp@#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Redefinitions}
+%
+% \begin{macro}{\ParallelParOnePage}
+% \begin{macrocode}
+\pcp@CmdCheckRedef\ParallelParOnePage{%
+ \ifnum\ParallelBoolVar=\@ne
+ \par
+ \begingroup
+ \leftmargin=\z@
+ \rightmargin=\z@
+ \parskip=\z@skip
+ \parindent=\z@
+ \vbadness=10000 %
+ \vfuzz=3ex %
+ \splittopskip=\z@skip
+ \loop
+ \ifnum\ParallelBoolVar=\@ne
+ \noindent
+ \hbox to\textwidth{%
+ \hskip\ParallelLeftMargin
+ \hbox to\ParallelTextWidth{%
+ \ifvoid\ParallelLBox
+ \hskip\ParallelLWidth
+ \else
+ \ParallelWhichBox=\z@
+ \vbox{%
+ \setbox\ParallelBoxVar
+ =\vsplit\ParallelLBox to\dp\strutbox
+ \unvbox\ParallelBoxVar
+ }%
+ \fi
+ \strut
+ \ifnum\ParallelBoolMid=\@ne
+ \hskip\ParallelMainMidSkip
+ \vrule
+ \else
+ \hss
+ \fi
+ \hss
+ \ifvoid\ParallelRBox
+ \hskip\ParallelRWidth
+ \else
+ \ParallelWhichBox=\@ne
+ \vbox{%
+ \setbox\ParallelBoxVar
+ =\vsplit\ParallelRBox to\dp\strutbox
+ \unvbox\ParallelBoxVar
+ }%
+ \fi
+ }%
+ }%
+ \ifvoid\ParallelLBox
+ \ifvoid\ParallelRBox
+ \global\ParallelBoolVar=\z@
+ \fi
+ \fi%
+ \fi%
+ \ifnum\ParallelBoolVar=\@ne
+ \penalty\interlinepenalty
+ \repeat
+ \par
+ \endgroup
+ \fi
+}{%
+ \ifnum\ParallelBoolVar=\@ne
+ \par
+ \begingroup
+ \leftmargin=\z@
+ \rightmargin=\z@
+ \parskip=\z@skip
+ \parindent=\z@
+ \vbadness=10000 %
+ \vfuzz=3ex %
+ \splittopskip=\z@skip
+ \loop
+ \ifnum\ParallelBoolVar=\@ne
+ \noindent
+ \hbox to\textwidth{%
+ \hskip\ParallelLeftMargin
+ \hbox to\ParallelTextWidth{%
+ \ifvoid\ParallelLBox
+ \hskip\ParallelLWidth
+ \else
+ \pcp@SetCurrent{Left}%
+ \ParallelWhichBox=\z@
+ \vbox{%
+ \setbox\ParallelBoxVar
+ =\vsplit\ParallelLBox to\dp\strutbox
+ \unvbox\ParallelBoxVar
+ }%
+ \fi
+ \strut
+ \ifnum\ParallelBoolMid=\@ne
+ \hskip\ParallelMainMidSkip
+ \begingroup
+ \pcp@RuleBetweenColor
+ \vrule
+ \endgroup
+ \else
+ \hss
+ \fi
+ \hss
+ \ifvoid\ParallelRBox
+ \hskip\ParallelRWidth
+ \else
+ \pcp@SetCurrent{Right}%
+ \ParallelWhichBox=\@ne
+ \vbox{%
+ \setbox\ParallelBoxVar
+ =\vsplit\ParallelRBox to\dp\strutbox
+ \unvbox\ParallelBoxVar
+ }%
+ \fi
+ }%
+ }%
+ \ifvoid\ParallelLBox
+ \ifvoid\ParallelRBox
+ \global\ParallelBoolVar=\z@
+ \fi
+ \fi%
+ \fi%
+ \ifnum\ParallelBoolVar=\@ne
+ \penalty\interlinepenalty
+ \repeat
+ \par
+ \endgroup
+ \pcp@SetCurrent{}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcp@RuleBetweenColorDefault}
+% \begin{macrocode}
+\def\pcp@RuleBetweenColorDefault{%
+ \normalcolor
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcp@RuleBetweenColor}
+% \begin{macrocode}
+\let\pcp@RuleBetweenColor\pcp@RuleBetweenColorDefault
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\RequirePackage{keyval}
+\define@key{parallel}{rulebetweencolor}{%
+ \edef\pcp@temp{#1}%
+ \ifx\pcp@temp\@empty
+ \let\pcp@RuleBetweenColor\pcp@RuleBetweenColorDefault
+ \else
+ \edef\pcp@temp{%
+ \noexpand\@ifnextchar[{%
+ \def\noexpand\pcp@RuleBetweenColor{%
+ \noexpand\color\pcp@temp
+ }%
+ \noexpand\pcp@GobbleNil
+ }{%
+ \def\noexpand\pcp@RuleBetweenColor{%
+ \noexpand\color{\pcp@temp}%
+ }%
+ \noexpand\pcp@GobbleNil
+ }%
+ \pcp@temp\noexpand\@nil
+ }%
+ \pcp@temp
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\pcp@GobbleNil}
+% \begin{macrocode}
+\long\def\pcp@GobbleNil#1\@nil{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% The test file is a modified version of the file that
+% Alexander Hirsch has posted in \xnewsgroup{de.comp.text.tex}:
+% \URL{``\link{\texttt{parallel.sty} und farbiger Text}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/6a759cf33bb071a5}
+% \begin{macrocode}
+%<*test1>
+\AtEndDocument{%
+ \typeout{}%
+ \typeout{**************************************}%
+ \typeout{*** \space Check the PDF file manually! \space ***}%
+ \typeout{**************************************}%
+ \typeout{}%
+}
+\documentclass{article}
+\usepackage{xcolor}
+\usepackage{pdfcolparallel}[2016/05/16]
+
+\begin{document}
+ \color{green}%
+ Green%
+ \begin{Parallel}{0.47\textwidth}{0.47\textwidth}%
+ \ParallelLText{%
+ \textcolor{red}{%
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll. %
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll.%
+ }%
+ }%
+ \ParallelRText{%
+ \textcolor{blue}{%
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll. %
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll.%
+ }%
+ }%
+ \ParallelPar
+ \ParallelLText{%
+ Default %
+ \color{red}%
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll. %
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll.%
+ }%
+ \ParallelRText{%
+ Default %
+ \color{blue}%
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll. %
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll.%
+ }%
+ \ParallelPar
+ \ParallelLText{%
+ \begin{enumerate}%
+ \item left text, left text, left text, left text, %
+ left text, left text, left text, left text,%
+ \item left text, left text, left text, left text, %
+ left text, left text, left text, left text.%
+ \end{enumerate}%
+ }%
+ \ParallelRText{%
+ \begin{enumerate}%
+ \item right text, right text, right text, right text, %
+ right text, right text, right text, right text.%
+ \item right text, right text, right text, right text, %
+ right text, right text, right text, right text.%
+ \end{enumerate}%
+ }%
+ \end{Parallel}%
+ \begin{Parallel}[p]{\textwidth}{\textwidth}%
+ \ParallelLText{%
+ \textcolor{red}{%
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll. %
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll. %
+ Foo bar bla bla bla.%
+ }%
+ \par
+ Und noch ein Absatz.%
+ }%
+ \ParallelRText{%
+ \textcolor{blue}{%
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll. %
+ Ein Absatz, der sich ueber zwei Zeilen erstrecken soll. %
+ Foo bar bla bla bla.%
+ }%
+ }%
+ \end{Parallel}%
+ \begin{Parallel}[p]{\textwidth}{\textwidth}%
+ \ParallelLText{%
+ \rule{1pt}{.98\textheight}\Huge g%
+ }%
+ \ParallelRText{%
+ \rule{1pt}{.98\textheight}y%
+ }%
+ \end{Parallel}%
+ Green%
+\end{document}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pdfcolparallel}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcolparallel.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcolparallel.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[\CTAN{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 pdfcolparallel.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@{}}
+% pdfcolparallel.sty & tex/latex/oberdiek/pdfcolparallel.sty\\
+% pdfcolparallel.pdf & doc/latex/oberdiek/pdfcolparallel.pdf\\
+% test/pdfcolparallel-test1.tex & doc/latex/oberdiek/test/pdfcolparallel-test1.tex\\
+% pdfcolparallel.dtx & source/latex/oberdiek/pdfcolparallel.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdfcolparallel.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pdfcolparallel.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 pdfcolparallel.dtx
+%makeindex -s gind.ist pdfcolparallel.idx
+%pdflatex pdfcolparallel.dtx
+%makeindex -s gind.ist pdfcolparallel.idx
+%pdflatex pdfcolparallel.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdfcolparallel.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdfcolparallel'>
+ <name>pdfcolparallel</name>
+ <caption>Fix colour problems in package 'parallel'.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2008,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ Since version 1.40 pdfTeX supports colour stacks.
+ This package uses them to fix colour problems in
+ package <xref refid='parallel'>parallel</xref>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdfcolparallel.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdfcolparallel.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{parallel}
+% Matthias Eckermann: \textit{The \xpackage{parallel}-package};
+% 2003/04/13;\\
+% \CTAN{macros/latex/contrib/parallel/}.
+%
+% \bibitem{pdfcol}
+% Heiko Oberdiek: \textit{The \xpackage{pdfcol} package};
+% 2007/09/09;\\
+% \CTAN{macros/latex/contrib/oberdiek/pdfcol.pdf}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/09/09 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/12/12 v1.1}
+% \item
+% Adds patch for setting \cs{linewidth} to fix bug
+% in package \xpackage{parallel}.
+% \item
+% Package \xpackage{parallel} is also fixed if color
+% stacks are not available.
+% \item
+% Bug fix, switched stacks now initialized with current color.
+% \item
+% Fix for package \xpackage{parallel}: \cs{raggedbottom} is respected.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.2}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2010/01/11 v1.3}
+% \item
+% Option `rulebetweencolor' added.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pdfcolparallel.pdf b/macros/latex/contrib/oberdiek/pdfcolparallel.pdf
new file mode 100644
index 0000000000..bbadf02f10
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcolparallel.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx b/macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx
new file mode 100644
index 0000000000..5a5c818310
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx
@@ -0,0 +1,847 @@
+% \iffalse meta-comment
+%
+% File: pdfcolparcolumns.dtx
+% Version: 2016/05/16 v1.4
+% Info: Color stacks for parcolumns
+%
+% Copyright (C) 2007, 2008, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file pdfcolparcolumns.dtx
+% and the derived files
+% pdfcolparcolumns.sty, pdfcolparcolumns.pdf, pdfcolparcolumns.ins,
+% pdfcolparcolumns.drv, pdfcolparcolumns-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx
+% CTAN:macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf
+%
+% Unpacking:
+% (a) If pdfcolparcolumns.ins is present:
+% tex pdfcolparcolumns.ins
+% (b) Without pdfcolparcolumns.ins:
+% tex pdfcolparcolumns.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pdfcolparcolumns.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pdfcolparcolumns.drv is present:
+% latex pdfcolparcolumns.drv
+% (b) Without pdfcolparcolumns.drv:
+% latex pdfcolparcolumns.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 pdfcolparcolumns.dtx
+% makeindex -s gind.ist pdfcolparcolumns.idx
+% pdflatex pdfcolparcolumns.dtx
+% makeindex -s gind.ist pdfcolparcolumns.idx
+% pdflatex pdfcolparcolumns.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/pdfcolparcolumns.sty
+% TDS:doc/latex/oberdiek/pdfcolparcolumns.pdf
+% TDS:doc/latex/oberdiek/test/pdfcolparcolumns-test1.tex
+% TDS:source/latex/oberdiek/pdfcolparcolumns.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pdfcolparcolumns 2016/05/16 v1.4 Color stacks for parcolumns (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pdfcolparcolumns
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2007, 2008, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file pdfcolparcolumns.dtx
+and the derived files
+ pdfcolparcolumns.sty, pdfcolparcolumns.pdf, pdfcolparcolumns.ins,
+ pdfcolparcolumns.drv, pdfcolparcolumns-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pdfcolparcolumns.ins}{\from{pdfcolparcolumns.dtx}{install}}%
+ \file{pdfcolparcolumns.drv}{\from{pdfcolparcolumns.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{pdfcolparcolumns.sty}{\from{pdfcolparcolumns.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pdfcolparcolumns-test1.tex}{\from{pdfcolparcolumns.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pdfcolparcolumns.xml}{\from{pdfcolparcolumns.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{* pdfcolparcolumns.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pdfcolparcolumns.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfcolparcolumns.drv}%
+ [2016/05/16 v1.4 Color stacks for parcolumns (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{pdfcolparcolumns.dtx}%
+\end{document}
+%</driver>
+% \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{pdfcolparcolumns.drv}
+%
+% \title{The \xpackage{pdfcolparcolumns} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Since version 1.40 \pdfTeX\ supports several color stacks.
+% This package uses them to fix color problems in
+% package \xpackage{parcolumns}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \begin{quote}
+% |\usepackage{pdfcolparcolumns}|
+% \end{quote}
+% The package \xpackage{pdfcolparcolumns} loads package \xpackage{parcolums}
+% \cite{parcolumns}. If color stacks are available then the
+% macros of \xpackage{parcolumns} are patched to add support
+% for color stacks.
+%
+% \subsection{Option \xoption{rulebetweencolor}}
+%
+% Package \xpackage{pdfcolparcolumns} also fixes the color for the
+% rule between columns (if \xoption{rulebetween} is set).
+% Default color is \cs{normalcolor}. But this can be changed by using
+% option \xoption{rulebetweencolor}. It takes a color specification
+% as value. If the value is empty, then the default (\cs{normalcolor})
+% is used.
+% Examples:
+% \begin{quote}
+% |rulebetweencolor=blue|,\\
+% |rulebetweencolor={red}|,\\
+% |rulebetweencolor={}|, \textit{\% \cs{normalcolor} is used}\\
+% |rulebetweencolor=[rgb]{1,0,.5}| \textit{\% see below}
+% \end{quote}
+% If used inside the optional argument of environment \textsf{parcolumns}
+% and the value contains an optional argument, then whole value
+% must be put in curly braces:
+%\begin{quote}
+%\begin{verbatim}
+%\begin{parcolumns}[
+% rulebetween,
+% rulebetweencolor={[rgb]{1,0,.5}},
+%]{2}
+% ...
+%\end{parcolumns}
+%\end{verbatim}
+%\end{quote}
+% This option \xoption{rulebetweencolor} can also be set using
+% \cs{setkeys}:
+%\begin{quote}
+%\begin{verbatim}
+%\setkeys{parcolumns}{rulebetweencolor=green}
+%\end{verbatim}
+%\end{quote}
+%
+% \subsection{Future}
+%
+% Currently package \xpackage{parcolumns} does not seem to be
+% maintained. Nevertheless if there will be a new version that
+% adds support for color stacks, then this package may become
+% obsolete.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pdfcolparcolumns}%
+ [2016/05/16 v1.4 Color stacks for parcolumns (HO)]%
+% \end{macrocode}
+%
+% \subsection{Load packages}
+%
+% \subsubsection{Package \xpackage{parcolumns}}
+%
+% Currently package \xpackage{parcolumns} does not define options.
+% Thus it is just a precaution that the options of
+% package \xpackage{pdfcolparcolumns} are passed to
+% package \xpackage{parcolumns}.
+% \begin{macrocode}
+\DeclareOption*{%
+ \PassoptionsToPackage{\CurrentOption}{parcolumns}%
+}
+\ProcessOptions\relax
+\RequirePackage{parcolumns}[2004/11/25]
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{pdfcol}}
+%
+% \begin{macrocode}
+\RequirePackage{pdfcol}[2007/09/09]
+\ifpdfcolAvailable
+\else
+ \PackageInfo{pdfcolparcolumns}{%
+ Loading aborted, because color stacks are not available%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{infwarerr}}
+%
+% \begin{macrocode}
+\RequirePackage{infwarerr}[2007/09/09]
+% \end{macrocode}
+%
+% \subsection{Color stack macros}
+%
+% \begin{macro}{\pcpc@MaxStack}
+% Macro \cs{pcpc@MaxStack} holds the highest number of
+% allocated stacks.
+% \begin{macrocode}
+\global\chardef\pcpc@MaxStack=\z@
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcpc@InitStacks}
+% Macro \cs{pcpc@InitStacks} takes the number of columns
+% as argument and ensures that there are enough color
+% stacks for all columns.
+% \begin{macrocode}
+\def\pcpc@InitStacks#1{%
+ \ifnum#1>\pcpc@MaxStack
+ \begingroup
+ \count@\pcpc@MaxStack
+ \loop
+ \advance\count@\@ne
+ \pdfcolInitStack{pcpc@\the\count@}%
+ \ifnum#1>\count@
+ \repeat
+ \global\chardef\pcpc@MaxStack=\count@
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pcpc@SwitchStack}
+% \begin{macrocode}
+\def\pcpc@SwitchStack#1{%
+ \pdfcolSwitchStack{pcpc@\number#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pcpc@SetCurrent}
+% \begin{macrocode}
+\def\pcpc@SetCurrent#1{%
+ \pdfcolSetCurrent{pcpc@\number#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Patches}
+%
+% Now the color stack macros are patched into the macros
+% of package \xpackage{parcolumns}.
+%
+% \subsubsection{Init stacks}
+%
+% \cs{pcpc@InitStacks} should go into the definition of
+% environment |parcolumns|. \cs{pc@alloccolumns} is executed
+% there and nowhere else, thus we hook into it.
+% \begin{macrocode}
+\g@addto@macro\pc@alloccolumns{%
+ \pcpc@InitStacks\pc@columncount
+}
+% \end{macrocode}
+%
+% \subsubsection{Switch stack}
+%
+% \cs{pcpc@SwitchStack} should be called by marco \cs{colchunk@}.
+% However it is easier to patch \cs{pc@setcolumnwidth} that
+% is executed in \cs{colchunk@} only.
+% \begin{macrocode}
+\g@addto@macro\pc@setcolumnwidth{%
+ \pcpc@SwitchStack\pc@columnctr
+}
+% \end{macrocode}
+%
+% \subsubsection{Set current stack color}
+%
+% \cs{pcpc@SetCurrent} is set at the begin of each line.
+% It must be inserted into \cs{pc@placeboxes}. Unhappily
+% there is no easy way. Therefore we check and
+% redefine \cs{pc@placeboxes}.
+% \begin{macrocode}
+\begingroup
+ \def\x{%
+ \global\let\@tempa\relax
+ \count@\z@
+ \hb@xt@\linewidth{%
+ \vfuzz30ex %
+ \vbadness\@M
+ \splittopskip\z@skip
+ \loop
+ \ifnum\count@<\pc@columncount
+ \advance\count@\@ne
+ \expandafter\ifvoid\csname pc@column@\number\count@\endcsname
+ \hskip\csname pc@column@width@\number\count@\endcsname
+ \else
+ \expandafter\setbox\expandafter\@tempboxa\expandafter
+ \vsplit\csname pc@column@\number\count@\endcsname
+ to \dp\strutbox
+ \vbox{%
+ \unvbox\@tempboxa
+ }%
+ \fi
+ \expandafter\ifvoid\csname pc@column@\number\count@\endcsname
+ \else
+ \global\let\@tempa\pc@placeboxes
+ \fi
+ \ifnum\count@<\pc@columncount
+ \strut
+ \hfill
+ \ifpc@rulebetween
+ \vrule
+ \hfill
+ \fi
+ \fi
+ \repeat
+ }%
+ \@tempa
+ }%
+ \ifx\x\pc@placeboxes
+ \else
+ \@PackageWarningNoLine{pdfcolparcolumns}{%
+ Command \string\pc@placeboxes\space has changed.\MessageBreak
+ Supported versions of package `parcolumns':\MessageBreak
+ \space\space 2004/08/05.\MessageBreak
+ The redefinition of \string\pc@placeboxes\space may not%
+ \MessageBreak
+ behave correctly depending on the changes%
+ }%
+ \fi
+\endgroup
+% \end{macrocode}
+% \begin{macro}{\pc@placeboxes}
+% \begin{macrocode}
+\renewcommand*{\pc@placeboxes}{%
+ \global\let\@tempa\relax
+ \count@\z@
+ \hb@xt@\linewidth{%
+ \vfuzz30ex %
+ \vbadness\@M
+ \splittopskip\z@skip
+ \loop
+ \ifnum\count@<\pc@columncount
+ \advance\count@\@ne
+ \expandafter\ifvoid\csname pc@column@\number\count@\endcsname
+ \hskip\csname pc@column@width@\number\count@\endcsname
+ \else
+ \expandafter\setbox\expandafter\@tempboxa\expandafter
+ \vsplit\csname pc@column@\number\count@\endcsname
+ to \dp\strutbox
+ \vbox{%
+ \pcpc@SetCurrent\count@
+ \unvbox\@tempboxa
+ }%
+ \fi
+ \expandafter\ifvoid\csname pc@column@\number\count@\endcsname
+ \else
+ \global\let\@tempa\pc@placeboxes
+ \fi
+ \ifnum\count@<\pc@columncount
+ \strut
+ \hfill
+ \ifpc@rulebetween
+ \begingroup
+ \pcpc@RuleBetweenColor
+ \vrule
+ \endgroup
+ \hfill
+ \fi
+ \fi
+ \repeat
+ }%
+ \@tempa
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcpc@RuleBetweenColorDefault}
+% \begin{macrocode}
+\def\pcpc@RuleBetweenColorDefault{%
+ \normalcolor
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pcpc@RuleBetweenColor}
+% \begin{macrocode}
+\let\pcpc@RuleBetweenColor\pcpc@RuleBetweenColorDefault
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\define@key{parcolumns}{rulebetweencolor}{%
+ \edef\pcpc@temp{#1}%
+ \ifx\pcpc@temp\@empty
+ \let\pcpc@RuleBetweenColor\pcpc@RuleBetweenColorDefault
+ \else
+ \edef\pcpc@temp{%
+ \noexpand\@ifnextchar[{%
+ \def\noexpand\pcpc@RuleBetweenColor{%
+ \noexpand\color\pcpc@temp
+ }%
+ \noexpand\pcpc@GobbleNil
+ }{%
+ \def\noexpand\pcpc@RuleBetweenColor{%
+ \noexpand\color{\pcpc@temp}%
+ }%
+ \noexpand\pcpc@GobbleNil
+ }%
+ \pcpc@temp\noexpand\@nil
+ }%
+ \pcpc@temp
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\pcpc@GobbleNil}
+% \begin{macrocode}
+\long\def\pcpc@GobbleNil#1\@nil{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% The test file is a modified version of the file that
+% Donald Goodman has posted in \xnewsgroup{comp.text.tex}: ^^A
+% \URL{``\link{Re: \xpackage{xcolor} glitches}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/8eda74ed292012bb}
+% \begin{macrocode}
+%<*test1>
+\NeedsTeXFormat{LaTeX2e}
+\AtEndDocument{%
+ \typeout{}%
+ \typeout{**************************************}%
+ \typeout{*** \space Check the PDF file manually! \space ***}%
+ \typeout{**************************************}%
+ \typeout{}%
+}
+\documentclass{article}
+\usepackage{xcolor}
+\usepackage{pdfcolparcolumns}
+
+\newcommand{\instruct}[1]{%
+ \noindent
+ \footnotesize
+ \textcolor{red}{#1}%
+}
+
+\begin{document}
+ \begin{parcolumns}[colwidths={1=2.3in,2=2.3in},sloppy]{2}%
+ \colchunk[1]{%
+ \instruct{Et non dicitur versus} %
+ Fidelium anim\ae\ %
+ \instruct{%
+ sed immediate subiungitur antiphona finalis %
+ beat\ae\ Mari\ae\ Virginis%
+ } %
+ 100.%
+ }%
+ \colchunk[2]{%
+ \instruct{%
+ And the verse %
+ \textcolor{black}{May the souls of the faithful} %
+ is not said, but the final antiphon of the %
+ Blessed Virgin Mary, %
+ \textcolor{black}{100,} %
+ is immediately joined.%
+ }%
+ }%
+ \end{parcolumns}%
+\end{document}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pdfcolparcolumns}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcolparcolumns.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[\CTAN{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 pdfcolparcolumns.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@{}}
+% pdfcolparcolumns.sty & tex/latex/oberdiek/pdfcolparcolumns.sty\\
+% pdfcolparcolumns.pdf & doc/latex/oberdiek/pdfcolparcolumns.pdf\\
+% test/pdfcolparcolumns-test1.tex & doc/latex/oberdiek/test/pdfcolparcolumns-test1.tex\\
+% pdfcolparcolumns.dtx & source/latex/oberdiek/pdfcolparcolumns.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdfcolparcolumns.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pdfcolparcolumns.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 pdfcolparcolumns.dtx
+%makeindex -s gind.ist pdfcolparcolumns.idx
+%pdflatex pdfcolparcolumns.dtx
+%makeindex -s gind.ist pdfcolparcolumns.idx
+%pdflatex pdfcolparcolumns.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdfcolparcolumns.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdfcolparcolumns'>
+ <name>pdfcolparcolumns</name>
+ <caption>Fix colour problems in package 'parcolumns'.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2008,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ Since version 1.40 pdfTeX supports colour stacks.
+ This package uses them to fix colour problems in
+ package <xref refid='parcolumns'>parcolumns</xref>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{parcolumns}
+% Jonathan Sauer: \textit{The \xpackage{parcolumns} package};
+% 2004/11/25;\\
+% \CTAN{macros/latex/contrib/sauerj/parcolumns.pdf}.
+%
+% \bibitem{pdfcol}
+% Heiko Oberdiek: \textit{The \xpackage{pdfcol} package};
+% 2007/09/09;\\
+% \CTAN{macros/latex/contrib/oberdiek/pdfcol.pdf}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/07/26 v1.0}
+% \item
+% First version, published in the newsgroup \xnewsgroup{comp.text.tex}
+% with the name \xpackage{parcolumns-colorstacks}: ^^A no line break
+% \URL{``\link{Re: \xpackage{xcolor} glitches}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/56bd897b11bca414}
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.1}
+% \item
+% CTAN version, package name renamed to \xpackage{pdfcolparcolumns}.
+% \item
+% Uses package \xpackage{pdfcol}.
+% \item
+% Documentation added.
+% \item
+% Test file added.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.2}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2010/01/11 v1.3}
+% \item
+% Fix for rule color.
+% \item
+% New option \xoption{rulebetweencolor} for environment |parcolumns|.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf b/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf
new file mode 100644
index 0000000000..a05da4f901
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdfcrypt.dtx b/macros/latex/contrib/oberdiek/pdfcrypt.dtx
new file mode 100644
index 0000000000..2f036e1514
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcrypt.dtx
@@ -0,0 +1,1160 @@
+% \iffalse meta-comment
+%
+% File: pdfcrypt.dtx
+% Version: 2016/05/16 v1.1
+% Info: Allows the setting of PDF encryption
+%
+% Copyright (C) 2001, 2006, 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 pdfcrypt.dtx
+% and the derived files
+% pdfcrypt.sty, pdfcrypt.pdf, pdfcrypt.ins, pdfcrypt.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pdfcrypt.dtx
+% CTAN:macros/latex/contrib/oberdiek/pdfcrypt.pdf
+%
+% Unpacking:
+% (a) If pdfcrypt.ins is present:
+% tex pdfcrypt.ins
+% (b) Without pdfcrypt.ins:
+% tex pdfcrypt.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pdfcrypt.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pdfcrypt.drv is present:
+% latex pdfcrypt.drv
+% (b) Without pdfcrypt.drv:
+% latex pdfcrypt.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 pdfcrypt.dtx
+% makeindex -s gind.ist pdfcrypt.idx
+% pdflatex pdfcrypt.dtx
+% makeindex -s gind.ist pdfcrypt.idx
+% pdflatex pdfcrypt.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/pdfcrypt.sty
+% TDS:doc/latex/oberdiek/pdfcrypt.pdf
+% TDS:source/latex/oberdiek/pdfcrypt.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pdfcrypt 2016/05/16 v1.1 Allows the setting of PDF encryption (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pdfcrypt
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2001, 2006, 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 pdfcrypt.dtx
+and the derived files
+ pdfcrypt.sty, pdfcrypt.pdf, pdfcrypt.ins, pdfcrypt.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pdfcrypt.ins}{\from{pdfcrypt.dtx}{install}}%
+ \file{pdfcrypt.drv}{\from{pdfcrypt.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{pdfcrypt.sty}{\from{pdfcrypt.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pdfcrypt.xml}{\from{pdfcrypt.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{* pdfcrypt.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pdfcrypt.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfcrypt.drv}%
+ [2016/05/16 v1.1 Allows the setting of PDF encryption (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{pdfcrypt.dtx}%
+\end{document}
+%</driver>
+% \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{pdfcrypt.drv}
+%
+% \title{The \xpackage{pdfcrypt} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package supports the setting of pdf encryption options
+% for \VTeX\ and some older versions of \pdfTeX.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% This package allows the setting of pdf encryption
+% options for
+% \begin{itemize}
+% \item
+% \VTeX, since version 7.35, \url{http://www.micropress-inc.com/}.
+% \item
+% \pdfTeX, patched by
+% \NameEmail{Ricardo Sanchez Carmenes}{carmenes@bioquimica.uniovi.es}.\\
+% Some supported versions are:
+% \begin{quote}
+% \pdfTeX-1.00a,\\
+% \pdfTeX-0.14h-pdfcrypt-20010310,\\
+% pdfcrypt-20010331
+% \end{quote}
+% \end{itemize}
+%
+% \noindent
+% \textcolor{red}{Note:} Since \pdfTeX-1.10a (2003-01-16) encryption
+% support was dropped! Thus the package is now obsolete for recent
+% \pdfTeX\ versions.
+%
+% \subsection{Alternatives}
+%
+% There are free alternatives, programs that can
+% be used for postprocessing the pdf file:
+% \begin{itemize}
+% \item \textsf{pdftk}\\
+% \url{http://www.accesspdf.com/pdftk/}
+% \item \textsf{Multivalent}\\
+% \url{http://multivalent.sourceforge.net/}
+% \item \textsf{PDFBox}\\
+% \url{http://www.pdfbox.org/}
+% \item \textsf{PDFTrans}\\
+% \url{http://maddingue.free.fr/softwares/pdftrans.html}
+% \item \dots
+% \end{itemize}
+%
+% \subsection{Usage}
+%
+% The options can be set as package options or
+% with the command \cs{pdfcryptsetup}:
+% \begin{quote}
+% |owner=|\meta{owner password}\\
+% |user=|\meta{user password}\\
+% |print|, |copy|, |edit|, |annotate=true|, |false|\\
+% |all|, |none|\\
+% |debug|
+% \end{quote}
+% The encryption is set at |\begin{document}| by default,
+% but this can be forced for an earlier time
+% using the option |set|.
+% Example:
+% \begin{quote}
+% |\usepackage[owner=Donald,user=Knuth,print=false]{pdfcrypt}|\\
+% \dots\\
+% |\begin{document}|
+% \end{quote}
+% or
+% \begin{quote}
+% |\usepackage{pdfcrypt}|\\
+% |\pdfcryptsetup{owner=Donald,user=Knut}|\\
+% |\pdfcryptsetup{print=false,set}|\\
+% \dots\\
+% |\begin{document}|
+% \end{quote}
+%
+% \subsubsection{Special characters}
+%
+% The characters `|{|', `|}|', and `|\|' have to be
+% escaped with `|\|'. Then the string should not
+% be specified as package option but with
+% the macro \cs{pdfcryptsetup}, eg:
+% \begin{quote}
+% |\pdfcryptsetup{user={\{\\Hello\}},print=false}|
+% \end{quote}
+% The password here is ``|{\Hello}|''.
+% Active characters can be used and are not expanded.
+% Macros except for |\{|, |\}|, and |\\| should not be used
+% and are not expanded.
+%
+% \subsubsection{\cs{nopdfcrypt}}
+%
+% Often the whole process of pdf generation includes
+% several \TeX\ compilations and perhaps other
+% postprocessing steps. Therefore a feature would
+% be useful to disable the encryption stuff in order
+% to speed up the first compilations.
+% Therefore package \xpackage{pdfcrypt} will look for
+% the macro \cs{nopdfcrypt}. If it has the meaning of the
+% letter `|Y|', the package will be disabled.
+% Example:
+% \begin{quote}
+% |pdflatex '\let\nopdfcrypt=Y\input myfile'|\\
+% |thumbpdf myfile|\\
+% |pdfelatex myfile|
+% \end{quote}
+%
+% \subsubsection{Configuration file}
+%
+% If the file \xfile{pdfcrypt.cfg} exists it is loaded
+% and can be used for common settings.
+%
+% \subsubsection{Support for \plainTeX}
+%
+% The package can also be used with \plainTeX. It defines the
+% missing \LaTeX\ macros and loads package \xpackage{keyval}.
+% The configuration file is not supported and automatically
+% loaded.
+%
+% \subsection{Hints for \pdfTeX}
+%
+% This section is out of date, because the encryption support
+% was removed from \pdfTeX. Therefore this hints are of
+% historical interest only.
+%
+%\begin{verbatim}
+%* There are packages such as thumbpdf that ship out
+% some stuff (\immediate\pdfobj{...}). In these cases
+% \pdfcrypt will be ignored without warning or error
+% message. Therefore the package pdfcrypt should be
+% loaded before and option "set" should be used in
+% order to force the call of \pdfcrypt, for example:
+% \usepackage{pdfcrypt}
+% \pdfcryptsetup{..., set}
+% ...
+% \usepackage{thumbpdf}
+%
+%* Compiling pdfTeX (eg. version 1.00a-pretest-20010804):
+% pdfTeX versions are available at
+% ftp://ftp.cstug.cz/pub/tex/local/cstug/thanh/pdftex/snapshots/
+% Unpack the latest .tgz file:
+% > tar xzf pdftex-20010804.tgz
+% Enable encryption support:
+% src> cd src/texk/web2c/pdftexdir
+% src/texk/web2c/pdftexdir> ln -fs pdfcrypt-full.c pdfcrypt.c
+% Compile:
+% src/texk/web2c/pdftexdir> cd ../../..
+% src> ./configure
+% src> cd texk/web2c
+% src/texk/web2c> make pdftexbin
+% At last install the binary and pool files.
+%\end{verbatim}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Help macros for \plainTeX}
+%
+% \begin{macrocode}
+\expandafter\edef\csname pc@endinput\endcsname{%
+ \catcode`\noexpand\@=\the\catcode`\@\relax
+ \noexpand\endinput
+}
+\catcode`\@=11 %
+
+\expandafter\ifx\csname @firstoftwo\endcsname\relax
+ \long\def\@firstoftwo#1#2{#1}%
+\fi
+
+\expandafter\ifx\csname @secondoftwo\endcsname\relax
+ \long\def\@secondoftwo#1#2{#2}%
+\fi
+
+\expandafter\ifx\csname @ifundefined\endcsname\relax
+ \def\@ifundefined#1{%
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ }%
+\fi
+
+\@ifundefined{@ifnextchar}{%
+ \long\def\@ifnextchar#1#2#3{%
+ \let\reserved@d=#1%
+ \def\reserved@a{#2}%
+ \def\reserved@b{#3}%
+ \futurelet\@let@token\@ifnch
+ }%
+ \def\@ifnch{%
+ \ifx\@let@token\@sptoken
+ \let\reserved@c\@xifnch
+ \else
+ \ifx\@let@token\reserved@d
+ \let\reserved@c\reserved@a
+ \else
+ \let\reserved@c\reserved@b
+ \fi
+ \fi
+ \reserved@c
+ }%
+ \begingroup
+ \def\:{\global\let\@sptoken= }%
+ \: %
+ \def\:{\@xifnch}%
+ \expandafter\gdef\: {\futurelet\@let@token\@ifnch}%
+ \endgroup
+}{}
+
+\@ifundefined{ProvidesPackage}{%
+ \def\ProvidesPackage#1{%
+ \@ifnextchar[{\pc@ProvidesPackage{#1}}%
+ {\pc@ProvidesPackage{#1}[]}%
+ }%
+ \def\pc@ProvidesPackage#1[#2]{%
+ \immediate\write-1{Package: #1 #2}%
+ }%
+}{}
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+\else
+ \RequirePackage{infwarerr}%
+\fi
+
+\@ifundefined{@gobble}{%
+ \long\def\@gobble#1{}%
+}{}
+
+\@ifundefined{@empty}{%
+ \def\@empty{}%
+}{}
+% \end{macrocode}
+%
+% \subsection{Package Identification and checks}
+%
+% \begin{macrocode}
+\ProvidesPackage{pdfcrypt}%
+ [2016/05/16 v1.1 Allows the setting of PDF encryption (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@ifundefined{pdfcryptsetup}{%
+ \let\pdfcryptsetup\@gobble
+}{%
+ \@PackageWarningNoLine{pdfcrypt}{Package pdfcrypt is already loaded}%
+ \pc@endinput
+}
+% \end{macrocode}
+% Support for \cs{nopdfcrypt}.
+% \begin{macrocode}
+\newif\ifpc@nopdfcrypt
+\ifx Y\nopdfcrypt
+ \@PackageWarningNoLine{pdfcrypt}{%
+ Encryption disabled by \string \nopdfcrypt\space request%
+ }%
+ \global\pc@nopdfcrypttrue
+\fi
+% \end{macrocode}
+%
+% \subsection{Driver detection}
+%
+% \begin{macrocode}
+\let\pc@driver\@empty
+\begingroup
+ % pdfTeX detection
+ \@ifundefined{pdfoutput}{%
+ }{%
+ \ifcase\pdfoutput
+ \else
+ \@ifundefined{pdfcrypt}{%
+ \@PackageError{pdfcrypt}{%
+ PDF encryption is not supported with this pdfTeX%
+ }{%
+ Encryption support was added in 0.14h (2001/03/10)\MessageBreak
+ and removed in 1.10a (2003/01/16).%
+ }%
+ \endgroup
+ \pc@endinput
+ }{%
+ \gdef\pc@driver{pdftex}%
+ }%
+ \fi
+ }%
+ % VTeX detection
+ \@ifundefined{OpMode}{%
+ }{%
+ \ifnum\OpMode=1 %
+ \ifnum\@ifundefined{VTeXversion}0\VTeXversion<735 %
+ \@PackageError{pdfcrypt}{%
+ PDF encryption is not supported with this VTeX%
+ }{%
+ You need VTeX 7.35 or higher.%
+ }%
+ \endgroup
+ \pc@endinput
+ \else
+ \gdef\pc@driver{vtex}%
+ \fi
+ \fi
+ }%
+\endgroup
+% \end{macrocode}
+%
+% \subsection{Load package \xpackage{keyval}}
+%
+% \begin{macrocode}
+\@ifundefined{@makeother}{%
+ \def\@makeother#1{\catcode`#1=12\relax}%
+}{}
+
+\@ifundefined{g@addto@macro}{%
+ \long\def\g@addto@macro#1#2{%
+ \begingroup
+ \toks@\expandafter{#1#2}%
+ \xdef#1{\the\toks@}%
+ \endgroup
+ }%
+}{}
+
+\@ifundefined{@namedef}{%
+ \def\@namedef#1{\expandafter\def\csname#1\endcsname}%
+}{}
+
+\@ifundefined{@nameuse}{%
+ \def\@nameuse#1{\csname #1\endcsname}%
+}{}
+
+\def\pc@KeyvalRestore{%
+ \let\pc@KeyvalRestore\@undefined
+}
+
+\let\pcOrg@NeedsTeXFormat\NeedsTeXFormat
+\@ifundefined{NeedsTeXFormat}{%
+ \def\NeedsTeXFormat#1{}%
+ \g@addto@macro\pc@KeyvalRestore{%
+ \let\NeedsTeXFormat\pcOrg@NeedsTeXFormat
+ }%
+}{}
+
+\let\pcOrg@DeclareOption\DeclareOption
+\@ifundefined{DeclareOption}{%
+ \def\DeclareOption#1#2{#2}%
+ \g@addto@macro\pc@KeyvalRestore{%
+ \let\DeclareOption\pcOrg@DeclareOption
+ }%
+}{}
+
+\let\pcOrg@ExecuteOptions\ExecuteOptions
+\@ifundefined{ExecuteOptions}{%
+ \def\ExecuteOptions#1{}%
+ \g@addto@macro\pc@KeyvalRestore{%
+ \let\ExecuteOptions\pcOrg@ExecuteOptions
+ }%
+}{}
+
+\let\pcOrg@ProcessOptions\ProcessOptions
+\@ifundefined{ProcessOptions}{%
+ \def\ProcessOptions{}%
+ \g@addto@macro\pc@KeyvalRestore{%
+ \let\ProcessOptions\pcOrg@ProcessOptions
+ }%
+}{}%
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input keyval.sty\relax
+\else
+ \RequirePackage{keyval}%
+\fi
+\pc@KeyvalRestore
+% \end{macrocode}
+%
+% \subsection{Define options}
+%
+% \begin{macrocode}
+\@ifundefined{@dblarg}{%
+ \long\def\@dblarg#1{\@ifnextchar[{#1}{\@xdblarg{#1}}}%
+ \long\def\@xdblarg#1#2{#1[{#2}]{#2}}%
+}{}
+
+\newif\ifpc@set
+\newif\ifpc@print
+\newif\ifpc@copy
+\newif\ifpc@edit
+\newif\ifpc@annotate
+\newif\ifpc@debug
+\let\pc@owner\@empty
+\let\pc@user\@empty
+
+% default: allow all
+\pc@printtrue
+\pc@copytrue
+\pc@edittrue
+\pc@annotatetrue
+
+\edef\pc@temp{\catcode`\noexpand\"=\the\catcode`\"\relax}
+\@makeother\"
+\def\pc@set{%
+ \@PackageInfo{pdfcrypt}{%
+ \ifpc@debug
+ \ifx\pc@owner\@empty
+ No owner password%
+ \else
+ Owner password: `\pc@owner'%
+ \fi
+ \MessageBreak
+ \ifx\pc@user\@empty
+ No user password%
+ \else
+ User password: `\pc@user'%
+ \fi
+ \MessageBreak
+ Flags: %
+ \ifpc@print \else no\fi print, %
+ \ifpc@copy \else no\fi copy, %
+ \ifpc@edit \else no\fi edit, %
+ \ifpc@annotate\else no\fi annotate%
+ \MessageBreak
+ \fi
+ \ifpc@nopdfcrypt
+ Encryption is disabled by `\string\nopdfcrypt'%
+ \else
+ Encryption is set for `\pc@driver'%
+ \fi
+ }%
+ \ifpc@nopdfcrypt
+ \else
+ \@ifundefined{pc@set@\pc@driver}{%
+ \ifx\pc@driver\@empty
+ \@PackageError{pdfcrypt}{No driver for encryption %
+ support found}\@ehc
+ \else
+ \@PackageError{pdfcrypt}{Cannot set encryption for %
+ unknown driver `\pc@driver'}\@ehc
+ \fi
+ }{%
+ \@nameuse{pc@set@\pc@driver}%
+ }%
+ \fi
+}
+\def\pc@set@pdftex{%
+ \ifnum\pdftexversion<100 %
+ \pc@set@pdftexold
+ \else
+ \pc@set@pdftexnew
+ \fi
+}
+\def\pc@set@pdftexold{%
+ \pdfcrypt{%
+ owner "\pc@owner" %
+ user "\pc@user" %
+ \ifpc@print \else no\fi print %
+ \ifpc@copy \else no\fi copy %
+ \ifpc@edit \else no\fi edit %
+ \ifpc@annotate\else no\fi annotate%
+ }%
+}
+\def\pc@set@pdftexnew{%
+ \pdfcrypt
+ owner{\pc@owner}%
+ user{\pc@user}%
+ \ifpc@print \else no\fi print %
+ \ifpc@copy \else no\fi copy %
+ \ifpc@edit \else no\fi edit %
+ \ifpc@annotate\else no\fi annotate%
+ \relax
+}
+\def\pc@set@vtex{%
+ \immediate\special{!security %
+ O=\pc@MakeVTeXString\pc@owner,%
+ U=\pc@MakeVTeXString\pc@user,%
+ P\ifpc@print +\else -\fi,%
+ C\ifpc@copy +\else -\fi,%
+ M\ifpc@edit +\else -\fi,%
+ A\ifpc@annotate +\else -\fi
+ }%
+}
+\def\pc@MakeVTeXString#1{%
+ "\expandafter\pc@@MakeVTeXString#1"\@nil"%
+}
+\def\pc@@MakeVTeXString#1"#2\@nil{%
+ #1%
+ \ifx\\#2\\%
+ \else
+ ""%
+ \@ReturnAfterFi{%
+ \pc@@MakeVTeXString#2\@nil
+ }%
+ \fi
+}
+\long\def\@ReturnAfterFi#1\fi{\fi#1}
+\pc@temp
+
+\begingroup
+ \catcode`\ =12 \gdef\pc@spaceother{ }\catcode`\ =10\relax
+ \catcode`\|=0 %
+ \catcode`\\=12 %
+ |gdef|pc@DefString#1#2{%
+ |def#1{#2}%
+ |edef#1{|expandafter|strip@prefix|meaning#1}%
+ |edef#1{|expandafter|pc@SpaceToOther#1 |@nil}%
+ |edef#1{|expandafter|pc@EscapeRemove#1|@empty\|@empty|@nil}%
+ }%
+ |gdef|pc@EscapeRemove#1\#2#3|@nil{%
+ #1#2%
+ |ifx|\#3|\%%
+ |else
+ |@ReturnAfterFi{%
+ |pc@EscapeRemove#3|@nil
+ }%
+ |fi
+ }%
+|endgroup
+\def\pc@SpaceToOther#1 #2\@nil{%
+ #1%
+ \ifx\\#2\\%
+ \else
+ \pc@spaceother
+ \@ReturnAfterFi{%
+ \pc@SpaceToOther#2\@nil
+ }%
+ \fi
+}
+
+\def\pc@boolkey{\@dblarg\pc@@boolkey}
+\def\pc@@boolkey[#1]#2#3{%
+ \lowercase{\def\pc@temp{#3}}%
+ \ifx\pc@temp\@empty
+ \let\pc@temp\pc@true
+ \fi
+ \ifx\pc@temp\pc@true
+ \else
+ \ifx\pc@temp\pc@false
+ \else
+ \let\pc@temp\relax
+ \fi
+ \fi
+ \ifx\pc@temp\relax
+ \@PackageWarning{pdfcrypt}{%
+ Unexpected value \string`#3\string' of %
+ option \string`#2\string'\MessageBreak
+ instead of %
+ \string`true\string' or \string`false\string'%
+ }%
+ \else
+ \csname pc@#2\pc@temp\endcsname
+ \fi
+}
+\def\pc@true{true}
+\def\pc@false{false}
+
+\define@key{pc}{set}[true]{%
+ \pc@boolkey{set}{#1}%
+}
+\define@key{pc}{pdftex}[]{%
+ \def\pc@driver{pdftex}%
+}
+\define@key{pc}{vtex}[]{%
+ \def\pc@driver{vtex}%
+}
+\define@key{pc}{print}[true]{%
+ \pc@boolkey{print}{#1}%
+}
+\define@key{pc}{copy}[true]{%
+ \pc@boolkey{copy}{#1}%
+}
+\define@key{pc}{edit}[true]{%
+ \pc@boolkey{edit}{#1}%
+}
+\define@key{pc}{annotate}[true]{%
+ \pc@boolkey{annotate}{#1}%
+}
+\define@key{pc}{all}[]{%
+ \pc@boolkey{print}{true}%
+ \pc@boolkey{copy}{true}%
+ \pc@boolkey{edit}{true}%
+ \pc@boolkey{annotate}{true}%
+}
+\define@key{pc}{none}[]{%
+ \pc@boolkey{print}{false}%
+ \pc@boolkey{copy}{false}%
+ \pc@boolkey{edit}{false}%
+ \pc@boolkey{annotate}{false}%
+}
+
+\define@key{pc}{owner}{%
+ \pc@DefString\pc@owner{#1}%
+}
+\define@key{pc}{user}{%
+ \pc@DefString\pc@user{#1}%
+}
+\define@key{pc}{debug}[true]{%
+ \pc@boolkey{debug}{#1}%
+}
+
+\def\pdfcryptsetup#1{%
+ \setkeys{pc}{#1}%
+ \ifpc@set
+ \pc@set
+ \global\let\pc@set\relax
+ \gdef\pdfcryptsetup##1{%
+ \@PackageWarning{pdfcrypt}{%
+ Encryption options are already set\MessageBreak
+ new values are ignored%
+ }%
+ }%
+ \fi
+}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname @onlypreamble\endcsname\relax
+\else
+ \@onlypreamble\pdfcryptsetup
+\fi
+% \end{macrocode}
+%
+% \subsection{support of configuration file}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname InputIfFileExists\endcsname\relax
+ \@PackageInfo{pdfcrypt}{%
+ Configuration file pdfcrypt.cfg not supported.%
+ }%
+\else
+ \let\pc@ExecuteOptions\ExecuteOptions
+ \InputIfFileExists{pdfcrypt.cfg}{}{}%
+ \let\ExecuteOptions\pc@ExecuteOptions
+\fi
+% \end{macrocode}
+%
+% \subsection{Package options}
+%
+% Plain format does not know package options.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname @classoptionslist\endcsname\relax
+ \expandafter\pc@endinput
+\fi
+% \end{macrocode}
+% Process global and local options.
+% \begin{macrocode}
+\def\pc@ProcessOptionsWithKV{%
+ \let\pc@temp\@empty
+ \@for\CurrentOption:=\@classoptionslist\do{%
+ \@ifundefined{KV@pc@\CurrentOption}{}{%
+ \edef\pc@temp{\pc@temp,\CurrentOption,}%
+ \@expandtwoargs\@removeelement\CurrentOption
+ \@unusedoptionlist\@unusedoptionlist
+ }%
+ }%
+ \edef\pc@temp{%
+ \noexpand\pdfcryptsetup{%
+ \pc@temp\@ptionlist{\@currname.\@currext}%
+ }%
+ }%
+ \pc@temp
+}
+\pc@ProcessOptionsWithKV
+\AtEndOfPackage{\let\@unprocessedoptions\relax}
+\AtBeginDocument{\pc@set}
+
+\pc@endinput
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pdfcrypt}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcrypt.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcrypt.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[\CTAN{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 pdfcrypt.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@{}}
+% pdfcrypt.sty & tex/generic/oberdiek/pdfcrypt.sty\\
+% pdfcrypt.pdf & doc/latex/oberdiek/pdfcrypt.pdf\\
+% pdfcrypt.dtx & source/latex/oberdiek/pdfcrypt.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdfcrypt.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pdfcrypt.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 pdfcrypt.dtx
+%makeindex -s gind.ist pdfcrypt.idx
+%pdflatex pdfcrypt.dtx
+%makeindex -s gind.ist pdfcrypt.idx
+%pdflatex pdfcrypt.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdfcrypt.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdfcrypt'>
+ <name>pdfcrypt</name>
+ <caption>Allows the setting of pdf encryption.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2001,2006,2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ Allows the setting of pdf encryption options for VTeX and some
+ older versions of pdfTeX. The options can be set as package
+ options or in the command <tt>\pdfcryptsetup</tt>. Options
+ include <tt>owner=OwnerPassword</tt>, <tt>user=UserPassword,
+ print</tt>, <tt>copy</tt>, <tt>edit</tt>, <tt>annotate=true,
+ false all, none</tt>. The encryption is set at
+ <tt>\begin{document}</tt> by default, but this can be forced for
+ an earlier time by option &#x2018;set&#x2019;.
+ <p/>
+ Example:
+ <tt>\usepackage[owner=Donald,user=Knuth,print=false]{pdfcrypt}</tt>
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdfcrypt.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdfcrypt.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2001/04/02 v0.1}
+% \item
+% First public version, published in the pdftex
+% mailing list for testing with pdfcrypt-20010331
+% \end{Version}
+% \begin{Version}{2001/07/19 v0.2}
+% \item
+% Default: all allowed.
+% \item
+% Support for \VTeX\ added.
+% \end{Version}
+% \begin{Version}{2001/07/19 v0.3}
+% \item
+% Bug fix: \VTeX\ letter for edit is M (modify).
+% \end{Version}
+% \begin{Version}{2001/07/19 v0.4}
+% \item
+% Bug fix: \cs{VTeXversion} is correct after
+% regenerating the format file.
+% \end{Version}
+% \begin{Version}{2001/08/05 v0.5}
+% \item
+% Syntax change in \pdfTeX\ 1.00a.
+% \end{Version}
+% \begin{Version}{2001/08/09 v0.6}
+% \item
+% Support of special characters:\\
+% input: |\{|, |\}|, |\\| for |{|, |}|, |\|\\
+% output: |"| in \VTeX
+% \item
+% Option debug added.
+% \end{Version}
+% \begin{Version}{2001/10/28 v0.7}
+% \item
+% Plain compatibility.
+% \item
+% \cs{nopdfcrypt} added.
+% \item
+% Typos corrected.
+% \end{Version}
+% \begin{Version}{2006/02/20 v0.8}
+% \item
+% Obsolete remarks for \pdfTeX.
+% \item
+% DTX framework.
+% \item
+% LPPL 1.3
+% \end{Version}
+% \begin{Version}{2007/04/11 v0.9}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/04/26 v1.0}
+% \item
+% Use of package \xpackage{infwarerr}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pdfcrypt.pdf b/macros/latex/contrib/oberdiek/pdfcrypt.pdf
new file mode 100644
index 0000000000..a4dd1bb092
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfcrypt.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdfescape.dtx b/macros/latex/contrib/oberdiek/pdfescape.dtx
new file mode 100644
index 0000000000..534d95c71b
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfescape.dtx
@@ -0,0 +1,2346 @@
+% \iffalse meta-comment
+%
+% File: pdfescape.dtx
+% Version: 2016/05/16 v1.14
+% Info: Implements pdfTeX's escape features
+%
+% Copyright (C) 2007, 2010, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 pdfescape.dtx
+% and the derived files
+% pdfescape.sty, pdfescape.pdf, pdfescape.ins, pdfescape.drv,
+% pdfescape-test1.tex, pdfescape-test2.tex,
+% pdfescape-test3.tex, pdfescape-test4.tex,
+% pdfescape-test5.tex, pdfescape-test6.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pdfescape.dtx
+% CTAN:macros/latex/contrib/oberdiek/pdfescape.pdf
+%
+% Unpacking:
+% (a) If pdfescape.ins is present:
+% tex pdfescape.ins
+% (b) Without pdfescape.ins:
+% tex pdfescape.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pdfescape.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pdfescape.drv is present:
+% latex pdfescape.drv
+% (b) Without pdfescape.drv:
+% latex pdfescape.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 pdfescape.dtx
+% makeindex -s gind.ist pdfescape.idx
+% pdflatex pdfescape.dtx
+% makeindex -s gind.ist pdfescape.idx
+% pdflatex pdfescape.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/pdfescape.sty
+% TDS:doc/latex/oberdiek/pdfescape.pdf
+% TDS:doc/latex/oberdiek/test/pdfescape-test1.tex
+% TDS:doc/latex/oberdiek/test/pdfescape-test2.tex
+% TDS:doc/latex/oberdiek/test/pdfescape-test3.tex
+% TDS:doc/latex/oberdiek/test/pdfescape-test4.tex
+% TDS:doc/latex/oberdiek/test/pdfescape-test5.tex
+% TDS:doc/latex/oberdiek/test/pdfescape-test6.tex
+% TDS:source/latex/oberdiek/pdfescape.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pdfescape 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pdfescape
+Version: 2016/05/16 v1.14
+
+Copyright (C) 2007, 2010, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 pdfescape.dtx
+and the derived files
+ pdfescape.sty, pdfescape.pdf, pdfescape.ins, pdfescape.drv,
+ pdfescape-test1.tex, pdfescape-test2.tex,
+ pdfescape-test3.tex, pdfescape-test4.tex,
+ pdfescape-test5.tex, pdfescape-test6.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pdfescape.ins}{\from{pdfescape.dtx}{install}}%
+ \file{pdfescape.drv}{\from{pdfescape.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{pdfescape.sty}{\from{pdfescape.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pdfescape-test1.tex}{\from{pdfescape.dtx}{test1}}%
+% \file{pdfescape-test2.tex}{\from{pdfescape.dtx}{test2}}%
+% \file{pdfescape-test3.tex}{\from{pdfescape.dtx}{test3}}%
+% \file{pdfescape-test4.tex}{\from{pdfescape.dtx}{test4}}%
+% \file{pdfescape-test5.tex}{\from{pdfescape.dtx}{test5}}%
+% \file{pdfescape-test6.tex}{\from{pdfescape.dtx}{test6}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pdfescape.xml}{\from{pdfescape.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{* pdfescape.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pdfescape.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfescape.drv}%
+ [2016/05/16 v1.14 Implements pdfTeX's escape features (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{pdfescape.dtx}%
+\end{document}
+%</driver>
+% \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{pdfescape.drv}
+%
+% \title{The \xpackage{pdfescape} package}
+% \date{2016/05/16 v1.14}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package implements \pdfTeX's escape features
+% (\cs{pdfescapehex}, \cs{pdfunescapehex}, \cs{pdfescapename},
+% \cs{pdfescapestring}) using \TeX\ or \eTeX.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \begin{declcs}{EdefEscapeHex} \M{cmd} \M{string}\\
+% \cs{EdefUnescapeHex} \M{cmd} \M{string}\\
+% \cs{EdefEscapeName} \M{cmd} \M{string}\\
+% \cs{EdefEscapeString} \M{cmd} \M{string}
+% \end{declcs}
+% These commands converts \meta{string} and stores the result
+% in macro \meta{cmd}. The conversion result is the same
+% as the conversion of the corresponding \pdfTeX's primitives.
+% Note that the argument \meta{string} is expanded before
+% the conversion.
+%
+% For example, if \pdfTeX\ \textgreater= 1.30 is present,
+% then \cs{EdefEscapeHex}
+% becomes to:
+% \begin{quote}
+%\begin{verbatim}
+%\def\EdefEscapeHex#1#2{%
+% \edef#1{\pdfescapehex{#2}}%
+%}
+%\end{verbatim}
+% \end{quote}
+% The package provides implementations for the case that \pdfTeX\ is
+% not present (or too old). Even \eTeX\ can be missing, however it is
+% used if it is detected.
+%
+% \paragraph{Babel.}
+% The input strings may contain shorthand characters of package
+% \xpackage{babel}.
+%
+% \subsection{Additional unescape macros}
+%
+% \begin{declcs}{EdefUnescapeName} \M{cmd} \M{string}
+% \end{declcs}
+% Sequences of a hash sign with two hexadecimal digits are
+% converted to the corresponding character (PDF-1.2).
+% A hash sign that is not followed by two hexadecimal digits
+% is left unchanged. The catcodes in the result string follow
+% TeX's conventions. The space has catcode 10 (space) and
+% the other characters have catcode 12 (other).
+%
+% \begin{declcs}{EdefUnescapeString} \M{cmd} \M{string}
+% \end{declcs}
+% Macro \meta{cmd} stores the unescaped string in \meta{string}.
+% All the rules for literal strings are implemented, see
+% PDF specification.
+% The catcodes in the result string follow TeX's conventions.
+%
+% \subsection{Sanitizing macro}
+%
+% \begin{declcs}{EdefSanitize} \M{cmd} \M{string}
+% \end{declcs}
+% Argument \meta{string} is expanded, converted to a string
+% of tokens with catcode 12 (other) and space tokens, and
+% stored in macro \meta{cmd}.
+%
+% \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@pdfescape.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{pdfescape}{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@pdfescape.sty\endcsname
+\ProvidesPackage{pdfescape}%
+ [2016/05/16 v1.14 Implements pdfTeX's escape features (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 PE@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#3{%
+ \edef\PE@AtEnd{%
+ \PE@AtEnd
+ #1#2=\the#1#2\relax
+ }%
+ #1#2=#3\relax
+}
+\TMP@EnsureCode\catcode{0}{12}% ^^@
+\TMP@EnsureCode\catcode{34}{12}% "
+\TMP@EnsureCode\catcode{36}{3}% $
+\TMP@EnsureCode\catcode{38}{4}% &
+\TMP@EnsureCode\catcode{39}{12}% '
+\TMP@EnsureCode\catcode{42}{12}% *
+\TMP@EnsureCode\catcode{45}{12}% -
+\TMP@EnsureCode\catcode{46}{12}% .
+\TMP@EnsureCode\catcode{47}{12}% /
+\TMP@EnsureCode\catcode{60}{12}% <
+\TMP@EnsureCode\catcode{62}{12}% >
+\TMP@EnsureCode\catcode{91}{12}% [
+\TMP@EnsureCode\catcode{93}{12}% ]
+\TMP@EnsureCode\catcode{94}{7}% ^
+\TMP@EnsureCode\catcode{96}{12}% `
+\TMP@EnsureCode\uccode{34}{0}% "
+\TMP@EnsureCode\uccode{48}{0}% 0
+\TMP@EnsureCode\uccode{61}{0}% =
+\edef\PE@AtEnd{\PE@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Load package}
+%
+% \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{ltxcmds}[2010/04/08]%
+\else
+ \RequirePackage{ltxcmds}[2010/04/08]%
+\fi
+% \end{macrocode}
+%
+% \subsection{Sanitizing}
+%
+% \begin{macro}{\EdefSanitize}
+% Macro \cs{EdefSanitize} takes |#2|, entirely converts
+% it to token with catcode 12 (other) and stores the
+% result in macro |#1|.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname detokenize\endcsname\relax
+ \long\def\EdefSanitize#1#2{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \edef#1{#2}%
+ \PE@onelevel@sanitize#1%
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{#1}%
+ }%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname @onelevel@sanitize\endcsname\relax
+ \def\PE@onelevel@sanitize#1{%
+ \edef#1{\expandafter\PE@strip@prefix\meaning#1}%
+ }%
+ \def\PE@strip@prefix#1>{}%
+ \else
+ \let\PE@onelevel@sanitize\@onelevel@sanitize
+ \fi
+\else
+ \long\def\EdefSanitize#1#2{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \edef#1{#2}%
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{%
+ \detokenize\expandafter{#1}%
+ }%
+ }%
+ \def\PE@onelevel@sanitize#1{%
+ \edef#1{\detokenize\expandafter{#1}}%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@sanitize}
+% Macro \cs{PE@sanitize} is only defined for
+% compatibility with version 1.4. Its use is deprecated.
+% \begin{macrocode}
+\let\PE@sanitize\EdefSanitize
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Space characters}
+%
+% \begin{macro}{\PE@space@other}
+% \begin{macrocode}
+\begingroup
+ \catcode`\ =12\relax%
+\def\x{\endgroup\def\PE@space@other{ }}\x\relax
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@space@space}
+% \begin{macrocode}
+\def\PE@space@space{ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Space normalization}
+%
+% \begin{macro}{\PE@SanitizeSpaceOther}
+% \begin{macrocode}
+\def\PE@SanitizeSpaceOther#1{%
+ \edef#1{\expandafter\PE@SpaceToOther#1 \relax}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PE@SpaceToOther}
+% \begin{macrocode}
+\def\PE@SpaceToOther#1 #2\relax{%
+ #1%
+ \ifx\\#2\\%
+ \else
+ \PE@space@other
+ \ltx@ReturnAfterFi{%
+ \PE@SpaceToOther#2\relax
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{EdefUnescapeName}}
+%
+% \begin{macro}{\EdefUnescapeName}
+% \begin{macrocode}
+\def\EdefUnescapeName#1#2{%
+ \EdefSanitize#1{#2}%
+ \PE@SanitizeSpaceOther#1%
+ \PE@UnescapeName#1%
+ \PE@onelevel@sanitize#1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PE@UnescapeName}
+% \begin{macrocode}
+\begingroup
+ \catcode`\$=6 % hash
+ \catcode`\#=12 % other
+ \gdef\PE@UnescapeName$1{%
+ \begingroup
+ \PE@InitUccodeHexDigit
+ \def\PE@result{}%
+ \expandafter\PE@DeName$1#\relax\relax
+ \expandafter\endgroup
+ \expandafter\def\expandafter$1\expandafter{\PE@result}%
+ }%
+ \gdef\PE@DeName$1#$2$3{%
+ \ifx\relax$2%
+ \edef\PE@result{\PE@result$1}%
+ \let\PE@next\relax
+ \else
+ \ifx\relax$3%
+ % wrong escape sequence in input
+ \edef\PE@result{\PE@result$1#}%
+ \let\PE@next\relax
+ \else
+ \uppercase{%
+ \def\PE@testA{$2}%
+ \def\PE@testB{$3}%
+ }%
+ \ifcase\ifcase\expandafter\PE@TestUcHexDigit\PE@testA
+ \ifcase\expandafter\PE@TestUcHexDigit\PE@testB
+ \ltx@zero
+ \else
+ \ltx@one
+ \fi
+ \else
+ \ltx@one
+ \fi
+ \uccode\ltx@zero="\PE@testA\PE@testB\relax
+ \uppercase{%
+ \def\PE@temp{^^@}%
+ }%
+ \uccode\ltx@zero=\ltx@zero
+ \edef\PE@result{\PE@result$1\PE@temp}%
+ \let\PE@next\PE@DeName
+ \else
+ % wrong escape sequence in input
+ \edef\PE@result{\PE@result$1#}%
+ \def\PE@next{\PE@DeName$2$3}%
+ \fi
+ \fi
+ \fi
+ \PE@next
+ }%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PE@InitUccodeHexDigit}
+% \begin{macrocode}
+\def\PE@InitUccodeHexDigit{%
+ \uccode`a=`A\relax
+ \uccode`b=`B\relax
+ \uccode`c=`C\relax
+ \uccode`d=`D\relax
+ \uccode`e=`E\relax
+ \uccode`f=`F\relax
+ \uccode`A=\ltx@zero
+ \uccode`B=\ltx@zero
+ \uccode`C=\ltx@zero
+ \uccode`D=\ltx@zero
+ \uccode`E=\ltx@zero
+ \uccode`F=\ltx@zero
+ \uccode`0=\ltx@zero
+ \uccode`1=\ltx@zero
+ \uccode`2=\ltx@zero
+ \uccode`3=\ltx@zero
+ \uccode`4=\ltx@zero
+ \uccode`5=\ltx@zero
+ \uccode`6=\ltx@zero
+ \uccode`7=\ltx@zero
+ \uccode`8=\ltx@zero
+ \uccode`9=\ltx@zero
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PE@TestUcHexDigit}
+% \begin{macrocode}
+\def\PE@TestUcHexDigit#1{%
+ \ifnum`#1<48 % 0
+ \ltx@one
+ \else
+ \ifnum`#1>70 % F
+ \ltx@one
+ \else
+ \ifnum`#1>57 % 9
+ \ifnum`#1<65 % A
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \else
+ \ltx@zero
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{EdefUnescapeString}}
+%
+% \begin{macro}{\EdefUnescapeString}
+% \begin{macrocode}
+\def\EdefUnescapeString#1#2{%
+ \EdefSanitize#1{#2}%
+ \PE@SanitizeSpaceOther#1%
+ \PE@NormalizeLineEnd#1%
+ \PE@UnescapeString#1%
+ \PE@onelevel@sanitize#1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\begingroup
+ \uccode`\8=10 % lf
+ \uccode`\9=13 % cr
+\def\x#1#2{\endgroup
+% \end{macrocode}
+% \begin{macro}{\PE@NormalizeLineEnd}
+% \begin{macrocode}
+ \def\PE@NormalizeLineEnd##1{%
+ \def\PE@result{}%
+ \expandafter\PE@@NormalizeLineEnd##1#2\relax
+ \let##1\PE@result
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@@NormalizeLineEnd}
+% \begin{macrocode}
+ \def\PE@@NormalizeLineEnd##1#2##2{%
+ \ifx\relax##2%
+ \edef\PE@result{\PE@result##1}%
+ \let\PE@next\relax
+ \else
+ \edef\PE@result{\PE@result##1#1}%
+ \ifx#1##2% lf
+ \let\PE@next\PE@@NormalizeLineEnd
+ \else
+ \def\PE@next{\PE@@NormalizeLineEnd##2}%
+ \fi
+ \fi
+ \PE@next
+ }%
+}%
+\uppercase{%
+ \x 89%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\begingroup
+ \catcode`\|=0 %
+ \catcode`\\=12 %
+% \end{macrocode}
+% \begin{macro}{\PE@UnescapeString}
+% \begin{macrocode}
+ |gdef|PE@UnescapeString#1{%
+ |begingroup
+ |def|PE@result{}%
+ |expandafter|PE@DeString#1\|relax
+ |expandafter|endgroup
+ |expandafter|def|expandafter#1|expandafter{|PE@result}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@DeString}
+% \begin{macrocode}
+ |gdef|PE@DeString#1\#2{%
+ |ifx|relax#2%
+ |edef|PE@result{|PE@result#1}%
+ |let|PE@next|relax
+ |else
+ |if n#2%
+ |uccode|ltx@zero=10 %
+ |else|if r#2%
+ |uccode|ltx@zero=13 %
+ |else|if t#2%
+ |uccode|ltx@zero=9 %
+ |else|if b#2%
+ |uccode|ltx@zero=8 %
+ |else|if f#2%
+ |uccode|ltx@zero=12 %
+ |else
+ |uccode|ltx@zero=|ltx@zero
+ |fi|fi|fi|fi|fi
+ |ifnum|uccode|ltx@zero>|ltx@zero
+ |uppercase{%
+ |edef|PE@temp{^^@}%
+ }%
+ |edef|PE@result{|PE@result#1|PE@temp}%
+ |let|PE@next|PE@DeString
+ |else
+ |if\#2% backslash
+ |edef|PE@result{|PE@result#1}%
+ |let|PE@next|PE@CheckEndBackslash
+ |else
+ |ifnum`#2=10 % linefeed
+ |edef|PE@result{|PE@result#1}%
+ |let|PE@next|PE@DeString
+ |else
+ |ifcase|PE@TestOctDigit#2%
+ |edef|PE@result{|PE@result#1}%
+ |def|PE@next{|PE@OctI#2}%
+ |else
+ |edef|PE@result{|PE@result#1#2}%
+ |let|PE@next|PE@DeString
+ |fi
+ |fi
+ |fi
+ |fi
+ |fi
+ |PE@next
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@CheckEndBackslash}
+% \begin{macrocode}
+ |gdef|PE@CheckEndBackslash#1{%
+ |ifx|relax#1%
+ |else
+ |edef|PE@result{|PE@result\}%
+ |expandafter|PE@DeString|expandafter#1%
+ |fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+|endgroup
+% \end{macrocode}
+% \begin{macro}{\PE@TestOctDigit}
+% \begin{macrocode}
+\def\PE@TestOctDigit#1{%
+ \ifnum`#1<48 % 0
+ \ltx@one
+ \else
+ \ifnum`#1>55 % 7
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@OctI}
+% \begin{macrocode}
+\def\PE@OctI#1#2{%
+ \ifcase\PE@TestOctDigit#2%
+ \def\PE@next{\PE@OctII{#1#2}}%
+ \else
+ \def\PE@next{\PE@OctAll#1#2}%
+ \fi
+ \PE@next
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@OctII}
+% \begin{macrocode}
+\def\PE@OctII#1#2{%
+ \ifcase\PE@TestOctDigit#2%
+ \def\PE@next{\PE@OctIII#1#2}%
+ \else
+ \def\PE@next{\PE@OctAll{#1}#2}%
+ \fi
+ \PE@next
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\ltx@IfUndefined{numexpr}{%
+ \catcode`\$=9 %
+ \catcode`\&=14 %
+}{%
+ \catcode`\$=14 %
+ \catcode`\&=9 %
+}
+% \end{macrocode}
+% \begin{macro}{\PE@OctIII}
+% \begin{macrocode}
+\def\PE@OctIII#1#2#3{%
+ \ifnum#1<4 %
+ \def\PE@next{\PE@OctAll{#1#2#3}}%
+ \else
+$ \count\ltx@cclv#1 %
+$ \advance\count\ltx@cclv -4 %
+ \edef\PE@next{%
+ \noexpand\PE@OctAll{%
+$ \the\count\ltx@cclv
+& \the\numexpr#1-4\relax
+ #2#3%
+ }%
+ }%
+ \fi
+ \PE@next
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@OctAll}
+% \begin{macrocode}
+\def\PE@OctAll#1{%
+ \uccode\ltx@zero='#1\relax
+ \uppercase{%
+ \edef\PE@result{\PE@result^^@}%
+ }%
+ \PE@DeString
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{User macros (\pdfTeX\space analogues)}
+%
+% \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{pdftexcmds}[2007/11/11]%
+\else
+ \RequirePackage{pdftexcmds}[2007/11/11]%
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@escapehex\endcsname\relax
+% \end{macrocode}
+%
+% \begin{macro}{\EdefEscapeHex}
+% \begin{macrocode}
+ \long\def\EdefEscapeHex#1#2{%
+ \EdefSanitize#1{#2}%
+ \PE@SanitizeSpaceOther#1%
+ \PE@EscapeHex#1%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EdefUnescapeHex}
+% \begin{macrocode}
+ \def\EdefUnescapeHex#1#2{%
+ \EdefSanitize#1{#2}%
+ \PE@UnescapeHex#1%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EdefEscapeName}
+% \begin{macrocode}
+ \long\def\EdefEscapeName#1#2{%
+ \EdefSanitize#1{#2}%
+ \PE@SanitizeSpaceOther#1%
+ \PE@EscapeName#1%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EdefEscapeString}
+% \begin{macrocode}
+ \long\def\EdefEscapeString#1#2{%
+ \EdefSanitize#1{#2}%
+ \PE@SanitizeSpaceOther#1%
+ \PE@EscapeString#1%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% \begin{macro}{\PE@edefbabel}
+% Help macro that adds support for \xpackage{babel}'s shorthand
+% characters.
+% \begin{macrocode}
+ \long\def\PE@edefbabel#1#2#3{%
+ \begingroup
+ \csname @save@activestrue\endcsname
+ \edef#1{#2{#3}}%
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{#1}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\EdefEscapeHex}
+% \begin{macrocode}
+ \long\def\EdefEscapeHex#1#2{%
+ \PE@edefbabel#1\pdf@escapehex{#2}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EdefUnescapeHex}
+% \begin{macrocode}
+ \def\EdefUnescapeHex#1#2{%
+ \PE@edefbabel#1\pdf@unescapehex{#2}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EdefEscapeName}
+% \begin{macrocode}
+ \long\def\EdefEscapeName#1#2{%
+ \PE@edefbabel#1\pdf@escapename{#2}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EdefEscapeString}
+% \begin{macrocode}
+ \long\def\EdefEscapeString#1#2{%
+ \PE@edefbabel#1\pdf@escapestring{#2}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \expandafter\PE@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Help macros}
+%
+% \subsubsection{Characters}
+%
+% Special characters with catcode 12 (other) are created and
+% stored in macros.
+% \begin{macro}{\PE@hash}
+% \begin{macrocode}
+\edef\PE@hash{\string#}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@backslash}
+% \begin{macrocode}
+\begingroup
+ \escapechar=-1 %
+\edef\x{\endgroup
+ \def\noexpand\PE@backslash{\string\\}%
+}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Switch for \eTeX}
+%
+% \begin{macrocode}
+\ltx@newif\ifPE@etex
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+\else
+ \PE@etextrue
+\fi
+% \end{macrocode}
+%
+% \subsection{Conversions}
+%
+% \subsubsection{Conversion to hex string}
+%
+% \begin{macro}{\PE@EscapeHex}
+% \begin{macrocode}
+\ifPE@etex
+ \def\PE@EscapeHex#1{%
+ \edef#1{\expandafter\PE@ToHex#1\relax}%
+ }%
+\else
+ \def\PE@EscapeHex#1{%
+ \def\PE@result{}%
+ \expandafter\PE@ToHex#1\relax
+ \let#1\PE@result
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@ToHex}
+% \begin{macrocode}
+\def\PE@ToHex#1{%
+ \ifx\relax#1%
+ \else
+ \PE@HexChar{#1}%
+ \expandafter\PE@ToHex
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@HexChar}
+% \begin{macrocode}
+\ifPE@etex
+ \def\PE@HexChar#1{%
+ \PE@HexDigit{\numexpr\dimexpr.0625\dimexpr`#1sp\relax\relax\relax}%
+ \PE@HexDigit{%
+ \numexpr`#1-16*\dimexpr.0625\dimexpr`#1sp\relax\relax\relax
+ }%
+ }%
+\else
+ \def\PE@HexChar#1{%
+ \dimen0=`#1sp%
+ \dimen2=.0625\dimen0 %
+ \advance\dimen0-16\dimen2 %
+ \edef\PE@result{%
+ \PE@result
+ \PE@HexDigit{\dimen2 }%
+ \PE@HexDigit{\dimen0 }%
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@HexDigit}
+% \begin{macrocode}
+\def\PE@HexDigit#1{%
+ \expandafter\string
+ \ifcase#1%
+ 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or
+ A\or B\or C\or D\or E\or F%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Character code to octal number}
+%
+% \begin{macro}{\PE@OctChar}
+% \begin{macrocode}
+\ifPE@etex
+ \def\PE@OctChar#1{%
+ \expandafter\PE@@OctChar
+ \the\numexpr\dimexpr.015625\dimexpr`#1sp\relax\relax
+ \expandafter\relax
+ \expandafter\relax
+ \the\numexpr\dimexpr.125\dimexpr`#1sp\relax\relax\relax
+ \relax
+ #1%
+ }%
+ \def\PE@@OctChar#1\relax#2\relax#3{%
+ \PE@backslash
+ #1%
+ \the\numexpr#2-8*#1\relax
+ \the\numexpr\dimexpr`#3sp\relax-8*#2\relax
+ }%
+\else
+ \def\PE@OctChar#1{%
+ \dimen0=`#1sp%
+ \dimen2=.125\dimen0 %
+ \dimen4=.125\dimen2 %
+ \advance\dimen0-8\dimen2 %
+ \advance\dimen2-8\dimen4 %
+ \edef\PE@result{%
+ \PE@result
+ \PE@backslash
+ \number\dimen4 %
+ \number\dimen2 %
+ \number\dimen0 %
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Unpack hex string}
+%
+% \begin{macro}{\PE@UnescapeHex}
+% \begin{macrocode}
+\def\PE@UnescapeHex#1{%
+ \begingroup
+ \PE@InitUccodeHexDigit
+ \def\PE@result{}%
+ \expandafter\PE@DeHex#1\relax\relax
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{\PE@result}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@DeHex}
+% \begin{macrocode}
+\def\PE@DeHex#1#2{%
+ \ifx#2\relax
+ \ifx#1\relax
+ \let\PE@next\relax
+ \else
+ \uppercase{%
+ \def\PE@testA{#1}%
+ }%
+ \ifcase\expandafter\PE@TestUcHexDigit\PE@testA
+ \def\PE@next{%
+ \PE@DeHex#10\relax\relax
+ }%
+ \else
+ \let\PE@next\relax
+ \fi
+ \fi
+ \else
+ \uppercase{%
+ \def\PE@testA{#1}%
+ \def\PE@testB{#2}%
+ }%
+ \ifcase\expandafter\PE@TestUcHexDigit\PE@testA
+ \ifcase\expandafter\PE@TestUcHexDigit\PE@testB
+ \uccode\ltx@zero="\PE@testA\PE@testB\relax
+ \ifnum\uccode\ltx@zero=32 %
+ \let\PE@temp\PE@space@space
+ \else
+ \uppercase{%
+ \def\PE@temp{^^@}%
+ }%
+ \fi
+ \edef\PE@result{\PE@result\PE@temp}%
+ \let\PE@next\PE@DeHex
+ \else
+ % invalid input sequence
+ \def\PE@next{%
+ \PE@DeHex#1%
+ }%
+ \fi
+ \else
+ % invalid input sequence
+ \def\PE@next{\PE@DeHex#2}%
+ \fi
+ \fi
+ \PE@next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Conversion to PDF name}
+%
+% \begin{macro}{\PE@EscapeName}
+% \begin{macrocode}
+\ifPE@etex
+ \def\PE@EscapeName#1{%
+ \edef#1{\expandafter\PE@EscapeNameTokens#1\relax}%
+ }%
+\else
+ \def\PE@EscapeName#1{%
+ \def\PE@result{}%
+ \expandafter\PE@EscapeNameTokens#1\relax
+ \let#1\PE@result
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@EscapeNameTokens}
+% \begin{macrocode}
+\def\PE@EscapeNameTokens#1{%
+ \ifx\relax#1%
+ \else
+ \ifnum`#1<33 %
+ \ifcase`#1 %
+ % drop illegal zero
+ \else
+ \PE@EscapeNameAdd\PE@hash
+ \PE@HexChar#1%
+ \fi
+ \else
+ \ifnum`#1>126 %
+ \PE@EscapeNameAdd\PE@hash
+ \PE@HexChar#1%
+ \else \ifnum`#1=35 \PE@EscapeNameHashChar 23% #
+ \else\ifnum`#1=37 \PE@EscapeNameHashChar 25% %
+ \else\ifnum`#1=40 \PE@EscapeNameHashChar 28% (
+ \else\ifnum`#1=41 \PE@EscapeNameHashChar 29% )
+ \else\ifnum`#1=47 \PE@EscapeNameHashChar 2F% /
+ \else\ifnum`#1=60 \PE@EscapeNameHashChar 3C% <
+ \else\ifnum`#1=62 \PE@EscapeNameHashChar 3E% >
+ \else\ifnum`#1=91 \PE@EscapeNameHashChar 5B% [
+ \else\ifnum`#1=93 \PE@EscapeNameHashChar 5D% ]
+ \else\ifnum`#1=123 \PE@EscapeNameHashChar 7B% {
+ \else\ifnum`#1=125 \PE@EscapeNameHashChar 7D% }
+ \else
+ \PE@EscapeNameAdd{#1}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi
+ \fi
+ \expandafter\PE@EscapeNameTokens
+ \fi
+}%
+\def\PE@EscapeNameHashChar#1#2{%
+ \PE@EscapeNameAdd{\PE@hash\string#1\string#2}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@EscapeNameAdd}
+% \begin{macrocode}
+\ifPE@etex
+ \def\PE@EscapeNameAdd#1{#1}%
+\else
+ \def\PE@EscapeNameAdd#1{%
+ \edef\PE@result{%
+ \PE@result
+ #1%
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Conversion to PDF string}
+%
+% \begin{macro}{\PE@EscapeString}
+% \begin{macrocode}
+\ifPE@etex
+ \def\PE@EscapeString#1{%
+ \edef#1{\expandafter\PE@EscapeStringTokens#1\relax}%
+ }%
+\else
+ \def\PE@EscapeString#1{%
+ \begingroup
+ \def\PE@result{}%
+ \expandafter\PE@EscapeStringTokens#1\relax
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{\PE@result}%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@EscapeStringTokens}
+% \begin{macrocode}
+\def\PE@EscapeStringTokens#1{%
+ \ifx\relax#1%
+ \else
+ \ifnum`#1<33 %
+ \PE@OctChar#1%
+ \else
+ \ifnum`#1>126 %
+ \PE@OctChar#1%
+ \else \ifnum`#1=40 \PE@EscapeStringAdd{\string\(}% (
+ \else\ifnum`#1=41 \PE@EscapeStringAdd{\string\)}% )
+ \else\ifnum`#1=92 \PE@EscapeStringAdd{\string\\}% \
+ \else
+ \PE@EscapeStringAdd{#1}%
+ \fi\fi\fi
+ \fi
+ \fi
+ \expandafter\PE@EscapeStringTokens
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PE@EscapeStringAdd}
+% \begin{macrocode}
+\ifPE@etex
+ \def\PE@EscapeStringAdd#1{#1}%
+\else
+ \def\PE@EscapeStringAdd#1{%
+ \edef\PE@result{%
+ \PE@result
+ #1%
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\PE@AtEnd%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \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 pdfescape.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \begin{macrocode}
+%<*test2|test3|test4|test5>
+\NeedsTeXFormat{LaTeX2e}
+\makeatletter
+% \end{macrocode}
+%
+% \subsection{Test with \cs{pdfescape...} commands}
+%
+% \begin{macrocode}
+%<*test2>
+\ProvidesFile{pdfescape-test2.tex}%
+ [2016/05/16 v1.14 Test with \string\pdfescape... commands]%
+%</test2>
+% \end{macrocode}
+%
+% \subsection{Test without \cs{pdfescape...}, with \eTeX}
+%
+% \begin{macrocode}
+%<*test3>
+\ProvidesFile{pdfescape-test3.tex}%
+ [2016/05/16 v1.14 Test without \string\pdfescape..., with e-TeX]%
+%</test3>
+% \end{macrocode}
+%
+% \subsection{Test without \cs{pdfescape...} and \eTeX}
+%
+% \begin{macrocode}
+%<*test4>
+\ProvidesFile{pdfescape-test4.tex}%
+ [2016/05/16 v1.14 Test without \string\pdfescape... and e-TeX]%
+%</test4>
+% \end{macrocode}
+%
+% \subsection{Test with \LuaTeX}
+%
+% \begin{macrocode}
+%<*test5>
+\ProvidesFile{pdfescape-test5.tex}%
+ [2016/05/16 v1.14 Test with LuaTeX]%
+%</test5>
+% \end{macrocode}
+%
+% \subsection{Check/ensure test preconditions}
+%
+% \subsubsection{Check \cs{pdfescape...}}
+%
+% \begin{macrocode}
+%<*test2>
+\@ifundefined{pdfescapehex}{%
+ \PackageError{pdfescape-test2}{%
+ Missing \string\pdfescape... commands%
+ }{Test aborted.}%
+ \stop
+}{}
+%</test2>
+% \end{macrocode}
+% \begin{macrocode}
+%<*test3|test4>
+\let\pdfescapehex\@undefined
+\let\pdfunescapehex\@undefined
+\let\pdfescapename\@undefined
+\let\pdfescapestring\@undefined
+%</test3|test4>
+% \end{macrocode}
+%
+% \subsubsection{Check \eTeX}
+%
+% \begin{macrocode}
+%<*test3>
+\@ifundefined{numexpr}{%
+ \PackageError{pdfescape-test3}{%
+ Missing \eTeX
+ }{Test aborted.}%
+ \stop
+}{}
+%</test3>
+% \end{macrocode}
+% Package \xpackage{qstest} uses \eTeX, thus \eTeX's features
+% can only be disabled later during loading of package \xpackage{pdfescape}.
+%
+% \subsubsection{Check \LuaTeX}
+%
+% \begin{macrocode}
+%<*test5>
+\@ifundefined{directlua}{%
+ \PackageError{pdfescape-test5}{%
+ Missing LuaTeX%
+ }{Test aborted.}%
+ \stop
+}{}
+%</test5>
+% \end{macrocode}
+%
+% \subsection{Common part}
+%
+% The files for testing uses the framework, provided by the
+% new package \xpackage{qstest} of David Kastrup.
+% \begin{macrocode}
+\RequirePackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\newcommand*{\ExpectVar}[2]{%
+ \ifx#1#2%
+ \else
+ \begingroup
+ \@onelevel@sanitize#1%
+ \@onelevel@sanitize#2%
+ \typeout{[#1] <> [#2]}% hash-ok
+ \endgroup
+ \fi
+ \Expect*{\ifx#1#2true\else false\fi}{true}%
+}
+
+\makeatletter
+\begingroup
+ \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
+\newcommand*{\AllBytesHex}{%
+ 000102030405060708090A0B0C0D0E0F%
+ 101112131415161718191A1B1C1D1E1F%
+ 202122232425262728292A2B2C2D2E2F%
+ 303132333435363738393A3B3C3D3E3F%
+ 404142434445464748494A4B4C4D4E4F%
+ 505152535455565758595A5B5C5D5E5F%
+ 606162636465666768696A6B6C6D6E6F%
+ 707172737475767778797A7B7C7D7E7F%
+ 808182838485868788898A8B8C8D8E8F%
+ 909192939495969798999A9B9C9D9E9F%
+ A0A1A2A3A4A5A6A7A8A9AAABACADAEAF%
+ B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
+ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF%
+ D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
+ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF%
+ F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
+}
+\@onelevel@sanitize\AllBytesHex
+\expandafter\lowercase\expandafter{%
+ \expandafter\newcommand\expandafter*\expandafter\AllBytesHexLC
+ \expandafter{\AllBytesHex}%
+}
+\newcommand*{\AllBytesName}{}
+\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\@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
+\@onelevel@sanitize\AllBytesName
+
+\newcommand*{\AllBytesString}{}
+\begingroup
+ \def\|{|}%
+ \edef\%{\@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
+\@onelevel@sanitize\AllBytesString
+
+%<*test4>
+\let\org@detokenize\detokenize
+\let\detokenize\@undefined
+\let\org@numexpr\numexpr
+\let\numexpr\@undefined
+%</test4>
+\RequirePackage{pdfescape}
+%<*test4>
+\let\detokenize\org@detokenize
+\let\numexpr\org@numexpr
+%</test4>
+
+\begin{qstest}{all-hex}{\AllBytes, escapehex}
+ \EdefEscapeHex\x{\AllBytes}%
+ \Expect*{\x}*{\AllBytesHex}%
+ \ExpectVar\x\AllBytesHex
+\end{qstest}
+
+\begin{qstest}{all-unhex}{\AllBytesHex, unescapehex}
+ \EdefUnescapeHex\x{\AllBytesHex}%
+ \Expect*{\x}*{\AllBytes}%
+ \ExpectVar\x\AllBytes
+\end{qstest}
+
+\begin{qstest}{all-unhex-lc}{\AllBytesHexLC, unescapehex, lowercase}
+ \EdefUnescapeHex\x{\AllBytesHexLC}%
+ \Expect*{\x}*{\AllBytes}%
+ \ExpectVar\x\AllBytes
+\end{qstest}
+
+\begin{qstest}{unhex-incomplete}{unescapehex, incomplete}
+ \EdefUnescapeHex\x{4}%
+ \Expect*{\x}{@}%
+\end{qstest}
+
+\begin{qstest}{unhex-space}{unescapehex, space}
+ \EdefUnescapeHex\x{20}%
+ \Expect*{\x}{ }%
+ \ExpectVar\x\space
+\end{qstest}
+
+\begin{qstest}{unhex-spaces}{unescapehex, spaces}
+ \EdefUnescapeHex\x{204020204120}%
+ \def\y#1{%
+ \edef\z{#1\string @#1#1\string A#1}%
+ }\y{ }%
+ \Expect*{\x}*{\z}%
+ \ExpectVar\x\z
+\end{qstest}
+
+\begin{qstest}{unhex-hash}{unescapehex, hash}
+ \catcode`\#=12 %
+ \EdefUnescapeHex\x{#20}%
+ \ExpectVar\x\space
+\end{qstest}
+
+\begin{qstest}{unhex-invalid}{unescapehex, invalid}
+ \def\test#1#2{%
+ \EdefUnescapeHex\x{#1}%
+ \edef\y{#2}%
+ \@onelevel@sanitize\y
+ \ExpectVar\x\y
+ }%
+%<*test2>
+ \edef\x{\pdfunescapehex{4X}}%
+ \edef\y{\string @}%
+ \ifx\x\y
+ \else
+ \def~{\space}%
+ \typeout{************************************}%
+ \typeout{* Your pdfTeX contains bug 777.~~~~*}%
+ \typeout{* This test is redefined as dummy, *}%
+ \typeout{* because it triggers the bug.~~~~~*}%
+ \typeout{************************************}%
+ \def\test#1#2{}%
+ \fi
+%</test2>
+ \test{X}{}%
+ \test{XY}{}%
+ \test{XYZ}{}%
+ \test{A}{^^a0}%
+ \test{AX}{^^a0}%
+ \test{XA}{^^a0}%
+ \test{XXAXX}{^^a0}%
+\end{qstest}
+
+\begin{qstest}{all-name}{\AllBytes, escapename}
+ \EdefEscapeName\x{\AllBytes}%
+ \Expect*{\x}*{\AllBytesName}%
+ \ExpectVar\x\AllBytesName
+\end{qstest}
+
+\begin{qstest}{all-string}{\AllBytes, escapestring}
+ \EdefEscapeString\x{\AllBytes}%
+ \Expect*{\x}*{\AllBytesString}%
+ \ExpectVar\x\AllBytesString
+\end{qstest}
+
+\begin{qstest}{uchexdigit}{unescape, uppercase hex digit}
+ \catcode`\@=11 %
+ \catcode0=12 %
+ \def\test#1#2{%
+ \uccode0=#1\relax
+ \uppercase{%
+ \def\x{^^@}%
+ }%
+ \Expect*{%
+ \ifcase\expandafter\PE@TestUcHexDigit\x
+ true%
+ \else
+ false%
+ \fi
+ }{#2}%
+ }%
+ \def\range#1#2#3{%
+ \count0=#1\relax
+ \loop
+ \ifnum\count0<#2\relax
+ \test{\count0}{#3}%
+ \advance\count0 by 1 %
+ \repeat
+ }%
+ \range{0}{47}{false}%
+ \range{48}{57}{true}%
+ \range{58}{64}{false}%
+ \range{65}{70}{true}%
+ \range{71}{255}{false}%
+\end{qstest}
+
+\begin{qstest}{unescapename}{unescapename}
+ \def\test#1#2{%
+ \EdefUnescapeName\x{#1}%
+ \edef\y{#2}%
+ \@onelevel@sanitize\y
+ \ExpectVar\x\y
+ }%
+ \catcode`\#=12 %
+ \catcode0=12 %
+ \test{}{}%
+ \test{x}{x}%
+ \test{xy}{xy}%
+ \test{#}{#}%
+ \test{##}{##}%
+ \test{###}{###}%
+ \test{####}{####}%
+ \test{#x}{#x}%
+ \test{#xy}{#xy}%
+ \test{#1}{#1}%
+ \test{#40}{@}%
+ \test{#400}{@0}%
+ \test{#4x0}{#4x0}%
+ \test{#ab}{^^ab}%
+ \test{#00}{^^@}%
+ \test{x#40y#40z}{x@y@z}%
+ \test{#40#40#40#40}{@@@@}%
+ \test{a#x}{a#x}%
+ \test{a#xy}{a#xy}%
+ \test{a#1}{a#1}%
+ \test{a#40}{a@}%
+ \test{a#400}{a@0}%
+ \test{#20}{ }%
+ \test{a#20}{a }%
+ \test{a#20b}{a b}%
+ \test{a#20#20#20b}{a \space\space b}%
+\end{qstest}
+
+\begin{qstest}{unescapestring}{unescapestring}
+ \def\test#1#2{%
+ \EdefUnescapeString\x{#1}%
+ \edef\y{#2}%
+ \@onelevel@sanitize\y
+ \ExpectVar\x\y
+ }%
+ \catcode0=12 %
+ \def\DefChar#1#2{%
+ \begingroup
+ \uccode0=#2\relax
+ \uppercase{\endgroup
+ \def#1{^^@}%
+ }%
+ }%
+ \DefChar\nul{0}%
+ \DefChar\one{1}%
+ \DefChar\bel{8}%
+ \DefChar\tab{9}%
+ \DefChar\lf{10}%
+ \DefChar\ff{12}%
+ \DefChar\cr{13}%
+ \DefChar\\{92}%
+ \test{}{}%
+ \test{a}{a}%
+ \test{\\}{}%
+ \test{\\\\}{\\}%
+ \test{\\\\y}{\\y}%
+ \test{\\000}{\nul}%
+ \test{\\b}{\bel}%
+ \test{\\t}{\tab}%
+ \test{\\n}{\lf}%
+ \test{\\f}{\ff}%
+ \test{\\r}{\cr}%
+ \test{\\(}{(}%
+ \test{\\)}{)}%
+ \test{\\040}{ }%
+ \test{\\100}{@}%
+ \test{\\40}{ }%
+ \test{\\1}{\one}%
+ \test{\\01}{\one}%
+ \test{\\001}{\one}%
+ \test{\\18}{\one8}%
+ \test{\\018}{\one8}%
+ \test{\\0018}{\one8}%
+ \test{x\\}{x}%
+ \test{x\\\\}{x\\}%
+ \test{x\\\\y}{x\\y}%
+ \test{x\\000}{x\nul}%
+ \test{x\\b}{x\bel}%
+ \test{x\\t}{x\tab}%
+ \test{x\\n}{x\lf}%
+ \test{x\\f}{x\ff}%
+ \test{x\\r}{x\cr}%
+ \test{x\\(}{x(}%
+ \test{x\\)}{x)}%
+ \test{x\\040}{x }%
+ \test{x\\100}{x@}%
+ \test{x\\40}{x }%
+ \test{x\\1}{x\one}%
+ \test{x\\01}{x\one}%
+ \test{x\\001}{x\one}%
+ \test{x\\18}{x\one8}%
+ \test{x\\018}{x\one8}%
+ \test{x\\0018}{x\one8}%
+ \test{\\b\\t\\n\\f\\r\\(\\)\\\\\\000\\040}{%
+ \bel\tab\lf\ff\cr()\\\nul\space
+ }%
+ \test{\\\lf}{}%
+ \test{x\\\lf}{x}%
+ \test{\cr}{\lf}%
+ \test{\cr\lf}{\lf}%
+ \test{\lf}{\lf}%
+ \test{\lf\cr}{\lf\lf}%
+ \test{x\cr}{x\lf}%
+ \test{x\cr\lf}{x\lf}%
+ \test{x\lf}{x\lf}%
+ \test{x\lf\cr}{x\lf\lf}%
+ \test{x\\\cr\lf y\cr}{xy\lf}%
+%
+ \test{\\409}{ 9}%
+ \test{\\800}{800}%
+ \test{\\900}{900}%
+ \test{\\578}{/8}%
+ \test{\\477}{?}%
+ \test{\\377}{^^ff}%
+ \test{\\777}{^^ff}%
+ \test{\\7777}{^^ff7}%
+\end{qstest}
+\stop
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</test2|test3|test4|test5>
+% \end{macrocode}
+%
+% \subsubsection{Test for \hologo{iniTeX}}
+%
+% \begin{macrocode}
+%<*test6>
+\input pdfescape.sty\relax
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\^=7 %
+\catcode`\@=11 %
+% \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
+\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\msg#{\immediate\write16}
+\def\Test#1#2#3{%
+ \begingroup
+ #1\TestResult{#2}%
+ \ifx\TestResult#3%
+ \else
+ \newlinechar=10 %
+ \msg{Expect:^^J#3}%
+ \msg{Result:^^J\TestResult}%
+ \errmessage{\string#2 -\string#1-> \string#3}%
+ \fi
+ \endgroup
+}
+\Test\EdefEscapeHex\AllBytes\AllBytesHex
+\Test\EdefUnescapeHex\AllBytesHex\AllBytes
+\Test\EdefEscapeName\AllBytes\AllBytesName
+\Test\EdefUnescapeName\AllBytesName\AllBytesFromName
+\Test\EdefEscapeString\AllBytes\AllBytesString
+\Test\EdefUnescapeString\AllBytesString\AllBytes
+% \end{macrocode}
+% \begin{macrocode}
+\csname @@end\endcsname\end
+%</test6>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pdfescape}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfescape.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfescape.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[\CTAN{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 pdfescape.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@{}}
+% pdfescape.sty & tex/generic/oberdiek/pdfescape.sty\\
+% pdfescape.pdf & doc/latex/oberdiek/pdfescape.pdf\\
+% test/pdfescape-test1.tex & doc/latex/oberdiek/test/pdfescape-test1.tex\\
+% test/pdfescape-test2.tex & doc/latex/oberdiek/test/pdfescape-test2.tex\\
+% test/pdfescape-test3.tex & doc/latex/oberdiek/test/pdfescape-test3.tex\\
+% test/pdfescape-test4.tex & doc/latex/oberdiek/test/pdfescape-test4.tex\\
+% test/pdfescape-test5.tex & doc/latex/oberdiek/test/pdfescape-test5.tex\\
+% test/pdfescape-test6.tex & doc/latex/oberdiek/test/pdfescape-test6.tex\\
+% pdfescape.dtx & source/latex/oberdiek/pdfescape.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdfescape.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pdfescape.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 pdfescape.dtx
+%makeindex -s gind.ist pdfescape.idx
+%pdflatex pdfescape.dtx
+%makeindex -s gind.ist pdfescape.idx
+%pdflatex pdfescape.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdfescape.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdfescape'>
+ <name>pdfescape</name>
+ <caption>Implements pdfTeX's escape features using TeX or e-TeX.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2010,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.14'/>
+ <description>
+ This package implements <xref refid='pdftex'>pdfTeX</xref>'s
+ escape features (<tt>\pdfescapehex</tt>, <tt>\pdfunescapehex</tt>,
+ <tt>\pdfescapename</tt>, <tt>\pdfescapestring</tt>) using TeX or
+ e-TeX.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdfescape.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdfescape.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/02/21 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/02/25 v1.1}
+% \item
+% Test files added.
+% \item
+% \cs{EdefUnescapeHex} supports lowercase letters.
+% \item
+% Fix: \verb|\EdefEscapeName{^^@}|
+% \item
+% Fix: \verb|\EdefEscapeName{\string#}|
+% \item
+% Fix for \cs{EdefUnescapeHex} in case of incomplete hex string.
+% \item
+% Fix: \cs{EdefUnescapeHex} generates space tokens with catcode
+% 10 (space) in all cases.
+% \item
+% Fix: \cs{EdefEscapeHex} and \cs{EdefEscapeName} now generate
+% tokens with catcode 12 (other) only.
+% \end{Version}
+% \begin{Version}{2007/03/20 v1.2}
+% \item
+% Fix: Wrong year in \cs{ProvidesPackage}.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.3}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/04/21 v1.4}
+% \item
+% \cs{EdefUnescapeName} and \cs{EdefUnescapeString} added.
+% \end{Version}
+% \begin{Version}{2007/08/27 v1.5}
+% \item
+% \cs{EdefSanitize} added (replaces \cs{PE@sanitize}).
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.6}
+% \item
+% Fix in catcode setup.
+% \end{Version}
+% \begin{Version}{2007/10/27 v1.7}
+% \item
+% More efficient \cs{EdefSanitize}.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.8}
+% \item
+% Use of package \xpackage{pdftexcmds} for \hologo{LuaTeX} support.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.9}
+% \item
+% Compatibility with \hologo{iniTeX}.
+% \end{Version}
+% \begin{Version}{2010/11/12 v1.10}
+% \item
+% Use of package \xpackage{ltxcmds}.
+% \item
+% Fix for compatibility with \hologo{iniTeX}.
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.11}
+% \item
+% Already loaded package files are not input in \hologo{plainTeX}.
+% \end{Version}
+% \begin{Version}{2011/04/04 v1.12}
+% \item
+% Further fixes for compatibility for \hologo{iniTeX}.
+% \item
+% Test file for \hologo{iniTeX} added.
+% \end{Version}
+% \begin{Version}{2011/11/25 v1.13}
+% \item
+% Higher order bit of octal sequences in \cs{EdefUnescapeString}
+% ignored according to the PDF specification
+% (Bug found by Bruno Le Floch).
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.14}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pdfescape.pdf b/macros/latex/contrib/oberdiek/pdfescape.pdf
new file mode 100644
index 0000000000..d4bb60e010
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfescape.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdflscape.dtx b/macros/latex/contrib/oberdiek/pdflscape.dtx
new file mode 100644
index 0000000000..dfaaddbb4d
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdflscape.dtx
@@ -0,0 +1,1117 @@
+% \iffalse meta-comment
+%
+% File: pdflscape.dtx
+% Version: 2016/05/14 v0.11
+% Info: Display of landscape pages in PDF
+%
+% Copyright (C) 2001, 2004, 2006-2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file pdflscape.dtx
+% and the derived files
+% pdflscape.sty, pdflscape.pdf, pdflscape.ins, pdflscape.drv,
+% pdflscape-test1.tex, pdflscape-test2.tex,
+% pdflscape-test3.tex, pdflscape-test4.tex,
+% pdflscape-test5.tex, pdflscape-test6.tex,
+% pdflscape-test6.txt, ExtractRotate.java.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pdflscape.dtx
+% CTAN:macros/latex/contrib/oberdiek/pdflscape.pdf
+%
+% Unpacking:
+% (a) If pdflscape.ins is present:
+% tex pdflscape.ins
+% (b) Without pdflscape.ins:
+% tex pdflscape.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pdflscape.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pdflscape.drv is present:
+% latex pdflscape.drv
+% (b) Without pdflscape.drv:
+% latex pdflscape.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 pdflscape.dtx
+% makeindex -s gind.ist pdflscape.idx
+% pdflatex pdflscape.dtx
+% makeindex -s gind.ist pdflscape.idx
+% pdflatex pdflscape.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/pdflscape.sty
+% TDS:doc/latex/oberdiek/pdflscape.pdf
+% TDS:doc/latex/oberdiek/test/pdflscape-test1.tex
+% TDS:doc/latex/oberdiek/test/pdflscape-test2.tex
+% TDS:doc/latex/oberdiek/test/pdflscape-test3.tex
+% TDS:doc/latex/oberdiek/test/pdflscape-test4.tex
+% TDS:doc/latex/oberdiek/test/pdflscape-test5.tex
+% TDS:doc/latex/oberdiek/test/pdflscape-test6.tex
+% TDS:doc/latex/oberdiek/test/pdflscape-test6.txt
+% TDS:doc/latex/oberdiek/test/ExtractRotate.java
+% TDS:source/latex/oberdiek/pdflscape.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pdflscape 2016/05/14 v0.11 Display of landscape pages in PDF (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pdflscape
+Version: 2016/05/14 v0.11
+
+Copyright (C) 2001, 2004, 2006-2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file pdflscape.dtx
+and the derived files
+ pdflscape.sty, pdflscape.pdf, pdflscape.ins, pdflscape.drv,
+ pdflscape-test1.tex, pdflscape-test2.tex,
+ pdflscape-test3.tex, pdflscape-test4.tex,
+ pdflscape-test5.tex, pdflscape-test6.tex,
+ pdflscape-test6.txt, ExtractRotate.java.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pdflscape.ins}{\from{pdflscape.dtx}{install}}%
+ \file{pdflscape.drv}{\from{pdflscape.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{pdflscape.sty}{\from{pdflscape.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pdflscape-test1.tex}{\from{pdflscape.dtx}{test0,test1}}%
+% \file{pdflscape-test2.tex}{\from{pdflscape.dtx}{test0,test2}}%
+% \file{pdflscape-test3.tex}{\from{pdflscape.dtx}{test0,test3}}%
+% \file{pdflscape-test4.tex}{\from{pdflscape.dtx}{test0,test4}}%
+% \file{pdflscape-test5.tex}{\from{pdflscape.dtx}{test5}}%
+% \file{pdflscape-test6.tex}{\from{pdflscape.dtx}{test6}}%
+ \nopreamble
+ \nopostamble
+% \file{pdflscape-test6.txt}{\from{pdflscape.dtx}{result6}}%
+ \file{ExtractRotate.java}{\from{pdflscape.dtx}{ExtractRotate}}%
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pdflscape.xml}{\from{pdflscape.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{* pdflscape.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pdflscape.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdflscape.drv}%
+ [2016/05/14 v0.11 Display of landscape pages in PDF (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{graphics}
+\begin{document}
+ \DocInput{pdflscape.dtx}%
+\end{document}
+%</driver>
+% \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{pdflscape.drv}
+%
+% \title{The \xpackage{pdflscape} package}
+% \date{2016/05/14 v0.11}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{pdflscape} adds PDF support to the
+% environment \texttt{landscape} of package \xpackage{lscape}
+% by setting the PDF page attribute \texttt{/Rotate}.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Supported drivers}
+%
+% \begin{itemize}
+% \item \xoption{pdftex},\xoption{luatex}
+% \item \xoption{dvips}, \xoption{dvipsone},
+% \xoption{pctex32}, \xoption{pctexps}
+% (and other drivers that provide a non-empty \cs{Gin@PS@raw})
+% \item \xoption{dvipdfm}
+% \end{itemize}
+%
+% \subsection{Caveat}
+%
+% Depending on the configuration Ghostscript
+% adds a guessed rotation entry by its own.
+% This can lead to two |/Rotate| entries per page.
+% To prevent this behaviour set the parameter
+% |AutoRotatePages| to |/None|, eg:
+% \begin{quote}
+% |ps2pdf -dAutoRotatePages=/None|
+% \end{quote}
+%
+% \subsection{Requirements}
+%
+% \begin{itemize}
+% \item The package \xpackage{lscape}.
+% \item The package \xpackage{atbegshi} for all drivers
+% except \xoption{pdftex},\xoption{luatex}.
+% \end{itemize}
+%
+% \subsection{Usage}
+%
+% Load this package instead of or after package \xpackage{lscape}:
+% \begin{quote}
+% |\usepackage{pdflscape}|\\
+% |\begin{landscape}|\dots|\end{landscape}|
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Package identification}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pdflscape}%
+ [2016/05/14 v0.11 Display of landscape pages in PDF (HO)]
+% \end{macrocode}
+%
+% \subsection{Driver options}
+%
+% \begin{macrocode}
+\let\PLS@option\@empty
+\let\PLS@driver\@empty
+\def\PLS@temp#1#2{%
+ \DeclareOption{#1}{%
+ \let\PLS@option\CurrentOption
+ \def\PLS@driver{#2}%
+ }%
+}
+\PLS@temp{pdftex}{pdftex}
+\PLS@temp{luatex}{pdftex}
+\PLS@temp{dvips}{dvips}
+\PLS@temp{dvipsone}{dvips}
+\PLS@temp{pctexps}{dvips}
+\PLS@temp{dvipdfm}{dvipdfm}
+\PLS@temp{dvipdfmx}{dvipdfm}
+\PLS@temp{xetex}{dvipdfm}
+\let\PLS@temp\@empty
+\DeclareOption*{%
+ \ifx\PLS@temp\@empty
+ \let\PLS@temp\CurrentOption
+ \else
+ \edef\PLS@temp{\PLS@temp,\CurrentOption}%
+ \fi
+}
+\ProcessOptions*
+\ifx\PLS@option\@empty
+\else
+ \expandafter\PassOptionsToPackage\expandafter{\PLS@option}{lscape}%
+\fi
+\ifx\PLS@temp\@empty
+\else
+ \expandafter\PassOptionsToPackage\expandafter{\PLS@temp}{lscape}%
+\fi
+\RequirePackage{lscape}
+% \end{macrocode}
+%
+% \subsection{Autodetection of driver}
+%
+% \subsubsection{Driver \xoption{pdftex}}
+%
+% \begin{macrocode}
+\RequirePackage{ifpdf}[2006/02/20]
+\def\PLS@temp{pdftex}
+\ifpdf
+ \ifx\PLS@driver\@empty
+ \let\PLS@driver\PLS@temp
+ \PackageInfo{pdflscape}{Auto-detected driver: \PLS@temp}%
+ \fi
+ \ifx\PLS@driver\PLS@temp
+ \else
+ \PackageError{pdflscape}{%
+ The driver option `\PLS@option' is not compatible\MessageBreak
+ with pdfTeX in PDF mode, using driver `pdftex' instead%
+ }\@ehc
+ \let\PLS@driver\PLS@temp
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Driver \xoption{xetex}}
+%
+% \begin{macrocode}
+\RequirePackage{ifxetex}%
+\def\PLS@temp{dvipdfm}
+\ifxetex
+ \ifx\PLS@driver\@empty
+ \let\PLS@driver\PLS@temp
+ \PackageInfo{pdflscape}{%
+ Auto-detected driver: \PLS@temp\space(xetex)%
+ }%
+ \fi
+ \ifx\PLS@driver\PLS@temp
+ \else
+ \PackageError{pdflscape}{%
+ The driver option `\PLS@option' is not compatible\MessageBreak
+ with XeTeX, using driver for XeTeX (dvipdfm) instead%
+ }\@ehc
+ \let\PLS@driver\PLS@temp
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Detect driver based on \cs{Gin@driver}}
+%
+% \begin{macrocode}
+\def\PLS@temp#1#2{%
+ \ifx\PLS@driver\@empty
+ \begingroup
+ \def\PLS@temp{#1.def}%
+ \expandafter\endgroup
+ \ifx\PLS@temp\Gin@driver
+ \def\PLS@driver{#2}%
+ \PackageInfo{pdflscape}{%
+ Auto-detected driver: \PLS@driver\space(#1)%
+ }%
+ \fi
+ \fi
+}
+\PLS@temp{dvipdfm}{dvipdfm}
+\PLS@temp{dvipdfmx}{dvipdfm}
+\PLS@temp{dvips}{dvips}
+\PLS@temp{dvipsone}{dvips}
+\PLS@temp{pctexps}{dvips}
+% \end{macrocode}
+%
+% \subsubsection{Driver \xoption{dvips}}
+%
+% \begin{macrocode}
+\ifx\PLS@driver\@empty
+ \def\PLS@temp{dvips}%
+ \ifnum 1=0\ifx\Gin@PS@raw\@undefined
+ \else
+ \ifx\Gin@PS@raw\relax
+ \else
+ \ifx\Gin@PS@raw\@empty
+ \else
+ 1%
+ \fi
+ \fi
+ \fi
+ \space
+ \let\PLS@driver\PLS@temp
+ \PackageInfo{pdflscape}{%
+ Auto-detected driver: \PLS@temp\space(PostScript)%
+ }%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifx\PLS@driver\@empty
+ \PackageError{pdflscape}{%
+ Neither pdfTeX, PostScript, nor dvipdfm driver found%
+ }\@ehc
+\fi
+% \end{macrocode}
+%
+% \subsection{Driver implementation}
+%
+% \begin{itemize}
+% \item |\PLS@AddRotate #1|\\
+% it expects the correct rotation number in |#1|
+% and implements the adding of the /Rotation entry
+% in the |/Page| object of the current page.
+% \item |\PLS@RemoveRotate|\\
+% it removes a previous |/Rotate| entry, if necessary.
+% \end{itemize}
+%
+% \subsubsection{\pdfTeX}
+%
+% Not too nice is the global setting of \cs{pdfpageattr}.
+% Perhaps this can be changed in future versions.
+%
+% luatex compat.
+% \begin{macrocode}
+\ifx\pdfpageattr\@undefined
+ \ifx\pdfvariable\@undefined\else
+ \protected\edef\pdfpageattr{\pdfvariable pageattr}
+ \fi
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\def\PLS@temp{pdftex}
+\ifx\PLS@temp\PLS@driver
+ \def\PLS@AddRotate#1{%
+ \ifnum#1=0 %
+% \end{macrocode}
+% Already the default.
+% \begin{macrocode}
+ \else
+ \global\pdfpageattr\expandafter{%
+ \the\pdfpageattr
+ /Rotate #1%
+ }%
+ \fi
+ }%
+% \end{macrocode}
+% Removes a |/Rotate| entry.
+% \begin{macrocode}
+ \def\PLS@RemoveRotate{%
+ \begingroup
+ \global\pdfpageattr\expandafter{\expandafter}%
+ \expandafter\PLS@@RemoveRotate
+ \the\pdfpageattr /Rotate\@nil
+ \endgroup
+ }%
+ \def\PLS@@RemoveRotate#1/Rotate#2\@nil{%
+% \end{macrocode}
+% Append |/Rotate| free stuff to \cs{pdfpageattr}.
+% \begin{macrocode}
+ \global\pdfpageattr\expandafter{\the\pdfpageattr#1}%
+ \ifx\\#2\\%
+% \end{macrocode}
+% Ready, because the detected |/Rotate| is part of
+% the end marker: |/Rotate\@nil|
+% \begin{macrocode}
+ \else
+% \end{macrocode}
+% First read in the argument of |/Rotate|,
+% then continue parsing.
+% \begin{macrocode}
+ \afterassignment\PLS@@RemoveRotate
+ \count0=#2\@nil
+ \fi
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{PostScript driver}
+%
+% \begin{macrocode}
+\def\PLS@temp{dvips}
+\ifx\PLS@temp\PLS@driver
+ \RequirePackage{atbegshi}%
+ \AtBeginShipout{\PLS@AtBeginShipout}%
+ \let\PLS@AtBeginShipout\@empty
+ \def\PLS@AddRotate#1{%
+ \ifnum#1=0 %
+ \else
+ \def\PLS@AtBeginShipout{%
+ \global\setbox\AtBeginShipoutBox\vbox{%
+ \Gin@PS@raw{%
+ [{ThisPage}\string<\string</Rotate #1\string>\string>%
+ /PUT pdfmark%
+ }%
+ \box\AtBeginShipoutBox
+ }%
+ }%
+ \fi
+ }%
+ \def\PLS@RemoveRotate{\let\PLS@AtBeginShipout\@empty}%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Driver dvipdfm}
+%
+% \begin{macrocode}
+\def\PLS@temp{dvipdfm}
+\ifx\PLS@temp\PLS@driver
+ \RequirePackage{atbegshi}%
+ \AtBeginShipout{\PLS@AtBeginShipout}%
+ \let\PLS@AtBeginShipout\@empty
+ \def\PLS@AddRotate#1{%
+ \ifnum#1=0 %
+ \else
+ \def\PLS@AtBeginShipout{%
+ \global\setbox\AtBeginShipoutBox\vbox{%
+ \special{pdf: put @thispage <</Rotate #1>>}%
+ \box\AtBeginShipoutBox
+ }%
+ }%
+ \fi
+ }%
+ \def\PLS@RemoveRotate{\let\PLS@AtBeginShipout\@empty}%
+\fi
+% \end{macrocode}
+%
+% \subsection{Driver independent stuff}
+%
+% The landscape environment is extended by
+% adding the correct |/Rotate| entries.
+% \begin{macrocode}
+\g@addto@macro{\landscape}{\PLS@Rotate{90}}
+\g@addto@macro{\endlandscape}{\PLS@Rotate{0}}
+% \end{macrocode}
+%
+% \begin{macro}{\PLS@Rotate}
+% Main macro, that sets the |/Rotate| entry.\\
+% Argument: any TeX number or nothing, that means zero.\\
+% Driver independent.
+% \begin{macrocode}
+\def\PLS@Rotate#1{%
+ \begingroup
+% \end{macrocode}
+% 1. Check and validate the argument.
+% \begin{macrocode}
+ \PLS@CheckAngle{#1}%
+ \expandafter\endgroup
+% \end{macrocode}
+% 2. Remove previous |\Rotate| entry.
+% \begin{macrocode}
+ \expandafter\PLS@RemoveRotate
+% \end{macrocode}
+% 3. Add |/Rotate| entry.
+% \begin{macrocode}
+ \expandafter\PLS@AddRotate\expandafter{\the\count@}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PLS@CheckAngle}
+% Validates the rotation angle.\\
+% The result is stored in the count register |\count@|.\\
+% Driver independent.
+% \begin{macrocode}
+\def\PLS@CheckAngle#1{%
+% \end{macrocode}
+% Nothing means zero:
+% \begin{macrocode}
+ \ifx\\#1\\%
+ \count@=0 %
+ \else
+ \count@=#1\relax
+ \fi
+% \end{macrocode}
+% Normalize to interval -360 $<$ |\count@| $<$ 360.
+% \begin{macrocode}
+ \@whilenum\count@>359\do{\advance\count@ -360 }%
+ \@whilenum\count@<-359\do{\advance\count@ 360 }%
+% \end{macrocode}
+% Check values: 0, +/-90, +/-180, +/-270
+% \begin{macrocode}
+ \ifnum 1=0\ifnum\count@=0 \else
+ \ifnum\count@=90 \else
+ \ifnum\count@=-90 \else
+ \ifnum\count@=180 \else
+ \ifnum\count@=-180 \else
+ \ifnum\count@=270 \else
+ \ifnum\count@=-270 \else
+ 1\fi\fi\fi\fi\fi\fi\fi\relax
+ \PackageError{pdflscape}{%
+ Invalid value \the\count@\space for /Rotate%
+ }\@ehc
+ \count@=0 %
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Driver detection tests}
+% \begin{macrocode}
+%<*test0>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+%</test0>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test1>
+\usepackage{ifpdf}
+\ifpdf
+ \def\ExpectDriver{pdftex}%
+\fi
+\usepackage{ifxetex}%
+\ifxetex
+ \def\ExpectDriver{dvipdfm}%
+\fi
+\usepackage{pdflscape}[2016/05/14]
+%</test1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test2>
+\def\ExpectDriver{pdftex}
+\usepackage[pdftex]{pdflscape}[2016/05/14]
+%</test2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test3>
+\def\ExpectDriver{dvipdfm}
+\usepackage[dvipdfmx]{pdflscape}[2016/05/14]
+%</test3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test4>
+\def\ExpectDriver{dvips}
+\usepackage[dvipsone]{graphics}
+\usepackage{pdflscape}[2016/05/14]
+%</test4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test0>
+\begin{document}
+\begin{qstest}{driver}{driver}
+ \makeatletter
+ \Expect*{\PLS@driver}*{\ExpectDriver}%
+\end{qstest}
+\end{document}
+%</test0>
+% \end{macrocode}
+%
+% \subsection{Test for \cs{PLS@CheckAngle}}
+%
+% \begin{macrocode}
+%<*test5>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\usepackage{pdflscape}[2016/05/14]
+\begin{document}
+\begin{qstest}{checkangle}{checkangle}
+ \makeatletter
+ \def\Result{%
+ \def\ResultString{\the\count@}%
+ }%
+ \def\PackageError#1#2#3{%
+ \def\Result{%
+ \def\ResultString{error}%
+ }%
+ }%
+ \def\Test#1#2{%
+ \begingroup
+ \PLS@CheckAngle{#1}%
+ \Result
+ \Expect*{\ResultString}{#2}%
+ \endgroup
+ }%
+ \Test{0}{0}%
+ \Test{90}{90}%
+ \Test{180}{180}%
+ \Test{270}{270}%
+ \Test{360}{0}%
+ \Test{450}{90}%
+ \Test{540}{180}%
+ \Test{630}{270}%
+ \Test{720}{0}%
+ \Test{3600}{0}%
+ \Test{3690}{90}%
+ \Test{-90}{270}%
+ \Test{-180}{180}%
+ \Test{-270}{-90}%
+ \Test{-360}{0}%
+ \Test{-450}{270}%
+ \Test{540}{180}%
+ \Test{-630}{90}%
+ \Test{-720}{0}%
+ \Test{-3600}{0}%
+ \Test{-3690}{270}%
+ \Test{1}{error}%
+ \Test{-1}{error}%
+ \Test{123}{error}%
+\end{qstest}
+\end{document}
+%</test5>
+% \end{macrocode}
+%
+% \subsection{Test for rotate}
+%
+% \begin{macrocode}
+%<*test6>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{pdflscape}[2016/05/14]
+\begin{document}
+\section{Portrait page}
+\begin{landscape}
+\section{Landscape page}
+Foo bar foo bar foo bar foo bar foo bar
+foo bar foo bar foo bar foo bar foo bar.
+\end{landscape}
+\section{Portrait Section}
+Foo bar
+\begin{landscape}
+\section{Again Landscape Section}
+\newpage
+\section{Second Page of Landscape Section}
+\end{landscape}
+\section{Second Last Portrait Page}
+\newpage
+\section{Last Portrait Page}
+\end{document}
+%</test6>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*result6>
+/Page 1 /Rotate 0
+/Page 2 /Rotate 90
+/Page 3 /Rotate 0
+/Page 4 /Rotate 90
+/Page 5 /Rotate 90
+/Page 6 /Rotate 0
+/Page 7 /Rotate 0
+%</result6>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ExtractRotate>
+/**
+ * ExtractRotate.java
+ *
+ * Copyright (C) 2007 by Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+ *
+ * Requires: PDFBox (http://www.pdfbox.org/)
+ *
+ * Syntax: java ExtractRotate <pdffile> <textfile>
+ *
+ * The <pdffile> is analyzed and for each page its rotation
+ * setting is printed in the <textfile>. Example:
+ * /Page 1 /Rotate 0
+ * /Page 2 /Rotate 90
+ */
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import org.pdfbox.pdfparser.PDFParser;
+import org.pdfbox.pdmodel.PDDocument;
+import org.pdfbox.pdmodel.PDDocumentCatalog;
+import org.pdfbox.pdmodel.PDPage;
+
+public class ExtractRotate {
+
+ public static void main(String[] args) {
+ try {
+ String infile = args[0];
+ String outfile = args[1];
+ FileWriter out = new FileWriter(outfile);
+ PDFParser parser =
+ new PDFParser(new FileInputStream(infile));
+ parser.parse();
+ PDDocument document = parser.getPDDocument();
+ PDDocumentCatalog catalog = document.getDocumentCatalog();
+ int i = 0;
+ for (Object page: catalog.getAllPages()) {
+ i++;
+ out.write("/Page " + i + " " + "/Rotate "
+ + ((PDPage)page).findRotation() + "\n");
+ }
+ document.close();
+ out.close();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+}
+%</ExtractRotate>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pdflscape}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdflscape.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdflscape.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[\CTAN{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 pdflscape.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@{}}
+% pdflscape.sty & tex/latex/oberdiek/pdflscape.sty\\
+% pdflscape.pdf & doc/latex/oberdiek/pdflscape.pdf\\
+% test/pdflscape-test1.tex & doc/latex/oberdiek/test/pdflscape-test1.tex\\
+% test/pdflscape-test2.tex & doc/latex/oberdiek/test/pdflscape-test2.tex\\
+% test/pdflscape-test3.tex & doc/latex/oberdiek/test/pdflscape-test3.tex\\
+% test/pdflscape-test4.tex & doc/latex/oberdiek/test/pdflscape-test4.tex\\
+% test/pdflscape-test5.tex & doc/latex/oberdiek/test/pdflscape-test5.tex\\
+% test/pdflscape-test6.tex & doc/latex/oberdiek/test/pdflscape-test6.tex\\
+% test/pdflscape-test6.txt & doc/latex/oberdiek/test/pdflscape-test6.txt\\
+% test/ExtractRotate.java & doc/latex/oberdiek/test/ExtractRotate.java\\
+% pdflscape.dtx & source/latex/oberdiek/pdflscape.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdflscape.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pdflscape.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 pdflscape.dtx
+%makeindex -s gind.ist pdflscape.idx
+%pdflatex pdflscape.dtx
+%makeindex -s gind.ist pdflscape.idx
+%pdflatex pdflscape.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdflscape.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdflscape'>
+ <name>pdflscape</name>
+ <caption>Make landscape pages display as landscape.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2001,2004,2006-2008'/>
+ <license type='lppl1.3'/>
+ <version number='0.11'/>
+ <description>
+ The package adds PDF support to the landscape environment of
+ package <xref refid='lscape'>lscape</xref>, by setting the PDF
+ <tt>/Rotate</tt> page attribute. Pages with this attribute will be
+ displayed in landscape orientation by conforming PDF viewers.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdflscape.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdflscape.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2001/01/15 v0.1}
+% \item
+% First public version,
+% published in \xnewsgroup{de.comp.text.tex}:\\
+% \URL{``\link{Re: Querformat, pdfLaTex und thumbpdf}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/e054c5795e52d2b8}
+% \end{Version}
+% \begin{Version}{2001/02/04 v0.2}
+% \item
+% Minor documentation update.
+% \item
+% CTAN.
+% \end{Version}
+% \begin{Version}{2004/05/11 v0.3}
+% \item
+% Support for dvipdfm added.
+% \end{Version}
+% \begin{Version}{2004/05/12 v0.4}
+% \item
+% Bug fix: support for multipage landscape environment
+% for all drivers except for \xoption{pdftex}.
+% \end{Version}
+% \begin{Version}{2006/02/20 v0.5}
+% \item
+% DTX framework.
+% \item
+% LPPL 1.3
+% \item
+% Code is not changed.
+% \end{Version}
+% \begin{Version}{2006/04/24 v0.6}
+% \item
+% Bug fix: \cs{PLS@RemoveRotate} reinserted for \cs{PLS@Rotate}.
+% \item
+% Fix for \cs{PLS@RemoveRotate} (dvips/dvipdfm): \cs{PLS@EverhShi}
+% hook is cleared.
+% \end{Version}
+% \begin{Version}{2007/04/11 v0.7}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/04/17 v0.8}
+% \item
+% Package \xpackage{atbegshi} replaces \xpackage{everyshi}.
+% \end{Version}
+% \begin{Version}{2007/10/21 v0.9}
+% \item
+% Driver detection for \XeTeX\ added.
+% \item
+% Fix for rotation angles $\le$~-360 or $\ge$~360.
+% \end{Version}
+% \begin{Version}{2008/08/11 v0.10}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2016/05/14 v0.11}
+% \item
+% LuaTeX Compatibility
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pdflscape.pdf b/macros/latex/contrib/oberdiek/pdflscape.pdf
new file mode 100644
index 0000000000..bfe81e27c1
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdflscape.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdfrender.dtx b/macros/latex/contrib/oberdiek/pdfrender.dtx
new file mode 100644
index 0000000000..6859ea88f7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfrender.dtx
@@ -0,0 +1,1960 @@
+% \iffalse meta-comment
+%
+% File: pdfrender.dtx
+% Version: 2018/11/01 v1.5
+% Info: Access to some PDF graphics parameters
+%
+% Copyright (C) 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 pdfrender.dtx
+% and the derived files
+% pdfrender.sty, pdfrender.pdf, pdfrender.ins, pdfrender.drv,
+% pdfrender-test1.tex, pdfrender-test2.tex,
+% pdfrender-test3.tex, pdfrender-test4.tex,
+% pdfrender-test5.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pdfrender.dtx
+% CTAN:macros/latex/contrib/oberdiek/pdfrender.pdf
+%
+% Unpacking:
+% (a) If pdfrender.ins is present:
+% tex pdfrender.ins
+% (b) Without pdfrender.ins:
+% tex pdfrender.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pdfrender.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pdfrender.drv is present:
+% latex pdfrender.drv
+% (b) Without pdfrender.drv:
+% latex pdfrender.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 pdfrender.dtx
+% makeindex -s gind.ist pdfrender.idx
+% pdflatex pdfrender.dtx
+% makeindex -s gind.ist pdfrender.idx
+% pdflatex pdfrender.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/pdfrender.sty
+% TDS:doc/latex/oberdiek/pdfrender.pdf
+% TDS:doc/latex/oberdiek/test/pdfrender-test1.tex
+% TDS:doc/latex/oberdiek/test/pdfrender-test2.tex
+% TDS:doc/latex/oberdiek/test/pdfrender-test3.tex
+% TDS:doc/latex/oberdiek/test/pdfrender-test4.tex
+% TDS:doc/latex/oberdiek/test/pdfrender-test5.tex
+% TDS:source/latex/oberdiek/pdfrender.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pdfrender 2018/11/01 v1.5 Access to some PDF graphics parameters (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pdfrender
+Version: 2018/11/01 v1.5
+
+Copyright (C) 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 pdfrender.dtx
+and the derived files
+ pdfrender.sty, pdfrender.pdf, pdfrender.ins, pdfrender.drv,
+ pdfrender-test1.tex, pdfrender-test2.tex,
+ pdfrender-test3.tex, pdfrender-test4.tex,
+ pdfrender-test5.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pdfrender.ins}{\from{pdfrender.dtx}{install}}%
+ \file{pdfrender.drv}{\from{pdfrender.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{pdfrender.sty}{\from{pdfrender.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pdfrender-test1.tex}{\from{pdfrender.dtx}{test1}}%
+% \file{pdfrender-test2.tex}{\from{pdfrender.dtx}{test2}}%
+% \file{pdfrender-test3.tex}{\from{pdfrender.dtx}{test3}}%
+% \file{pdfrender-test4.tex}{\from{pdfrender.dtx}{test4}}%
+% \file{pdfrender-test5.tex}{\from{pdfrender.dtx}{test5}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pdfrender.xml}{\from{pdfrender.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{* pdfrender.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pdfrender.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfrender.drv}%
+ [2018/11/01 v1.5 Access to some PDF graphics parameters (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{longtable}
+\renewcommand*{\arraystretch}{1.2}
+\begin{document}
+ \DocInput{pdfrender.dtx}%
+\end{document}
+%</driver>
+% \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{pdfrender.drv}
+%
+% \title{The \xpackage{pdfrender} package}
+% \date{2018/11/01 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The PDF format has some graphics parameter like
+% line width or text rendering mode. This package
+% provides an interface for setting these parameters.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% This package \xpackage{pdfrender} defines an interface for
+% PDF specific parameters that affects the rendering of
+% graphics or text. The interface and its implementation
+% uses the same technique as package \xpackage{color}
+% for color settings. Therefore this package is loaded to
+% enable \LaTeX's color interface.
+%
+% At different places \LaTeX\ uses \cs{normalcolor} to avoid that
+% header, footer or floats are print in the current color of the
+% main text. \cs{setgroup@color} is used to start a save box
+% with the color that is set at box saving time.
+% Package \xpackage{pdfrender} extends these macros to
+% add its own hooks of its parameters. Therefore \LaTeX3 should
+% generalize \LaTeXe's color interface.
+%
+% \subsection{Usage}
+%
+% In \LaTeX\ the package is loaded as normal package. Options
+% are not defined for this package.
+% \begin{quote}
+% |\usepackage{pdfrender}|
+% \end{quote}
+%
+% This package can also be used in \plainTeX\ and even ini\TeX:
+% \begin{quote}
+% |input pdfrender.sty|
+% \end{quote}
+%
+% \subsection{Macros}
+%
+% \begin{declcs}{pdfrender} \M{key value list}
+% \end{declcs}
+% The first parameter \meta{key value list} contains a
+% list of parameter settings. The key entry is the parameter name.
+% The macro works like
+% \cs{color} (without optional argument) for color setting.
+%
+% \begin{declcs}{textpdfrender} \M{key value list} \M{text}
+% \end{declcs}
+% In the same way as \cs{pdfrender} the first argument
+% specifies the parameters that should be set. This parameter
+% setting affects \meta{text} only. Basically it works
+% the same way as \cs{textcolor} (without optional argument).
+%
+% \subsection{Parameters}
+%
+% The following table shows an overview for the supported
+% parameters and values:
+%
+% \begin{longtable}{@{}l|l|l@{}}
+% \bfseries Parameter & \bfseries Value & \bfseries Alias\\*
+% \hline
+% \endhead
+% \xoption{TextRenderingMode}
+% & \texttt{0} & \texttt{Fill}\\*
+% & \texttt{1} & \texttt{Stroke}\\*
+% & \texttt{2} & \texttt{FillStroke}\\*
+% & \texttt{3} & \texttt{Invisible}\\*
+% & \texttt{4} & \texttt{FillClip}\\*
+% & \texttt{5} & \texttt{StrokeClip}\\*
+% & \texttt{6} & \texttt{FillStrokeClip}\\*
+% & \texttt{7} & \texttt{Clip}\\
+% \hline
+% \xoption{LineWidth}
+% & \itshape positive number, & \itshape \TeX\ dimen\\*[-.2ex]
+% & \qquad \itshape unit is bp & \\
+% \hline
+% \xoption{LineCapStyle}
+% & \texttt{0} & \texttt{Butt}\\*
+% & \texttt{1} & \texttt{Round}\\*
+% & \texttt{2} & \texttt{ProjectingSquare}\\
+% \hline
+% \xoption{LineJoinStyle}
+% & \texttt{0} & \texttt{Miter}\\*
+% & \texttt{1} & \texttt{Round}\\*
+% & \texttt{2} & \texttt{Bevel}\\
+% \hline
+% \xoption{MiterLimit}
+% & \multicolumn{2}{l@{}}{\itshape positive number} \\
+% \hline
+% \xoption{Flatness}
+% & \multicolumn{2}{l@{}}{\itshape number between 0 and 100} \\
+% \hline
+% \xoption{LineDashPattern}
+% & \multicolumn{2}{l@{}}{^^A
+% \itshape numbers in square brackets,^^A
+% } \\*[-.2ex]
+% & \multicolumn{2}{l@{}}{^^A
+% \qquad \itshape followed by number,^^A
+% } \\*
+% & \multicolumn{2}{l@{}}{^^A
+% \qquad \itshape units are bp^^A
+% } \\
+% \hline
+% \xoption{RenderingIntent}
+% & \multicolumn{2}{l@{}}{\texttt{AbsoluteColorimetric}} \\*
+% & \multicolumn{2}{l@{}}{\texttt{RelativeColorimetric}} \\*
+% & \multicolumn{2}{l@{}}{\texttt{Saturation}} \\*
+% & \multicolumn{2}{l@{}}{\texttt{Perceptual}} \\
+% \hline
+% \xoption{FillColor}
+% & & \itshape color specification \\
+% \hline
+% \xoption{StrokeColor}
+% & & \itshape color specification \\
+% \end{longtable}
+%
+% \subsubsection{Details}
+%
+% The description and specification of these parameters
+% are available in the PDF specification \cite{pdf-spec}.
+% Therefore they are not repeated here.
+%
+% \begin{description}
+% \item[Value:]
+% The values in the second column lists or describe
+% the values that are specified by the PDF specification.
+% \item[Alias:] Instead of magic numbers the package also
+% defines some aliases that can be given as value.
+% Example: |LineCapStyle=Round| has the same effect as
+% |LineCapStyle=1|.
+% \item[Number:] The term \emph{number} means an integer
+% or real number. The real number is given as plain
+% decimal number without exponent. The decimal separator is a period.
+% At least one digit must be present.
+% \item[\xoption{LineWidth}:] As alias a \TeX\ dimen specification
+% can be given. This includes explicit specifications with number
+% and unit, e.g. |LineWidth=0.5pt|. Also \LaTeX\ length registers
+% may be used. If \eTeX's \cs{dimexpr} is available, then it is
+% automatically added. However package \xpackage{calc} is not
+% supported.
+% \item[\xoption{FillColor}, \xoption{StrokeColor}:]
+% Package \xpackage{color} or \xpackage{xcolor} must be loaded
+% before these options can be used (since version 1.2).
+% \LaTeX's color support sets both colors at the same time
+% to the same value. However parameter \xoption{TextRenderingMode}
+% offers the value \texttt{FillStroke} that makes only sense, if
+% the two color types can be set separately.
+% If one of the options \xoption{FillColor} or \xoption{StrokeColor}
+% is specified, then also the color is set. For compatibility
+% with the \LaTeX\ color packages (\xpackage{color} or \xpackage{xcolor}),
+% always both colors must be set. Thus if one of them is not specified,
+% it is taken from the current color.
+%
+% Both options \xoption{FillColor} and \xoption{StrokeColor}
+% expect a \LaTeX\ color specification as value.
+% Also the optional color model argument is supported.
+% Example:
+% \begin{quote}
+% |FillColor=yellow|,\\
+% |StrokeColor=[cmyk]{1,.5,0,0}|\\
+% \end{quote}
+% \end{description}
+%
+% \subsection{Color stack}
+%
+% If the \pdfTeX\ version provides color stacks, then each
+% parameter is assigned a page based color stack. The assignment
+% of a stack takes place, when its parameter is set the first time.
+% This avoids the use of color stacks that are not needed.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@pdfrender.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{pdfrender}{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@pdfrender.sty\endcsname
+\ProvidesPackage{pdfrender}%
+ [2018/11/01 v1.5 Access to some PDF graphics parameters (HO)]%
+% \end{macrocode}
+%
+% \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 PdfRender@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\PdfRender@AtEnd{%
+ \PdfRender@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{36}{3}% $
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{59}{12}% ;
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{63}{12}% ?
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^ (superscript)
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{124}{12}% |
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\PdfRender@AtEndHook{}
+\expandafter\def\expandafter\PdfRender@AtEnd\expandafter{%
+ \expandafter\PdfRender@AtEndHook
+ \PdfRender@AtEnd
+ \endinput
+}
+% \end{macrocode}
+%
+% \subsection{Look for \pdfTeX, its mode and features}
+%
+% \begin{macro}{\PdfRender@newif}
+% \begin{macrocode}
+\def\PdfRender@newif#1{%
+ \expandafter\edef\csname PdfRender@#1true\endcsname{%
+ \let
+ \expandafter\noexpand\csname ifPdfRender@#1\endcsname
+ \noexpand\iftrue
+ }%
+ \expandafter\edef\csname PdfRender@#1false\endcsname{%
+ \let
+ \expandafter\noexpand\csname ifPdfRender@#1\endcsname
+ \noexpand\iffalse
+ }%
+ \csname PdfRender@#1false\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifPdfRender@Stack}
+% \begin{macrocode}
+\PdfRender@newif{Stack}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifPdfRender@Match}
+% \begin{macrocode}
+\PdfRender@newif{Match}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PdfRender@RequirePackage}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \def\PdfRender@RequirePackage#1[#2]{%
+ \expandafter\def\expandafter\PdfRender@AtEndHook\expandafter{%
+ \PdfRender@AtEndHook
+ \ltx@ifpackagelater{#1}{#2}{}{%
+ \@PackageWarningNoLine{pdfrender}{%
+ You have requested version\MessageBreak
+ `#2' of package `#1',\MessageBreak
+ but only version\MessageBreak
+ `\csname ver@#1.\ltx@pkgextension\endcsname'\MessageBreak
+ is available%
+ }%
+ }%
+ }%
+ \input #1.sty\relax
+ }%
+\else
+ \let\PdfRender@RequirePackage\RequirePackage
+\fi
+% \end{macrocode}
+% \end{macro}
+% Luatex compatibility
+% \begin{macrocode}
+\ifx\pdfextension\@undefined\else
+ \def\pdfcolorstackinit {\pdffeedback colorstackinit}
+ \protected\def\pdfcolorstack {\pdfextension colorstack}
+ \protected\def\pdfliteral {\pdfextension literal}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\PdfRender@RequirePackage{ifpdf}[2010/01/28]
+\PdfRender@RequirePackage{infwarerr}[2007/09/09]
+\PdfRender@RequirePackage{ltxcmds}[2010/01/28]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifpdf
+ \ltx@IfUndefined{pdfcolorstackinit}{%
+ \@PackageWarning{pdfrender}{%
+ Missing \string\pdfcolorstackinit
+ }%
+ }{%
+ \PdfRender@Stacktrue
+ }%
+ \ltx@IfUndefined{pdfmatch}{%
+ \@PackageInfoNoLine{pdfrender}{%
+ \string\pdfmatch\ltx@space not found. %
+ Therefore the values\MessageBreak
+ of some parameters are not validated%
+ }%
+ }{%
+ \PdfRender@Matchtrue
+ }%
+\else
+ \@PackageWarning{pdfrender}{%
+ Missing pdfTeX in PDF mode%
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \ltx@IfUndefined{newcommand}{%
+% \end{macrocode}
+% \begin{macro}{\pdfrender}
+% \begin{macrocode}
+ \def\pdfrender#1{}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textpdfrender}
+% \begin{macrocode}
+ \long\def\textpdfrender#1#2{#2}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+% \begin{macro}{\pdfrender}
+% \begin{macrocode}
+ \newcommand*{\pdfrender}[1]{}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textpdfrender}
+% \begin{macrocode}
+ \newcommand{\textpdfrender}[2]{#2}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ }%
+ \expandafter\PdfRender@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Enable color support of \LaTeX}
+%
+% \begin{macrocode}
+\ltx@ifpackageloaded{color}{}{%
+ \def\color@setgroup{\begingroup\set@color}%
+ \let\color@begingroup\begingroup
+ \def\color@endgroup{\endgraf\endgroup}%
+ \def\color@hbox{\hbox\bgroup\color@begingroup}%
+ \def\color@vbox{\vbox\bgroup\color@begingroup}%
+ \def\color@endbox{\color@endgroup\egroup}%
+ \ltx@ifundefined{bgroup}{%
+ \let\bgroup={\let\egroup=}%
+ }{}%
+ \ltx@ifundefined{endgraf}{%
+ \let\endgraf=\par
+ }{}%
+}
+% \end{macrocode}
+%
+% \subsection{Hook into \cs{normalcolor}}
+%
+% The problem is that packages \xpackage{color} and \xpackage{xcolor}
+% each overwrite \cs{normalcolor}. For example, after the package
+% loading order \xpackage{color}, \xpackage{pdfrender} and \xpackage{xcolor}
+% the patched version of \cs{normalcolor} is overwritten by
+% package \xpackage{xcolor}. Also using \cs{AtBeginDocument} for
+% patching is not enough. If package \xpackage{hyperref} is loaded
+% later, it might load package \xpackage{color} using \cs{AtBeginDocument}.
+% \begin{macro}{\PdfRender@NormalColorHook}
+% \begin{macrocode}
+\def\PdfRender@NormalColorHook{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@ColorSetGroupHook}
+% \begin{macrocode}
+\def\PdfRender@ColorSetGroupHook{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@TestBox}
+% \begin{macrocode}
+\def\PdfRender@TestBox#1{%
+ \setbox0=\color@hbox#1\color@endbox
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@PatchNormalColor}
+% \begin{macrocode}
+\def\PdfRender@PatchNormalColor{%
+ \ltx@ifundefined{normalcolor}{%
+ \gdef\normalcolor{\PdfRender@NormalColorHook}%
+ }{%
+ \begingroup
+ \def\PdfRender@NormalColorHook{\let\PdfRender@temp=Y}%
+ \PdfRender@TestBox{%
+ \let\set@color\relax
+ \normalcolor
+ \ifx\PdfRender@temp Y%
+ \else
+ \ltx@GlobalAppendToMacro\normalcolor{%
+ \PdfRender@NormalColorHook
+ }%
+ \fi
+ }%
+ \endgroup
+ }%
+ \ifx\@nodocument\relax
+ \global\let\PdfRender@PatchNormalColor\relax
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@PatchColorSetGroup}
+% \begin{macrocode}
+\def\PdfRender@PatchColorSetGroup{%
+ \begingroup
+ \def\PdfRender@ColorSetGroupHook{\let\PdfRender@temp=Y}%
+ \PdfRender@TestBox{%
+ \let\set@color\relax
+ \color@setgroup\color@endgroup
+ \ifx\PdfRender@temp Y%
+ \else
+ \ltx@GlobalAppendToMacro\color@setgroup{%
+ \PdfRender@ColorSetGroupHook
+ }%
+ \fi
+ }%
+ \endgroup
+ \ifx\@nodocument\relax
+ \global\let\PdfRender@PatchColorSetGroup\relax
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@PatchColor}
+% \begin{macrocode}
+\def\PdfRender@PatchColor{%
+ \PdfRender@PatchNormalColor
+ \PdfRender@PatchColorSetGroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\PdfRender@PatchColor
+\ltx@IfUndefined{AtBeginDocument}{}{%
+ \AtBeginDocument{\PdfRender@PatchColor}%
+}
+% \end{macrocode}
+% \cs{AfterPackage} is provided by package \xpackage{scrlfile}.
+% \begin{macrocode}
+\ltx@IfUndefined{AfterPackage}{%
+}{%
+ \AfterPackage{color}{\PdfRender@PatchColor}%
+ \AfterPackage{xcolor}{\PdfRender@PatchColor}%
+ \AfterPackage{etoolbox}{%
+ \AfterEndPreamble{\PdfRender@PatchColor}%
+ }%
+}%
+% \end{macrocode}
+% \cs{AfterEndPreamble} is provided by package \xpackage{etoolbox}.
+% \begin{macrocode}
+\ltx@IfUndefined{AfterEndPreamble}{%
+}{%
+ \AfterEndPreamble{\PdfRender@PatchColor}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\PdfRender@RequirePackage{kvsetkeys}[2010/01/28]
+% \end{macrocode}
+% \begin{macro}{\PdfRender@texorpdfstring}
+% \begin{macrocode}
+\def\PdfRender@texorpdfstring{%
+ \ltx@IfUndefined{texorpdfstring}\ltx@firstoftwo\texorpdfstring
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pdfrender}
+% \begin{macrocode}
+\ltx@IfUndefined{DeclareRobustCommand}%
+\ltx@firstoftwo\ltx@secondoftwo
+{%
+ \def\pdfrender#1%
+}{%
+ \newcommand{\pdfrender}{}%
+ \DeclareRobustCommand*{\pdfrender}[1]%
+}%
+{%
+ \PdfRender@texorpdfstring{%
+ \PdfRender@PatchNormalColor
+ \global\let\PdfRender@FillColor\ltx@empty
+ \global\let\PdfRender@StrokeColor\ltx@empty
+ \kvsetkeys{PDFRENDER}{#1}%
+ \PdfRender@SetColor
+ }{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\textpdfrender}
+% \begin{macrocode}
+\ltx@IfUndefined{DeclareRobustCommand}%
+\ltx@firstoftwo\ltx@secondoftwo
+{%
+ \long\def\textpdfrender#1#2%
+}{%
+ \newcommand{\textpdfrender}{}%
+ \DeclareRobustCommand{\textpdfrender}[2]%
+}%
+{%
+ \PdfRender@texorpdfstring{%
+ \begingroup
+ \pdfrender{#1}%
+ #2%
+ \endgroup
+ }{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifPdfRender@Values}
+% \begin{macrocode}
+\PdfRender@newif{Values}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@NewClassValues}
+% \begin{macrocode}
+\def\PdfRender@NewClassValues#1#2#3#4{%
+ \PdfRender@Valuestrue
+ \PdfRender@NewClass{#1}{#2}{#3}{#4}{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@NewClass}
+% \begin{macrocode}
+\def\PdfRender@NewClass#1#2#3#4#5{%
+ \PdfRender@newif{Active#1}%
+ \expandafter\def\csname PdfRender@Default#1\endcsname{#2}%
+ \expandafter\let\csname PdfRender@Current#1\expandafter\endcsname
+ \csname PdfRender@Default#1\endcsname
+ \ifPdfRender@Stack
+ \expandafter\edef\csname PdfRender@Init#1\endcsname{%
+ \global\chardef
+ \expandafter\noexpand\csname PdfRender@Stack#1\endcsname=%
+ \noexpand\pdfcolorstackinit page direct{%
+ \noexpand#3%
+ \expandafter\noexpand\csname PdfRender@Default#1\endcsname
+ }\relax
+ \noexpand\@PackageInfo{pdfrender}{%
+ New color stack `#1' = \noexpand\number
+ \expandafter\noexpand\csname PdfRender@Stack#1\endcsname
+ }%
+ \gdef\expandafter\noexpand\csname PdfRender@Init#1\endcsname{}%
+ }%
+ \expandafter\edef\csname PdfRender@Set#1\endcsname{%
+ \expandafter\noexpand\csname PdfRender@Init#1\endcsname
+ \noexpand\pdfcolorstack
+ \expandafter\noexpand\csname PdfRender@Stack#1\endcsname
+ push{%
+ #3{\expandafter\noexpand\csname PdfRender@Current#1\endcsname}%
+ }%
+ \noexpand\aftergroup
+ \expandafter\noexpand\csname PdfRender@Reset#1\endcsname
+ }%
+ \expandafter\edef\csname PdfRender@Reset#1\endcsname{%
+ \expandafter\noexpand\csname PdfRender@Init#1\endcsname
+ \noexpand\pdfcolorstack
+ \expandafter\noexpand\csname PdfRender@Stack#1\endcsname
+ pop\relax
+ }%
+ \else
+ \expandafter\edef\csname PdfRender@Set#1\endcsname{%
+ \noexpand\pdfliteral direct{%
+ #3{\expandafter\noexpand\csname PdfRender@Current#1\endcsname}%
+ }%
+ \noexpand\aftergroup
+ \expandafter\noexpand\csname PdfRender@Reset#1\endcsname
+ }%
+ \expandafter\edef\csname PdfRender@Reset#1\endcsname{%
+ \noexpand\pdfliteral direct{%
+ #3{\expandafter\noexpand\csname PdfRender@Current#1\endcsname}%
+ }%
+ }%
+ \fi
+ \expandafter\edef\csname PdfRender@Normal#1\endcsname{%
+ \let
+ \expandafter\noexpand\csname PdfRender@Current#1\endcsname
+ \expandafter\noexpand\csname PdfRender@Default#1\endcsname
+ \noexpand\PdfRender@Set{#1}%
+ }%
+ \expandafter\ltx@GlobalAppendToMacro\expandafter\PdfRender@NormalColorHook
+ \expandafter{%
+ \csname PdfRender@Normal#1\endcsname
+ }%
+ \ltx@GlobalAppendToMacro\PdfRender@ColorSetGroupHook{%
+ \PdfRender@Set{#1}%
+ }%
+ \ifPdfRender@Values
+ \kv@parse@normalized{#4}{%
+ \expandafter\let\csname PdfRender@#1@\kv@key\endcsname\kv@key
+ \ifx\kv@value\relax
+ \else
+ \expandafter\let\csname PdfRender@#1@\kv@value\endcsname\kv@key
+ \fi
+ \ltx@gobbletwo
+ }%
+ \PdfRender@define@key{PDFRENDER}{#1}{%
+ \global\csname PdfRender@Active#1true\endcsname
+ \def\PdfRender@Current{##1}%
+ \PdfRender@SetValidateValues{#1}%
+ }%
+ \PdfRender@Valuesfalse
+ \else
+ \PdfRender@define@key{PDFRENDER}{#1}{%
+ \global\csname PdfRender@Active#1true\endcsname
+ \expandafter\def\csname PdfRender@Current#1\endcsname{##1}%
+ \ltx@IfUndefined{PdfRender@PostProcess#1}{%
+ }{%
+ \csname PdfRender@PostProcess#1\endcsname
+ }%
+ \PdfRender@SetValidate{#1}{#4}{#5}%
+ }%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@define@key}
+% \begin{macrocode}
+\ltx@IfUndefined{define@key}{%
+ \def\PdfRender@define@key#1#2{%
+ \expandafter\def\csname KV@#1@#2\endcsname##1%
+ }%
+}{%
+ \let\PdfRender@define@key\define@key
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@Set}
+% \begin{macrocode}
+\def\PdfRender@Set#1{%
+ \csname ifPdfRender@Active#1\endcsname
+ \csname PdfRender@Set#1\expandafter\endcsname
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@Reset}
+% \begin{macrocode}
+\def\PdfRender@Reset#1{%
+ \csname ifPdfRender@Active#1\endcsname
+ \csname PdfRender@Reset#1\expandafter\endcsname
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@ErrorInvalidValue}
+% \begin{macrocode}
+\def\PdfRender@ErrorInvalidValue#1{%
+ \PackageError{pdfrender}{%
+ Ignoring parameter setting for `#1'\MessageBreak
+ because of invalid value %
+ `\csname PdfRender@Current#1\endcsname'%
+ }\@ehc
+ \expandafter\let\csname PdfRender@Current#1\endcsname\ltx@empty
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@SetValidate}
+% \begin{macrocode}
+\ifPdfRender@Match
+ \def\PdfRender@SetValidate#1#2#3{%
+ \ifnum\pdfmatch{^(#2)$}{\csname PdfRender@Current#1\endcsname}=1 %
+ \csname PdfRender@Set#1\expandafter\endcsname
+ \else
+ \PdfRender@ErrorInvalidValue{#1}%
+ \fi
+ }%
+\else
+ \def\PdfRender@SetValidate#1#2#3{%
+ \expandafter\let\expandafter\PdfRender@Current
+ \csname PdfRender@Current#1\endcsname
+ #3%
+ \ifx\PdfRender@Current\@empty
+ \PdfRender@ErrorInvalidValue{#1}%
+ \else
+ \csname PdfRender@Set#1\expandafter\endcsname
+ \fi
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@SetValidateValues}
+% \begin{macrocode}
+\def\PdfRender@SetValidateValues#1{%
+ \ltx@IfUndefined{PdfRender@#1@\PdfRender@Current}{%
+ \expandafter\let\csname PdfRender@Current#1\endcsname
+ \PdfRender@Current
+ \PdfRender@ErrorInvalidValue{#1}%
+ }{%
+ \expandafter\edef\csname PdfRender@Current#1\endcsname{%
+ \csname PdfRender@#1@\PdfRender@Current\endcsname
+ }%
+ \csname PdfRender@Set#1\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@OpValue}
+% \begin{macrocode}
+\def\PdfRender@OpValue#1#2{#2\ltx@space#1}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@OpName}
+% \begin{macrocode}
+\def\PdfRender@OpName#1#2{/#2\ltx@space#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Declare and setup parameters}
+%
+% \begin{macrocode}
+\PdfRender@NewClassValues{TextRenderingMode}%
+ {0}%
+ {\PdfRender@OpValue{Tr}}{%
+ 0=Fill,%
+ 1=Stroke,%
+ 2=FillStroke,%
+ 3=Invisible,%
+ 4=FillClip,%
+ 5=StrokeClip,%
+ 6=FillStrokeClip,%
+ 7=Clip,%
+}%
+\PdfRender@NewClass{LineWidth}{1}{\PdfRender@OpValue{w}}{%
+ [0-9]+\string\.?[0-9]*|\string\.[0-9]+%
+}{}%
+\ltx@IfUndefined{dimexpr}{%
+ \def\PdfRender@dimexpr{}%
+}{%
+ \let\PdfRender@dimexpr\dimexpr
+}
+\def\PdfRender@PostProcessLineWidth{%
+ \begingroup
+ \afterassignment\PdfRender@@PostProcessLineWidth
+ \dimen0=\PdfRender@dimexpr\PdfRender@CurrentLineWidth bp %
+ \PdfRender@let\PdfRender@relax\PdfRender@relax
+}
+\let\PdfRender@let\let
+\let\PdfRender@relax\relax
+\def\PdfRender@@PostProcessLineWidth#1\PdfRender@let{%
+ \ifx\\#1\\%
+ \endgroup
+ \else
+ \dimen0=.996264\dimen0 % 72/72.27
+ \edef\x{\endgroup
+ \def\noexpand\PdfRender@CurrentLineWidth{%
+ \strip@pt\dimen0%
+ }%
+ }%
+ \expandafter\x
+ \fi
+}
+\PdfRender@NewClassValues{LineCapStyle}{0}{\PdfRender@OpValue{J}}{%
+ 0=Butt,%
+ 1=Round,%
+ 2=ProjectingSquare,%
+}%
+\PdfRender@NewClassValues{LineJoinStyle}{0}{\PdfRender@OpValue{j}}{%
+ 0=Miter,%
+ 1=Round,%
+ 2=Bevel,%
+}%
+\PdfRender@NewClass{MiterLimit}{10}{\PdfRender@OpValue{M}}{%
+ [0-9]*[1-9][0-9]*\string\.?[0-9]*|%
+ [0-9]*\string\.?[0-9]*[1-9][0-9]*%
+}{}%
+\PdfRender@NewClass{Flatness}{0}{\PdfRender@OpValue{i}}{%
+ 100(\string\.0*)?|[0-9][0-9](\string\.[0-9]*)?|\string\.[0-9]+%
+}{}%
+\PdfRender@NewClass{LineDashPattern}{[]0}{\PdfRender@OpValue{d}}{%
+ \string\[%
+ ( ?([0-9]+\string\.?[0-9]*|\string\.[0-9]+) ?)*%
+ \string\] ?%
+ ([0-9]+\string\.?[0-9]*|\string\.[0-9]+)%
+}{}%
+\PdfRender@NewClassValues{RenderingIntent}%
+ {RelativeColorimetric}%
+ {\PdfRender@OpName{ri}}{%
+ AbsoluteColorimetric,%
+ RelativeColorimetric,%
+ Saturation,%
+ Perceptual,%
+}%
+% \end{macrocode}
+%
+% \subsection{Fill and stroke color support}
+%
+% \begin{macrocode}
+\PdfRender@define@key{PDFRENDER}{FillColor}{%
+ \begingroup
+ \def\PdfRender@Color{#1}%
+ \ifx\PdfRender@Color\ltx@empty
+ \global\let\PdfRender@FillColor\ltx@empty
+ \else
+ \PdfRender@ColorAvailable{%
+ \PdfRender@TestBox{%
+ \expandafter\PdfRender@TryColor\PdfRender@Color\ltx@empty
+ \PdfRender@GetFillColor
+ \ifx\PdfRender@FillColor\ltx@empty
+ \@PackageWarning{pdfrender}{%
+ Cannot extract fill color\MessageBreak
+ from value `#1'%
+ }%
+ \fi
+ }%
+ }%
+ \fi
+ \endgroup
+}
+\PdfRender@define@key{PDFRENDER}{StrokeColor}{%
+ \begingroup
+ \def\PdfRender@Color{#1}%
+ \ifx\PdfRender@Color\ltx@empty
+ \global\let\PdfRender@StrokeColor\ltx@empty
+ \else
+ \PdfRender@ColorAvailable{%
+ \PdfRender@TestBox{%
+ \expandafter\PdfRender@TryColor\PdfRender@Color\ltx@empty
+ \PdfRender@GetStrokeColor
+ \ifx\PdfRender@StrokeColor\ltx@empty
+ \@PackageWarning{pdfrender}{%
+ Cannot extract stroke color\MessageBreak
+ from value `#1'%
+ }%
+ \fi
+ }%
+ }%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \begin{macro}{\PdfRender@ColorAvailable}
+% \begin{macrocode}
+\def\PdfRender@ColorAvailable{%
+ \@ifundefined{set@color}{%
+ \@PackageError{pdfrender}{%
+ Ignoring color options, because neither\MessageBreak
+ package `color' nor package `xcolor' is loaded%
+ }\@ehc
+ \global\let\PdfRender@ColorAvailable\ltx@gobble
+ }{%
+ \global\let\PdfRender@ColorAvailable\ltx@firstofone
+ }%
+ \PdfRender@ColorAvailable
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@TryColor}
+% \begin{macrocode}
+\def\PdfRender@TryColor{%
+ \@ifnextchar[\color\PdfRender@@TryColor
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@@TryColor}
+% \begin{macrocode}
+\def\PdfRender@@TryColor#1\ltx@empty{%
+ \expandafter\color\expandafter{\PdfRender@Color}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@SetColor}
+% \begin{macrocode}
+\def\PdfRender@SetColor{%
+ \chardef\PdfRender@NeedsCurrentColor=0 %
+ \ifx\PdfRender@FillColor\ltx@empty
+ \ifx\PdfRender@StrokeColor\ltx@empty
+ \else
+ \edef\PdfRender@CurrentColor{%
+ \noexpand\PdfRender@FillColor\ltx@space\PdfRender@StrokeColor
+ }%
+ \chardef\PdfRender@NeedsCurrentColor=1 %
+ \fi
+ \else
+ \ifx\PdfRender@StrokeColor\ltx@empty
+ \edef\PdfRender@CurrentColor{%
+ \PdfRender@FillColor\ltx@space\noexpand\PdfRender@StrokeColor
+ }%
+ \chardef\PdfRender@NeedsCurrentColor=2 %
+ \else
+ \edef\current@color{%
+ \PdfRender@FillColor\ltx@space\PdfRender@StrokeColor
+ }%
+ \set@color
+ \fi
+ \fi
+ \ifnum\PdfRender@NeedsCurrentColor=1 %
+ \PdfRender@GetFillColor
+ \ifx\PdfRender@FillColor\ltx@empty
+ \@PackageWarning{pdfrender}{%
+ Cannot extract current fill color%
+ }%
+ \else
+ \edef\current@color{\PdfRender@CurrentColor}%
+ \set@color
+ \fi
+ \else
+ \ifnum\PdfRender@NeedsCurrentColor=2 %
+ \PdfRender@GetStrokeColor
+ \ifx\PdfRender@StrokeColor\ltx@empty
+ \@PackageWarning{pdfrender}{%
+ Cannot extract current stroke color%
+ }%
+ \else
+ \edef\current@color{\PdfRender@CurrentColor}%
+ \set@color
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@PatternFillColor}
+% \begin{macrocode}
+\edef\PdfRender@PatternFillColor{ % space
+ (%
+ [0-9\string\.]+ g|%
+ [0-9\string\.]+ [0-9\string\.]+ [0-9\string\.]+ rg|%
+ [0-9\string\.]+ [0-9\string\.]+ %
+ [0-9\string\.]+ [0-9\string\.]+ k%
+ ) % space
+ (.*)$%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@PatternStrokeColor}
+% \begin{macrocode}
+\edef\PdfRender@PatternStrokeColor{ % space
+ (%
+ [0-9\string\.]+ G|%
+ [0-9\string\.]+ [0-9\string\.]+ [0-9\string\.]+ RG|%
+ [0-9\string\.]+ [0-9\string\.]+ %
+ [0-9\string\.]+ [0-9\string\.]+ K%
+ ) % space
+ (.*)$%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@MatchPattern}
+% \begin{macrocode}
+\def\PdfRender@MatchPattern#1{%
+ \ifnum\pdfmatch{\PdfRender@Pattern}{\PdfRender@String}=1 %
+ \xdef#1{%
+ \expandafter\strip@prefix\pdflastmatch 1%
+ }%
+ \edef\PdfRender@String{%
+ \expandafter\strip@prefix\pdflastmatch 2%
+ }%
+ \ifx\PdfRender@String\ltx@empty
+ \else
+ \expandafter\expandafter\expandafter\PdfRender@MatchPattern
+ \expandafter\expandafter\expandafter#1%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@GetFillColor}
+% \begin{macrocode}
+\def\PdfRender@GetFillColor{%
+ \global\let\PdfRender@FillColor\ltx@empty
+ \begingroup
+ \ifPdfRender@Match
+ \let\PdfRender@Pattern\PdfRender@PatternFillColor
+ \edef\PdfRender@String{\ltx@space\current@color\ltx@space}%
+ \PdfRender@MatchPattern\PdfRender@FillColor
+ \else
+ \edef\current@color{\current@color\ltx@space}%
+ \let\PdfRender@OP\relax
+ \PdfRender@FindOp{g}0%
+ \PdfRender@FindOp{G}1%
+ \PdfRender@FindOp{rg}0%
+ \PdfRender@FindOp{RG}1%
+ \PdfRender@FindOp{k}0%
+ \PdfRender@FindOp{K}1%
+ \PdfRender@FilterOp 0\PdfRender@FillColor
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@GetStrokeColor}
+% \begin{macrocode}
+\def\PdfRender@GetStrokeColor{%
+ \global\let\PdfRender@StrokeColor\ltx@empty
+ \begingroup
+ \ifPdfRender@Match
+ \let\PdfRender@Pattern\PdfRender@PatternStrokeColor
+ \edef\PdfRender@String{\ltx@space\current@color\ltx@space}%
+ \PdfRender@MatchPattern\PdfRender@StrokeColor
+ \else
+ \edef\current@color{\current@color\ltx@space}%
+ \let\PdfRender@OP\relax
+ \PdfRender@FindOp{g}0%
+ \PdfRender@FindOp{G}1%
+ \PdfRender@FindOp{rg}0%
+ \PdfRender@FindOp{RG}1%
+ \PdfRender@FindOp{k}0%
+ \PdfRender@FindOp{K}1%
+ \PdfRender@FilterOp 1\PdfRender@StrokeColor
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\ifPdfRender@Match
+ \expandafter\PdfRender@AtEnd
+\fi%
+% \end{macrocode}
+% \begin{macro}{\PdfRender@FindOp}
+% \begin{macrocode}
+\def\PdfRender@FindOp#1#2{%
+ \def\PdfRender@temp##1 #1 ##2\@nil{%
+ ##1%
+ \ifx\\##2\\%
+ \expandafter\@gobble
+ \else
+ \PdfRender@OP{#1}#2%
+ \expandafter\@firstofone
+ \fi
+ {%
+ \PdfRender@temp##2\@nil
+ }%
+ }%
+ \edef\current@color{%
+ \@firstofone{\expandafter\PdfRender@temp\current@color} #1 \@nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@FilterOp}
+% \begin{macrocode}
+\def\PdfRender@FilterOp#1#2{%
+ \expandafter\PdfRender@@FilterOp\expandafter#1\expandafter#2%
+ \current@color\PdfRender@OP{}{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PdfRender@@FilterOp}
+% \begin{macrocode}
+\def\PdfRender@@FilterOp#1#2#3\PdfRender@OP#4#5{%
+ \ifx\\#4#5\\%
+ \else
+ \ifnum#1=#5 %
+ \xdef#2{#3 #4}%
+ \fi
+ \expandafter\PdfRender@@FilterOp\expandafter#1\expandafter#2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\PdfRender@AtEnd%
+%</package>
+% \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 pdfrender.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Simple test file}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfrender-test2.tex}[2018/11/01]
+\documentclass{article}
+\usepackage{color}
+\usepackage{pdfrender}[2018/11/01]
+\begin{document}
+Hello World
+\newpage
+Start
+\textpdfrender{%
+ TextRenderingMode=1,%
+ LineWidth=.1,%
+ LineCapStyle=2,%
+ LineJoinStyle=1,%
+ MiterLimit=1.2,%
+ LineDashPattern=[2 2]0,%
+ RenderingIntent=Saturation,%
+}{Hello\newpage World}
+Stop
+\par
+\newlength{\LineWidth}
+\setlength{\LineWidth}{.5pt}
+Start
+\textpdfrender{%
+ FillColor=yellow,%
+ StrokeColor=[cmyk]{1,.5,0,0},%
+ TextRenderingMode=FillStroke,%
+ LineWidth=.5\LineWidth,%
+ LineCapStyle=Round,%
+ LineJoinStyle=Bevel,%
+}{Out-\par\newpage line}
+Stop
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \subsection{Further tests}
+%
+% Robustness and bookmarks.
+% \begin{macrocode}
+%<*test3>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfrender-test3.tex}[2018/11/01]
+\documentclass{article}
+\usepackage{pdfrender}[2018/11/01]
+\usepackage{hyperref}
+\usepackage{bookmark}
+\begin{document}
+\tableofcontents
+\section{%
+ \textpdfrender{%
+ TextRenderingMode=1,%
+ LineCapStyle=2,%
+ LineJoinStyle=1,%
+ MiterLimit=1.2,%
+ LineDashPattern=[2 2]0,%
+ RenderingIntent=Saturation,%
+ }{Hello World}%
+}
+\end{document}
+%</test3>
+% \end{macrocode}
+%
+% Color algorithm if \cs{pdfmatch} is not available.
+% \begin{macrocode}
+%<*test4>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pdfrender-test4.tex}[2018/11/01]
+\documentclass[12pt]{article}
+\usepackage{pdfrender}[2018/11/01]
+\usepackage{color}
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\makeatletter
+\newcommand*{\CheckColor}[1]{%
+ \Expect{#1}*{\current@color}%
+}
+\makeatother
+\begin{document}
+ \begin{qstest}{color}{color}%
+ \CheckColor{0 g 0 G}%
+ \Huge\bfseries
+ \noindent
+ \textpdfrender{%
+ TextRenderingMode=2,%
+ LineWidth=.5,%
+ FillColor=yellow,%
+ StrokeColor=blue,%
+ }{%
+ \CheckColor{0 0 1 0 k 0 0 1 RG}%
+ Blue(Yellow)\\%
+ \textpdfrender{%
+ FillColor=green,%
+ }{%
+ \CheckColor{0 1 0 rg 0 0 1 RG}%
+ Blue(Green)%
+ }\\%
+ \CheckColor{0 0 1 0 k 0 0 1 RG}%
+ Blue(Yellow)\\%
+ \textpdfrender{%
+ StrokeColor=red,%
+ }{%
+ \CheckColor{0 0 1 0 k 1 0 0 RG}%
+ Red(Yellow)%
+ }\\%
+ \CheckColor{0 0 1 0 k 0 0 1 RG}%
+ Blue(Yellow) %
+ }%
+ \end{qstest}%
+ \begin{qstest}{colorlast}{colorlast}%
+ \makeatletter
+ \def\Test#1#2#3{%
+ \begingroup
+ \def\current@color{#1}%
+ \textpdfrender{#2}{%
+ \CheckColor{#3}%
+ }%
+ \endgroup
+ }%
+ \Test{1 g 0 0 1 RG 0 0 1 0 k 0.5 G}%
+ {StrokeColor=green}%
+ {0 0 1 0 k 0 1 0 RG}%
+ \Test{1 g 0 0 1 RG 0 0 1 0 k 0.5 G}%
+ {FillColor=red}%
+ {1 0 0 rg 0.5 G}%
+ \end{qstest}%
+\end{document}
+%</test4>
+% \end{macrocode}
+%
+% \subsection{Compatibility with \plainTeX}
+%
+% \begin{macrocode}
+%<*test5>
+\input luatex85.sty
+\pdfoutput=1 %
+\hsize=6.5in
+\vsize=8.9in
+\pdfpagewidth=\hsize
+\pdfpageheight=\vsize
+\parfillskip=0pt plus 1fil\relax
+\input pdfrender.sty\relax
+\catcode`\{=1 %
+\catcode`\}=2 %
+\let\OrgMakeFootLine\makefootline
+\def\makefootline{%
+ \begingroup\normalcolor\OrgMakeFootLine\endgroup
+}
+\font\f=ec-lmr10 scaled 3000\relax
+\f
+Before %
+\textpdfrender{%
+ TextRenderingMode=1,%
+ LineWidth=.1,%
+}{Hello\par\vfill\penalty-10000 World} %
+After %
+\par
+\vfill
+\penalty-10000 %
+\csname @@end\endcsname\end
+%</test5>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pdfrender}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfrender.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pdfrender.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[\CTAN{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 pdfrender.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@{}}
+% pdfrender.sty & tex/generic/oberdiek/pdfrender.sty\\
+% pdfrender.pdf & doc/latex/oberdiek/pdfrender.pdf\\
+% test/pdfrender-test1.tex & doc/latex/oberdiek/test/pdfrender-test1.tex\\
+% test/pdfrender-test2.tex & doc/latex/oberdiek/test/pdfrender-test2.tex\\
+% test/pdfrender-test3.tex & doc/latex/oberdiek/test/pdfrender-test3.tex\\
+% test/pdfrender-test4.tex & doc/latex/oberdiek/test/pdfrender-test4.tex\\
+% test/pdfrender-test5.tex & doc/latex/oberdiek/test/pdfrender-test5.tex\\
+% pdfrender.dtx & source/latex/oberdiek/pdfrender.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdfrender.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pdfrender.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 pdfrender.dtx
+%makeindex -s gind.ist pdfrender.idx
+%pdflatex pdfrender.dtx
+%makeindex -s gind.ist pdfrender.idx
+%pdflatex pdfrender.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdfrender.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdfrender'>
+ <name>pdfrender</name>
+ <caption>Control rendering parameters.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.5'/>
+ <description>
+ The package provides interfaces for the user to control PDF
+ parameters, such as line width or text rendering mode. The
+ control operations work in a manner very similar to that of the
+ <xref refid='color'>color</xref> package.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdfrender.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdfrender.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \section{Acknowledgement}
+%
+% \begin{description}
+% \item[Friedrich Vosberg] asked in the
+% newsgroup \textsf{de.comp.text.tex} for the font
+% outline feature \cite{news-Vosberg}.
+% \item[Gaius Pupus] proposed the basic method
+% using \cs{pdfliteral} in this thread \cite{news-Pupus}.
+% \item[Rolf Niepraschk] added color support \cite{news-Niepraschk}.
+% \end{description}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+%
+% \bibitem{pdf-spec}
+% Adobe Systems Incorporated. \textit{PDF Reference --
+% Adobe Portable Document format -- Version 1.7}.
+% 6th ed. 2006.
+% \textsc{URL:}\,\url{http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference_1-7.pdf}.
+%
+% \bibitem{news-Vosberg}
+% Friedrich Vosberg, \textit{Text in Buchstabenumrissen},
+% de.comp.text.tex, 2010-01-22.
+% \textsc{URL:}\,\url{http://groups.google.com/group/de.comp.text.tex/msg/f442310ac8b2d506}.
+%
+% \bibitem{news-Pupus}
+% Gaius Pupus, \textit{Re: Text in Buchstabenumrissen},
+% de.comp.text.tex, 2010-01-23.
+% \textsc{URL:}\,\url{http://groups.google.com/group/de.comp.text.tex/msg/95d890d77ac47eb1}.
+%
+% \bibitem{news-Niepraschk}
+% Rolf Niepraschk, \textit{Re: Text in Buchstabenumrissen},
+% de.comp.text.tex, 2010-01-24.
+% \textsc{URL:}\,\url{http://groups.google.com/group/de.comp.text.tex/msg/4eb61a5879db54db}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2010/01/26 v1.0}
+% \item
+% The first version.
+% \end{Version}
+% \begin{Version}{2010/01/27 v1.1}
+% \item
+% Macros \cs{pdfrender} and \cs{textpdfrender} are made robust.
+% \item
+% Color extraction rewritten for the case that \cs{pdfmatch}
+% is not available. This fixes wrong color assigments in
+% case of nesting.
+% \item
+% Color extraction of case \cs{pdfmatch} is fixed
+% for the case that the color string contains several
+% fill or several stroke operations.
+% \end{Version}
+% \begin{Version}{2010/01/28 v1.2}
+% \item
+% Dependency from package \xpackage{color} is removed.
+% \item
+% Compatibility for \plainTeX\ and even ini\TeX\ added.
+% \end{Version}
+% \begin{Version}{2016/05/14 v1.3}
+% \item
+% Use package \xpackage{luatex85} for compatibility with new LuaTeX.
+% \end{Version}
+% \begin{Version}{2016/05/17 v1.4}
+% \item
+% Documentation updates.
+% \item adjust luatex85 reference so that it works in plain TeX.
+% \end{Version}
+% \begin{Version}{2018/11/01 v1.5}
+% \item
+% Remove luatex85 dependency
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pdfrender.pdf b/macros/latex/contrib/oberdiek/pdfrender.pdf
new file mode 100644
index 0000000000..5ff26fc0f6
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdfrender.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pdftexcmds.dtx b/macros/latex/contrib/oberdiek/pdftexcmds.dtx
new file mode 100644
index 0000000000..9a948c3c2d
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdftexcmds.dtx
@@ -0,0 +1,2732 @@
+% \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 <heiko.oberdiek at googlemail.com>
+%
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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
+%</ignore>
+%<*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 <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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
+%</install>
+%<*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},
+}
+%</bib>
+%<*ignore>
+\fi
+%</ignore>
+%<*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}
+%</driver>
+% \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 https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \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%
+%</package>
+% \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}
+%</lua>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \subsection{Catcode checks for loading}
+%
+% \begin{macrocode}
+%<*test1>
+% \end{macrocode}
+% \begin{macrocode}
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\expandafter\ifx\csname count@\endcsname\relax
+ \countdef\count@=255 %
+\fi
+\expandafter\ifx\csname @gobble\endcsname\relax
+ \long\def\@gobble#1{}%
+\fi
+\expandafter\ifx\csname @firstofone\endcsname\relax
+ \long\def\@firstofone#1{#1}%
+\fi
+\expandafter\ifx\csname loop\endcsname\relax
+ \expandafter\@firstofone
+\else
+ \expandafter\@gobble
+\fi
+{%
+ \def\loop#1\repeat{%
+ \def\body{#1}%
+ \iterate
+ }%
+ \def\iterate{%
+ \body
+ \let\next\iterate
+ \else
+ \let\next\relax
+ \fi
+ \next
+ }%
+ \let\repeat=\fi
+}%
+\def\RestoreCatcodes{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@ 1 %
+\repeat
+
+\def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@ 1 %
+ \repeat
+}
+\def\RangeCatcodeCheck#1#2#3{%
+ \count@=#1\relax
+ \loop
+ \ifnum#3=\catcode\count@
+ \else
+ \errmessage{%
+ Character \the\count@\space
+ with wrong catcode \the\catcode\count@\space
+ instead of \number#3%
+ }%
+ \fi
+ \ifnum\count@<#2\relax
+ \advance\count@ 1 %
+ \repeat
+}
+\def\space{ }
+\expandafter\ifx\csname LoadCommand\endcsname\relax
+ \def\LoadCommand{\input pdftexcmds.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test for \cs{pdf@isprimitive}}
+%
+% \begin{macrocode}
+%<*test2>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\input pdftexcmds.sty\relax
+\def\msg#1{%
+ \begingroup
+ \escapechar=92 %
+ \immediate\write16{#1}%
+ \endgroup
+}
+\long\def\test#1#2#3#4{%
+ \begingroup
+ #4%
+ \def\str{%
+ Test \string\pdf@isprimitive
+ {\string #1}{\string #2}{...}: %
+ }%
+ \pdf@isprimitive{#1}{#2}{%
+ \ifx#3Y%
+ \msg{\str true ==> OK.}%
+ \else
+ \errmessage{\str false ==> FAILED}%
+ \fi
+ }{%
+ \ifx#3Y%
+ \errmessage{\str true ==> FAILED}%
+ \else
+ \msg{\str false ==> OK.}%
+ \fi
+ }%
+ \endgroup
+}
+\test\relax\relax Y{}
+\test\foobar\relax Y{\let\foobar\relax}
+\test\foobar\relax N{}
+\test\hbox\hbox Y{}
+\test\foobar@hbox\hbox Y{\let\foobar@hbox\hbox}
+\test\if\if Y{}
+\test\if\ifx N{}
+\test\ifx\if N{}
+\test\par\par Y{}
+\test\hbox\par N{}
+\test\par\hbox N{}
+\csname @@end\endcsname\end
+%</test2>
+% \end{macrocode}
+%
+% \subsection{Test for \cs{pdf@shellescape}}
+%
+% \begin{macrocode}
+%<*test-shell>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\input pdftexcmds.sty\relax
+\def\msg#{\immediate\write16}
+\def\MaybeEnd{}
+\ifx\luatexversion\UnDeFiNeD
+\else
+ \ifnum\luatexversion<68 %
+ \ifx\pdf@shellescape\@undefined
+ \msg{SHELL=U}%
+ \msg{OK (LuaTeX < 0.68)}%
+ \else
+ \msg{SHELL=defined}%
+ \errmessage{Failed (LuaTeX < 0.68)}%
+ \fi
+ \def\MaybeEnd{\csname @@end\endcsname\end}%
+ \fi
+\fi
+\MaybeEnd
+\ifx\pdf@shellescape\@undefined
+ \msg{SHELL=U}%
+\else
+ \msg{SHELL=\number\pdf@shellescape}%
+\fi
+\ifx\expected\@undefined
+\else
+ \ifx\expected\relax
+ \msg{EXPECTED=U}%
+ \ifx\pdf@shellescape\@undefined
+ \msg{OK}%
+ \else
+ \errmessage{Failed}%
+ \fi
+ \else
+ \msg{EXPECTED=\number\expected}%
+ \ifnum\pdf@shellescape=\expected\relax
+ \msg{OK}%
+ \else
+ \errmessage{Failed}%
+ \fi
+ \fi
+\fi
+\csname @@end\endcsname\end
+%</test-shell>
+% \end{macrocode}
+%
+% \subsection{Test for escape functions}
+%
+% \begin{macrocode}
+%<*test-escape>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\^=7 %
+\catcode`\@=11 %
+\errorcontextlines=1000 %
+\input pdftexcmds.sty\relax
+\def\msg#1{%
+ \begingroup
+ \escapechar=92 %
+ \immediate\write16{#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \begin{macrocode}
+\begingroup
+ \catcode`\@=11 %
+ \countdef\count@=255 %
+ \def\space{ }%
+ \long\def\@whilenum#1\do #2{%
+ \ifnum #1\relax
+ #2\relax
+ \@iwhilenum{#1\relax#2\relax}%
+ \fi
+ }%
+ \long\def\@iwhilenum#1{%
+ \ifnum #1%
+ \expandafter\@iwhilenum
+ \else
+ \expandafter\ltx@gobble
+ \fi
+ {#1}%
+ }%
+ \gdef\AllBytes{}%
+ \count@=0 %
+ \catcode0=12 %
+ \@whilenum\count@<256 \do{%
+ \lccode0=\count@
+ \ifnum\count@=32 %
+ \xdef\AllBytes{\AllBytes\space}%
+ \else
+ \lowercase{%
+ \xdef\AllBytes{\AllBytes^^@}%
+ }%
+ \fi
+ \advance\count@ by 1 %
+ }%
+\endgroup
+% \end{macrocode}
+% \begin{macrocode}
+\def\AllBytesHex{%
+ 000102030405060708090A0B0C0D0E0F%
+ 101112131415161718191A1B1C1D1E1F%
+ 202122232425262728292A2B2C2D2E2F%
+ 303132333435363738393A3B3C3D3E3F%
+ 404142434445464748494A4B4C4D4E4F%
+ 505152535455565758595A5B5C5D5E5F%
+ 606162636465666768696A6B6C6D6E6F%
+ 707172737475767778797A7B7C7D7E7F%
+ 808182838485868788898A8B8C8D8E8F%
+ 909192939495969798999A9B9C9D9E9F%
+ A0A1A2A3A4A5A6A7A8A9AAABACADAEAF%
+ B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
+ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF%
+ D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
+ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF%
+ F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
+}
+\ltx@onelevel@sanitize\AllBytesHex
+\expandafter\lowercase\expandafter{%
+ \expandafter\def\expandafter\AllBytesHexLC
+ \expandafter{\AllBytesHex}%
+}
+\begingroup
+ \catcode`\#=12 %
+ \xdef\AllBytesName{%
+ #01#02#03#04#05#06#07#08#09#0A#0B#0C#0D#0E#0F%
+ #10#11#12#13#14#15#16#17#18#19#1A#1B#1C#1D#1E#1F%
+ #20!"#23$#25&'#28#29*+,-.#2F%
+ 0123456789:;#3C=#3E?%
+ @ABCDEFGHIJKLMNO%
+ PQRSTUVWXYZ#5B\ltx@backslashchar#5D^_%
+ `abcdefghijklmno%
+ pqrstuvwxyz#7B|#7D\string~#7F%
+ #80#81#82#83#84#85#86#87#88#89#8A#8B#8C#8D#8E#8F%
+ #90#91#92#93#94#95#96#97#98#99#9A#9B#9C#9D#9E#9F%
+ #A0#A1#A2#A3#A4#A5#A6#A7#A8#A9#AA#AB#AC#AD#AE#AF%
+ #B0#B1#B2#B3#B4#B5#B6#B7#B8#B9#BA#BB#BC#BD#BE#BF%
+ #C0#C1#C2#C3#C4#C5#C6#C7#C8#C9#CA#CB#CC#CD#CE#CF%
+ #D0#D1#D2#D3#D4#D5#D6#D7#D8#D9#DA#DB#DC#DD#DE#DF%
+ #E0#E1#E2#E3#E4#E5#E6#E7#E8#E9#EA#EB#EC#ED#EE#EF%
+ #F0#F1#F2#F3#F4#F5#F6#F7#F8#F9#FA#FB#FC#FD#FE#FF%
+ }%
+\endgroup
+\ltx@onelevel@sanitize\AllBytesName
+\edef\AllBytesFromName{\expandafter\ltx@gobble\AllBytes}
+\begingroup
+ \def\|{|}%
+ \edef\%{\ltx@percentchar}%
+ \catcode`\|=0 %
+ \catcode`\#=12 %
+ \catcode`\~=12 %
+ \catcode`\\=12 %
+ |xdef|AllBytesString{%
+ \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017%
+ \020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037%
+ \040!"#$|%&'\(\)*+,-./%
+ 0123456789:;<=>?%
+ @ABCDEFGHIJKLMNO%
+ PQRSTUVWXYZ[\\]^_%
+ `abcdefghijklmno%
+ pqrstuvwxyz{||}~\177%
+ \200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217%
+ \220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237%
+ \240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257%
+ \260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277%
+ \300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317%
+ \320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337%
+ \340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357%
+ \360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377%
+ }%
+|endgroup
+\ltx@onelevel@sanitize\AllBytesString
+% \end{macrocode}
+% \begin{macrocode}
+\def\Test#1#2#3{%
+ \begingroup
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestResult
+ \expandafter\expandafter\expandafter{%
+ #1{#2}%
+ }%
+ \ifx\TestResult#3%
+ \else
+ \newlinechar=10 %
+ \msg{Expect:^^J#3}%
+ \msg{Result:^^J\TestResult}%
+ \errmessage{\string#2 -\string#1-> \string#3}%
+ \fi
+ \endgroup
+}
+\def\test#1#2#3{%
+ \edef\TestFrom{#2}%
+ \edef\TestExpect{#3}%
+ \ltx@onelevel@sanitize\TestExpect
+ \Test#1\TestFrom\TestExpect
+}
+\test\pdf@unescapehex{74657374}{test}
+\begingroup
+ \catcode0=12 %
+ \catcode1=12 %
+ \test\pdf@unescapehex{740074017400740174}{t^^@t^^At^^@t^^At}%
+\endgroup
+\Test\pdf@escapehex\AllBytes\AllBytesHex
+\Test\pdf@unescapehex\AllBytesHex\AllBytes
+\Test\pdf@escapename\AllBytes\AllBytesName
+\Test\pdf@escapestring\AllBytes\AllBytesString
+% \end{macrocode}
+% \begin{macrocode}
+\csname @@end\endcsname\end
+%</test-escape>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/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[\CTAN{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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pdftexcmds.pdf unpack_files output .|
+% \end{quote}
+%
+% \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}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pdftexcmds.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pdftexcmds'>
+ <name>pdftexcmds</name>
+ <caption>LuaTeX support for pdfTeX utility functions.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007,2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='0.20'/>
+ <description>
+ LuaTeX provides most of the commands of
+ <xref refid='pdftex'>pdfTeX</xref> 1.40. However, a number of
+ utility functions are not available. This package tries to fill
+ the gap and implements some of the missing primitives using Lua.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pdftexcmds.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pdftexcmds.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \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
new file mode 100644
index 0000000000..7d1378275b
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pdftexcmds.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/picture.dtx b/macros/latex/contrib/oberdiek/picture.dtx
new file mode 100644
index 0000000000..ba41078a32
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/picture.dtx
@@ -0,0 +1,840 @@
+% \iffalse meta-comment
+%
+% File: picture.dtx
+% Version: 2016/05/16 v1.4
+% Info: Dimens for picture macros
+%
+% Copyright (C) 2006-2009 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file picture.dtx
+% and the derived files
+% picture.sty, picture.pdf, picture.ins, picture.drv,
+% picture-example.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/picture.dtx
+% CTAN:macros/latex/contrib/oberdiek/picture.pdf
+%
+% Unpacking:
+% (a) If picture.ins is present:
+% tex picture.ins
+% (b) Without picture.ins:
+% tex picture.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{picture.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If picture.drv is present:
+% latex picture.drv
+% (b) Without picture.drv:
+% latex picture.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 picture.dtx
+% makeindex -s gind.ist picture.idx
+% pdflatex picture.dtx
+% makeindex -s gind.ist picture.idx
+% pdflatex picture.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/picture.sty
+% TDS:doc/latex/oberdiek/picture.pdf
+% TDS:doc/latex/oberdiek/picture-example.tex
+% TDS:source/latex/oberdiek/picture.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: picture 2016/05/16 v1.4 Dimens for picture macros (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: picture
+Version: 2016/05/16 v1.4
+
+Copyright (C) 2006-2009 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file picture.dtx
+and the derived files
+ picture.sty, picture.pdf, picture.ins, picture.drv,
+ picture-example.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{picture.ins}{\from{picture.dtx}{install}}%
+ \file{picture.drv}{\from{picture.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{picture.sty}{\from{picture.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{picture-example.tex}{\from{picture.dtx}{example}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{picture.xml}{\from{picture.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{* picture.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `picture.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{picture.drv}%
+ [2016/05/16 v1.4 Dimens for picture macros (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{picture.dtx}%
+\end{document}
+%</driver>
+% \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{picture.drv}
+%
+% \title{The \xpackage{picture} package}
+% \date{2016/05/16 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% There are macro and environment arguments that expect numbers
+% that will internally be multiplicated with \cs{unitlength}.
+% This package extends the syntax of these arguments that
+% dimens with calculation support can be added for these arguments.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% \subsection{Introduction}
+%
+% The environment |picture| and macros such as \cs{put}, \cs{line},
+% \cs{vector} and other macros have arguments that expect numbers
+% that are used as factor for \cs{unitlength}.
+% This package redefines such macros and adds code that detects
+% whether such an argument is given as number or as length.
+% In the latter case, the length is used directly without multiplying
+% with \cs{unitlength}.
+%
+% \subsection{Options}
+%
+% Depending on the available features, also length expressions
+% can be given. Option \xoption{calc} loads package \xpackage{calc}.
+% Then expressions of these package may be used.
+% Otherwise \xoption{etex} wraps the length argument inside
+% \cs{dimexpr}\dots\cs{relax}, if \eTeX\ is available. Otherwise
+% option \xoption{plain} uses plain assignments without calculation
+% support.
+%
+% The default is \xoption{calc} if package \xpackage{calc}
+% is loaded before package \xoption{picture}. If you specify
+% option \xoption{calc} the loading of \xpackage{calc} is ensured.
+% Otherwise package \xpackage{picture} looks whether \cs{dimexpr}
+% is available and uses then option \xoption{etex} as default.
+% If \eTeX\ also could not be found, then \xoption{plain} is used.
+%
+% \subsection{Example}
+%
+% \begin{macrocode}
+%<*example>
+\documentclass{article}
+
+\usepackage[calc]{picture}
+
+\begin{document}
+
+\setlength{\unitlength}{1pt}
+
+\begin{picture}(\widthof{Hello World}, 10mm)
+ \put(0, 0){\makebox(0,0)[lb]{Hello World}}%
+ \put(0, \heightof{Hello World} + \fboxsep){%
+ \line(1, 0){\widthof{Hello World}}%
+ }%
+ \put(\widthof{Hello World}, 10mm){%
+ \line(0, -1){10mm}%
+ }%
+\end{picture}
+
+\end{document}
+%</example>
+% \end{macrocode}
+%
+% \subsection{Supported packages}
+%
+% Packages \xpackage{pspicture} and \xpackage{pict2e} are supported,
+% but they must be loaded before package \xpackage{picture}.
+%
+% New macros can be supported by \cs{picture@redefine}.
+% The first argument is the macro which contains the arguments
+% in its parameter text that you want to support by package \xpackage{picture}.
+% The second argument contains the parameter text. Change \# to \& for
+% the arguments in question.
+% Examples (already used by package \xpackage{picture}):
+% \begin{quote}
+% |\picture@redefine\put{(&1,&2)}|\\
+% |\picture@redefine\line{(#1,#2)&3}|
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{picture}%
+ [2016/05/16 v1.4 Dimens for picture macros (HO)]%
+% \end{macrocode}
+%
+% \subsection{Options}
+%
+% \begin{macrocode}
+\def\Pc@calcname{calc}
+\def\Pc@etexname{etex}
+\def\Pc@plainname{plain}
+% \end{macrocode}
+% \begin{macro}{\Pc@method}
+% Macro \cs{Pc@method} stores the method to use for calculations.
+% Check which features are available and set the default for \cs{Pc@method}.
+% \begin{macrocode}
+\@ifpackageloaded{calc}{%
+ \let\Pc@method\Pc@calcname
+}{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname dimexpr\endcsname\relax
+ \let\Pc@method\Pc@plainname
+ \else
+ \let\Pc@method\Pc@etexname
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareOption{plain}{%
+ \let\Pc@method\Pc@plainname
+}
+\DeclareOption{etex}{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname dimexpr\endcsname\relax
+ \PackageError{picture}{%
+ e-TeX is not available%
+ }\@ehc
+ \else
+ \let\Pc@method\Pc@etexname
+ \fi
+}
+\DeclareOption{calc}{%
+ \let\Pc@method\Pc@calcname
+}
+\ProcessOptions*
+\begingroup
+ \let\on@line\@empty
+ \PackageInfo{picture}{Calculation method: \Pc@method}%
+\endgroup
+% \end{macrocode}
+%
+% \subsection{Calculation method}
+%
+% \begin{macrocode}
+\ifx\Pc@method\Pc@calcname
+ \RequirePackage{calc}%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Method \xoption{calc}}
+%
+% \begin{macrocode}
+\ifx\Pc@method\Pc@calcname
+ \def\Pc@tokslength#1{%
+ \begingroup
+ \let\calc@error\Pc@calc@error
+ \setlength\dimen@{#1\unitlength}\Pc@next\Pc@nil{#1}%
+ }%
+ \let\PcOrg@calc@error\calc@error
+ \@ifpackagelater{calc}{2007/08/22}{% v4.3
+ \def\Pc@calc@error#1{%
+ \expandafter\ifx\expandafter\unitlength\noexpand#1\relax
+ \def\calc@next##1!{%
+ \endgroup
+ \aftergroup\afterassignment
+ \aftergroup\Pc@next
+ }%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \calc@next{#1}%
+ }{%
+ \PcOrg@calc@error{#1}%
+ }%
+ }%
+ }{%
+ \def\Pc@calc@error#1{%
+ \expandafter\ifx\expandafter\unitlength\noexpand#1\relax
+ \def\calc@next##1!{%
+ \endgroup
+ \aftergroup\afterassignment
+ \aftergroup\Pc@next
+ }%
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi
+ {%
+ \PcOrg@calc@error{#1}%
+ }%
+ }%
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Method \xoption{etex}}
+%
+% \begin{macrocode}
+\ifx\Pc@method\Pc@etexname
+ \def\Pc@tokslength#1{%
+ \begingroup
+ \afterassignment\Pc@next
+ \dimen@=\dimexpr#1\unitlength\Pc@nil{#1}%
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Method \xoption{plain}}
+%
+% \begin{macrocode}
+\ifx\Pc@method\Pc@plainname
+ \def\Pc@tokslength#1{%
+ \begingroup
+ \afterassignment\Pc@next
+ \dimen@=#1\unitlength\Pc@nil{#1}%
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Help macros}
+%
+% \begin{macrocode}
+\def\Pc@next#1\Pc@nil#2{%
+ \ifx\\#1\\%
+ \endgroup
+ \Pc@addtoks{{#2}}%
+ \else
+ \expandafter\endgroup
+ \expandafter\Pc@addtoks\expandafter{%
+ \expandafter{\the\dimen@\@gobble}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\Pc@nil}
+% \cs{Pc@nil} must not have the meaning of \cs{relax} because of
+% \cs{dimexpr}.
+% \begin{macrocode}
+\let\Pc@nil\message
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Pc@addtoks}
+% \begin{macrocode}
+\def\Pc@addtoks#1{%
+ \toks@=\expandafter{\the\toks@#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Pc@init}
+% \begin{macrocode}
+\def\Pc@init#1{%
+ \begingroup
+ \toks@={#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Pc@finish}
+% \begin{macrocode}
+\def\Pc@finish#1{%
+ \expandafter\endgroup
+ \expandafter#1\the\toks@
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Redefinitions}
+%
+% \begin{macro}{\picture@redefine}
+% \begin{tabular}[t]{@{}l@{ }l@{}}
+% |#1|:& command name\\
+% |#2|:& parameter text, length parameter with \& instead of \#
+% \end{tabular}
+% \begin{macrocode}
+\def\picture@redefine#1#2{%
+ \begingroup
+ \edef\reserved@a{%
+ \noexpand\noexpand
+ \expandafter\noexpand
+ \csname PcOrg@\expandafter\@gobble\string#1\endcsname
+ }%
+ \toks0{#1}%
+ \Pc@first#2&0%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Pc@first}
+% \begin{macrocode}
+\def\Pc@first#1&{%
+ \toks1={#1}%
+ \toks2={\Pc@init{#1}}%
+ \Pc@scanlength
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Pc@scanlength}
+% |#1|: number of length parameter or zero
+% \begin{macrocode}
+\def\Pc@scanlength#1{%
+ \ifcase#1 %
+ \expandafter\Pc@last
+ \else
+ \toks1=\expandafter{\the\toks1 ###1}%
+ \toks2=\expandafter{\the\toks2 \Pc@tokslength{###1}}%
+ \expandafter\Pc@scannext
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Pc@scannext}
+% \begin{macrocode}
+\def\Pc@scannext#1&{%
+ \ifx\\#1\\%
+ \else
+ \toks1=\expandafter{\the\toks1 #1}%
+ \toks2=\expandafter{\the\toks2 \Pc@addtoks{#1}}%
+ \fi
+ \Pc@scanlength
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Pc@last}
+% \begin{macrocode}
+\def\Pc@last{%
+ \edef\x{%
+ \endgroup
+ \let\reserved@a\the\toks0 %
+ \def\the\toks0 \the\toks1 {%
+ \the\toks2 %
+ \noexpand\Pc@finish\reserved@a
+ }%
+ }%
+ \x
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\LaTeX\ base macros}
+%
+% \begin{macrocode}
+\picture@redefine\@picture{(&1,&2)(&3,&4)}
+\picture@redefine\put{(&1,&2)}
+\picture@redefine\multiput{(&1,&2)}
+\picture@redefine\@multiput{(&1,&2)}
+\picture@redefine\line{(#1,#2)&3}
+\picture@redefine\vector{(#1,#2)&3}
+\picture@redefine\dashbox{&1(&2,&3)}
+\picture@redefine\@circle{&1}
+\picture@redefine\@dot{&1}
+\picture@redefine\@bezier{#1(&2,&3)(&4,&5)(&6,&7)}
+\picture@redefine\@imakepicbox{(&1,&2)}
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{pspicture}}
+%
+% Package \xpackage{pspicture} changes the signature of \cs{@oval}
+% by adding an optional argument.
+% \begin{macrocode}
+\@ifpackageloaded{pspicture}{%
+ \picture@redefine\@oval{[&1](&2,&3)}%
+ \picture@redefine\Line{(&1,&2)}%
+ \picture@redefine\Curve{(&1,&2)}%
+ \picture@redefine\Vector{(&1,&2)}%
+}{%
+ \picture@redefine\@oval{(&1,&2)}%
+}
+% \end{macrocode}
+%
+% \subsection{Check package loading order}
+%
+% \begin{macro}{\PC@checkpackage}
+% \begin{macrocode}
+\def\Pc@checkpackage#1{%
+ \@ifpackageloaded{#1}{%
+ }{%
+ \AtBeginDocument{%
+ \@ifpackageloaded{#1}{%
+ \PackageWarningNoLine{picture}{%
+ Package `#1' is loaded after `picture'.\MessageBreak
+ Load package `picture' afterwards to get full support%
+ \MessageBreak
+ of its additional syntax with length specifications%
+ }%
+ }{}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\Pc@checkpackage{pict2e}
+\Pc@checkpackage{pspicture}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/picture}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/picture.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/picture.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[\CTAN{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 picture.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@{}}
+% picture.sty & tex/latex/oberdiek/picture.sty\\
+% picture.pdf & doc/latex/oberdiek/picture.pdf\\
+% picture-example.tex & doc/latex/oberdiek/picture-example.tex\\
+% picture.dtx & source/latex/oberdiek/picture.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk picture.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{picture.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 picture.dtx
+%makeindex -s gind.ist picture.idx
+%pdflatex picture.dtx
+%makeindex -s gind.ist picture.idx
+%pdflatex picture.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{picture.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='picture'>
+ <name>picture</name>
+ <caption>Dimens for picture macros.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006-2009'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ There are macro and environment arguments that expect numbers
+ that will internally be multiplied by <tt>\unitlength</tt>.
+ This package extends the syntax of these arguments, so that
+ dimensions with calculation support may be used for these arguments.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/picture.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/picture.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2006/08/26 v1.0}
+% \item
+% First released version. (First start of the project was June/July 2002.)
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.1}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2008/11/26 v1.2}
+% \item
+% Package \xpackage{pict2e} added to documentation section ``Supported
+% packages''.
+% \item
+% Package order of supported packages is checked.
+% \end{Version}
+% \begin{Version}{2009/10/11 v1.3}
+% \item
+% Fix because of new version v4.3 of package \xpackage{calc}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.4}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/picture.pdf b/macros/latex/contrib/oberdiek/picture.pdf
new file mode 100644
index 0000000000..99161807ef
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/picture.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/pmboxdraw.dtx b/macros/latex/contrib/oberdiek/pmboxdraw.dtx
new file mode 100644
index 0000000000..d2c96ad89c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pmboxdraw.dtx
@@ -0,0 +1,5647 @@
+% \iffalse meta-comment
+%
+% File: pmboxdraw.dtx
+% Version: 2019/02/28 v1.3
+% Info: Poor man's box drawing characters
+%
+% Copyright (C) 2006, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file pmboxdraw.dtx
+% and the derived files
+% pmboxdraw.sty, pmboxdraw.pdf, pmboxdraw.ins, pmboxdraw.drv,
+% pmboxdrawenc.dfu, pmboxdraw-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/pmboxdraw.dtx
+% CTAN:macros/latex/contrib/oberdiek/pmboxdraw.pdf
+%
+% Unpacking:
+% (a) If pmboxdraw.ins is present:
+% tex pmboxdraw.ins
+% (b) Without pmboxdraw.ins:
+% tex pmboxdraw.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{pmboxdraw.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If pmboxdraw.drv is present:
+% latex pmboxdraw.drv
+% (b) Without pmboxdraw.drv:
+% latex pmboxdraw.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 pmboxdraw.dtx
+% makeindex -s gind.ist pmboxdraw.idx
+% pdflatex pmboxdraw.dtx
+% makeindex -s gind.ist pmboxdraw.idx
+% pdflatex pmboxdraw.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/pmboxdraw.sty
+% TDS:tex/latex/oberdiek/pmboxdrawenc.dfu
+% TDS:doc/latex/oberdiek/pmboxdraw.pdf
+% TDS:doc/latex/oberdiek/test/pmboxdraw-test1.tex
+% TDS:source/latex/oberdiek/pmboxdraw.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: pmboxdraw 2019/02/28 v1.3 Poor man's box drawing characters (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: pmboxdraw
+Version: 2019/02/28 v1.3
+
+Copyright (C) 2006, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file pmboxdraw.dtx
+and the derived files
+ pmboxdraw.sty, pmboxdraw.pdf, pmboxdraw.ins, pmboxdraw.drv,
+ pmboxdrawenc.dfu, pmboxdraw-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{pmboxdraw.ins}{\from{pmboxdraw.dtx}{install}}%
+ \file{pmboxdraw.drv}{\from{pmboxdraw.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{pmboxdraw.sty}{\from{pmboxdraw.dtx}{package}}%
+ \file{pmboxdrawenc.dfu}{\from{pmboxdraw.dtx}{utf8}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{pmboxdraw-test1.tex}{\from{pmboxdraw.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{pmboxdraw.xml}{\from{pmboxdraw.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{* pmboxdraw.sty, pmboxdrawenc.dfu}
+\Msg{*}
+\Msg{* To produce the documentation run the file `pmboxdraw.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{pmboxdraw.drv}%
+ [2019/02/28 v1.3 Poor man's box drawing characters (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{color}
+\let\orgdimexpr\dimexpr
+%\let\dimexpr\relax
+\usepackage{pmboxdraw}
+\let\dimexpr\orgdimexpr
+\usepackage{longtable}
+\setcounter{tocdepth}{2}
+\hypersetup{bookmarksdepth=3}
+\begin{document}
+ \DocInput{pmboxdraw.dtx}%
+\end{document}
+%</driver>
+% \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{pmboxdraw.drv}
+%
+% \title{The \xpackage{pmboxdraw} package}
+% \date{2019/02/28 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{pmboxdraw} declares box drawings characters of
+% old code pages, e.g. cp437. It uses rules instead of using a font.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \DoNotIndex{\dimen,\dimen@,\z@,\tw@,\wd,\ht,\dp}
+% \DoNotIndex{\@width,\@height,\@depth}
+% \DoNotIndex{\advance,\hss,\kern,\rlap,\vrule}
+%
+% \section{User interface}
+%
+% \begin{quote}
+% \ttfamily\fontfamily{lmtt}\selectfont
+% \catcode`=\active
+% \catcode`|\active
+% \catcode`-\active
+% \def={\textSFxliii}
+% \def|{\textSFxxiv}
+% \def-{\textSFx}
+% \def~{\mbox{ }}
+% \textSFxxxix===================\textSFxxv\\
+% | P M B O X D R A W |\\
+% \textSFxxxviii ==\textSFxlvii============\textSFxlvii===\textSFxxvi\\
+% ~~~\textSFxi~2019/02/28 \textSFxi\\
+% ~~~\textSFii------------\textSFiv
+% \end{quote}
+%
+% \subsection{Introduction}
+%
+% In old code pages (CP 437, \dots) many slots are occupied
+% by graphical characters. The definition files for the input
+% encodings that come with \LaTeX's package \xpackage{inputenc}
+% ignore these characters. This packages tries to close this gap.
+% Package \xpackage{inputenx} provides more complete definitions
+% files of input encodings (\cite{inputenx}).
+%
+% The graphical characters are available in some fonts, mostly
+% some derivates of Courier. However, the symbols are usually
+% used to gegnerate some kind of ASCII art. Thus it should fit
+% with the current typewriter font in use. That means:
+% \begin{itemize}
+% \item Same and constant symbol width.
+% \item Use of the full line height. Vertical lines should not be
+% interrupted if the symbols that contribute to that lines
+% are in adjacent text lines.
+% \end{itemize}
+% Therefore I decided to generate the symbols by rules.
+% Parameters such as rule width and box dimensions are accessible
+% at macro level. This avoids to generate many fonts for the used
+% typewriter fonts (Courier, LuxiMono, Computer/Latin Modern, \dots).
+%
+% The disadvantage is that there are no characters in the output
+% file, just rules. Thus operations such as cut and paste or text
+% search will not detect these graphical characters.
+%
+% \subsection{Setup}
+%
+% Usually the box drawings symbols of this package derive its parameters
+% from the current font. But they can be set explicitly.
+%
+% \begin{declcs}{pmboxdrawbox} \M{template}
+% \end{declcs}
+% The \meta{template} is used as size template for the symbols.
+% It is initialized by |\strut0|. (Usually |\strut| carries the information
+% about the \cs{baselineskip} and |0| the symbol width.)
+%
+% \begin{declcs}{pmboxdrawrulewidth} \M{dimen}
+% \end{declcs}
+% This macro allows the setup of the rule width used in the symbols.
+% It is initialized with |0.1\width|, that means 10\,\% of the symbol
+% width. \cs{width}, \cs{height}, and \cs{depth} can be used here and
+% are set to the corresponding symbol box parameter.
+%
+% \begin{declcs}{pmboxdrawdoublerulesep} \M{dimen}
+% \end{declcs}
+% Some symbols have double lines. The distance between the lines is
+% configured by this macro. It is set to |0.25\width|, a quarter of
+% the symbol width. Also \cs{height} and \cs{depth} are available.
+%
+% \subsection{Symbol list}
+%
+% The macro names for the symbols in \LaTeX\ (LICR) are derived
+% from Adobe's glyph names for these characters (\cite{aglfn}).
+% Example:
+% \begin{quote}
+% U+2580 (\textupblock) with glyph name \textsf{upblock}: \cs{textupblock}
+% \end{quote}
+% Some glyph names start with |SF|, two individual digits follow and
+% the name is closed by four digits zero. For the LICR name the
+% two individual digits form a number that is converted to lowercase
+% roman number. The trailing zeros are dropped. Example:
+% \begin{quote}
+% U+2556 (\textSFxxi) with glyph name \textsf{SF210000}: \cs{textSFxxi}
+% \end{quote}
+%
+% The three gray symbols require package \xpackage{color}:
+% \begin{quote}
+% U+2591 (\textltshade) light shade: \cs{textltshade}\\
+% U+2592 (\textshade) medium shade: \cs{textshade}\\
+% U+2593 (\textdkshade) dark shade: \cs{textdkshade}
+% \end{quote}
+%
+% It follows a list with all graphical symbols provided by this
+% package:
+%
+% \begingroup
+% \def\entrygen#1#2#3#4{%
+% \textcolor{blue}{^^A
+% \fbox{\color{black}\texttt{\csname text#3\endcsname}}^^A
+% }
+% & \texttt{U+25#1}
+% & \texttt{#2}
+% & \texttt{\textbackslash text#3}
+% \\*[-\fboxsep]
+% &
+% \multicolumn{3}{l}{\lowercase{#4}}\\^^A
+% }
+% \def\entryU#1#2{%
+% \textcolor{blue}{^^A
+% \fbox{\color{black}\texttt{\pmboxdrawuni{25#1}}}^^A
+% }
+% & \texttt{U+25#1}
+% & \texttt{uni25#1}
+% & \texttt{\textbackslash pmboxdrawuni\{25#1\}}
+% \\*[-\fboxsep]
+% &
+% \multicolumn{3}{l}{\lowercase{#2}}\\^^A
+% }
+% \def\entry#1#2{\entrygen{#1}{SF#20000}{SF\romannumeral#2}}
+% \def\entryB#1#2{\entrygen{#1}{#2}{#2}}
+% \begin{longtable}{clll}
+% Symbol & Unicode & Glyph name & LICR\\
+% \hline
+% \endhead
+% \entry{00}{10}{BOX DRAWINGS LIGHT HORIZONTAL}
+% \entryU{01}{BOX DRAWINGS HEAVY HORIZONTAL}
+% \entry{02}{11}{BOX DRAWINGS LIGHT VERTICAL}
+% \entryU{03}{BOX DRAWINGS HEAVY VERTICAL}
+% \entry{0C}{01}{BOX DRAWINGS LIGHT DOWN AND RIGHT}
+% \entryU{0D}{BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY}
+% \entryU{0E}{BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT}
+% \entryU{0F}{BOX DRAWINGS HEAVY DOWN AND RIGHT}
+% \entry{10}{03}{BOX DRAWINGS LIGHT DOWN AND LEFT}
+% \entryU{11}{BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY}
+% \entryU{12}{BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT}
+% \entryU{13}{BOX DRAWINGS HEAVY DOWN AND LEFT}
+% \entry{14}{02}{BOX DRAWINGS LIGHT UP AND RIGHT}
+% \entryU{15}{BOX DRAWINGS UP LIGHT AND RIGHT HEAVY}
+% \entryU{16}{BOX DRAWINGS UP HEAVY AND RIGHT LIGHT}
+% \entryU{17}{BOX DRAWINGS HEAVY UP AND RIGHT}
+% \entry{18}{04}{BOX DRAWINGS LIGHT UP AND LEFT}
+% \entryU{19}{BOX DRAWINGS UP LIGHT AND LEFT HEAVY}
+% \entryU{1A}{BOX DRAWINGS UP HEAVY AND LEFT LIGHT}
+% \entryU{1B}{BOX DRAWINGS HEAVY UP AND LEFT}
+% \entry{1C}{08}{BOX DRAWINGS LIGHT VERTICAL AND RIGHT}
+% \entryU{1D}{BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY}
+% \entryU{1E}{BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT}
+% \entryU{1F}{BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT}
+% \entryU{20}{BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT}
+% \entryU{21}{BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY}
+% \entryU{22}{BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY}
+% \entryU{23}{BOX DRAWINGS HEAVY VERTICAL AND RIGHT}
+% \entry{24}{09}{BOX DRAWINGS LIGHT VERTICAL AND LEFT}
+% \entryU{25}{BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY}
+% \entryU{26}{BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT}
+% \entryU{27}{BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT}
+% \entryU{28}{BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT}
+% \entryU{29}{BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY}
+% \entryU{2A}{BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY}
+% \entryU{2B}{BOX DRAWINGS HEAVY VERTICAL AND LEFT}
+% \entry{2C}{06}{BOX DRAWINGS LIGHT DOWN AND HORIZONTAL}
+% \entryU{2D}{BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT}
+% \entryU{2E}{BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT}
+% \entryU{2F}{BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY}
+% \entryU{30}{BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT}
+% \entryU{31}{BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY}
+% \entryU{32}{BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY}
+% \entryU{33}{BOX DRAWINGS HEAVY DOWN AND HORIZONTAL}
+% \entry{34}{07}{BOX DRAWINGS LIGHT UP AND HORIZONTAL}
+% \entryU{35}{BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT}
+% \entryU{36}{BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT}
+% \entryU{37}{BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY}
+% \entryU{38}{BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT}
+% \entryU{39}{BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY}
+% \entryU{3A}{BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY}
+% \entryU{3B}{BOX DRAWINGS HEAVY UP AND HORIZONTAL}
+% \entry{3C}{05}{BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL}
+% \entryU{3D}{BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT}
+% \entryU{3E}{BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT}
+% \entryU{3F}{BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY}
+% \entryU{40}{BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT}
+% \entryU{41}{BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT}
+% \entryU{42}{BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT}
+% \entryU{43}{BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT}
+% \entryU{44}{BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT}
+% \entryU{45}{BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT}
+% \entryU{46}{BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT}
+% \entryU{47}{BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY}
+% \entryU{48}{BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY}
+% \entryU{49}{BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY}
+% \entryU{4A}{BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY}
+% \entryU{4B}{BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL}
+% \entry{50}{43}{BOX DRAWINGS DOUBLE HORIZONTAL}
+% \entry{51}{24}{BOX DRAWINGS DOUBLE VERTICAL}
+% \entry{52}{51}{BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE}
+% \entry{53}{52}{BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE}
+% \entry{54}{39}{BOX DRAWINGS DOUBLE DOWN AND RIGHT}
+% \entry{55}{22}{BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE}
+% \entry{56}{21}{BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE}
+% \entry{57}{25}{BOX DRAWINGS DOUBLE DOWN AND LEFT}
+% \entry{58}{50}{BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE}
+% \entry{59}{49}{BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE}
+% \entry{5A}{38}{BOX DRAWINGS DOUBLE UP AND RIGHT}
+% \entry{5B}{28}{BOX DRAWINGS UP SINGLE AND LEFT DOUBLE}
+% \entry{5C}{27}{BOX DRAWINGS UP DOUBLE AND LEFT SINGLE}
+% \entry{5D}{26}{BOX DRAWINGS DOUBLE UP AND LEFT}
+% \entry{5E}{36}{BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE}
+% \entry{5F}{37}{BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE}
+% \entry{60}{42}{BOX DRAWINGS DOUBLE VERTICAL AND RIGHT}
+% \entry{61}{19}{BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE}
+% \entry{62}{20}{BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE}
+% \entry{63}{23}{BOX DRAWINGS DOUBLE VERTICAL AND LEFT}
+% \entry{64}{47}{BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE}
+% \entry{65}{48}{BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE}
+% \entry{66}{41}{BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL}
+% \entry{67}{45}{BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE}
+% \entry{68}{46}{BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE}
+% \entry{69}{40}{BOX DRAWINGS DOUBLE UP AND HORIZONTAL}
+% \entry{6A}{54}{BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE}
+% \entry{6B}{53}{BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE}
+% \entry{6C}{44}{BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL}
+% \entryU{74}{BOX DRAWINGS LIGHT LEFT}
+% \entryU{75}{BOX DRAWINGS LIGHT UP}
+% \entryU{76}{BOX DRAWINGS LIGHT RIGHT}
+% \entryU{77}{BOX DRAWINGS LIGHT DOWN}
+% \entryU{78}{BOX DRAWINGS HEAVY LEFT}
+% \entryU{79}{BOX DRAWINGS HEAVY UP}
+% \entryU{7A}{BOX DRAWINGS HEAVY RIGHT}
+% \entryU{7B}{BOX DRAWINGS HEAVY DOWN}
+% \entryU{7C}{BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT}
+% \entryU{7D}{BOX DRAWINGS LIGHT UP AND HEAVY DOWN}
+% \entryU{7E}{BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT}
+% \entryU{7F}{BOX DRAWINGS HEAVY UP AND LIGHT DOWN}
+% \entryB{80}{upblock}{UPPER HALF BLOCK}
+% \entryU{81}{LOWER ONE EIGHTH BLOCK}
+% \entryU{82}{LOWER ONE QUARTER BLOCK}
+% \entryU{83}{LOWER THREE EIGHTHS BLOCK}
+% \entryB{84}{dnblock}{LOWER HALF BLOCK}
+% \entryU{85}{LOWER FIVE EIGHTHS BLOCK}
+% \entryU{86}{LOWER THREE QUARTERS BLOCK}
+% \entryU{87}{LOWER SEVEN EIGHTHS BLOCK}
+% \entryB{88}{block}{FULL BLOCK}
+% \entryU{89}{LEFT SEVEN EIGHTHS BLOCK}
+% \entryU{8A}{LEFT THREE QUARTERS BLOCK}
+% \entryU{8B}{LEFT FIVE EIGHTHS BLOCK}
+% \entryB{8C}{lfblock}{LEFT HALF BLOCK}
+% \entryU{8D}{LEFT THREE EIGHTHS BLOCK}
+% \entryU{8E}{LEFT ONE QUARTER BLOCK}
+% \entryU{8F}{LEFT ONE EIGHTH BLOCK}
+% \entryB{90}{rtblock}{RIGHT HALF BLOCK}
+% \entryB{91}{ltshade}{LIGHT SHADE}
+% \entryB{92}{shade}{MEDIUM SHADE}
+% \entryB{93}{dkshade}{DARK SHADE}
+% \entryU{94}{UPPER ONE EIGHTH BLOCK}
+% \entryU{95}{RIGHT ONE EIGHTH BLOCK}
+% \entryU{96}{QUADRANT LOWER LEFT}
+% \entryU{97}{QUADRANT LOWER RIGHT}
+% \entryU{98}{QUADRANT UPPER LEFT}
+% \entryU{99}{QUADRANT UPPER LEFT AND LOWER LEFT AND LOWER RIGHT}
+% \entryU{9A}{QUADRANT UPPER LEFT AND LOWER RIGHT}
+% \entryU{9B}{QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER LEFT}
+% \entryU{9C}{QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER RIGHT}
+% \entryU{9D}{QUADRANT UPPER RIGHT}
+% \entryU{9E}{QUADRANT UPPER RIGHT AND LOWER LEFT}
+% \entryU{9F}{QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT}
+% \end{longtable}
+% \endgroup
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Initial stuff}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@pmboxdraw.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{pmboxdraw}{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@pmboxdraw.sty\endcsname
+\ProvidesPackage{pmboxdraw}%
+ [2019/02/28 v1.3 Poor man's box drawing characters (HO)]%
+% \end{macrocode}
+%
+% \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 pmbd@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\pmbd@AtEnd{%
+ \pmbd@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{34}{12}% "
+\TMP@EnsureCode{36}{3}% $
+\TMP@EnsureCode{38}{4}% &
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\pmbd@AtEnd{\pmbd@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Resources}
+%
+% \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
+ }%
+\else
+ \let\TMP@RequirePackage\RequirePackage
+\fi
+\TMP@RequirePackage{ltxcmds}[2010/12/12]%
+\TMP@RequirePackage{kvsetkeys}[2011/01/30]%
+\TMP@RequirePackage{kvdefinekeys}[2011/01/30]%
+\TMP@RequirePackage{infwarerr}[2010/04/08]%
+% \end{macrocode}
+% \begin{macro}{\ifpmbd@latex}
+% \begin{macrocode}
+\ltx@newif\ifpmbd@latex
+\ltx@IfUndefined{fmtname}{}{%
+ \def\pmbd@tmp{LaTeX2e}%
+ \ifx\pmbd@tmp\fmtname
+ \pmbd@latextrue
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Dummy font encoding}
+%
+% Using a dummy font encoding because of
+% \begin{quote}
+% |\usepackage[utf8]{inputenc}|
+% \end{quote}
+% \begin{macrocode}
+\ifpmbd@latex
+ \DeclareFontEncoding{pmboxdraw}{}{}%
+ \DeclareFontFamily{pmboxdraw}{pmboxdraw}{}%
+ \DeclareFontShape{pmboxdraw}{pmboxdraw}{m}{n}{ <-> cmr10 }{}%
+ \DeclareFontSubstitution{pmboxdraw}{pmboxdraw}{m}{n}%
+% \end{macrocode}
+%
+% \subsection{Setup}
+%
+% \subsubsection{Options}
+%
+% \begin{macrocode}
+ \RequirePackage{kvoptions}[2010/02/22]%
+ \SetupKeyvalOptions{%
+ family=PMBD,%
+ prefix=pmbd@%
+ }%
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\ltx@IfUndefined{dimexpr}{%
+ \catcode36=9 %
+ \catcode38=14 %
+}{%
+ \catcode36=14 %
+ \catcode38=9 %
+}
+% \end{macrocode}
+% \begin{macro}{\pmbd@ProtectedDef}
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \def\pmbd@ProtectedDef#1{%
+ \let\pmbd@temp\ltx@gobble
+ \@ifdefinable#1{%
+ \def\pmbd@temp{\DeclareRobustCommand*#1}%
+ }%
+ \pmbd@temp
+ }%
+ \def\pmbd@ProtectedDefOne#1{%
+ \let\pmbd@temp\ltx@gobble
+ \@ifdefinable#1{%
+ \def\pmbd@temp{\DeclareRobustCommand*#1[1]}%
+ }%
+ \pmbd@temp
+ }%
+}{%
+ \def\pmbd@ProtectedDef#1{%
+ \let\pmbd@temp\ltx@gobble
+ \@ifdefinable#1{%
+ \def\pmbd@temp{\protected\def#1}%
+ }%
+ \pmbd@temp
+ }%
+ \def\pmbd@ProtectedDefOne#1{%
+ \let\pmbd@temp\ltx@gobblethree
+ \@ifdefinable#1{%
+ \def\pmbd@temp{\protected\def#1}%
+ }%
+ \pmbd@temp##1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmboxdrawsetup}
+% \begin{macrocode}
+\pmbd@ProtectedDef\pmboxdrawsetup{%
+ \kvsetkeys{PMBD}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\catcode47=11 %
+\def\pmbd@temp#1#2{%
+ \DeclareStringOption[\width]{#1/width}%
+ \DeclareStringOption[\height]{#1/height}%
+ \DeclareStringOption[\depth]{#1/depth}%
+ \DeclareStringOption[{#2}]{#1/box/default}%
+ \expandafter\DeclareStringOption\expandafter[%
+ \csname pmbd@#1/box/default\endcsname
+ ]{#1/box}%
+}
+\pmbd@temp{BoxDrawing}{\strut0}%
+\pmbd@temp{Block}{%
+ \begingroup
+ \sbox\z@{\strut}%
+ \dimen@=\ht\z@
+ \advance\dimen@\dp\z@
+ \wd\z@=\dimen@
+ \box\z@
+ \endgroup
+}%
+\pmbd@temp{Shade}{%
+ \begingroup
+ \sbox\z@{\strut}%
+ \dimen@=\ht\z@
+ \advance\dimen@\dp\z@
+ \wd\z@=\dimen@
+ \box\z@
+ \endgroup
+}%
+\pmbd@temp{TerminalGraphic}{%
+ \begingroup
+ \sbox\z@{\"A}%
+ \wd\z@=\ht\z@
+ \dp\z@=\z@
+ \box\z@
+ \endgroup
+}%
+\DeclareStringOption[.1\width]{BoxDrawing/thinlinewidth}
+\DeclareStringOption[.25\width]{BoxDrawing/thicklinewidth}
+\DeclareStringOption[.25\width]{BoxDrawing/doublelinesep}
+%
+\DeclareStringOption[\strut0]{box} %%
+\DeclareStringOption[.1\width]{rulewidth}
+\DeclareStringOption[.25\width]{doublerulesep}
+% \end{macrocode}
+%
+% \begin{macro}{\pmboxdrawUniRobust}
+% \begin{macrocode}
+\pmbd@ProtectedDefOne\pmboxdrawUniRobust{%
+ \comma@parse{#1}{%
+ \ltx@IfUndefined{pmbd@U+\comma@entry}{%
+ \begingroup\expandafter\endgroup
+ \expandafter
+ \TextSymbolUnavailable\csname U+\comma@entry\endcsname
+ }{%
+ \csname pmbd@U+\comma@entry\endcsname
+ }%
+ \@gobble
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmboxdrawuni}
+% \begin{macrocode}
+\newcommand*{\pmboxdrawuni}[1]{%
+ \ifx\texorpdfstring\ltx@undefined
+ \expandafter\ltx@firstoftwo
+ \else
+ \ifx\texorpdfstring\relax
+ \expandafter\expandafter\expandafter\ltx@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\texorpdfstring
+ \fi
+ \fi
+ {%
+ \pmboxdrawUniRobust{#1}%
+ }{%
+ \expandafter\ifx\csname ifHy@unicode\expandafter\endcsname
+ \csname iftrue\endcsname
+ \expandafter\unichar\expandafter{\number"#1}%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Setup commands of version 1.0}
+%
+% \begin{macro}{\pmboxdrawbox}
+% \begin{macrocode}
+\pmbd@ProtectedDefOne\pmboxdrawbox{%
+ \def\pmbd@box{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmboxdrawrulewidth}
+% \begin{macrocode}
+\pmbd@ProtectedDefOne\pmboxdrawrulewidth{%
+ \def\pmbd@rulewidth{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmboxdrawdoublerulesep}
+% \begin{macrocode}
+\pmbd@ProtectedDefOne\pmboxdrawdoublerulesep{%
+ \def\pmbd@doublerulesep{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Utils}
+%
+% \begin{macro}{\pmbd@UniDef}
+% \begin{macrocode}
+\def\pmbd@UniDef#1#2{%
+ \expandafter\pmbd@ProtectedDef\expandafter#1\expandafter{%
+ \csname pmbd@U+#2\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmbd@SetLength}
+% \begin{macrocode}
+\ltx@ifpackageloaded{calc}{%
+ \def\pmbd@SetLength{%
+ \setlength
+ }%
+}{%
+ \ltx@IfUndefined{dimexpr}{%
+ \def\pmbd@SetDim#1#2{%
+ #1=#2\relax
+ }%
+ }{%
+ \def\pmbd@SetDim#1#2{%
+ #1=\dimexpr#2\relax
+ }%
+ }%
+ \def\pmbd@SetLength{%
+ \ltx@ifpackageloaded{calc}{%
+ \setlength
+ }{%
+ \pmbd@SetDim
+ }%
+ }%
+ \AtBeginDocument{%
+ \ltx@ifpackageloaded{calc}{%
+ \def\pmbd@SetLength{\setlength}%
+ }{%
+ \let\pmbd@SetLength\pmbd@SetDim
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmbd@W}
+% \begin{macrocode}
+\newdimen\pmbd@W
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@H}
+% \begin{macrocode}
+\newdimen\pmbd@H
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@L}
+% \begin{macrocode}
+\newdimen\pmbd@L
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@Thin}
+% \begin{macrocode}
+\newdimen\pmbd@Thin
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@Thick}
+% \begin{macrocode}
+\newdimen\pmbd@Thick
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@Sep}
+% \begin{macrocode}
+\newdimen\pmbd@Sep
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@A}
+% \begin{macrocode}
+\dimendef\pmbd@A=2 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@B}
+% \begin{macrocode}
+\dimendef\pmbd@B=4 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@C}
+% \begin{macrocode}
+\dimendef\pmbd@C=6 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@D}
+% \begin{macrocode}
+\dimendef\pmbd@D=8 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmbd@BeginBox}
+% \begin{macrocode}
+\def\pmbd@BeginBox#1{%
+ \ltx@leavevmode
+ \@begin@tempboxa\hbox{%
+ \csname pmbd@#1/box\endcsname
+ }%
+ \pmbd@SetLength\pmbd@W{%
+ \csname pmbd@#1/width\endcsname
+ }%
+ \pmbd@SetLength\pmbd@H{%
+ \csname pmbd@#1/height\endcsname
+ }%
+ \pmbd@SetLength\pmbd@L{%
+ \csname pmbd@#1/depth\endcsname
+ }%
+ \advance\pmbd@H\pmbd@L
+ \setbox\ltx@zero\hbox to \pmbd@W\bgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@EndBox}
+% \begin{macrocode}
+\def\pmbd@EndBox{%
+ \hss
+ \egroup
+ \ht\ltx@zero=\pmbd@H
+ \dp\ltx@zero=\z@
+ \ifdim\pmbd@L=\z@
+ \else
+ \lower\pmbd@L
+ \fi
+ \box\ltx@zero
+ \@end@tempboxa
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmbd@Rule}
+% \begin{macrocode}
+\def\pmbd@Rule#1#2#3{%
+ \vrule\@width#1\@height#2\@depth#3\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Block elements}
+%
+% \begin{macrocode}
+\def\pmbd@begin{%
+ \begingroup
+ \sbox\z@{\pmbd@box}%
+ \ltx@leavevmode
+ \setbox\tw@\hb@xt@\wd\z@\bgroup
+}
+\def\pmbd@end{%
+ \egroup
+ \ht\tw@\ht\z@
+ \dp\tw@\dp\z@
+ \box\tw@
+ \endgroup
+}
+% \end{macrocode}
+%
+% \begin{macro}{\pmbd@LowerBlock}
+% \begin{macrocode}
+\def\pmbd@LowerBlock#1{%
+ \pmbd@BeginBox{Block}%
+ \pmbd@Rule\pmbd@W{#1\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmbd@LeftBlock}
+% \begin{macrocode}
+\def\pmbd@LeftBlock#1{%
+ \pmbd@BeginBox{Block}%
+ \pmbd@Rule{#1\pmbd@W}\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2580} UPPER HALF BLOCK
+% \begin{macro}{\textupblock}
+% \begin{macrocode}
+\pmbd@UniDef\textupblock{2580}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2580}
+% \begin{macrocode}
+\@namedef{pmbd@U+2580}{%
+ \pmbd@BeginBox{Block}%
+ \pmbd@Rule\pmbd@W\pmbd@H{-.5\pmbd@H}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2581} LOWER ONE EIGHTH BLOCK
+% \begin{macro}{\pmbd@U+2581}
+% \begin{macrocode}
+\@namedef{pmbd@U+2581}{%
+ \pmbd@LowerBlock{.125}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2582} LOWER ONE QUARTER BLOCK
+% \begin{macro}{\pmbd@U+2582}
+% \begin{macrocode}
+\@namedef{pmbd@U+2582}{%
+ \pmbd@LowerBlock{.25}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2583} LOWER THREE EIGHTHS BLOCK
+% \begin{macro}{pmbd@U+2583}
+% \begin{macrocode}
+\@namedef{pmbd@U+2583}{%
+ \pmbd@LowerBlock{.375}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2584} LOWER HALF BLOCK
+% \begin{macro}{\textdnblock}
+% \begin{macrocode}
+\pmbd@UniDef\textdnblock{2584}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2584}
+% \begin{macrocode}
+\@namedef{pmbd@U+2584}{%
+ \pmbd@LowerBlock{.5}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2585} LOWER FIVE EIGHTHS BLOCK
+% \begin{macro}{pmbd@U+2585}
+% \begin{macrocode}
+\@namedef{pmbd@U+2585}{%
+ \pmbd@LowerBlock{.625}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2586} LOWER THREE QUARTERS BLOCK
+% \begin{macro}{pmbd@U+2586}
+% \begin{macrocode}
+\@namedef{pmbd@U+2586}{%
+ \pmbd@LowerBlock{.75}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2587} LOWER SEVEN EIGHTHS BLOCK
+% \begin{macro}{pmbd@U+2587}
+% \begin{macrocode}
+\@namedef{pmbd@U+2587}{%
+ \pmbd@LowerBlock{.875}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2588} FULL BLOCK
+% \begin{macro}{\textblock}
+% \begin{macrocode}
+\pmbd@UniDef\textblock{2588}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{pmbd@U+2588}
+% \begin{macrocode}
+\@namedef{pmbd@U+2588}{%
+ \pmbd@LowerBlock{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2589} LEFT SEVEN EIGHTHS BLOCK
+% \begin{macro}{\pmbd@U+2589}
+% \begin{macrocode}
+\@namedef{pmbd@U+2589}{%
+ \pmbd@LeftBlock{.875}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+258A} LEFT THREE QUARTERS BLOCK
+% \begin{macro}{\pmbd@U+258A}
+% \begin{macrocode}
+\@namedef{pmbd@U+258A}{%
+ \pmbd@LeftBlock{.75}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+258B} LEFT FIVE EIGHTHS BLOCK
+% \begin{macro}{\pmbd@U+258B}
+% \begin{macrocode}
+\@namedef{pmbd@U+258B}{%
+ \pmbd@LeftBlock{.625}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+258C} LEFT HALF BLOCK
+% \begin{macro}{\textlfblock}
+% \begin{macrocode}
+\pmbd@UniDef\textlfblock{258C}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+258C}
+% \begin{macrocode}
+\@namedef{pmbd@U+258C}{%
+ \pmbd@LeftBlock{.5}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+258D} LEFT THREE EIGHTHS BLOCK
+% \begin{macro}{\pmbd@U+258D}
+% \begin{macrocode}
+\@namedef{pmbd@U+258D}{%
+ \pmbd@LeftBlock{.375}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+258E} LEFT ONE QUARTER BLOCK
+% \begin{macro}{\pmbd@U+258E}
+% \begin{macrocode}
+\@namedef{pmbd@U+258E}{%
+ \pmbd@LeftBlock{.25}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+258F} LEFT ONE EIGHTH BLOCK
+% \begin{macro}{\pmbd@U+258F}
+% \begin{macrocode}
+\@namedef{pmbd@U+258F}{%
+ \pmbd@LeftBlock{.125}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2590} RIGHT HALF BLOCK
+% \begin{macro}{\textrtblock}
+% \begin{macrocode}
+\pmbd@UniDef\textrtblock{2590}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2590}
+% \begin{macrocode}
+\@namedef{pmbd@U+2590}{%
+ \pmbd@BeginBox{Block}%
+ \kern.5\pmbd@W
+ \pmbd@Rule{.5\pmbd@W}\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2594} UPPER ONE EIGHTH BLOCK
+% \begin{macro}{\pmbd@U+2594}
+% \begin{macrocode}
+\@namedef{pmbd@U+2594}{%
+ \pmbd@BeginBox{Block}%
+ \pmbd@Rule\pmbd@W\pmbd@H{-.875\pmbd@H}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2595} RIGHT ONE EIGHTH BLOCK
+% \begin{macro}{\pmbd@U+2595}
+% \begin{macrocode}
+\@namedef{pmbd@U+2595}{%
+ \pmbd@BeginBox{Block}%
+ \kern.875\pmbd@W
+ \pmbd@Rule{.125\pmbd@W}\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Shade characters}
+%
+% \begin{macro}{\pmbd@BeginShade}
+% \begin{macrocode}
+\def\pmbd@Shade#1#2{%
+ \pmbd@BeginBox{Shade}%
+ \ltx@ifundefined{textcolor}{%
+ \pmbd@colorwarning{#1}%
+ }{%
+ \textcolor[gray]{\csname pmbd@Shade/#2\endcsname}%
+ }{%
+ \pmbd@Rule\pmbd@W\pmbd@H\z@
+ }%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2591} LIGHT SHADE
+% \begin{macrocode}
+\DeclareStringOption[.75]{Shade/light}
+% \end{macrocode}
+% \begin{macro}{\textltshade}
+% \begin{macrocode}
+\pmbd@UniDef\textltshade{2591}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2591}
+% \begin{macrocode}
+\@namedef{pmbd@U+2591}{%
+ \pmbd@Shade{2591}{light}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2592} MEDIUM SHADE
+% \begin{macrocode}
+\DeclareStringOption[.5]{Shade/medium}
+% \end{macrocode}
+% \begin{macro}{\textshade}
+% \begin{macrocode}
+\pmbd@UniDef\textshade{2592}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2592}
+% \begin{macrocode}
+\@namedef{pmbd@U+2592}{%
+ \pmbd@Shade{2592}{medium}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2593} DARK SHADE
+% \begin{macrocode}
+\DeclareStringOption[.25]{Shade/dark}
+% \end{macrocode}
+% \begin{macro}{\textdkshade}
+% \begin{macrocode}
+\pmbd@UniDef\textdkshade{2593}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2593}
+% \begin{macrocode}
+\@namedef{pmbd@U+2593}{%
+ \pmbd@Shade{2593}{dark}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Color warning}
+%
+% \begin{macro}{\pmbd@colorwarning}
+% \begin{macrocode}
+\def\pmbd@colorwarning#1{%
+ \PackageWarning{pmboxdraw}{%
+ U+#1 requires package \string`color\string'\MessageBreak
+ }%
+% \PackageWarningNoLine{pmboxdraw}{%
+% Package \string`color\string' is required for\MessageBreak
+% \string\textltshade, \string\textshade, and \string\textdkshade
+% }%
+% \global\let\pmbd@colorwarning\@secondoftwo
+ \@firstofone
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Terminal graphics characters}
+%
+% \begin{macro}{\pmbd@BeginTerminal}
+% \begin{macrocode}
+\def\pmbd@BeginTerminal{%
+ \pmbd@BeginBox{TerminalGraphic}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2596} QUADRANT LOWER LEFT
+% \begin{macro}{\pmbd@U+2596}
+% \begin{macrocode}
+\@namedef{pmbd@U+2596}{%
+ \pmbd@BeginTerminal
+ \pmbd@Rule{.5\pmbd@W}{.5\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2597} QUADRANT LOWER RIGHT
+% \begin{macro}{\pmbd@U+2597}
+% \begin{macrocode}
+\@namedef{pmbd@U+2597}{%
+ \pmbd@BeginTerminal
+ \kern.5\pmbd@W
+ \pmbd@Rule{.5\pmbd@W}{.5\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2598} QUADRANT UPPER LEFT
+% \begin{macro}{\pmbd@U+2598}
+% \begin{macrocode}
+\@namedef{pmbd@U+2598}{%
+ \pmbd@BeginTerminal
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}{-.5\pmbd@H}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2599} QUADRANT UPPER LEFT AND LOWER LEFT AND LOWER RIGHT
+% \begin{macro}{\pmbd@U+2599}
+% \begin{macrocode}
+\@namedef{pmbd@U+2599}{%
+ \pmbd@BeginTerminal
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}\z@
+ \pmbd@Rule{.5\pmbd@W}{.5\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+259A} QUADRANT UPPER LEFT AND LOWER RIGHT
+% \begin{macro}{\pmbd@U+259A}
+% \begin{macrocode}
+\@namedef{pmbd@U+259A}{%
+ \pmbd@BeginTerminal
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}{-.5\pmbd@H}%
+ \pmbd@Rule{.5\pmbd@W}{.5\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+259B} QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER LEFT
+% \begin{macro}{\pmbd@U+259B}
+% \begin{macrocode}
+\@namedef{pmbd@U+259B}{%
+ \pmbd@BeginTerminal
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}\z@
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}{-.5\pmbd@H}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+259C} QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER RIGHT
+% \begin{macro}{\pmbd@U+259C}
+% \begin{macrocode}
+\@namedef{pmbd@U+259C}{%
+ \pmbd@BeginTerminal
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}{-.5\pmbd@H}%
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+259D} QUADRANT UPPER RIGHT
+% \begin{macro}{\pmbd@U+259D}
+% \begin{macrocode}
+\@namedef{pmbd@U+259D}{%
+ \pmbd@BeginTerminal
+ \kern.5\pmbd@W
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}{-.5\pmbd@H}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+259E} QUADRANT UPPER RIGHT AND LOWER LEFT
+% \begin{macro}{\pmbd@U+259E}
+% \begin{macrocode}
+\@namedef{pmbd@U+259E}{%
+ \pmbd@BeginTerminal
+ \pmbd@Rule{.5\pmbd@W}{.5\pmbd@H}\z@
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}{-.5\pmbd@H}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+259F} QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT
+% \begin{macro}{\pmbd@U+259F}
+% \begin{macrocode}
+\@namedef{pmbd@U+259F}{%
+ \pmbd@BeginTerminal
+ \pmbd@Rule{.5\pmbd@W}{.5\pmbd@H}\z@
+ \pmbd@Rule{.5\pmbd@W}{\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Box drawing}
+%
+% \begin{macro}{\pmbd@BeginDraw}
+% \begin{macrocode}
+\def\pmbd@BeginDraw#1#2{%
+ \pmbd@BeginBox{BoxDrawing}%
+ \ifx#1X%
+ \pmbd@SetLength\pmbd@Thin\pmbd@BoxDrawing/thinlinewidth%
+ \fi
+ \ifx#2X%
+ \pmbd@SetLength\pmbd@Thick\pmbd@BoxDrawing/thicklinewidth%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2500} BOX DRAWINGS LIGHT HORIZONTAL
+% \begin{macro}{\textSFx}
+% \begin{macrocode}
+\pmbd@UniDef\textSFx{2500}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2500}
+% \begin{macrocode}
+\@namedef{pmbd@U+2500}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \dimen@=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\dimen@{-\dimexpr\dimen@-\pmbd@Thin\relax}
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2501} BOX DRAWINGS HEAVY HORIZONTAL
+% \begin{macro}{\pmbd@U+2501}
+% \begin{macrocode}
+\@namedef{pmbd@U+2501}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@W\pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2502} BOX DRAWINGS LIGHT VERTICAL
+% \begin{macro}{\textSFxi}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxi{2502}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2502}
+% \begin{macrocode}
+\@namedef{pmbd@U+2502}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \kern\pmbd@A
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2503} BOX DRAWINGS HEAVY VERTICAL
+% \begin{macro}{\pmbd@U+2503}
+% \begin{macrocode}
+\@namedef{pmbd@U+2503}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \kern\pmbd@A
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+250C} BOX DRAWINGS LIGHT DOWN AND RIGHT
+% \begin{macro}{\textSFi}
+% \begin{macrocode}
+\pmbd@UniDef\textSFi{250C}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+250C}
+% \begin{macrocode}
+\@namedef{pmbd@U+250C}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+250D} BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY
+% \begin{macro}{\pmbd@U+250D}
+% \begin{macrocode}
+\@namedef{pmbd@U+250D}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+250E} BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT
+% \begin{macro}{\pmbd@U+250E}
+% \begin{macrocode}
+\@namedef{pmbd@U+250E}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+250F} BOX DRAWINGS HEAVY DOWN AND RIGHT
+% \begin{macro}{\pmbd@U+250F}
+% \begin{macrocode}
+\@namedef{pmbd@U+250F}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2510} BOX DRAWINGS LIGHT DOWN AND LEFT
+% \begin{macro}{\textSFiii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFiii{2510}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2510}
+% \begin{macrocode}
+\@namedef{pmbd@U+2510}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2511} BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY
+% \begin{macro}{\pmbd@U+2511}
+% \begin{macrocode}
+\@namedef{pmbd@U+2511}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2512} BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT
+% \begin{macro}{\pmbd@U+2512}
+% \begin{macrocode}
+\@namedef{pmbd@U+2512}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2513} BOX DRAWINGS HEAVY DOWN AND LEFT
+% \begin{macro}{\pmbd@U+2513}
+% \begin{macrocode}
+\@namedef{pmbd@U+2513}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2514} BOX DRAWINGS LIGHT UP AND RIGHT
+% \begin{macro}{\textSFii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFii{2514}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2514}
+% \begin{macrocode}
+\@namedef{pmbd@U+2514}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2515} BOX DRAWINGS UP LIGHT AND RIGHT HEAVY
+% \begin{macro}{\pmbd@U+2515}
+% \begin{macrocode}
+\@namedef{pmbd@U+2515}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2516} BOX DRAWINGS UP HEAVY AND RIGHT LIGHT
+% \begin{macro}{\pmbd@U+2516}
+% \begin{macrocode}
+\@namedef{pmbd@U+2516}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2517} BOX DRAWINGS HEAVY UP AND RIGHT
+% \begin{macro}{\pmbd@U+2517}
+% \begin{macrocode}
+\@namedef{pmbd@U+2517}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2518} BOX DRAWINGS LIGHT UP AND LEFT
+% \begin{macro}{\textSFiv}
+% \begin{macrocode}
+\pmbd@UniDef\textSFiv{2518}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2518}
+% \begin{macrocode}
+\@namedef{pmbd@U+2518}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2519} BOX DRAWINGS UP LIGHT AND LEFT HEAVY
+% \begin{macro}{\pmbd@U+2519}
+% \begin{macrocode}
+\@namedef{pmbd@U+2519}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+251A} BOX DRAWINGS UP HEAVY AND LEFT LIGHT
+% \begin{macro}{\pmbd@U+251A}
+% \begin{macrocode}
+\@namedef{pmbd@U+251A}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+251B} BOX DRAWINGS HEAVY UP AND LEFT
+% \begin{macro}{\pmbd@U+251B}
+% \begin{macrocode}
+\@namedef{pmbd@U+251B}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+251C} BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+% \begin{macro}{\textSFviii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFviii{251C}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+251C}
+% \begin{macrocode}
+\@namedef{pmbd@U+251C}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A
+& {-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+251D} BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY
+% \begin{macro}{\pmbd@U+251D}
+% \begin{macrocode}
+\@namedef{pmbd@U+251D}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A
+& {-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+251E} BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT
+% \begin{macro}{\pmbd@U+251E}
+% \begin{macrocode}
+\@namedef{pmbd@U+251E}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \rlap{%
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+$ }%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \rlap{%
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+251F} BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT
+% \begin{macro}{\pmbd@U+251F}
+% \begin{macrocode}
+\@namedef{pmbd@U+251F}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \rlap{%
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+$ }%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \rlap{%
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2520} BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT
+% \begin{macro}{\pmbd@U+2520}
+% \begin{macrocode}
+\@namedef{pmbd@U+2520}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A
+& {-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2521} BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY
+% \begin{macro}{\pmbd@U+2521}
+% \begin{macrocode}
+\@namedef{pmbd@U+2521}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \rlap{%
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+$ }%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \rlap{%
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2522} BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY
+% \begin{macro}{\pmbd@U+2522}
+% \begin{macrocode}
+\@namedef{pmbd@U+2522}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \rlap{%
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+$ }%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \rlap{%
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2523} BOX DRAWINGS HEAVY VERTICAL AND RIGHT
+% \begin{macro}{\pmbd@U+2523}
+% \begin{macrocode}
+\@namedef{pmbd@U+2523}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A
+& {-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2524} BOX DRAWINGS LIGHT VERTICAL AND LEFT
+% \begin{macro}{\textSFix}
+% \begin{macrocode}
+\pmbd@UniDef\textSFix{2524}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2524}
+% \begin{macrocode}
+\@namedef{pmbd@U+2524}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2525} BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY
+% \begin{macro}{\pmbd@U+2525}
+% \begin{macrocode}
+\@namedef{pmbd@U+2525}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2526} BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT
+% \begin{macro}{\pmbd@U+2526}
+% \begin{macrocode}
+\@namedef{pmbd@U+2526}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@Thick
+$ \rlap{%
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ }%
+$ \kern.5\pmbd@D
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2527} BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT
+% \begin{macro}{\pmbd@U+2527}
+% \begin{macrocode}
+\@namedef{pmbd@U+2527}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@Thick
+$ \rlap{%
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ }%
+$ \kern.5\pmbd@D
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2528} BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT
+% \begin{macro}{\pmbd@U+2528}
+% \begin{macrocode}
+\@namedef{pmbd@U+2528}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2529} BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY
+% \begin{macro}{\pmbd@U+2529}
+% \begin{macrocode}
+\@namedef{pmbd@U+2529}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \rlap{%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ }%
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& }%
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+252A} BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY
+% \begin{macro}{\pmbd@U+252A}
+% \begin{macrocode}
+\@namedef{pmbd@U+252A}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \rlap{%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ }%
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& }%
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+252B} BOX DRAWINGS HEAVY VERTICAL AND LEFT
+% \begin{macro}{\pmbd@U+252B}
+% \begin{macrocode}
+\@namedef{pmbd@U+252B}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+252C} BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+% \begin{macro}{\textSFvi}
+% \begin{macrocode}
+\pmbd@UniDef\textSFvi{252C}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+252C}
+% \begin{macrocode}
+\@namedef{pmbd@U+252C}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+$ }%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& }%
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+252D} BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT
+% \begin{macro}{\pmbd@U+252D}
+% \begin{macrocode}
+\@namedef{pmbd@U+252D}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ }%
+$ \rlap{%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+$ }%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+& }%
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& }%
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+252E} BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT
+% \begin{macro}{\pmbd@U+252E}
+% \begin{macrocode}
+\@namedef{pmbd@U+252E}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \kern\pmbd@C
+$ \advance\pmbd@C-\pmbd@W
+$ \pmbd@Rule{-\pmbd@C}\pmbd@A\pmbd@B
+$ }%
+$ \rlap{%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+$ }%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+& }%
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& }%
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+252F} BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY
+% \begin{macro}{\pmbd@U+252F}
+% \begin{macrocode}
+\@namedef{pmbd@U+252F}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+$ }%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& }%
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2530} BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT
+% \begin{macro}{\pmbd@U+2530}
+% \begin{macrocode}
+\@namedef{pmbd@U+2530}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \rlap{%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+$ }%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& }%
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2531} BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY
+% \begin{macro}{\pmbd@U+2531}
+% \begin{macrocode}
+\@namedef{pmbd@U+2531}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \rlap{%
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+& }%
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2532} BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY
+% \begin{macro}{\pmbd@U+2532}
+% \begin{macrocode}
+\@namedef{pmbd@U+2532}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \rlap{%
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+& }%
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2533} BOX DRAWINGS HEAVY DOWN AND HORIZONTAL
+% \begin{macro}{\pmbd@U+2533}
+% \begin{macrocode}
+\@namedef{pmbd@U+2533}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \rlap{%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+$ }%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& }%
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2534} BOX DRAWINGS LIGHT UP AND HORIZONTAL
+% \begin{macro}{\textSFvii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFvii{2534}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2534}
+% \begin{macrocode}
+\@namedef{pmbd@U+2534}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2535} BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHL
+% \begin{macro}{\pmbd@U+2535}
+% \begin{macrocode}
+\@namedef{pmbd@U+2535}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ }%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& }%
+& \rlap{%
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2536} BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT
+% \begin{macro}{\pmbd@U+2536}
+% \begin{macrocode}
+\@namedef{pmbd@U+2536}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \kern\pmbd@C
+$ \advance\pmbd@C-\pmbd@W
+$ \pmbd@Rule{-\pmbd@C}\pmbd@A\pmbd@B
+$ }%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& }%
+& \rlap{%
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2537} BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY
+% \begin{macro}{\pmbd@U+2537}
+% \begin{macrocode}
+\@namedef{pmbd@U+2537}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \rlap{%
+& \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2538} BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT
+% \begin{macro}{\pmbd@U+2538}
+% \begin{macrocode}
+\@namedef{pmbd@U+2538}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \rlap{%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2539} BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY
+% \begin{macro}{\pmbd@U+2539}
+% \begin{macrocode}
+\@namedef{pmbd@U+2539}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \rlap{%
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+& }%
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+253A} BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY
+% \begin{macro}{\pmbd@U+253A}
+% \begin{macrocode}
+\@namedef{pmbd@U+253A}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \rlap{%
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+& }%
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+253B} BOX DRAWINGS HEAVY UP AND HORIZONTAL
+% \begin{macro}{\pmbd@U+253B}
+% \begin{macrocode}
+\@namedef{pmbd@U+253B}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \rlap{%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \rlap{%
+& \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+253C} BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+% \begin{macro}{\textSFv}
+% \begin{macrocode}
+\pmbd@UniDef\textSFv{253C}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+253C}
+% \begin{macrocode}
+\@namedef{pmbd@U+253C}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \dimen@=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\dimen@{-\dimexpr\dimen@-\pmbd@Thin\relax}%
+ \kern-\pmbd@W
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \kern\pmbd@A
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+253D} BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT
+% \begin{macro}{\pmbd@U+253D}
+% \begin{macrocode}
+\@namedef{pmbd@U+253D}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A
+& {-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+253E} BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT
+% \begin{macro}{\pmbd@U+253E}
+% \begin{macrocode}
+\@namedef{pmbd@U+253E}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+ \kern.5\pmbd@W
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+253F} BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT
+% \begin{macro}{\pmbd@U+253F}
+% \begin{macrocode}
+\@namedef{pmbd@U+253F}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \dimen@=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@W\dimen@{-\dimexpr\dimen@-\pmbd@Thick\relax}%
+ \kern-\pmbd@W
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \kern\pmbd@A
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2540} BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT
+% \begin{macro}{\pmbd@U+2540}
+% \begin{macrocode}
+\@namedef{pmbd@U+2540}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick\pmbd@H{-.5\pmbd@H}%
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+$ }%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& }%
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2541} BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT
+% \begin{macro}{\pmbd@U+2541}
+% \begin{macrocode}
+\@namedef{pmbd@U+2541}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick{.5\pmbd@H}\z@
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \rlap{%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \rlap{%
+& \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{U+2542} BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT
+% \begin{macro}{\pmbd@U+2542}
+% \begin{macrocode}
+\@namedef{pmbd@U+2542}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \dimen@=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\dimen@{-\dimexpr\dimen@-\pmbd@Thin\relax}%
+ \kern-\pmbd@W
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2543} BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT
+% \begin{macro}{\pmbd@U+2543}
+% \begin{macrocode}
+\@namedef{pmbd@U+2543}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2544} BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT
+% \begin{macro}{\pmbd@U+2544}
+% \begin{macrocode}
+\@namedef{pmbd@U+2544}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thin\relax}%
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2545} BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT
+% \begin{macro}{\pmbd@U+2545}
+% \begin{macrocode}
+\@namedef{pmbd@U+2545}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A\pmbd@B
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2546} BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT
+% \begin{macro}{\pmbd@U+2546}
+% \begin{macrocode}
+\@namedef{pmbd@U+2546}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thin
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thin
+$ \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thin\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thin\relax}%
+& \pmbd@A\pmbd@B
+& \kern-\pmbd@Thin
+& \pmbd@Rule\pmbd@Thin\pmbd@H\pmbd@B
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}%
+& \pmbd@A{-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2547} BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY
+% \begin{macro}{\pmbd@U+2547}
+% \begin{macrocode}
+\@namedef{pmbd@U+2547}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \kern\pmbd@A
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \rlap{%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+$ }%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@B=\dimexpr-\pmbd@A+\pmbd@Thick\relax
+& \rlap{%
+& \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& }%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@H\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2548} BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY
+% \begin{macro}{\pmbd@U+2548}
+% \begin{macrocode}
+\@namedef{pmbd@U+2548}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \kern\pmbd@A
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \rlap{%
+$ \kern.5\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+$ }%
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \rlap{%
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@Thick\pmbd@A\z@
+& }%
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2549} BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY
+% \begin{macro}{\pmbd@U+2549}
+% \begin{macrocode}
+\@namedef{pmbd@U+2549}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \dimen@=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\dimen@{-\dimexpr\dimen@-\pmbd@Thin\relax}
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@C}\pmbd@A\pmbd@B
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\dimexpr\pmbd@W+\pmbd@Thick\relax}%
+& \pmbd@A{\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+& \kern-\pmbd@Thick
+& \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+254A} BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY
+% \begin{macro}{\pmbd@U+254A}
+% \begin{macrocode}
+\@namedef{pmbd@U+254A}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \dimen@=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule\pmbd@W\dimen@{-\dimexpr\dimen@-\pmbd@Thin\relax}
+ }%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \pmbd@C=.5\pmbd@C
+$ \pmbd@D=\pmbd@W
+$ \advance\pmbd@D-\pmbd@C
+$ \kern\pmbd@C
+$ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+$ \kern-\pmbd@Thick
+$ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@C=.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+& \kern\pmbd@C
+& \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+& \kern-\pmbd@Thick
+& \pmbd@Rule{\dimexpr\pmbd@W-\pmbd@C\relax}\pmbd@A
+& {-\dimexpr\pmbd@A-\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+254B} BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL
+% \begin{macro}{\pmbd@U+254B}
+% \begin{macrocode}
+\@namedef{pmbd@U+254B}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \dimen@=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule\pmbd@W\dimen@{-\dimexpr\dimen@-\pmbd@Thick\relax}%
+ \kern-\pmbd@W
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \kern\pmbd@A
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Box drawing, double lines}
+%
+% \begin{macro}{\pmbd@BeginDouble}
+% \begin{macrocode}
+\def\pmbd@BeginDouble{%
+ \pmbd@BeginDraw X-%
+ \pmbd@SetLength\pmbd@Sep\pmbd@BoxDrawing/doublelinesep%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pmbd@beginB}
+% \begin{macrocode}
+\def\pmbd@beginB{%
+ \pmbd@beginA
+ \setlength{\dimen@}{\pmbd@doublerulesep}%
+ \edef\pmbd@doublesepH{\number\dimen@ sp}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@beginC}
+% \begin{macrocode}
+\def\pmbd@beginC{%
+ \pmbd@beginB
+ \advance\dimen@\pmbd@rulewidth
+ \edef\pmbd@doublesepV{\number\dimen@ sp}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2550} BOX DRAWINGS DOUBLE HORIZONTAL
+% \begin{macro}{\textSFxliii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxliii{2550}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2550}
+% \begin{macrocode}
+\@namedef{pmbd@U+2550}{%
+ \pmbd@BeginDouble
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A-\pmbd@Sep
+$ \pmbd@A=.5\pmbd@A
+& \pmbd@A=.5\dimexpr\pmbd@H-\pmbd@Sep\relax
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \kern-\pmbd@W
+$ \advance\pmbd@A\pmbd@Sep
+$ \advance\pmbd@A\pmbd@Thin
+$ \advance\pmbd@B-\pmbd@Sep
+$ \advance\pmbd@B-\pmbd@Thin
+& \pmbd@A=\dimexpr\pmbd@A+\pmbd@Sep+\pmbd@Thin\relax
+$ \pmbd@Rule\pmbd@W\pmbd@A\pmbd@B
+& \pmbd@Rule\pmbd@W\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2551} BOX DRAWINGS DOUBLE VERTICAL
+% \begin{macro}{\textSFxxiv}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxiv{2551}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{pmbd@U+2551}
+% \begin{macrocode}
+\@namedef{pmbd@U+2551}{%
+ \pmbd@BeginDouble
+$ \pmbd@A=\pmbd@W
+$ \advance\pmbd@A-\pmbd@Sep
+$ \pmbd@A=.5\pmbd@A
+$ \advance\pmbd@A-.5\pmbd@Thin
+$ \kern\pmbd@A
+& \kern\dimexpr.5\dimexpr\pmbd@W-\pmbd@Sep\relax-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ \kern\pmbd@Sep
+ \pmbd@Rule\pmbd@Thin\pmbd@H\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2552} BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+% \begin{macro}{\textSFli}
+% \begin{macrocode}
+\pmbd@UniDef\textSFli{2552}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2552}
+% \begin{macrocode}
+\@namedef{pmbd@U+2552}{%
+ \pmbd@BeginDouble
+ \pmbd@C=\pmbd@W
+ \advance\pmbd@C-\pmbd@Thin
+ \pmbd@C=.5\pmbd@C
+ \kern\pmbd@C
+ \pmbd@A=\pmbd@H
+ \advance\pmbd@A\pmbd@Sep
+ \pmbd@A=.5\pmbd@A
+ \advance\pmbd@A\pmbd@Thin
+ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ \kern-\pmbd@Thin
+ \pmbd@D=\pmbd@W
+ \advance\pmbd@D-\pmbd@C
+ \pmbd@B=-\pmbd@A
+ \advance\pmbd@B\pmbd@Thin
+ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+ \kern-\pmbd@D
+ \advance\pmbd@A-\pmbd@Sep
+ \advance\pmbd@A-\pmbd@Thin
+ \advance\pmbd@B\pmbd@Sep
+ \advance\pmbd@B\pmbd@Thin
+ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2553} BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+% \begin{macro}{\textSFlii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFlii{2553}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2553}
+% \begin{macrocode}
+\@namedef{pmbd@U+2553}{%
+ \pmbd@BeginDouble
+ \pmbd@C=\pmbd@W
+ \advance\pmbd@C-\pmbd@Sep
+ \pmbd@C=.5\pmbd@C
+ \advance\pmbd@C-\pmbd@Thin
+ \kern\pmbd@C
+ \pmbd@D=\pmbd@W
+ \advance\pmbd@D-\pmbd@C
+ \pmbd@A=\pmbd@H
+ \advance\pmbd@A\pmbd@Thin
+ \pmbd@A=.5\pmbd@A
+ \pmbd@B=-\pmbd@A
+ \advance\pmbd@B\pmbd@Thin
+ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+ \kern-\pmbd@D
+ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ \kern\pmbd@Sep
+ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{U+2554} BOX DRAWINGS DOUBLE DOWN AND RIGHT
+% \begin{macro}{\textSFxxxix}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxxix{2554}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2554}
+% \begin{macrocode}
+\@namedef{pmbd@U+2554}{%
+ \pmbd@BeginDouble
+ \pmbd@C=\pmbd@W
+ \advance\pmbd@C-\pmbd@Sep
+ \pmbd@C=.5\pmbd@C
+ \advance\pmbd@C-\pmbd@Thin
+ \kern\pmbd@C
+ \pmbd@A=\pmbd@H
+ \advance\pmbd@A\pmbd@Sep
+ \pmbd@A=.5\pmbd@A
+ \advance\pmbd@A\pmbd@Thin
+ \pmbd@B=-\pmbd@A
+ \advance\pmbd@B\pmbd@Thin
+ \pmbd@D=\pmbd@W
+ \advance\pmbd@D-\pmbd@C
+ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ \kern-\pmbd@Thin
+ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+ \advance\pmbd@D-\pmbd@Sep
+ \advance\pmbd@D-\pmbd@Thin
+ \kern-\pmbd@D
+ \advance\pmbd@A-\pmbd@Sep
+ \advance\pmbd@A-\pmbd@Thin
+ \advance\pmbd@B\pmbd@Sep
+ \advance\pmbd@B\pmbd@Thin
+ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ \kern-\pmbd@Thin
+ \pmbd@Rule\pmbd@D\pmbd@A\pmbd@B
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2555} BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+% \begin{macro}{\textSFxxii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxii{2555}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2555}
+% \begin{macrocode}
+\@namedef{pmbd@U+2555}{%
+ \pmbd@BeginDouble
+ \pmbd@A=\pmbd@H
+ \advance\pmbd@A-\pmbd@Sep
+ \pmbd@A=.5\pmbd@A
+ \pmbd@B=-\pmbd@A
+ \advance\pmbd@B\pmbd@Thin
+ \pmbd@C=\pmbd@W
+ \advance\pmbd@C\pmbd@Thin
+ \pmbd@C=.5\pmbd@C
+ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+ \kern-\pmbd@C
+ \advance\pmbd@A\pmbd@Sep
+ \advance\pmbd@A\pmbd@Thin
+ \advance\pmbd@B-\pmbd@Sep
+ \advance\pmbd@B-\pmbd@Thin
+ \pmbd@Rule\pmbd@C\pmbd@A\pmbd@B
+ \kern-\pmbd@Thin
+ \pmbd@Rule\pmbd@Thin\pmbd@A\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2556} BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+% \begin{macro}{\textSFxxi}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxi{2556}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2556}
+% \begin{macrocode}
+\@namedef{pmbd@U+2556}{%
+ \pmbd@beginB
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \dimen4 \wd\z@
+ \advance\dimen4 \pmbd@doublesepH
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2557} BOX DRAWINGS DOUBLE DOWN AND LEFT
+% \begin{macro}{\textSFxxv}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxv{2557}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2557}
+% \begin{macrocode}
+\@namedef{pmbd@U+2557}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \dimen4 \wd\z@
+ \begingroup
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \advance\dimen4 \pmbd@doublesepH
+ \rlap{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \kern\pmbd@rulewidth
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@\@depth\dp\z@
+ \hss
+ }%
+ }%
+ \endgroup
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \advance\dimen4 -\pmbd@doublesepH
+ \rlap{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \kern\pmbd@doublesepH
+ \kern\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2558} BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+% \begin{macro}{\textSFl}
+% \begin{macrocode}
+\pmbd@UniDef\textSFl{2558}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2558}
+% \begin{macrocode}
+\@namedef{pmbd@U+2558}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \kern.5\wd\z@
+ \vrule\@width.5\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \rlap{%
+ \kern.5\wd\z@
+ \vrule\@width.5\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2559} BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+% \begin{macro}{\textSFxlix}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxlix{2559}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2559}
+% \begin{macrocode}
+\@namedef{pmbd@U+2559}{%
+ \pmbd@beginB
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \dimen4 \wd\z@
+ \advance\dimen4 \pmbd@doublesepH
+ \hb@xt@\wd\z@{%
+ \hfill
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+255A} BOX DRAWINGS DOUBLE UP AND RIGHT
+% \begin{macro}{\textSFxxxviii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxxviii{255A}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+255A}
+% \begin{macrocode}
+\@namedef{pmbd@U+255A}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \dimen4 \wd\z@
+ \begingroup
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \advance\dimen4 -\pmbd@doublesepH
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \kern\pmbd@rulewidth
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height\ht\z@\@depth-.5\dimen\tw@
+ \hss
+ }%
+ }%
+ \endgroup
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \advance\dimen4 \pmbd@doublesepH
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \kern\pmbd@doublesepH
+ \kern\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+255B} BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+% \begin{macro}{\textSFxxviii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxviii{255B}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+255B}
+% \begin{macrocode}
+\@namedef{pmbd@U+255B}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \vrule\@width.5\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \rlap{%
+ \vrule\@width.5\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+255C} BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+% \begin{macro}{\textSFxxvii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxvii{255C}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+255C}
+% \begin{macrocode}
+\@namedef{pmbd@U+255C}{%
+ \pmbd@beginB
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \dimen4 \wd\z@
+ \advance\dimen4 \pmbd@doublesepH
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+255D} BOX DRAWINGS DOUBLE UP AND LEFT
+% \begin{macro}{\textSFxxvi}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxvi{255D}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+255D}
+% \begin{macrocode}
+\@namedef{pmbd@U+255D}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \dimen4 \wd\z@
+ \begingroup
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \advance\dimen4 -\pmbd@doublesepH
+ \rlap{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height\ht\z@\@depth-.5\dimen\tw@
+ \kern\pmbd@doublesepH
+ \kern\pmbd@rulewidth
+ \hss
+ }%
+ }%
+ \endgroup
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \advance\dimen4 \pmbd@doublesepH
+ \rlap{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \kern\pmbd@rulewidth
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+255E} BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+% \begin{macro}{\textSFxxxvi}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxxvi{255E}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+255E}
+% \begin{macrocode}
+\@namedef{pmbd@U+255E}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \kern.5\wd\z@
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \vrule\@width.5\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \rlap{%
+ \kern.5\wd\z@
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \vrule\@width.5\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+255F} BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+% \begin{macro}{\textSFxxxvii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxxvii{255F}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+255F}
+% \begin{macrocode}
+\@namedef{pmbd@U+255F}{%
+ \pmbd@beginB
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \dimen4 \wd\z@
+ \advance\dimen4 -\pmbd@doublesepH
+ \hb@xt@\wd\z@{%
+ \hfill
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2560} BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+% \begin{macro}{\textSFxlii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxlii{2560}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2560}
+% \begin{macrocode}
+\@namedef{pmbd@U+2560}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \dimen4 \wd\z@
+ \advance\dimen4 -\pmbd@doublesepH
+ \begingroup
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \kern\pmbd@rulewidth
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height\ht\z@\@depth-.5\dimen\tw@
+ \hss
+ }%
+ }%
+ \endgroup
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2561} BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+% \begin{macro}{\textSFxix}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxix{2561}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2561}
+% \begin{macrocode}
+\@namedef{pmbd@U+2561}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \vrule\@width.5\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \rlap{%
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \vrule\@width.5\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2562} BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+% \begin{macro}{\textSFxx}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxx{2562}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2562}
+% \begin{macrocode}
+\@namedef{pmbd@U+2562}{%
+ \pmbd@beginB
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \dimen4 \wd\z@
+ \advance\dimen4 -\pmbd@doublesepH
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2563} BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+% \begin{macro}{\textSFxxiii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxxiii{2563}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2563}
+% \begin{macrocode}
+\@namedef{pmbd@U+2563}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \dimen4 \wd\z@
+ \advance\dimen4 -\pmbd@doublesepH
+ \begingroup
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \rlap{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height\ht\z@\@depth-.5\dimen\tw@
+ \kern\pmbd@doublesepH
+ \kern\pmbd@rulewidth
+ \hss
+ }%
+ }%
+ \endgroup
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \rlap{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2564} BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+% \begin{macro}{\textSFxlvii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxlvii{2564}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2564}
+% \begin{macrocode}
+\@namedef{pmbd@U+2564}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \rlap{%
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2565} BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+% \begin{macro}{\textSFxlviii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxlviii{2565}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2565}
+% \begin{macrocode}
+\@namedef{pmbd@U+2565}{%
+ \pmbd@beginB
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2566} BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+% \begin{macro}{\textSFxli}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxli{2566}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2566}
+% \begin{macrocode}
+\@namedef{pmbd@U+2566}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \dimen4 \wd\z@
+ \advance\dimen4 -\pmbd@doublesepH
+ \rlap{%
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ \hss
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2567} BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+% \begin{macro}{\textSFxlv}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxlv{2567}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2567}
+% \begin{macrocode}
+\@namedef{pmbd@U+2567}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \rlap{%
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2568} BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+% \begin{macro}{\textSFxlvi}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxlvi{2568}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2568}
+% \begin{macrocode}
+\@namedef{pmbd@U+2568}{%
+ \pmbd@beginB
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@depth-.5\dimen\tw@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2569} BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+% \begin{macro}{\textSFxl}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxl{2569}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+2569}
+% \begin{macrocode}
+\@namedef{pmbd@U+2569}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \dimen4 \wd\z@
+ \advance\dimen4 -\pmbd@doublesepH
+ \begingroup
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ \hss
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height\ht\z@\@depth-.5\dimen\tw@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height\ht\z@\@depth-.5\dimen\tw@
+ \hss
+ }%
+ }%
+ \endgroup
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+256A} BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+% \begin{macro}{\textSFliv}
+% \begin{macrocode}
+\pmbd@UniDef\textSFliv{256A}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+256A}
+% \begin{macrocode}
+\@namedef{pmbd@U+256A}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \rlap{%
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+256B} BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+% \begin{macro}{\textSFliii}
+% \begin{macrocode}
+\pmbd@UniDef\textSFliii{256B}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+256B}
+% \begin{macrocode}
+\@namedef{pmbd@U+256B}{%
+ \pmbd@beginB
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \rlap{%
+ \vrule\@width\wd\z@\@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+256C} BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+% \begin{macro}{\textSFxliv}
+% \begin{macrocode}
+\pmbd@UniDef\textSFxliv{256C}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pmbd@U+256C}
+% \begin{macrocode}
+\@namedef{pmbd@U+256C}{%
+ \pmbd@beginC
+ \dimen@\ht\z@
+ \advance\dimen@-\dp\z@
+ \dimen\tw@\dimen@
+ \advance\dimen@\pmbd@rulewidth
+ \advance\dimen\tw@-\pmbd@rulewidth
+ \dimen4 \wd\z@
+ \advance\dimen4 -\pmbd@doublesepH
+ \begingroup
+ \advance\dimen@\pmbd@doublesepV
+ \advance\dimen\tw@\pmbd@doublesepV
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ \hss
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height\ht\z@\@depth-.5\dimen\tw@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height\ht\z@\@depth-.5\dimen\tw@
+ \hss
+ }%
+ }%
+ \endgroup
+ \advance\dimen@-\pmbd@doublesepV
+ \advance\dimen\tw@-\pmbd@doublesepV
+ \rlap{%
+ \hb@xt@\wd\z@{%
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ \hss
+ \vrule\@width.5\dimen4 \@height.5\dimen@\@depth-.5\dimen\tw@
+ }%
+ }%
+ \hss
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \kern\pmbd@doublesepH
+ \vrule\@width\pmbd@rulewidth\@height.5\dimen@
+ \hss
+ \pmbd@end
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2574} BOX DRAWINGS LIGHT LEFT
+% \begin{macro}{\pmbd@U+2574}
+% \begin{macrocode}
+\@namedef{pmbd@U+2574}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2575} BOX DRAWINGS LIGHT UP
+% \begin{macro}{\pmbd@U+2575}
+% \begin{macrocode}
+\@namedef{pmbd@U+2575}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin\pmbd@H{-.5\pmbd@H}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2576} BOX DRAWINGS LIGHT RIGHT
+% \begin{macro}{\pmbd@U+2576}
+% \begin{macrocode}
+\@namedef{pmbd@U+2576}{%
+ \pmbd@BeginDraw X-%
+ \kern.5\pmbd@W
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2577} BOX DRAWINGS LIGHT DOWN
+% \begin{macro}{\pmbd@U+2577}
+% \begin{macrocode}
+\@namedef{pmbd@U+2577}{%
+ \pmbd@BeginDraw X-%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin{.5\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2578} BOX DRAWINGS HEAVY LEFT
+% \begin{macro}{\pmbd@U+2578}
+% \begin{macrocode}
+\@namedef{pmbd@U+2578}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+2579} BOX DRAWINGS HEAVY UP
+% \begin{macro}{\pmbd@U+2579}
+% \begin{macrocode}
+\@namedef{pmbd@U+2579}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick\pmbd@H{-.5\pmbd@H}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+257A} BOX DRAWINGS HEAVY RIGHT
+% \begin{macro}{\pmbd@U+257A}
+% \begin{macrocode}
+\@namedef{pmbd@U+257A}{%
+ \pmbd@BeginDraw -X%
+ \kern.5\pmbd@W
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+257B} BOX DRAWINGS HEAVY DOWN
+% \begin{macro}{\pmbd@U+257B}
+% \begin{macrocode}
+\@namedef{pmbd@U+257B}{%
+ \pmbd@BeginDraw -X%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick{.5\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+257C} BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT
+% \begin{macro}{\pmbd@U+257C}
+% \begin{macrocode}
+\@namedef{pmbd@U+257C}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+257D} BOX DRAWINGS LIGHT UP AND HEAVY DOWN
+% \begin{macro}{\pmbd@U+257D}
+% \begin{macrocode}
+\@namedef{pmbd@U+257D}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin\pmbd@H{-.5\pmbd@H}%
+ }%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick{.5\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+257E} BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT
+% \begin{macro}{\pmbd@U+257E}
+% \begin{macrocode}
+\@namedef{pmbd@U+257E}{%
+ \pmbd@BeginDraw XX%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thick
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thick
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thick\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thick\relax}%
+$ \pmbd@A=\pmbd@H
+$ \advance\pmbd@A\pmbd@Thin
+$ \pmbd@A=.5\pmbd@A
+$ \pmbd@B=-\pmbd@A
+$ \advance\pmbd@B\pmbd@Thin
+$ \pmbd@Rule{.5\pmbd@W}\pmbd@A\pmbd@B
+& \pmbd@A=.5\dimexpr\pmbd@H+\pmbd@Thin\relax
+& \pmbd@Rule{.5\pmbd@W}\pmbd@A
+& {\dimexpr-\pmbd@A+\pmbd@Thin\relax}%
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{U+257F} BOX DRAWINGS HEAVY UP AND LIGHT DOWN
+% \begin{macro}{\pmbd@U+257F}
+% \begin{macrocode}
+\@namedef{pmbd@U+257F}{%
+ \pmbd@BeginDraw XX%
+ \rlap{%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thick
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thick\relax
+ \pmbd@Rule\pmbd@Thick\pmbd@H{-.5\pmbd@H}%
+ }%
+$ \pmbd@C=\pmbd@W
+$ \advance\pmbd@C-\pmbd@Thin
+$ \kern.5\pmbd@C
+& \kern.5\dimexpr\pmbd@W-\pmbd@Thin\relax
+ \pmbd@Rule\pmbd@Thin{.5\pmbd@H}\z@
+ \pmbd@EndBox
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Box drawing, light single lines}
+%
+% \begin{macro}{\pmbd@beginA}
+% \begin{macrocode}
+\def\pmbd@beginA{%
+ \pmbd@begin
+ \def\width{\wd\z@}%
+ \def\height{\ht\z@}%
+ \def\depth{\dp\z@}%
+ \setlength{\dimen@}{\pmbd@rulewidth}%
+ \edef\pmbd@rulewidth{\number\dimen@ sp}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macrocode}
+\pmbd@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \subsection{Unicode support file}
+%
+% \begin{macrocode}
+%<*utf8>
+\ProvidesFile{pmboxdrawenc.dfu}%
+ [2019/02/28 v1.3 UTF-8 support for box drawing characters]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareUnicodeCharacter{2500}{\textSFx}
+\DeclareUnicodeCharacter{2501}{\pmboxdrawuni{2501}}
+\DeclareUnicodeCharacter{2502}{\textSFxi}
+\DeclareUnicodeCharacter{2503}{\pmboxdrawuni{2503}}
+\DeclareUnicodeCharacter{250C}{\textSFi}
+\DeclareUnicodeCharacter{250D}{\pmboxdrawuni{250D}}
+\DeclareUnicodeCharacter{250E}{\pmboxdrawuni{250E}}
+\DeclareUnicodeCharacter{250F}{\pmboxdrawuni{250F}}
+\DeclareUnicodeCharacter{2510}{\textSFiii}
+\DeclareUnicodeCharacter{2511}{\pmboxdrawuni{2511}}
+\DeclareUnicodeCharacter{2512}{\pmboxdrawuni{2512}}
+\DeclareUnicodeCharacter{2513}{\pmboxdrawuni{2513}}
+\DeclareUnicodeCharacter{2514}{\textSFii}
+\DeclareUnicodeCharacter{2515}{\pmboxdrawuni{2515}}
+\DeclareUnicodeCharacter{2516}{\pmboxdrawuni{2516}}
+\DeclareUnicodeCharacter{2517}{\pmboxdrawuni{2517}}
+\DeclareUnicodeCharacter{2518}{\textSFiv}
+\DeclareUnicodeCharacter{2519}{\pmboxdrawuni{2519}}
+\DeclareUnicodeCharacter{251A}{\pmboxdrawuni{251A}}
+\DeclareUnicodeCharacter{251B}{\pmboxdrawuni{251B}}
+\DeclareUnicodeCharacter{251C}{\textSFviii}
+\DeclareUnicodeCharacter{251D}{\pmboxdrawuni{251D}}
+\DeclareUnicodeCharacter{251E}{\pmboxdrawuni{251E}}
+\DeclareUnicodeCharacter{251F}{\pmboxdrawuni{251F}}
+\DeclareUnicodeCharacter{2520}{\pmboxdrawuni{2520}}
+\DeclareUnicodeCharacter{2521}{\pmboxdrawuni{2521}}
+\DeclareUnicodeCharacter{2522}{\pmboxdrawuni{2522}}
+\DeclareUnicodeCharacter{2523}{\pmboxdrawuni{2523}}
+\DeclareUnicodeCharacter{2524}{\textSFix}
+\DeclareUnicodeCharacter{252C}{\textSFvi}
+\DeclareUnicodeCharacter{252D}{\pmboxdrawuni{252D}}
+\DeclareUnicodeCharacter{252E}{\pmboxdrawuni{252E}}
+\DeclareUnicodeCharacter{252F}{\pmboxdrawuni{252F}}
+\DeclareUnicodeCharacter{2530}{\pmboxdrawuni{2530}}
+\DeclareUnicodeCharacter{2531}{\pmboxdrawuni{2531}}
+\DeclareUnicodeCharacter{2532}{\pmboxdrawuni{2532}}
+\DeclareUnicodeCharacter{2533}{\pmboxdrawuni{2533}}
+\DeclareUnicodeCharacter{2534}{\textSFvii}
+\DeclareUnicodeCharacter{2535}{\pmboxdrawuni{2535}}
+\DeclareUnicodeCharacter{2536}{\pmboxdrawuni{2536}}
+\DeclareUnicodeCharacter{2537}{\pmboxdrawuni{2537}}
+\DeclareUnicodeCharacter{2538}{\pmboxdrawuni{2538}}
+\DeclareUnicodeCharacter{2539}{\pmboxdrawuni{2539}}
+\DeclareUnicodeCharacter{253A}{\pmboxdrawuni{253A}}
+\DeclareUnicodeCharacter{253B}{\pmboxdrawuni{253B}}
+\DeclareUnicodeCharacter{253C}{\textSFv}
+\DeclareUnicodeCharacter{253D}{\pmboxdrawuni{253D}}
+\DeclareUnicodeCharacter{253E}{\pmboxdrawuni{253E}}
+\DeclareUnicodeCharacter{253F}{\pmboxdrawuni{253F}}
+\DeclareUnicodeCharacter{2540}{\pmboxdrawuni{2540}}
+\DeclareUnicodeCharacter{2541}{\pmboxdrawuni{2541}}
+\DeclareUnicodeCharacter{2542}{\pmboxdrawuni{2542}}
+\DeclareUnicodeCharacter{2543}{\pmboxdrawuni{2543}}
+\DeclareUnicodeCharacter{2544}{\pmboxdrawuni{2544}}
+\DeclareUnicodeCharacter{2545}{\pmboxdrawuni{2545}}
+\DeclareUnicodeCharacter{2546}{\pmboxdrawuni{2546}}
+\DeclareUnicodeCharacter{2547}{\pmboxdrawuni{2547}}
+\DeclareUnicodeCharacter{2548}{\pmboxdrawuni{2548}}
+\DeclareUnicodeCharacter{2549}{\pmboxdrawuni{2549}}
+\DeclareUnicodeCharacter{254A}{\pmboxdrawuni{254A}}
+\DeclareUnicodeCharacter{254B}{\pmboxdrawuni{254B}}
+\DeclareUnicodeCharacter{2550}{\textSFxliii}
+\DeclareUnicodeCharacter{2551}{\textSFxxiv}
+\DeclareUnicodeCharacter{2552}{\textSFli}
+\DeclareUnicodeCharacter{2553}{\textSFlii}
+\DeclareUnicodeCharacter{2554}{\textSFxxxix}
+\DeclareUnicodeCharacter{2555}{\textSFxxii}
+\DeclareUnicodeCharacter{2556}{\textSFxxi}
+\DeclareUnicodeCharacter{2557}{\textSFxxv}
+\DeclareUnicodeCharacter{2558}{\textSFl}
+\DeclareUnicodeCharacter{2559}{\textSFxlix}
+\DeclareUnicodeCharacter{255A}{\textSFxxxviii}
+\DeclareUnicodeCharacter{255B}{\textSFxxviii}
+\DeclareUnicodeCharacter{255C}{\textSFxxvii}
+\DeclareUnicodeCharacter{255D}{\textSFxxvi}
+\DeclareUnicodeCharacter{255E}{\textSFxxxvi}
+\DeclareUnicodeCharacter{255F}{\textSFxxxvii}
+\DeclareUnicodeCharacter{2560}{\textSFxlii}
+\DeclareUnicodeCharacter{2561}{\textSFxix}
+\DeclareUnicodeCharacter{2562}{\textSFxx}
+\DeclareUnicodeCharacter{2563}{\textSFxxiii}
+\DeclareUnicodeCharacter{2564}{\textSFxlvii}
+\DeclareUnicodeCharacter{2565}{\textSFxlviii}
+\DeclareUnicodeCharacter{2566}{\textSFxli}
+\DeclareUnicodeCharacter{2567}{\textSFxlv}
+\DeclareUnicodeCharacter{2568}{\textSFxlvi}
+\DeclareUnicodeCharacter{2569}{\textSFxl}
+\DeclareUnicodeCharacter{256A}{\textSFliv}
+\DeclareUnicodeCharacter{256B}{\textSFliii}
+\DeclareUnicodeCharacter{256C}{\textSFxliv}
+\DeclareUnicodeCharacter{2574}{\pmboxdrawuni{2574}}
+\DeclareUnicodeCharacter{2575}{\pmboxdrawuni{2575}}
+\DeclareUnicodeCharacter{2576}{\pmboxdrawuni{2576}}
+\DeclareUnicodeCharacter{2577}{\pmboxdrawuni{2577}}
+\DeclareUnicodeCharacter{2578}{\pmboxdrawuni{2578}}
+\DeclareUnicodeCharacter{2579}{\pmboxdrawuni{2579}}
+\DeclareUnicodeCharacter{257A}{\pmboxdrawuni{257A}}
+\DeclareUnicodeCharacter{257B}{\pmboxdrawuni{257B}}
+\DeclareUnicodeCharacter{257C}{\pmboxdrawuni{257C}}
+\DeclareUnicodeCharacter{257D}{\pmboxdrawuni{257D}}
+\DeclareUnicodeCharacter{257E}{\pmboxdrawuni{257E}}
+\DeclareUnicodeCharacter{257F}{\pmboxdrawuni{257F}}
+\DeclareUnicodeCharacter{2580}{\textupblock}
+\DeclareUnicodeCharacter{2581}{\pmboxdrawuni{2581}}
+\DeclareUnicodeCharacter{2582}{\pmboxdrawuni{2582}}
+\DeclareUnicodeCharacter{2583}{\pmboxdrawuni{2583}}
+\DeclareUnicodeCharacter{2584}{\textdnblock}
+\DeclareUnicodeCharacter{2585}{\pmboxdrawuni{2585}}
+\DeclareUnicodeCharacter{2586}{\pmboxdrawuni{2586}}
+\DeclareUnicodeCharacter{2587}{\pmboxdrawuni{2587}}
+\DeclareUnicodeCharacter{2588}{\textblock}
+\DeclareUnicodeCharacter{2589}{\pmboxdrawuni{2589}}
+\DeclareUnicodeCharacter{258A}{\pmboxdrawuni{258A}}
+\DeclareUnicodeCharacter{258B}{\pmboxdrawuni{258B}}
+\DeclareUnicodeCharacter{258C}{\textlfblock}
+\DeclareUnicodeCharacter{258D}{\pmboxdrawuni{258D}}
+\DeclareUnicodeCharacter{258E}{\pmboxdrawuni{258E}}
+\DeclareUnicodeCharacter{258F}{\pmboxdrawuni{258F}}
+\DeclareUnicodeCharacter{2590}{\textrtblock}
+\DeclareUnicodeCharacter{2591}{\textltshade}
+\DeclareUnicodeCharacter{2592}{\textshade}
+\DeclareUnicodeCharacter{2593}{\textdkshade}
+\DeclareUnicodeCharacter{2594}{\pmboxdrawuni{2594}}
+\DeclareUnicodeCharacter{2595}{\pmboxdrawuni{2595}}
+\DeclareUnicodeCharacter{2596}{\pmboxdrawuni{2596}}
+\DeclareUnicodeCharacter{2597}{\pmboxdrawuni{2597}}
+\DeclareUnicodeCharacter{2598}{\pmboxdrawuni{2598}}
+\DeclareUnicodeCharacter{2599}{\pmboxdrawuni{2599}}
+\DeclareUnicodeCharacter{259A}{\pmboxdrawuni{259A}}
+\DeclareUnicodeCharacter{259B}{\pmboxdrawuni{259B}}
+\DeclareUnicodeCharacter{259C}{\pmboxdrawuni{259C}}
+\DeclareUnicodeCharacter{259D}{\pmboxdrawuni{259D}}
+\DeclareUnicodeCharacter{259E}{\pmboxdrawuni{259E}}
+\DeclareUnicodeCharacter{259F}{\pmboxdrawuni{259F}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</utf8>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \begin{macrocode}
+%<*test1>
+\def\LoadCommand{\RequirePackage{pmboxdraw}[2019/02/28]}
+%</test1>
+% \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 pmboxdraw.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/pmboxdraw}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/pmboxdraw.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/pmboxdraw.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[\CTAN{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 pmboxdraw.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@{}}
+% pmboxdraw.sty & tex/latex/oberdiek/pmboxdraw.sty\\
+% pmboxdrawenc.dfu & tex/latex/oberdiek/pmboxdrawenc.dfu\\
+% pmboxdraw.pdf & doc/latex/oberdiek/pmboxdraw.pdf\\
+% test/pmboxdraw-test1.tex & doc/latex/oberdiek/test/pmboxdraw-test1.tex\\
+% pmboxdraw.dtx & source/latex/oberdiek/pmboxdraw.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk pmboxdraw.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{pmboxdraw.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 pmboxdraw.dtx
+%makeindex -s gind.ist pmboxdraw.idx
+%pdflatex pmboxdraw.dtx
+%makeindex -s gind.ist pmboxdraw.idx
+%pdflatex pmboxdraw.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{pmboxdraw.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='pmboxdraw'>
+ <name>pmboxdraw</name>
+ <caption>Poor man's box drawing characters.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ This package declares box drawing characters of
+ old code pages, e.g. cp437. It uses rules instead of using a font.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/pmboxdraw.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/pmboxdraw.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{inputenx}
+% Heiko Oberdiek, The \xpackage{inputenx} Package (Enhanced input encoding
+% handling), 2006/03/05 v1.0,
+% \url{http://ctan.org/pkg/inputenx}.
+%
+% \bibitem{aglfn}
+% Adobe Systems Incorporated,
+% Adobe Glyph List for New Fonts (AGLFN), version 1.5, 2005/09/18,
+% \url{http://partners.adobe.com/public/developer/en/opentype/aglfn13.txt}.
+%
+% \bibitem{2500}
+% Unicode Inc.,
+% The Unicode Standard, Version 4.1, Box Drawing, Range: 2500--257F,
+% 2005.
+% \url{http://www.unicode.org/charts/PDF/U2500.pdf}
+%
+% \bibitem{2580}
+% Unicode Inc.,
+% The Unicode Standard, Version 4.1, Block Elements, Range: 2580--259F,
+% 2005.
+% \url{http://www.unicode.org/charts/PDF/U2580.pdf}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/05/03 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2011/03/24 v1.1}
+% \item
+% Support of more characters.
+% \item
+% Catcode section added.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.2}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2019/02/28 v1.3}
+% \item
+% Fix character U+257F (gh issue 59)
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/pmboxdraw.pdf b/macros/latex/contrib/oberdiek/pmboxdraw.pdf
new file mode 100644
index 0000000000..7307f590ad
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/pmboxdraw.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/protecteddef.dtx b/macros/latex/contrib/oberdiek/protecteddef.dtx
new file mode 100644
index 0000000000..528bd62d35
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/protecteddef.dtx
@@ -0,0 +1,1052 @@
+% \iffalse meta-comment
+%
+% File: protecteddef.dtx
+% Version: 2016/05/16 v1.1
+% Info: Define protected commands
+%
+% Copyright (C) 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 protecteddef.dtx
+% and the derived files
+% protecteddef.sty, protecteddef.pdf, protecteddef.ins, protecteddef.drv,
+% protecteddef-test1.tex, protecteddef-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/protecteddef.dtx
+% CTAN:macros/latex/contrib/oberdiek/protecteddef.pdf
+%
+% Unpacking:
+% (a) If protecteddef.ins is present:
+% tex protecteddef.ins
+% (b) Without protecteddef.ins:
+% tex protecteddef.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{protecteddef.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If protecteddef.drv is present:
+% latex protecteddef.drv
+% (b) Without protecteddef.drv:
+% latex protecteddef.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 protecteddef.dtx
+% makeindex -s gind.ist protecteddef.idx
+% pdflatex protecteddef.dtx
+% makeindex -s gind.ist protecteddef.idx
+% pdflatex protecteddef.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/protecteddef.sty
+% TDS:doc/latex/oberdiek/protecteddef.pdf
+% TDS:doc/latex/oberdiek/test/protecteddef-test1.tex
+% TDS:doc/latex/oberdiek/test/protecteddef-test2.tex
+% TDS:source/latex/oberdiek/protecteddef.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: protecteddef 2016/05/16 v1.1 Define protected commands (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: protecteddef
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 protecteddef.dtx
+and the derived files
+ protecteddef.sty, protecteddef.pdf, protecteddef.ins, protecteddef.drv,
+ protecteddef-test1.tex, protecteddef-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{protecteddef.ins}{\from{protecteddef.dtx}{install}}%
+ \file{protecteddef.drv}{\from{protecteddef.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{protecteddef.sty}{\from{protecteddef.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{protecteddef-test1.tex}{\from{protecteddef.dtx}{test1}}%
+% \file{protecteddef-test2.tex}{\from{protecteddef.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{protecteddef.xml}{\from{protecteddef.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{* protecteddef.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `protecteddef.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{protecteddef.drv}%
+ [2016/05/16 v1.1 Define protected commands (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{protecteddef.dtx}%
+\end{document}
+%</driver>
+% \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{protecteddef.drv}
+%
+% \title{The \xpackage{protecteddef} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This packages provides \cs{ProtectedDef} for defining
+% robust macros for both \hologo{plainTeX} and \hologo{LaTeX}.
+% First \hologo{eTeX}'s \cs{protected} is tried, then
+% \hologo{LaTeX}'s \cs{DeclareRobustCommand} is used.
+% Otherwise the macro is not made robust.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% Many of my packages work for both formats \hologo{plainTeX}
+% and \hologo{LaTeX}, even \hologo{iniTeX} is often supported.
+% It would be nice if fragile macros could be protected and
+% made robust. However the different format worlds offer different
+% solutions.
+%
+% \subsection{The \hologo{LaTeX}'s way}
+%
+% Usually \cs{newcommand} is used to define macros. It provides
+% a check if the command to be defined is already defined or
+% cannot be defined for other reasons.
+%
+% For making robust macros \hologo{LaTeX} provides \cs{DeclareRobustCommand}.
+% It shares the syntax with \cs{newcommand}. However it does not provide
+% latters check. Internally the check is available via \cs{@ifdefinable}.
+%
+% Internally the robust macro is using \cs{protect} with a nested
+% macro definition. The \cs{protect} infrastructure is a feature of
+% \cs{LaTeX} and usually not available in other formats.
+%
+% \subsection{The \hologo{eTeX}'s way}
+%
+% The need for robust macros is addressed in \cs{eTeX}. It provides
+% \cs{protected} that modifies the behaviour of \cs{def} in a similar
+% way as \cs{long}. A protected macro does not expand in
+% some expandable contexts like writing to a file or \cs{edef}.
+%
+% \subsection{The way of this package}
+%
+% The package tries to find the available protection mechanism.
+% First it looks for \cs{eTeX}'s \cs{protected}, then
+% it uses \hologo{LaTeX}'s \cs{DeclareRobustCommand}.
+% If both fails, then the macro remains unprotected.
+%
+% Additionally, \cs{LaTeX}'s check, if a macro is already defined
+% is added in all cases. First \hologo{LaTeX}'s \cs{@ifdefinable}
+% is tried to be compatible with \hologo{LaTeX}.
+% If \cs{@ifdefinable} is not available, then the test is implemented
+% by asserting that the macro is undefined or has the meaning of \cs{relax}.
+% If the test fails, then in all cases the macro is not defined
+% and an error is thrown.
+%
+% \subsection{Usage}
+%
+% \begin{declcs}{ProtectedDef} \* \M{cmd} [\meta{num}] \M{definition text}
+% \end{declcs}
+% Macro \cs{ProtectedDef} follows the syntax of \hologo{LaTeX}'s
+% \cs{newcommand} with the exception that an optional argument
+% is not supported. Macro \meta{cmd} is to be defined as
+% \cs{long} macro without star with \meta{num} arguments.
+%
+% The number of arguments \meta{num} must be given as explicite digit
+% |0| upto |9|. Otherwise the part between the argument \meta{cmd} and
+% the \meta{definition text} is taken as parameter text in the syntax
+% of vanilla \hologo{TeX}. Examples (with \cs{protected}):
+% \begin{quote}
+% \def\to{$\Rightarrow$ }%
+% |\ProtectedDef*{\foo}[1]{\message{#1}}|\\
+% \to |\protected\def\foo#1{\message#1}}|\\[1ex]
+% |\ProtectedDef\foo{abc}|\\
+% \to |\protected\def\foo{abc}|\\[1ex]
+% |\ProtectedDef*\foo(#1)<#2>{#1/#2}|\\
+% \to |\protected\def\foo(#1)<#2>{#1/#2}|
+% \end{quote}
+%
+% \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@protecteddef.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{protecteddef}{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@protecteddef.sty\endcsname
+\ProvidesPackage{protecteddef}%
+ [2016/05/16 v1.1 Define protected commands (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 ProDef@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\ProDef@AtEnd{%
+ \ProDef@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{38}{4}% &
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\ProDef@AtEnd{\ProDef@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Resources}
+%
+% \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
+ }%
+\else
+ \let\TMP@RequirePackage\RequirePackage
+\fi
+\TMP@RequirePackage{ltxcmds}[2010/12/12]%
+\TMP@RequirePackage{infwarerr}[2010/04/08]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\ProDef@temp#1{%
+ \expandafter\def\csname ProDef@param[#1]\endcsname % hash-ok
+}
+\expandafter\def\csname ProDef@param\endcsname{}
+\ProDef@temp0{}
+\ProDef@temp1{##1}
+\ProDef@temp2{##1##2}
+\ProDef@temp3{##1##2##3}
+\ProDef@temp4{##1##2##3##4}
+\ProDef@temp5{##1##2##3##4##5}
+\ProDef@temp6{##1##2##3##4##5##6}
+\ProDef@temp7{##1##2##3##4##5##7}
+\ProDef@temp8{##1##2##3##4##5##7##8}
+\ProDef@temp9{##1##2##3##4##5##7##8##9}
+% \end{macrocode}
+%
+% \begin{macro}{\ProDef@IfDefinable}
+% \begin{macrocode}
+\ltx@IfUndefined{@ifdefinable}{%
+ \long\def\ProDef@IfDefinable#1{%
+ \begingroup
+ \escapechar=-1 %
+ \ltx@ifundefined{\string#1}{%
+ \endgroup
+ \ltx@firstofone
+ }{%
+ \expandafter\endgroup
+ \expandafter
+ \edef\expandafter\ProDef@temp\expandafter{\string#1 }%
+ \@PackageError{protecteddef}{%
+ Command \ltx@backslashchar\ProDef@temp already defined%
+ }\@ehc
+ \ltx@gobbletwo
+ }%
+ }%
+}{%
+ \long\def\ProDef@IfDefinable#1{%
+ \let\ProDef@next\ltx@gobbletwo
+ \@ifdefinable{#1}{%
+ \let\ProDef@next\ltx@firstofone
+ }%
+ \ProDef@next
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname protected\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname DeclareRobustCommand\endcsname\relax
+ \catcode`\&=14 % comment
+ \else
+ \newcommand*{\ProtectedDef}{%
+ \ltx@ifnextchar*{%
+ \ProDef@ProtectedDef
+ }{%
+ \ProDef@ProtectedDef{}%
+ }%
+ }%
+ \long\def\ProDef@ProtectedDef#1#2#3#{%
+ \ProDef@IfDefinable{#2}{%
+ \ltx@IfUndefined{ProDef@param#3}{%
+ \DeclareRobustCommand*{#2}{}%
+ \begingroup
+ \escapechar=-1 %
+ \def\ProDef@temp{#1}%
+ \edef\x{\endgroup
+ \ifx\ProDef@temp\ltx@empty
+ \noexpand\long
+ \fi
+ \noexpand\def
+ \expandafter\noexpand\csname\string#2 \endcsname
+ }%
+ \x#3%
+ }{%
+ \DeclareRobustCommand#1{#2}#3%
+ }%
+ }%
+ }%
+ \expandafter\expandafter\expandafter\ProDef@AtEnd
+ \fi
+\else
+ \catcode`\&=9 % ignore
+\fi%
+\ProDef@IfDefinable\ProtectedDef{%
+& \protected
+ \def\ProtectedDef%
+}{%
+ \ltx@ifnextchar*{%
+ \let\ProDef@long\ltx@empty
+ \expandafter\ProDef@ProtectedDef\ltx@gobble
+ }{%
+ \let\ProDef@long\long
+ \ProDef@ProtectedDef
+ }%
+}
+\long\def\ProDef@ProtectedDef#1#2#{%
+ \ProDef@IfDefinable{#1}{%
+ \ltx@IfUndefined{ProDef@param#2}{%
+& \protected
+ \ProDef@long
+ \def#1#2%
+ }{%
+& \protected
+ \ProDef@long
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#1%
+ \csname ProDef@param#2\endcsname
+ }%
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProDef@AtEnd%
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \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 protecteddef.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test without \hologo{LaTeX} and \cs{protected}}
+%
+% \begin{macrocode}
+%<*test2>
+\errorcontextlines=10000 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input protecteddef.sty\relax
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+\else
+ \RequirePackage{protecteddef}[2016/05/16]%
+\fi
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname protected\endcsname\relax
+ \let\pdef\def
+\else
+ \def\pdef{\protected\def}%
+\fi
+\def\msg#{\immediate\write16}
+\countdef\errcount=2 %
+\long\def\BeginCheck#1\ProtectedDef#2\EndCheck{%
+ \begingroup
+ \toks0={\ProtectedDef#2}%
+ \msg{<<\the\toks0>>}%
+ \endgroup
+ \setbox0=\hbox{%
+ #1%
+ \ProtectedDef#2%
+ \check\foo
+ }%
+ \ifdim\wd0=0pt\relax
+ \else
+ \errmessage{[Definition] Unwanted spaces?!}%
+ \fi
+ \setbox0=\hbox{%
+ \def\fooinitial{XYZ}%
+ \let\foo\fooinitial
+ \errcount=0 %
+ \expandafter\def\csname @PackageError\endcsname##1##2##3{%
+ \advance\errcount by 1 %
+ }%
+ \expandafter\def\csname @notdefinable\endcsname{%
+ \advance\errcount by 1 %
+ }%
+ \ProtectedDef#2%
+ \ifnum\errcount=1 %
+ \else
+ \errmessage{1 error expected, but found: \the\errcount}%
+ \fi
+ \ifx\foo\fooinitial
+ \else
+ \def\space{ }%
+ \errmessage{\string\foo\space is overwritten}%
+ \fi
+ }%
+ \ifdim\wd0=0pt\relax
+ \else
+ \errmessage{[Error] Unwanted spaces?!}%
+ \fi
+}
+\chardef\DeclareVersion=0 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname protected\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname DeclareRobustCommand\endcsname\relax
+ \else
+ \chardef\DeclareVersion=1 %
+ \fi
+\fi
+\ifnum\DeclareVersion=0 %
+ \def\check#1{%
+ \ifx\cmp#1%
+ \msg{* Test passed.}%
+ \else
+ \msg{}%
+ \msg{[\meaning#1]}%
+ \msg{[\meaning\cmp]}%
+ \errmessage{Test failed!}%
+ \fi
+ }%
+\else
+ \def\check#1{%
+ \begingroup
+ \escapechar=-1 %
+ \edef\x{\endgroup
+ \def\noexpand\cs/{\string#1}%
+ }\x
+ \edef\CMP{%
+ \noexpand\protect
+ \expandafter\noexpand\csname\cs/ \endcsname
+ }%
+ \ifx\CMP#1%
+ \expandafter\ifx\csname\cs/ \endcsname\cmp
+ \msg{Test passed.}%
+ \else
+ \msg{}%
+ \msg{[\expandafter\meaning\csname\cs/ \endcsname]}%
+ \msg{[\meaning\cmp]}%
+ \errmessage{Test failed!}%
+ \fi
+ \else
+ \msg{}%
+ \msg{[\meaning#1]}%
+ \msg{[\meaning\CMP]}%
+ \errmessage{Test failed!}%
+ \fi
+ }%
+\fi
+
+\tracingmacros=1
+
+\BeginCheck
+ \pdef\cmp{}%
+ \ProtectedDef*\foo{}%
+\EndCheck
+
+\BeginCheck
+ \pdef\cmp{}%
+ \ProtectedDef*\foo[0]{}%
+\EndCheck
+
+\BeginCheck
+ \pdef\cmp#1{<#1>}%
+ \ProtectedDef*\foo[1]{<#1>}%
+\EndCheck
+
+\BeginCheck
+ \pdef\cmp(#1){<#1>}%
+ \ProtectedDef*\foo(#1){<#1>}%
+\EndCheck
+
+\BeginCheck
+ \long\pdef\cmp{}%
+ \ProtectedDef\foo{}%
+\EndCheck
+
+\BeginCheck
+ \long\pdef\cmp{}%
+ \ProtectedDef\foo[0]{}%
+\EndCheck
+
+\BeginCheck
+ \long\pdef\cmp#1{<#1>}%
+ \ProtectedDef\foo[1]{<#1>}%
+\EndCheck
+
+\BeginCheck
+ \long\pdef\cmp(#1){<#1>}%
+ \ProtectedDef\foo(#1){<#1>}%
+\EndCheck
+
+\csname @@end\endcsname\end
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/protecteddef}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/protecteddef.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/protecteddef.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[\CTAN{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 protecteddef.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@{}}
+% protecteddef.sty & tex/generic/oberdiek/protecteddef.sty\\
+% protecteddef.pdf & doc/latex/oberdiek/protecteddef.pdf\\
+% test/protecteddef-test1.tex & doc/latex/oberdiek/test/protecteddef-test1.tex\\
+% test/protecteddef-test2.tex & doc/latex/oberdiek/test/protecteddef-test2.tex\\
+% protecteddef.dtx & source/latex/oberdiek/protecteddef.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk protecteddef.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{protecteddef.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 protecteddef.dtx
+%makeindex -s gind.ist protecteddef.idx
+%pdflatex protecteddef.dtx
+%makeindex -s gind.ist protecteddef.idx
+%pdflatex protecteddef.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{protecteddef.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='protecteddef'>
+ <name>protecteddef</name>
+ <caption>Define protected commands.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ The package defines a command <tt>\ProtectedDef</tt> that will
+ create LaTeX &#x2018;robust&#x2019; command or an e-TeX
+ &#x2018;protected&#x2019; command as appropriate
+ to its environment.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/protecteddef.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/protecteddef.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2011/01/31 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/protecteddef.pdf b/macros/latex/contrib/oberdiek/protecteddef.pdf
new file mode 100644
index 0000000000..bddf7cdf1c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/protecteddef.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/refcount.dtx b/macros/latex/contrib/oberdiek/refcount.dtx
new file mode 100644
index 0000000000..d8b6b8e4ea
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/refcount.dtx
@@ -0,0 +1,1603 @@
+% \iffalse meta-comment
+%
+% File: refcount.dtx
+% Version: 2016/05/16 v3.5
+% Info: Data extraction from label references
+%
+% Copyright (C) 1998, 2000, 2006, 2008, 2010, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file refcount.dtx
+% and the derived files
+% refcount.sty, refcount.pdf, refcount.ins, refcount.drv,
+% refcount-test1.tex, refcount-test2.tex, refcount-test3.tex,
+% refcount-test4.tex, refcount-test5.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/refcount.dtx
+% CTAN:macros/latex/contrib/oberdiek/refcount.pdf
+%
+% Unpacking:
+% (a) If refcount.ins is present:
+% tex refcount.ins
+% (b) Without refcount.ins:
+% tex refcount.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{refcount.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If refcount.drv is present:
+% latex refcount.drv
+% (b) Without refcount.drv:
+% latex refcount.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 refcount.dtx
+% makeindex -s gind.ist refcount.idx
+% pdflatex refcount.dtx
+% makeindex -s gind.ist refcount.idx
+% pdflatex refcount.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/refcount.sty
+% TDS:doc/latex/oberdiek/refcount.pdf
+% TDS:doc/latex/oberdiek/test/refcount-test1.tex
+% TDS:doc/latex/oberdiek/test/refcount-test2.tex
+% TDS:doc/latex/oberdiek/test/refcount-test3.tex
+% TDS:doc/latex/oberdiek/test/refcount-test4.tex
+% TDS:doc/latex/oberdiek/test/refcount-test5.tex
+% TDS:source/latex/oberdiek/refcount.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: refcount 2016/05/16 v3.5 Data extraction from label references (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: refcount
+Version: 2016/05/16 v3.5
+
+Copyright (C) 1998, 2000, 2006, 2008, 2010, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file refcount.dtx
+and the derived files
+ refcount.sty, refcount.pdf, refcount.ins, refcount.drv,
+ refcount-test1.tex, refcount-test2.tex, refcount-test3.tex,
+ refcount-test4.tex, refcount-test5.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{refcount.ins}{\from{refcount.dtx}{install}}%
+ \file{refcount.drv}{\from{refcount.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{refcount.sty}{\from{refcount.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{refcount-test1.tex}{\from{refcount.dtx}{test1}}%
+% \file{refcount-test2.tex}{\from{refcount.dtx}{test2}}%
+% \file{refcount-test3.tex}{\from{refcount.dtx}{test3}}%
+% \file{refcount-test4.tex}{\from{refcount.dtx}{test3,test4}}%
+% \file{refcount-test5.tex}{\from{refcount.dtx}{test5}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{refcount.xml}{\from{refcount.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{* refcount.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `refcount.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{refcount.drv}%
+ [2016/05/16 v3.5 Data extraction from label references (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{refcount.dtx}%
+\end{document}
+%</driver>
+% \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{refcount.drv}
+%
+% \title{The \xpackage{refcount} package}
+% \date{2016/05/16 v3.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% References are not numbers, however they often store numerical
+% data such as section or page numbers. \cs{ref} or \cs{pageref}
+% cannot be used for counter assignments or calculations because
+% they are not expandable, generate warnings, or can even be links.
+% The package provides expandable macros to extract the data
+% from references. Packages \xpackage{hyperref}, \xpackage{nameref},
+% \xpackage{titleref}, and \xpackage{babel} are supported.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \subsection{Setting counters}
+%
+% The following commands are similar to \LaTeX's
+% \cs{setcounter} and \cs{addtocounter},
+% but they extract the number value from a reference:
+% \begin{quote}
+% \cs{setcounterref}, \cs{addtocounterref}\\
+% \cs{setcounterpageref}, \cs{addtocounterpageref}
+% \end{quote}
+% They take two arguments:
+% \begin{quote}
+% \cs{...counter...ref} |{|\meta{\LaTeX\ counter}|}|
+% |{|\meta{reference}|}|
+% \end{quote}
+% An undefined references produces the usual LaTeX warning
+% and its value is assumed to be zero.
+% Example:
+% \begin{quote}
+%\begin{verbatim}
+%\newcounter{ctrA}
+%\newcounter{ctrB}
+%\refstepcounter{ctrA}\label{ref:A}
+%\setcounterref{ctrB}{ref:A}
+%\addtocounterpageref{ctrB}{ref:A}
+%\end{verbatim}
+% \end{quote}
+%
+% \subsection{Expandable commands}
+%
+% These commands that can be used in expandible contexts
+% (inside calculations, \cs{edef}, \cs{csname}, \cs{write}, \dots):
+% \begin{quote}
+% \cs{getrefnumber}, \cs{getpagerefnumber}
+% \end{quote}
+% They take one argument, the reference:
+% \begin{quote}
+% \cs{get...refnumber} |{|\meta{reference}|}|
+% \end{quote}
+% The default for undefined references can be changed
+% with macro \cs{setrefcountdefault}, for example this
+% package calls:
+% \begin{quote}
+% \cs{setrefcountdefault}|{0}|
+% \end{quote}
+%
+% Since version 2.0 of this package there is a new
+% command:
+% \begin{quote}
+% \cs{getrefbykeydefault} |{|\meta{reference}|}|
+% |{|\meta{key}|}| |{|\meta{default}|}|
+% \end{quote}
+% This generalized version allows the extraction
+% of further properties of a reference than the
+% two standard ones. Thus the following properties
+% are supported, if they are available:
+% \begin{quote}
+% \begin{tabular}{@{}l|l|l@{}}
+% Key & Description & Package\\
+% \hline
+% \meta{empty} & same as \cs{ref} & \LaTeX\\
+% |page| & same as \cs{pageref} & \LaTeX\\
+% |title| & section and caption titles & \xpackage{titleref}\\
+% |name| & section and caption titles & \xpackage{nameref}\\
+% |anchor| & anchor name & \xpackage{hyperref}\\
+% |url| & url/file & \xpackage{hyperref}/\xpackage{xr}
+% \end{tabular}
+% \end{quote}
+%
+% Since version 3.2 the expandable macros described before
+% in this section
+% are expandable in exact two expansion steps.
+%
+% \subsection{Undefined references}
+%
+% Because warnings and assignments cannot be used in
+% expandible contexts, undefined references do not
+% produce a warning, their values are assumed to be zero.
+% Example:
+% \begin{quote}
+%\begin{verbatim}
+%\label{ref:here}% somewhere
+%\refused{ref:here}% see below
+%\ifodd\getpagerefnumber{ref:here}%
+% reference is on an odd page
+%\else
+% reference is on an even page
+%\fi
+%\end{verbatim}
+% \end{quote}
+%
+% In case of undefined references the user usually want's
+% to be informed. Also \LaTeX\ prints a warning at
+% the end of the \LaTeX\ run. To notify \LaTeX\ and
+% get a normal warning, just use
+% \begin{quote}
+% \cs{refused} |{|\meta{reference}|}|
+% \end{quote}
+% outside the expanding context. Example, see above.
+%
+% \subsubsection{Check for undefined references}
+%
+% In version 3.2 macros were added, that test, whether references
+% are defined.
+% \begin{declcs}{IfRefUndefinedExpandable} \M{refname} \M{then} \M{else}\\
+% \cs{IfRefUndefinedBabel} \M{refname} \M{then} \M{else}
+% \end{declcs}
+% If the reference is not available and therefore undefined, then
+% argument \meta{then} is executed, otherwise argument \meta{else}
+% is called. Macro \cs{IfRefUndefinedExpandable} is expandable,
+% but \meta{refname} must not contain babel shorthand characters.
+% Macro \cs{IfRefUndefinedBabel} supports shorthand characters of
+% babel, but it is not expandable.
+%
+% \subsection{Notes}
+%
+% \begin{itemize}
+% \item
+% The method of extracting the number in this
+% package also works in cases, where the
+% reference cannot be used directly, because
+% a package such as \xpackage{hyperref} has added
+% extra stuff (hyper link), so that the reference cannot
+% be used as number any more.
+% \item
+% If the reference does not contain a number,
+% assignments to a counter will fail of course.
+% \end{itemize}
+%
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@refcount.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{refcount}{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@refcount.sty\endcsname
+\ProvidesPackage{refcount}%
+ [2016/05/16 v3.5 Data extraction from label references (HO)]%
+% \end{macrocode}
+%
+% \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 rc@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\rc@AtEnd{%
+ \rc@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{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\rc@AtEnd{\rc@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Loading packages}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+ \input infwarerr.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2011/11/09]%
+ \RequirePackage{infwarerr}[2010/04/08]%
+\fi
+% \end{macrocode}
+%
+% \subsection{Defining commands}
+%
+% \begin{macro}{\rc@IfDefinable}
+% \begin{macrocode}
+\ltx@IfUndefined{@ifdefinable}{%
+ \def\rc@IfDefinable#1{%
+ \ifx#1\ltx@undefined
+ \expandafter\ltx@firstofone
+ \else
+ \ifx#1\relax
+ \expandafter\expandafter\expandafter\ltx@firstofone
+ \else
+ \@PackageError{refcount}{%
+ Command \string#1 is already defined.\MessageBreak
+ It will not redefined by this package%
+ }\@ehc
+ \expandafter\expandafter\expandafter\ltx@gobble
+ \fi
+ \fi
+ }%
+}{%
+ \let\rc@IfDefinable\@ifdefinable
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rc@RobustDefOne}
+% \begin{macro}{\rc@RobustDefZero}
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\rc@RobustDefOne#1#2#3#4{%
+ \rc@IfDefinable#3{%
+ #1\def#3##1{#4}%
+ }%
+ }%
+ \def\rc@RobustDefZero#1#2{%
+ \rc@IfDefinable#1{%
+ \def#1{#2}%
+ }%
+ }%
+ }{%
+ \def\rc@RobustDefOne#1#2#3#4{%
+ \rc@IfDefinable#3{%
+ \DeclareRobustCommand#2#3[1]{#4}%
+ }%
+ }%
+ \def\rc@RobustDefZero#1#2{%
+ \rc@IfDefinable#1{%
+ \DeclareRobustCommand#1{#2}%
+ }%
+ }%
+ }%
+}{%
+ \def\rc@RobustDefOne#1#2#3#4{%
+ \rc@IfDefinable#3{%
+ \protected#1\def#3##1{#4}%
+ }%
+ }%
+ \def\rc@RobustDefZero#1#2{%
+ \rc@IfDefinable#1{%
+ \protected\def#1{#2}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\rc@newcommand}
+% \begin{macrocode}
+\ltx@IfUndefined{newcommand}{%
+ \def\rc@newcommand*#1[#2]#3{% hash-ok
+ \rc@IfDefinable#1{%
+ \ifcase#2 %
+ \def#1{#3}%
+ \or
+ \def#1##1{#3}%
+ \or
+ \def#1##1##2{#3}%
+ \else
+ \rc@InternalError
+ \fi
+ }%
+ }%
+}{%
+ \let\rc@newcommand\newcommand
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{setrefcountdefault}}
+%
+% \begin{macro}{\setrefcountdefault}
+% \begin{macrocode}
+\rc@RobustDefOne\long{}\setrefcountdefault{%
+ \def\rc@default{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\setrefcountdefault{0}
+% \end{macrocode}
+%
+% \subsection{\cs{refused}}
+%
+% \begin{macro}{\refused}
+% \begin{macrocode}
+\ltx@IfUndefined{G@refundefinedtrue}{%
+ \rc@RobustDefOne{}{*}\refused{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \ltx@IfUndefined{r@#1}{%
+ \protect\G@refundefinedtrue
+ \rc@WarningUndefined{#1}%
+ }{}%
+ \endgroup
+ }%
+}{%
+ \rc@RobustDefOne{}{*}\refused{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \ltx@IfUndefined{r@#1}{%
+ \csname protect\expandafter\endcsname
+ \csname G@refundefinedtrue\endcsname
+ \rc@WarningUndefined{#1}%
+ }{}%
+ \endgroup
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@WarningUndefined}
+% \begin{macrocode}
+\ltx@IfUndefined{@latex@warning}{%
+ \def\rc@WarningUndefined#1{%
+ \ltx@ifundefined{thepage}{%
+ \def\thepage{\number\count0 }%
+ }{}%
+ \@PackageWarning{refcount}{%
+ Reference `#1' on page \thepage\space undefined%
+ }%
+ }%
+}{%
+ \def\rc@WarningUndefined#1{%
+ \@latex@warning{%
+ Reference `#1' on page \thepage\space undefined%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Setting counters by reference data}
+%
+% \subsubsection{Generic setting}
+%
+% \begin{macro}{\rc@set}
+% Generic command for
+% |\|$\{$|set|$,$|addto|$\}$|counter|$\{$|page|$,\}$|ref|:
+%\begin{quote}
+%\begin{tabular}[t]{@{}l@{: }l@{}}
+% |#1|& \cs{setcounter}, \cs{addtocounter}\\
+% |#2|& \cs{ltx@car} (for \cs{ref}), \cs{ltx@cartwo} (for \cs{pageref})\\
+% |#3|& \hologo{LaTeX} counter\\
+% |#4|& reference\\
+%\end{tabular}
+%\end{quote}
+% \begin{macrocode}
+\def\rc@set#1#2#3#4{%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \refused{#4}%
+ \expandafter\rc@@set\csname r@#4\endcsname{#1}{#2}{#3}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@@set}
+%\begin{quote}
+%\begin{tabular}[t]{@{}l@{: }l@{}}
+% |#1|& \cs{r@<...>}\\
+% |#2|& \cs{setcounter}, \cs{addtocounter}\\
+% |#3|& \cs{ltx@car} (for \cs{ref}), \cs{ltx@carsecond} (for \cs{pageref})\\
+% |#4|& \hologo{LaTeX} counter\\
+%\end{tabular}
+%\end{quote}
+% \begin{macrocode}
+\def\rc@@set#1#2#3#4{%
+ \ifx#1\relax
+ #2{#4}{\rc@default}%
+ \else
+ #2{#4}{%
+ \expandafter#3#1\rc@default\rc@default\@nil
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{User commands}
+%
+% \begin{macro}{\setcounterref}
+% \begin{macrocode}
+\rc@RobustDefZero\setcounterref{%
+ \rc@set\setcounter\ltx@car
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\addtocounterref}
+% \begin{macrocode}
+\rc@RobustDefZero\addtocounterref{%
+ \rc@set\addtocounter\ltx@car
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setcounterpageref}
+% \begin{macrocode}
+\rc@RobustDefZero\setcounterpageref{%
+ \rc@set\setcounter\ltx@carsecond
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\addtocounterpageref}
+% \begin{macrocode}
+\rc@RobustDefZero\addtocounterpageref{%
+ \rc@set\addtocounter\ltx@carsecond
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Extracting references}
+%
+% \begin{macro}{\getrefnumber}
+% \begin{macrocode}
+\rc@newcommand*{\getrefnumber}[1]{%
+ \romannumeral
+ \ltx@ifundefined{r@#1}{%
+ \expandafter\ltx@zero
+ \rc@default
+ }{%
+ \expandafter\expandafter\expandafter\rc@extract@
+ \expandafter\expandafter\expandafter!%
+ \csname r@#1\expandafter\endcsname
+ \expandafter{\rc@default}\@nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\getpagerefnumber}
+% \begin{macrocode}
+\rc@newcommand*{\getpagerefnumber}[1]{%
+ \romannumeral
+ \ltx@ifundefined{r@#1}{%
+ \expandafter\ltx@zero
+ \rc@default
+ }{%
+ \expandafter\expandafter\expandafter\rc@extract@page
+ \expandafter\expandafter\expandafter!%
+ \csname r@#1\expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter{%
+ \expandafter\rc@default
+ \expandafter}\expandafter{\rc@default}\@nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\getrefbykeydefault}
+% \begin{macrocode}
+\rc@newcommand*{\getrefbykeydefault}[2]{%
+ \romannumeral
+ \expandafter\rc@getrefbykeydefault
+ \csname r@#1\expandafter\endcsname
+ \csname rc@extract@#2\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@getrefbykeydefault}
+%\begin{quote}
+%\begin{tabular}[t]{@{}l@{: }l@{}}
+% |#1|& \cs{r@<...>}\\
+% |#2|& \cs{rc@extract@<...>}\\
+% |#3|& default\\
+%\end{tabular}
+%\end{quote}
+% \begin{macrocode}
+\long\def\rc@getrefbykeydefault#1#2#3{%
+ \ifx#1\relax
+ % reference is undefined
+ \ltx@ReturnAfterElseFi{%
+ \ltx@zero
+ #3%
+ }%
+ \else
+ \ltx@ReturnAfterFi{%
+ \ifx#2\relax
+ % extract method is missing
+ \ltx@ReturnAfterElseFi{%
+ \ltx@zero
+ #3%
+ }%
+ \else
+ \ltx@ReturnAfterFi{%
+ \expandafter
+ \rc@generic#1{#3}{#3}{#3}{#3}{#3}\@nil#2{#3}%
+ }%
+ \fi
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@generic}
+%\begin{quote}
+%\begin{tabular}[t]{@{}l@{: }l@{}}
+% |#1|& first item in \cs{r@<...>}\\
+% |#2|& remaining items in \cs{r@<...>}\\
+% |#3|& \cs{rc@extract@<...>}\\
+% |#4|& default\\
+%\end{tabular}
+%\end{quote}
+% \begin{macrocode}
+\long\def\rc@generic#1#2\@nil#3#4{%
+ #3{#1\TR@TitleReference\@empty{#4}\@nil}{#1}#2\@nil
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@extract@}
+% \begin{macrocode}
+\long\def\rc@extract@#1#2#3\@nil{%
+ \ltx@zero
+ #2%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@extract@page}
+% \begin{macrocode}
+\long\def\rc@extract@page#1#2#3#4\@nil{%
+ \ltx@zero
+ #3%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@extract@name}
+% \begin{macrocode}
+\long\def\rc@extract@name#1#2#3#4#5\@nil{%
+ \ltx@zero
+ #4%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@extract@anchor}
+% \begin{macrocode}
+\long\def\rc@extract@anchor#1#2#3#4#5#6\@nil{%
+ \ltx@zero
+ #5%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@extract@url}
+% \begin{macrocode}
+\long\def\rc@extract@url#1#2#3#4#5#6#7\@nil{%
+ \ltx@zero
+ #6%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@extract@title}
+% \begin{macrocode}
+\long\def\rc@extract@title#1#2\@nil{%
+ \rc@@extract@title#1%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rc@@extract@title}
+% \begin{macrocode}
+\long\def\rc@@extract@title#1\TR@TitleReference#2#3#4\@nil{%
+ \ltx@zero
+ #3%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Macros for checking undefined references}
+%
+% \begin{macro}{\IfRefUndefinedExpandable}
+% \begin{macrocode}
+\rc@newcommand*{\IfRefUndefinedExpandable}[1]{%
+ \ltx@ifundefined{r@#1}\ltx@firstoftwo\ltx@secondoftwo
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IfRefUndefinedBabel}
+% \begin{macrocode}
+\rc@RobustDefOne{}*\IfRefUndefinedBabel{%
+ \begingroup
+ \csname safe@actives@true\endcsname
+ \expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname r@#1\endcsname\relax
+ \expandafter\ltx@firstoftwo
+ \else
+ \expandafter\ltx@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\rc@AtEnd%
+%</package>
+% \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 refcount.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \begin{macrocode}
+%<*test2>
+\errorcontextlines=10000 %
+\showboxbreadth=10000 %
+\showboxdepth=10000 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input refcount.sty\relax
+\else
+ \RequirePackage{refcount}[2016/05/16]%
+\fi
+\catcode`\@=11 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname @onelevel@sanitize\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname detokenize\endcsname\relax
+ \def\strip@prefix#1->{}%
+ \def\@onelevel@sanitize#1{%
+ \edef#1{%
+ \expandafter\strip@prefix\meaning#1%
+ }%
+ }%
+ \else
+ \def\@onelevel@sanitize#1{%
+ \edef#1{%
+ \detokenize\expandafter{#1}%
+ }%
+ }%
+ \fi
+\fi
+\def\msg#{\immediate\write16}
+\def\empty{}
+\def\space{ }
+% \end{macrocode}
+% \begin{macrocode}
+\def\r@foo{{\empty 1}{\empty 2}}
+\long\def\test#1#2{%
+ \begingroup
+ \setbox0=\hbox{%
+ \def\TestTask{#1}%
+ \@onelevel@sanitize\TestTask
+ \msg{* \TestTask}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestResult
+ \expandafter\expandafter\expandafter{%
+ #1%
+ }%
+ \def\TestExpected{#2}%
+ \ifx\TestResult\TestExpected
+ \msg{ \space ok.}%
+ \else
+ \@onelevel@sanitize\TestResult
+ \@onelevel@sanitize\TestExpected
+ \msg{ \space Result: \space\space[\TestResult]}%
+ \msg{ \space Expected: [\TestExpected]}%
+ \errmessage{Test failed!}%
+ \fi
+ }%
+ \ifdim\wd0=0pt %
+ \else
+ \showbox0 %
+ \fi
+ \endgroup
+}
+\test{\getrefnumber{foo}}{\empty 1}
+\test{\getpagerefnumber{foo}}{\empty 2}
+\test{\getrefbykeydefault{foo}{}{\empty default}}{\empty 1}
+\test{\getrefbykeydefault{foo}{page}{\empty default}}{\empty 2}
+\test{\getrefbykeydefault{foo}{name}{\empty default}}{\empty default}
+\test{\getrefbykeydefault{foo}{anchor}{\empty default}}{\empty default}
+\test{\getrefbykeydefault{foo}{url}{\empty default}}{\empty default}
+\test{\getrefbykeydefault{foo}{title}{\empty default}}{\empty default}
+\msg{}
+\def\r@foo{{}{}{}{}{}{}{}{}{}{}}
+\def\Test#1#2\\{%
+ \test{#1{foo}#2}{}%
+}
+\def\TestGroup{%
+ \Test\getrefnumber\\%
+ \Test\getpagerefnumber\\%
+ \Test\getrefbykeydefault{}{}\\%
+ \Test\getrefbykeydefault{page}{}\\%
+ \Test\getrefbykeydefault{anchor}{}\\%
+ \Test\getrefbykeydefault{name}{}\\%
+ \Test\getrefbykeydefault{url}{}\\%
+}
+\TestGroup
+\Test\getrefbykeydefault{title}{}\\%
+\msg{}
+\def\r@foo{\par\par\par\par\par\par\par\par}
+\long\def\Test#1#2\\{%
+ \test{#1{foo}#2}{\par}%
+}
+\TestGroup
+\test{\getrefbykeydefault{title}{}{}}{}
+\msg{}
+\def\r@foo{{ }{ }{ }{ }{ }}
+\def\Test#1#2\\{%
+ \test{#1{foo}#2}{ }%
+}
+\TestGroup
+\msg{}
+\long\def\TestDefault#1{%
+ \begingroup
+ \setrefcountdefault{#1}%
+ \test{\getrefnumber{foo}}{#1}%
+ \test{\getpagerefnumber{foo}}{#1}%
+ \endgroup
+}
+\def\TestDefaultX{%
+ \TestDefault{}%
+ \TestDefault{\par}%
+ \TestDefault{ }%
+ \TestDefault{\space}%
+}
+\let\r@foo\@undefined
+\TestDefaultX
+\let\r@foo\relax
+\TestDefaultX
+\def\r@foo{}
+\TestDefaultX
+% \end{macrocode}
+% \begin{macrocode}
+\msg{}
+\long\def\Test#1#2#3#4{%
+ \begingroup
+ \def\TestTask{#1}%
+ \@onelevel@sanitize\TestTask
+ \msg{* [\TestTask]}%
+ \edef\TestResultA{\IfRefUndefinedExpandable{#1}{#2}{#3}}%
+ \IfRefUndefinedBabel{#1}{%
+ \def\TestResultB{#2}%
+ }{%
+ \def\TestResultB{#3}%
+ }%
+ \def\TestExpected{#4}%
+ \ifx\TestResultA\TestExpected
+ \msg{ \space ok.}%
+ \else
+ \begingroup
+ \@onelevel@sanitize\TestResultA
+ \@onelevel@sanitize\TestExpected
+ \msg{ \space Result: \space\space[\TestResultA]}%
+ \msg{ \space Expected: [\TestExpected]}%
+ \errmessage{Test failed!}%
+ \endgroup
+ \fi
+ \ifx\TestResultB\TestExpected
+ \msg{ \space ok.}%
+ \else
+ \begingroup
+ \@onelevel@sanitize\TestResultB
+ \@onelevel@sanitize\TestExpected
+ \msg{ \space Result: \space\space[\TestResultB]}%
+ \msg{ \space Expected: [\TestExpected]}%
+ \errmessage{Test failed!}%
+ \endgroup
+ \fi
+ \endgroup
+}
+\begingroup
+ \def\r@foo{{}{}}%
+ \let\r@bar\@undefined
+ \let\r@xyz\relax
+ \Test{foo}{true}{false}{false}%
+ \Test{bar}{true}{false}{true}%
+ \Test{xyz}{true}{false}{true}%
+\endgroup
+% \end{macrocode}
+% \begin{macrocode}
+\csname @@end\endcsname\end
+%</test2>
+% \end{macrocode}
+% \subsection{Test with package \xpackage{titleref}}
+%
+% \begin{macrocode}
+%<*test3>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{refcount}[2016/05/16]
+%<test4>\usepackage{nameref}
+\usepackage{titleref}
+\begin{document}
+\section{Hello World}
+\label{sec:hello}
+\section{\hbox{xy}}
+\label{sec:foo}
+%
+\makeatletter
+\@ifundefined{r@sec:hello}{%
+ \typeout{==> Compile twice!}%
+}{%
+ \def\test#1#2{%
+ \begingroup
+ \def\TestTask{#1}%
+ \@onelevel@sanitize\TestTask
+ \typeout{* \TestTask}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestResult
+ \expandafter\expandafter\expandafter{%
+ #1%
+ }%
+ \def\TestExpected{#2}%
+ \ifx\TestResult\TestExpected
+ \typeout{ \space ok.}%
+ \else
+ \@onelevel@sanitize\TestResult
+ \@onelevel@sanitize\TestExpected
+ \typeout{ \space Result: \space\space[\TestResult]}%
+ \typeout{ \space Expected: [\TestExpected]}%
+ \errmessage{Test failed!}%
+ \fi
+ \endgroup
+ }%
+ \test{\getrefbykeydefault{sec:hello}{title}{}}{Hello World}%
+ \test{\getrefbykeydefault{sec:foo}{title}{}}{\hbox{xy}}%
+ \begingroup
+ \def\hbox#1{[#1]}% hash-ok
+ \test{\getrefbykeydefault{sec:foo}{title}{}}{\hbox{xy}}%
+ \endgroup
+}
+\makeatother
+% \end{macrocode}
+% \begin{macrocode}
+\end{document}
+%</test3>
+% \end{macrocode}
+% \begin{macrocode}
+%<*test5>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{book}
+\usepackage{refcount}[2016/05/16]
+\usepackage{zref-runs}
+\newcounter{test}
+\begin{document}
+\ifnum\zruns>1 %
+ \makeatletter
+ \def\Test#1#2#3{%
+ \begingroup
+ \setcounter{test}{10}%
+ \sbox0{%
+ #1{test}{#2}%
+ \ifnum#3=\value{test}%
+ \else
+ \PackageError{test}{\string#1{#2} <> #3 (\the\value{test})}%
+ \fi
+ }%
+ \ifdim\wd0=0pt %
+ \else
+ \PackageError{test}{Non-empty box}\@ehc
+ \fi
+ \endgroup
+ }%
+ \makeatother
+ \Test\setcounterpageref{ch:two}{1}%
+ \Test\setcounterpageref{ch:three}{3}%
+ \Test\setcounterpageref{ch:four}{5}%
+ \Test\setcounterpageref{ch:five}{7}%
+ \Test\setcounterpageref{ch:six}{9}%
+ \Test\setcounterpageref{ch:seven}{13}%
+ \Test\addtocounterpageref{ch:two}{11}%
+ \Test\addtocounterpageref{ch:three}{13}%
+ \Test\addtocounterpageref{ch:four}{15}%
+ \Test\addtocounterpageref{ch:five}{17}%
+ \Test\addtocounterpageref{ch:six}{19}%
+ \Test\addtocounterpageref{ch:seven}{23}%
+ \Test\setcounterref{ch:two}{1}%
+ \Test\setcounterref{ch:three}{2}%
+ \Test\setcounterref{ch:four}{11}%
+ \Test\addtocounterref{ch:two}{11}%
+ \Test\addtocounterref{ch:three}{12}%
+ \Test\addtocounterref{ch:four}{21}%
+\fi
+\frontmatter
+\chapter{Chapter one}\label{ch:one}
+\cleardoublepage
+\mainmatter
+\chapter{Chapter two}\label{ch:two}
+\cleardoublepage
+\chapter{Chapter three}\label{ch:three}
+\cleardoublepage
+\setcounter{chapter}{10}
+\chapter{Chapter four}\label{ch:four}
+\cleardoublepage
+\appendix
+\chapter{Chapter five}\label{ch:five}
+\cleardoublepage
+\chapter{Chapter six}\label{ch:six}
+\cleardoublepage
+\null
+\cleardoublepage
+\chapter{Chapter seven}\label{ch:seven}
+\end{document}
+%</test5>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/refcount}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/refcount.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/refcount.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[\CTAN{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 refcount.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@{}}
+% refcount.sty & tex/latex/oberdiek/refcount.sty\\
+% refcount.pdf & doc/latex/oberdiek/refcount.pdf\\
+% test/refcount-test1.tex & doc/latex/oberdiek/test/refcount-test1.tex\\
+% test/refcount-test2.tex & doc/latex/oberdiek/test/refcount-test2.tex\\
+% test/refcount-test3.tex & doc/latex/oberdiek/test/refcount-test3.tex\\
+% test/refcount-test4.tex & doc/latex/oberdiek/test/refcount-test4.tex\\
+% test/refcount-test5.tex & doc/latex/oberdiek/test/refcount-test5.tex\\
+% refcount.dtx & source/latex/oberdiek/refcount.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk refcount.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{refcount.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 refcount.dtx
+%makeindex -s gind.ist refcount.idx
+%pdflatex refcount.dtx
+%makeindex -s gind.ist refcount.idx
+%pdflatex refcount.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{refcount.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='refcount'>
+ <name>refcount</name>
+ <caption>Counter operations with label references.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1998,2000,2006,2008,2010,2011'/>
+ <license type='lppl1.3'/>
+ <version number='3.5'/>
+ <description>
+ Provides commands <tt>\setcounterref</tt> and
+ <tt>\addtocounterref</tt> which use the section (or whatever)
+ number from the reference as the value to put into the counter, as
+ in:
+
+ <pre>
+ ...\label{sec:foo}
+ ...
+ \setcounterref{foonum}{sec:foo}
+ </pre>
+ Commands <tt>\setcounterpageref</tt> and
+ <tt>\addtocounterpageref</tt> do the corresponding thing with the
+ page reference of the label.
+ <p/>
+ No <tt>.ins</tt> file is distributed; process the
+ <tt>.dtx</tt> with plain TeX to create one.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/refcount.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/refcount.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1998/04/08 v1.0}
+% \item
+% First public release, written as answer in the
+% newsgroup \xnewsgroup{comp.text.tex}:
+% \URL{``\link{Re: Adding a \cs{ref} to a counter?}''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/c3f2a135ef5ee528}
+% \end{Version}
+% \begin{Version}{2000/09/07 v2.0}
+% \item
+% Documentation added.
+% \item
+% LPPL 1.2
+% \item
+% Package rewritten, new commands added.
+% \end{Version}
+% \begin{Version}{2006/02/20 v3.0}
+% \item
+% Support for \xpackage{hyperref} and \xpackage{nameref} improved.
+% \item
+% Support for \xpackage{titleref} and \xpackage{babel}'s shorthands added.
+% \item
+% New: \cs{refused}, \cs{getrefbykeydefault}
+% \end{Version}
+% \begin{Version}{2008/08/11 v3.1}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2010/12/01 v3.2}
+% \item
+% \cs{IfRefUndefinedExpandable} and \cs{IfRefUndefinedBabel} added.
+% \item
+% \cs{getrefnumber}, \cs{getpagerefnumber}, \cs{getrefbykeydefault}
+% are expandable in exact two expansion steps.
+% \item
+% Non-expandable macros are made robust.
+% \item
+% Test files added.
+% \end{Version}
+% \begin{Version}{2011/06/22 v3.3}
+% \item
+% Bug fix: \cs{rc@refused} is undefined for \cs{setcounterpageref}
+% and similar macros. (Bug found by Marc van Dongen.)
+% \end{Version}
+% \begin{Version}{2011/10/16 v3.4}
+% \item
+% Bug fix: \cs{setcounterpageref} and \cs{addtocounterpageref} fixed.
+% (Bug found by Staz.)
+% \item
+% Macros \cs{(set|addto)counter(page|)ref} are made robust.
+% \end{Version}
+% \begin{Version}{2016/05/16 v3.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/refcount.pdf b/macros/latex/contrib/oberdiek/refcount.pdf
new file mode 100644
index 0000000000..6efc8d360a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/refcount.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/rerunfilecheck.dtx b/macros/latex/contrib/oberdiek/rerunfilecheck.dtx
new file mode 100644
index 0000000000..d8f37a1da8
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/rerunfilecheck.dtx
@@ -0,0 +1,1106 @@
+% \iffalse meta-comment
+%
+% File: rerunfilecheck.dtx
+% Version: 2016/05/16 v1.8
+% Info: Rerun checks for auxiliary files
+%
+% Copyright (C) 2009-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file rerunfilecheck.dtx
+% and the derived files
+% rerunfilecheck.sty, rerunfilecheck.pdf, rerunfilecheck.ins,
+% rerunfilecheck.drv, rerunfilecheck-example.cfg,
+% rerunfilecheck-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/rerunfilecheck.dtx
+% CTAN:macros/latex/contrib/oberdiek/rerunfilecheck.pdf
+%
+% Unpacking:
+% (a) If rerunfilecheck.ins is present:
+% tex rerunfilecheck.ins
+% (b) Without rerunfilecheck.ins:
+% tex rerunfilecheck.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{rerunfilecheck.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If rerunfilecheck.drv is present:
+% latex rerunfilecheck.drv
+% (b) Without rerunfilecheck.drv:
+% latex rerunfilecheck.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 rerunfilecheck.dtx
+% makeindex -s gind.ist rerunfilecheck.idx
+% pdflatex rerunfilecheck.dtx
+% makeindex -s gind.ist rerunfilecheck.idx
+% pdflatex rerunfilecheck.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/rerunfilecheck.sty
+% TDS:doc/latex/oberdiek/rerunfilecheck.pdf
+% TDS:doc/latex/oberdiek/rerunfilecheck-example.cfg
+% TDS:doc/latex/oberdiek/test/rerunfilecheck-test1.tex
+% TDS:source/latex/oberdiek/rerunfilecheck.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: rerunfilecheck 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: rerunfilecheck
+Version: 2016/05/16 v1.8
+
+Copyright (C) 2009-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file rerunfilecheck.dtx
+and the derived files
+ rerunfilecheck.sty, rerunfilecheck.pdf, rerunfilecheck.ins,
+ rerunfilecheck.drv, rerunfilecheck-example.cfg,
+ rerunfilecheck-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{rerunfilecheck.ins}{\from{rerunfilecheck.dtx}{install}}%
+ \file{rerunfilecheck.drv}{\from{rerunfilecheck.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{rerunfilecheck.sty}{\from{rerunfilecheck.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{rerunfilecheck-test1.tex}{\from{rerunfilecheck.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+ \usedir{doc/latex/oberdiek}%
+ \file{rerunfilecheck-example.cfg}{\from{rerunfilecheck.dtx}{cfg}}%
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{rerunfilecheck.xml}{\from{rerunfilecheck.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{* rerunfilecheck.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `rerunfilecheck.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{rerunfilecheck.drv}%
+ [2016/05/16 v1.8 Rerun checks for auxiliary files (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{rerunfilecheck.dtx}%
+\end{document}
+%</driver>
+% \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{rerunfilecheck.drv}
+%
+% \title{The \xpackage{rerunfilecheck} package}
+% \date{2016/05/16 v1.8}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package provides additional rerun warnings if some
+% auxiliary files have changed. It is based on MD5 checksum,
+% provided by \pdfTeX.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \LaTeX\ informs the user, when to run \LaTeX\ again, if the
+% references have changed. It has the old references from the
+% first reading of the \xext{aux} files already in memory, thus
+% it compares them with the new version of the \xext{aux} file
+% at the end of the document. However this rerun warnings are
+% not given for the table of contents and other data stored
+% in the \xext{aux} files or other auxiliary files.
+% Usually many of these data as the table of contents is not keep
+% in memory. If someone wants to detect changes, he has either
+% to keep the data in memory. This does not scale well with huge
+% documents. Or he copies the file before they are changed. Slow
+% I/O operations cost time.
+%
+% Since version 1.30.0 \pdfTeX\ provides \cs{pdfmdfivesum}
+% and \cs{pdffilesize}.
+% These features are also available in \LuaTeX, provided by package
+% \xpackage{pdftexcmds}.
+% Thus this package \xpackage{rerunfilecheck} uses these features to
+% detect file changes. This saves the packages from keeping
+% the whole files in memory or in file copies.
+% The drawback are different files with the same size and the
+% same MD5 checksum (seldom, hopefully).
+%
+% \subsection{Options}
+%
+% All options are key value options of boolean type.
+% No option or |true| turns an option on, |false| disables
+% an option.
+% \begin{description}
+% \item[\xoption{mainaux}:]
+% Check the main \xext{aux} file.
+% \item[\xoption{partaux}:]
+% Check the \xext{aux} files from \cs{include} files.
+% \item[\xoption{starttoc}:]
+% Add the rerun checks in \cs{@starttoc} that is called by
+% \cs{tableofcontents}, \cs{listoffigures}, \dots
+% \item[\xoption{index}, \xoption{glossary}:]
+% \LaTeX's original \cs{makeindex} and \cs{makeglossary} are
+% redefined to add the rerun checks. The options do not have
+% an effect, if \cs{makeindex}/\cs{makeglossary} are already
+% called or if a package or class had redefined or will
+% redefine them.
+% \item[\xoption{aux}:]
+% This option turns all previous options on or off.
+% ``aux'' means auxiliary file.
+% \end{description}
+% The default for the options is |false|, because
+% some internals must be redefined to insert the
+% rerun checks.
+% The options can be set in \cs{usepackage} or
+% the configuration file \xfile{rerunfilecheck.cfg}.
+% Global options are ignored (since 1.4).
+%
+% \begin{declcs}{RerunFileCheckSetup} \M{key value list}
+% \end{declcs}
+% Options can also be set using \cs{RerunFileCheckSetup}.
+% Currently all options are disabled after the package
+% is loaded. Thus \cs{RerunFileCheckSetup} makes sense in
+% the configuration file only.
+%
+% Example for the configuration file:
+% \begin{macrocode}
+%<*cfg>
+\ProvidesFile{rerunfilecheck.cfg}[2016/05/16 Default configuration]%
+\RerunFileCheckSetup{aux}
+%</cfg>
+% \end{macrocode}
+%
+% \subsection{Interface for class/package authors}
+%
+% \begin{declcs}{RerunFileCheck} \M{file} \M{file closing action} \M{rerun warning}
+% \end{declcs}
+% If you want to add a rerun check, call \cs{RerunFileCheck} right before
+% an output file is opened for writing. The macro first remembers
+% the current checksum of \meta{file}.
+% The file is checked again right before the end of the job.
+% Macro \cs{AtVeryEndDocument} of package \xpackage{atveryend}
+% is used to place the check after the main aux file is closed
+% in |\end{document}|. Before reading the file again, it must be
+% closed. Provide the code for closing in argument \meta{file closing action}.
+% Do not forget \cs{immediate} before \cs{openout}. Otherwise the
+% closing action would be delayed to the next shipout that never happens
+% (the last page is already shipped out).
+% If the file has changed, \cs{RerunFileCheck} informs the user with
+% a warning that the file has changed and says the magic word ``Rerun''.
+% If the last argument \meta{rerun warning} is not empty, then
+% the rerun sentence is replaced by it. Usually the phrase
+% ``to get something right'' is added.
+% As example the relevant part of the redefined \cs{makeindex}
+% is shown, see package code:
+%\begin{quote}
+%\begin{verbatim}
+%\newwrite\@indexfile
+%\RerunFileCheck{\jobname.idx}{%
+% \immediate\closeout\@indexfile
+%}{%
+% Rerun LaTeX/makeindex to get index right%
+%}%
+%\immediate\openout\@indexfile=\jobname.idx %
+%\end{verbatim}
+%\end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \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 ReFiCh@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\ReFiCh@AtEnd{%
+ \ReFiCh@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{44}{12}% ,
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{59}{12}% ;
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\ReFiCh@AtEnd{\ReFiCh@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{rerunfilecheck}%
+ [2016/05/16 v1.8 Rerun checks for auxiliary files (HO)]
+% \end{macrocode}
+%
+% \subsection{Options}
+%
+% \begin{macrocode}
+\RequirePackage{kvoptions}[2010/02/22]
+\SetupKeyvalOptions{%
+ family=rerunfilecheck,%
+ prefix=ReFiCh@%
+}
+% \end{macrocode}
+% \begin{macro}{\RerunFileCheckSetup}
+% \begin{macrocode}
+\newcommand*{\RerunFileCheckSetup}{%
+ \setkeys{rerunfilecheck}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareBoolOption{mainaux}
+\DeclareBoolOption{partaux}
+\DeclareBoolOption{starttoc}
+\DeclareBoolOption{index}
+\DeclareBoolOption{glossary}
+\define@key{rerunfilecheck}{aux}[true]{%
+ \RerunFileCheckSetup{%
+ mainaux={#1},%
+ partaux={#1},%
+ starttoc={#1},%
+ index={#1},%
+ glossary={#1}%
+ }%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\InputIfFileExists{rerunfilecheck.cfg}{}{}
+\ProcessLocalKeyvalOptions*
+% \end{macrocode}
+%
+% \begin{macro}{\ReFiCh@DisableOption}
+% \begin{macrocode}
+\def\ReFiCh@DisableOption{%
+ \DisableKeyvalOption[%
+ action=warning,%
+ package=rerunfilecheck%
+ ]{rerunfilecheck}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Check for checksum feature}
+%
+% \begin{macrocode}
+\RequirePackage{infwarerr}[2007/09/09]
+\RequirePackage{pdftexcmds}[2009/04/10]
+% \end{macrocode}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@filemdfivesum\endcsname\relax
+ \@PackageInfoNoLine{rerunfilecheck}{%
+ Feature \string\pdfmdfivesum\space is not available\MessageBreak
+ (e.g. pdfTeX or LuaTeX with package `pdftexcmds').\MessageBreak
+ Therefore file contents cannot be checked efficiently\MessageBreak
+ and the loading of the package is aborted%
+ }%
+ \newcommand*{\RerunFileCheck}[3]{}%
+ \renewcommand*{\RerunFileCheckSetup}[1]{}%
+ \expandafter\ReFiCh@AtEnd
+\fi%
+% \end{macrocode}
+%
+% \subsection{Standard \xext{aux} files}
+%
+% \begin{macrocode}
+\ifReFiCh@partaux
+ \let\ReFiCh@org@include\@include
+ \def\@include#1 {%
+ \if@filesw
+ \RerunFileCheck{#1.aux}{}{}%
+ \fi
+ \ReFiCh@org@include{#1} %
+ }%
+\fi
+\ifReFiCh@mainaux
+ \AtBeginDocument{%
+ \ReFiCh@mainauxfalse
+ }%
+ \ifReFiCh@mainaux
+ \AtEndOfPackage{%
+ \RerunFileCheck{\jobname.aux}{}{}%
+ }%
+ \else
+ \if@filesw
+ \@PackageWarningNoLine{rerunfilecheck}{%
+ Main aux file check is disabled,\MessageBreak
+ because the file is already opened.\MessageBreak
+ Load the package before \string\begin{document}%
+ }%
+ \fi
+ \fi
+\fi
+\ifReFiCh@starttoc
+ \let\ReFiCh@org@starttoc\@starttoc
+ \def\@starttoc#1{%
+ \if@filesw
+ \RerunFileCheck{\jobname.#1}{%
+ \@ifundefined{tf@#1}{%
+ }{%
+ \immediate\closeout\csname tf@#1\endcsname
+ }%
+ }{}%
+ \fi
+ \ReFiCh@org@starttoc{#1}%
+ }%
+\fi
+\ifReFiCh@index
+ \ifx\makeindex\@empty
+ \@PackageWarningNoLine{rerunfilecheck}{%
+ Option `index' ignored,\MessageBreak
+ because \string\makeindex\space has already been called%
+ }%
+ \else
+ \def\ReFiCh@temp{%
+ \newwrite\@indexfile
+ \immediate\openout\@indexfile=\jobname.idx %
+ \def\index{%
+ \@bsphack
+ \begingroup
+ \@sanitize
+ \@wrindex
+ }%
+ \typeout{Writing index file \jobname.idx}%
+ \let\makeindex\@empty
+ }%
+ \ifx\ReFiCh@temp\makeindex
+ \def\makeindex{%
+ \newwrite\@indexfile
+ \RerunFileCheck{\jobname.idx}{%
+ \immediate\closeout\@indexfile
+ }{%
+ Rerun LaTeX/makeindex to get index right%
+ }%
+ \immediate\openout\@indexfile=\jobname.idx %
+ \def\index{%
+ \@bsphack
+ \begingroup
+ \@sanitize
+ \@wrindex
+ }%
+ \typeout{Writing index file \jobname.idx}%
+ \let\makeindex\@empty
+ }%
+ \else
+ \@PackageInfoNoLine{rerunfilecheck}{%
+ Option `index': unsupported version of \string\makeindex
+ }%
+ \fi
+ \fi
+\fi
+\ifReFiCh@glossary
+ \ifx\makeglossary\@empty
+ \@PackageWarningNoLine{rerunfilecheck}{%
+ Option `glossary' ignored,\MessageBreak
+ because \string\makeglossary\space has already been called%
+ }%
+ \else
+ \def\ReFiCh@temp{%
+ \newwrite\@glossaryfile
+ \immediate\openout\@glossaryfile=\jobname.glo %
+ \def\glossary{%
+ \@bsphack
+ \begingroup
+ \@sanitize
+ \@wrglossary
+ }%
+ \typeout{Writing glossary file \jobname.glo }%
+ \let\makeglossary\@empty
+ }%
+ \ifx\ReFiCh@temp\makeglossary
+ \def\ReFiCh@temp{%
+ \newwrite\@glossaryfile
+ \RerunFileCheck{\jobname.glo}{%
+ \immediate\closeout\@glossaryfile
+ }{%
+ Rerun LaTeX/makeindex to get glossary right%
+ }%
+ \immediate\openout\@glossaryfile=\jobname.glo %
+ \def\glossary{%
+ \@bsphack
+ \begingroup
+ \@sanitize
+ \@wrglossary
+ }%
+ \typeout{Writing glossary file \jobname.glo}%
+ \let\makeglossary\@empty
+ }%
+ \else
+ \@PackageInfoNoLine{rerunfilecheck}{%
+ Option `glossary': unsupported version of \string\makeglossary
+ }%
+ \fi
+ \fi
+\fi
+\ReFiCh@DisableOption{mainaux}
+\ReFiCh@DisableOption{partaux}
+\ReFiCh@DisableOption{starttoc}
+\ReFiCh@DisableOption{index}
+\ReFiCh@DisableOption{glossary}
+\ReFiCh@DisableOption{aux}
+% \end{macrocode}
+%
+% \subsection{Rerun check}
+%
+% \begin{macrocode}
+\RequirePackage{atveryend}[2016/05/16]
+\RequirePackage{uniquecounter}[2009/12/18]
+% \end{macrocode}
+%
+% \begin{macro}{\ReFiCh@CheckSum}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf@filesize\endcsname\relax
+ \def\ReFiCh@CheckSum{%
+ \pdf@filemdfivesum
+ }%
+\else
+ \def\ReFiCh@CheckSum#1{%
+ \pdf@filemdfivesum{#1}%
+ \ReFiCh@Separator
+ \pdf@filesize{#1}%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ReFiCh@NoFile}
+% \begin{macrocode}
+\def\ReFiCh@Separator{;}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ReFiCh@NoFile}
+% \begin{macrocode}
+\def\ReFiCh@NoFile{<no file>}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\UniqueCounterNew{rerunfilecheck}
+% \end{macrocode}
+%
+% \begin{macro}{\RerunFileCheck}
+% \begin{macrocode}
+\newcommand*{\RerunFileCheck}{%
+ \UniqueCounterCall{rerunfilecheck}\ReFiCh@RerunFileCheck
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ReFiCh@RerunFileCheck}
+% \begin{macrocode}
+\def\ReFiCh@RerunFileCheck#1{%
+ \expandafter\ReFiCh@@RerunFileCheck\csname ReFiCh@#1\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ReFiCh@Check}
+% \begin{macrocode}
+\def\ReFiCh@Check#1#2#3{%
+% \IfFileExists{#3}{%
+ #1\edef#2{\ReFiCh@CheckSum{#3}}%
+ \ifx#2\ReFiCh@Separator
+ #1\let#2\ReFiCh@NoFile
+ \fi
+% }{%
+% #1\let#2\ReFiCh@NoFile
+% }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ReFiCh@@RerunFileCheck}
+% \begin{macrocode}
+\def\ReFiCh@@RerunFileCheck#1#2#3#4{%
+ \ReFiCh@Check\global#1{#2}%
+ \AtEndAfterFileList{%
+ \begingroup
+ #3%
+ \ReFiCh@Check{}\x{#2}%
+ \ifx#1\x
+ \@PackageInfoNoLine{rerunfilecheck}{%
+ File `#2' has not changed.\MessageBreak
+ Checksum: \x
+ }%
+ \else
+ \ifnum
+ \ReFiCh@IsAux#2\relax.aux\relax\@nil
+ \ifx#1\ReFiCh@NoFile 1\else 0\fi
+ \ifx\x\ReFiCh@AuxEmptyUnix 1%
+ \else
+ \ifx\x\ReFiCh@AuxEmptyDos 1\fi
+ \fi
+ =111 %
+ \@PackageInfoNoLine{rerunfilecheck}{%
+ File `#2' is empty .aux file.\MessageBreak
+ Before: #1\MessageBreak
+ After: \space\x
+ }%
+ \else
+ \@PackageWarningNoLine{rerunfilecheck}{%
+ File `#2' has changed.%
+ \ifx\\#4\\%
+ \space Rerun%
+ \else
+ \MessageBreak
+ #4%
+ \fi
+ }%
+ \@PackageInfoNoLine{rerunfilecheck}{%
+ Checksums for `#2':\MessageBreak
+ Before: #1\MessageBreak
+ After: \space\x
+ }%
+ \fi
+ \fi
+ \endgroup
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\def\ReFiCh@IsAux#1.aux\relax#2\@nil{%
+ \ifx\hbox#2\hbox
+ 0%
+ \else
+ 1%
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\ReFiCh@AuxEmptyUnix{A94A2480D3289E625EEA47CD1B285758;8}%
+\@onelevel@sanitize\ReFiCh@AuxEmptyUnix
+% \end{macrocode}
+% \begin{macrocode}
+\def\ReFiCh@AuxEmptyDos{A62A15ECE803E2EBE94952FCC9933BC0;9}%
+\@onelevel@sanitize\ReFiCh@AuxEmptyDos
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ReFiCh@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \begin{macrocode}
+%<*test1>
+\def\LoadCommand{\RequirePackage{rerunfilecheck}[2016/05/16]}
+%</test1>
+% \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 rerunfilecheck.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/rerunfilecheck}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/rerunfilecheck.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/rerunfilecheck.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[\CTAN{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 rerunfilecheck.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@{}}
+% rerunfilecheck.sty & tex/latex/oberdiek/rerunfilecheck.sty\\
+% rerunfilecheck.pdf & doc/latex/oberdiek/rerunfilecheck.pdf\\
+% rerunfilecheck-example.cfg & doc/latex/oberdiek/rerunfilecheck-example.cfg\\
+% test/rerunfilecheck-test1.tex & doc/latex/oberdiek/test/rerunfilecheck-test1.tex\\
+% rerunfilecheck.dtx & source/latex/oberdiek/rerunfilecheck.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk rerunfilecheck.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{rerunfilecheck.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 rerunfilecheck.dtx
+%makeindex -s gind.ist rerunfilecheck.idx
+%pdflatex rerunfilecheck.dtx
+%makeindex -s gind.ist rerunfilecheck.idx
+%pdflatex rerunfilecheck.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{rerunfilecheck.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='rerunfilecheck'>
+ <name>rerunfilecheck</name>
+ <caption>Checksum based rerun checks on auxiliary files.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.8'/>
+ <description>
+ The package provides additional rerun warnings if some
+ auxiliary files have changed. It is based on MD5 checksum,
+ provided by pdfTeX.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/rerunfilecheck.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/rerunfilecheck.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2009/12/10 v1.0}
+% \item
+% The first version.
+% \end{Version}
+% \begin{Version}{2009/12/12 v1.1}
+% \item
+% Short info shortened.
+% \end{Version}
+% \begin{Version}{2009/12/18 v1.2}
+% \item
+% Required date for package \xpackage{uniquecounter} updated
+% because of bug in this package.
+% \end{Version}
+% \begin{Version}{2010/01/25 v1.3}
+% \item
+% Moved from \texttt{TDS:*/generic/*} to \texttt{TDS:*/latex/*}.
+% \end{Version}
+% \begin{Version}{2010/02/22 v1.4}
+% \item
+% The options of this package are recognized only if they are
+% package options. Global options are ignored. This avoids
+% name clashes with class and other package options
+% (for example, class option `index=totoc').
+% \end{Version}
+% \begin{Version}{2010/03/15 v1.5}
+% \item
+% Call of \cs{pdffivesum} is wrapped in \cs{IfFileExists} to avoid
+% calls of \textsf{mktextex} if this feature is enabled.
+% However \cs{IfFileExists} has file name limitations.
+% \end{Version}
+% \begin{Version}{2010/03/16 v1.6}
+% \item
+% Reverted to version 1.4 and \cs{IfFileExists} wrapper of
+% version 1.5 is removed.
+% \end{Version}
+% \begin{Version}{2011/04/15 v1.7}
+% \item
+% Using \cs{AtEndAfterFileList} of package \xpackage{atveryend}
+% 2011/04/15 v1.6 instead of \cs{AtVeryEndDocument}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.8}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/rerunfilecheck.pdf b/macros/latex/contrib/oberdiek/rerunfilecheck.pdf
new file mode 100644
index 0000000000..b92f959320
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/rerunfilecheck.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/resizegather.dtx b/macros/latex/contrib/oberdiek/resizegather.dtx
new file mode 100644
index 0000000000..07bbe0f133
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/resizegather.dtx
@@ -0,0 +1,1041 @@
+% \iffalse meta-comment
+%
+% File: resizegather.dtx
+% Version: 2016/05/16 v1.3
+% Info: Resize overly large equations
+%
+% Copyright (C) 2009, 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file resizegather.dtx
+% and the derived files
+% resizegather.sty, resizegather.pdf, resizegather.ins, resizegather.drv,
+% resizegather-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/resizegather.dtx
+% CTAN:macros/latex/contrib/oberdiek/resizegather.pdf
+%
+% Unpacking:
+% (a) If resizegather.ins is present:
+% tex resizegather.ins
+% (b) Without resizegather.ins:
+% tex resizegather.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{resizegather.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If resizegather.drv is present:
+% latex resizegather.drv
+% (b) Without resizegather.drv:
+% latex resizegather.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 resizegather.dtx
+% makeindex -s gind.ist resizegather.idx
+% pdflatex resizegather.dtx
+% makeindex -s gind.ist resizegather.idx
+% pdflatex resizegather.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/resizegather.sty
+% TDS:doc/latex/oberdiek/resizegather.pdf
+% TDS:doc/latex/oberdiek/test/resizegather-test1.tex
+% TDS:source/latex/oberdiek/resizegather.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: resizegather 2016/05/16 v1.3 Resize overly large equations (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: resizegather
+Version: 2016/05/16 v1.3
+
+Copyright (C) 2009, 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file resizegather.dtx
+and the derived files
+ resizegather.sty, resizegather.pdf, resizegather.ins, resizegather.drv,
+ resizegather-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{resizegather.ins}{\from{resizegather.dtx}{install}}%
+ \file{resizegather.drv}{\from{resizegather.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{resizegather.sty}{\from{resizegather.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{resizegather-test1.tex}{\from{resizegather.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{resizegather.xml}{\from{resizegather.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{* resizegather.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `resizegather.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{resizegather.drv}%
+ [2016/05/16 v1.3 Resize overly large equations (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{ifluatex}
+\ifluatex
+\else
+ \usepackage[T1]{fontenc}%
+ \usepackage{textcomp}%
+ \usepackage{lmodern}%
+\fi
+\begin{document}
+ \DocInput{resizegather.dtx}%
+\end{document}
+%</driver>
+% \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{resizegather.drv}
+%
+% \title{The \xpackage{resizegather} package}
+% \date{2016/05/16 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Equations that are too large are resized to fit the available
+% space. The environment \textsf{gather} of package \xpackage{amsmath}
+% is supported. Also the environments \textsf{equation} and
+% \textsf{displaymath} are redefined using \textsf{gather}
+% and its starred version.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \makeatletter
+% \def\env#1{^^A
+% \textsf{\@env#1*\@nil}^^A
+% }%
+% \def\@env#1*#2\@nil{^^A
+% #1^^A
+% \ifx\\#2\\^^A
+% \expandafter\@gobble
+% \else
+% \textasteriskcentered
+% \expandafter\@firstofone
+% \fi
+% {\@env#2\@nil}^^A
+% }
+% \makeatother
+%
+% \section{Documentation}
+%
+% Sometimes an equation is just a little to large to fit in the
+% line. And breaking the equation across lines might be worse
+% than downscaling the equation. This package implements this
+% for the environments \env{gather} and \env{gather*} of
+% package \xpackage{amsmath}. That package already measures
+% the equations and simplifies the implementation of \xpackage{resizegather}
+% that only needs to hook into \xpackage{amsmath}'s code to add
+% the resizing feature.
+%
+% Resized equations are recorded in the \xext{log} file
+% for small exceeds (default setting is smaller than five percent).
+% Otherwise a warning is given.
+%
+% Also environments \env{equation} and \env{displaymath}
+% are supported by redefining them using \env{gather}
+% and \env{gather*}.
+%
+% \cs{[} and \cs{]} are not supported, because these macros
+% are not in environment form that is required for
+% \xpackage{amsmath}. The environment body is collected
+% first to be able to process the body twice for measuring
+% first.
+%
+% Also the environments using alignments are not supported.
+% If a single equation line would be resized, the alignment
+% would get lost. And resizing all equations of the alignment
+% does not seem appropriate either.
+%
+% \subsection{Options}
+%
+% \begin{description}
+% \item[\xoption{warningthreshold}:]
+% Print a warning if the original equation line exceeds
+% its available width by the given fraction.
+% Default is |0.05|: A warning is given if the equation
+% is too large by five percent.
+% Otherwise the exceed is recorded in the \xext{log} file
+% only.
+% \end{description}
+% The next options are boolean options. They are enabled
+% by value |true| or if no value is given. They are switched
+% off by value |false|.
+% \begin{description}
+% \item[\xoption{enable}:] The resize feature is active (default).
+% \item[\xoption{disable}:] The complementary option for \xoption{enable},
+% added for convenience: |disable| (or |disable=true|) is the same
+% as |enable=false|.
+% \item[\xoption{equations}:]
+% \LaTeX\ environments \textsf{equation} and \textsf{displaymath}
+% environments are redefined. These equations
+% are now using environment \env{gather} and
+% \env{gather*}. This is the default.
+% \end{description}
+% The following table shows additional options if you
+% want to have finer control for the redefined
+% environments:
+% \begin{quote}
+% \def\unchanged{\textit{unchanged}}
+% \def\notprovided{\textit{not provided}}
+% \begin{tabular}{l|ll}
+% &\multicolumn{2}{c}{Environments}\\
+% Option & \env{equation} & \env{displaymath}\\
+% \hline
+% \xoption{equations} & \env{gather} & \env{gather*}\\
+% \xoption{equation} & \env{gather} & \unchanged\\
+% \xoption{displaymath} & \unchanged & \env{gather*}\\
+% \end{tabular}
+% \end{quote}
+% If such an option is switched off, the original meaning
+% of the affected environments is restored.
+%
+% Options are evaluated in the following order:
+% \begin{enumerate}
+% \item
+% Configuration file \xfile{resizegather.cfg} using \cs{resizegathersetup}
+% if the file exists.
+% \item
+% Package options given for \cs{usepackage}.
+% \item
+% Later calls of \cs{resizegathersetup}.
+% \end{enumerate}
+% \begin{declcs}{resizegathersetup}\M{option list}
+% \end{declcs}
+% The options are key value options. Boolean options are enabled by
+% default (without value) or by using the explicit value \texttt{true}.
+% Value \texttt{false} disable the option.
+%
+% \subsection{Options for packages \xpackage{amsmath} or \xpackage{graphics}}
+%
+% The package loads the package \xpackage{amsmath} because is internally
+% measures the equations first. Thus this package hooks into this code
+% in order to resize the equations if they are too large.
+% The resizing itself is done by \cs{resizebox} of package \xpackage{graphics}.
+% If you need special options for these packages, just load them first or
+% use global options when appropriate. Example:
+% \begin{quote}
+%\begin{verbatim}
+%\usepackage[dvipdfm]{graphicx}% or graphics
+%\usepackage[fleqn]{amsmath}
+%\usepackage{resizegather}
+%\end{verbatim}
+%\end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% 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@resizegather.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{resizegather}{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@resizegather.sty\endcsname
+\ProvidesPackage{resizegather}%
+ [2016/05/16 v1.3 Resize overly large equations (HO)]%
+% \end{macrocode}
+%
+% \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 ResizeGather@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\ResizeGather@AtEnd{%
+ \ResizeGather@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{36}{3}% $
+\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{59}{12}% ;
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{63}{12}% ?
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^ (superscript)
+\TMP@EnsureCode{96}{12}% `
+\edef\ResizeGather@AtEnd{\ResizeGather@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{kvoptions}[2009/12/04]
+\SetupKeyvalOptions{%
+ family=resizegather,%
+ prefix=ResizeGather@,%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\@for\ResizeGather@option:=%
+ centertags,%
+ tbtags,%
+ sumlimits,%
+ nosumlimits,%
+ intlimits,%
+ nointlimits,%
+ nonamelimits,%
+ leqno,%
+ reqno,%
+ fleqn%
+\do{%
+ \edef\ResizeGather@temp{%
+ \noexpand\DeclareVoidOption{\ResizeGather@option}{%
+ \noexpand\PassOptionsToPackage{amsmath}{\ResizeGather@option}%
+ }%
+ \noexpand\AtEndOfPackage{%
+ \noexpand\DisableKeyvalOption[%
+ action=error,%
+ package=resizegather,%
+ ]{resizegather}{\ResizeGather@option}%
+ }%
+ }%
+ \ResizeGather@temp
+}
+\@for\ResizeGather@option:=%
+ draft,%
+ final,%
+ hiderotate,%
+ hidescale,%
+ hiresbb,%
+ demo,%
+ dvips,xdvi,dvipdf,dvipdfm,dvipdfmx,pdftex,dvipsone,%
+ dviwindo,emtex,dviwin,pctexps,pctexwin,pctexhp,pctex32,%
+ truetex,tcidvi,vtex,oztex,textures,xetex%
+\do{%
+ \edef\ResizeGather@temp{%
+ \noexpand\DeclareVoidOption{\ResizeGather@option}{%
+ \noexpand\PassOptionsToPackage{graphics}{\ResizeGather@option}%
+ }%
+ \noexpand\AtEndOfPackage{%
+ \noexpand\DisableKeyvalOption[%
+ action=error,%
+ package=resizegather,%
+ ]{resizegather}{\ResizeGather@option}%
+ }%
+ }%
+ \ResizeGather@temp
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareBoolOption[true]{enable}
+\DeclareComplementaryOption{disable}{enable}
+\DeclareStringOption[.05]{warningthreshold}
+\newif\ifResizeGather@NeedInit
+\DeclareBoolOption[true]{equations}
+\DeclareBoolOption[true]{equation}
+\DeclareBoolOption[true]{displaymath}
+\AddToKeyvalOption*{equations}{%
+ \ResizeGather@NeedInittrue
+ \ifResizeGather@equations
+ \ResizeGather@equationtrue
+ \ResizeGather@displaymathtrue
+ \else
+ \ResizeGather@equationfalse
+ \ResizeGather@displaymathfalse
+ \fi
+}
+\AddToKeyvalOption*{equation}{%
+ \ResizeGather@NeedInittrue
+}
+\AddToKeyvalOption*{displaymath}{%
+ \ResizeGather@NeedInittrue
+}
+% \end{macrocode}
+%
+% \begin{macro}{\resizegathersetup}
+% \begin{macrocode}
+\newcommand*{\resizegathersetup}[1]{%
+ \ResizeGather@NeedInitfalse
+ \setkeys{resizegather}{#1}%
+ \ifResizeGather@NeedInit
+ \ResizeGather@init
+ \fi
+}
+\let\ResizeGather@init\relax
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\InputIfFileExists{resizegather.cfg}{}{}%
+\ProcessKeyvalOptions*\relax
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{amsmath}
+\RequirePackage{graphics}
+% \end{macrocode}
+% \begin{macro}{\ResizeGather@redefine}
+% \begin{macrocode}
+\def\ResizeGather@redefine#1#2#3#4#5{%
+ \csname ifResizeGather@#1\endcsname
+ \@ifundefined{ResizeGather@org@#2}{%
+ \expandafter\let\csname ResizeGather@org@#2\expandafter\endcsname
+ \csname #2\endcsname
+ }{}%
+ \@ifundefined{ResizeGather@org@#3}{%
+ \expandafter\let\csname ResizeGather@org@#3\expandafter\endcsname
+ \csname #3\endcsname
+ }{}%
+ \expandafter\edef\csname #2\endcsname{%
+ \expandafter\noexpand\csname#4\endcsname
+ }%
+ \expandafter\edef\csname #3\endcsname{%
+ \expandafter\noexpand\csname#5\endcsname
+ }%
+ \else
+ \@ifundefined{ResizeGather@org@#2}{}{%
+ \expandafter\let\csname #2\expandafter\endcsname
+ \csname ResizeGather@org@#2\endcsname
+ \expandafter\let\csname #3\expandafter\endcsname
+ \csname ResizeGather@org@#3\endcsname
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ResizeGather@init}
+% \begin{macrocode}
+\def\ResizeGather@init{%
+ \ResizeGather@redefine{equation}{equation}{endequation}%
+ {gather}{endgather}%
+ \ResizeGather@redefine{displaymath}{displaymath}{enddisplaymath}%
+ {gather*}{endgather*}%
+}
+\ResizeGather@init
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ResizeGather@ResizeGather}
+% \begin{macrocode}
+\def\ResizeGather@ResizeGather{%
+ \ifResizeGather@enable
+ \dimen@\displaywidth
+ \if@fleqn
+ \advance\dimen@-\@mathmargin
+ \fi
+ \ifdim\wdz@>\dimen@
+ \begingroup
+ \advance\dimen@ -\wdz@
+ \dimen@ -\dimen@
+ \ifdim\ResizeGather@warningthreshold\wdz@>\dimen@
+ \expandafter\PackageInfo
+ \else
+ \expandafter\PackageWarning
+ \fi
+ {resizegather}{%
+ Equation line \the\row@\space is too large %
+ by \the\dimen@\MessageBreak
+ in environment `\@currenvir'%
+ }%
+ \endgroup
+ \setboxz@h to\dimen@{%
+ \resizebox{\dimen@}{!}{\boxz@}%
+ \hss
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\calc@shift@gather}
+% \begin{macrocode}
+\expandafter\def\expandafter\calc@shift@gather\expandafter{%
+ \expandafter\ResizeGather@ResizeGather
+ \calc@shift@gather
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ResizeGather@org@gmeasure@}
+% \begin{macrocode}
+\let\ResizeGather@org@gmeasure@\gmeasure@
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\gmeasure@}
+% \begin{macrocode}
+\def\gmeasure@#1{%
+ \ResizeGather@org@gmeasure@{#1}%
+ \ifResizeGather@enable
+ \ifdim\totwidth@>\displaywidth
+ \totwidth@=\displaywidth
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ResizeGather@AtEnd%
+%</package>
+% \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 resizegather.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/resizegather}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/resizegather.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/resizegather.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[\CTAN{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 resizegather.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@{}}
+% resizegather.sty & tex/latex/oberdiek/resizegather.sty\\
+% resizegather.pdf & doc/latex/oberdiek/resizegather.pdf\\
+% test/resizegather-test1.tex & doc/latex/oberdiek/test/resizegather-test1.tex\\
+% resizegather.dtx & source/latex/oberdiek/resizegather.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk resizegather.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{resizegather.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 resizegather.dtx
+%makeindex -s gind.ist resizegather.idx
+%pdflatex resizegather.dtx
+%makeindex -s gind.ist resizegather.idx
+%pdflatex resizegather.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{resizegather.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='resizegather'>
+ <name>resizegather</name>
+ <caption>Automatically resize overly large equations.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2009,2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ Equations that are too large are resized to fit the available
+ space. The environment &#x2018;gather&#x2019; of package
+ <xref refid='amsmath'>amsmath</xref> is supported. Also the
+ environments &#x2018;equation&#x2019; and
+ &#x2018;displaymath&#x2019; are redefined using
+ &#x2018;gather&#x2019; and its starred version.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/resizegather.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/resizegather.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \section{Acknowledgement}
+%
+% \begin{description}
+% \item[Dieter Jurzitza:]
+% He wanted the resizing feature at the \TeX\ table
+% in Karlsruhe of December 2009. Thus this package is a kind of
+% Christmas present.
+% \end{description}
+%
+% \begin{History}
+% \begin{Version}{2009/12/04 v1.0}
+% \item
+% The first version.
+% \end{Version}
+% \begin{Version}{2009/12/05 v1.1}
+% \item
+% Options \xoption{enable} and \xoption{disable} added.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.2}
+% \item
+% TDS location moved from `generic' to `latex'.
+% \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/resizegather.pdf b/macros/latex/contrib/oberdiek/resizegather.pdf
new file mode 100644
index 0000000000..5095ae202b
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/resizegather.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/rotchiffre.dtx b/macros/latex/contrib/oberdiek/rotchiffre.dtx
new file mode 100644
index 0000000000..004dd3245b
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/rotchiffre.dtx
@@ -0,0 +1,1416 @@
+% \iffalse meta-comment
+%
+% File: rotchiffre.dtx
+% Version: 2016/05/16 v1.1
+% Info: Perform simple rotation ciphers
+%
+% Copyright (C) 2010 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 rotchiffre.dtx
+% and the derived files
+% rotchiffre.sty, rotchiffre.pdf, rotchiffre.ins, rotchiffre.drv,
+% rotchiffre-test1.tex, rotchiffre-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/rotchiffre.dtx
+% CTAN:macros/latex/contrib/oberdiek/rotchiffre.pdf
+%
+% Unpacking:
+% (a) If rotchiffre.ins is present:
+% tex rotchiffre.ins
+% (b) Without rotchiffre.ins:
+% tex rotchiffre.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{rotchiffre.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If rotchiffre.drv is present:
+% latex rotchiffre.drv
+% (b) Without rotchiffre.drv:
+% latex rotchiffre.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 rotchiffre.dtx
+% makeindex -s gind.ist rotchiffre.idx
+% pdflatex rotchiffre.dtx
+% makeindex -s gind.ist rotchiffre.idx
+% pdflatex rotchiffre.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/rotchiffre.sty
+% TDS:doc/latex/oberdiek/rotchiffre.pdf
+% TDS:doc/latex/oberdiek/test/rotchiffre-test1.tex
+% TDS:doc/latex/oberdiek/test/rotchiffre-test2.tex
+% TDS:source/latex/oberdiek/rotchiffre.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: rotchiffre 2016/05/16 v1.1 Perform simple rotation ciphers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: rotchiffre
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2010 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 rotchiffre.dtx
+and the derived files
+ rotchiffre.sty, rotchiffre.pdf, rotchiffre.ins, rotchiffre.drv,
+ rotchiffre-test1.tex, rotchiffre-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{rotchiffre.ins}{\from{rotchiffre.dtx}{install}}%
+ \file{rotchiffre.drv}{\from{rotchiffre.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{rotchiffre.sty}{\from{rotchiffre.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{rotchiffre-test1.tex}{\from{rotchiffre.dtx}{test1}}%
+% \file{rotchiffre-test2.tex}{\from{rotchiffre.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{rotchiffre.xml}{\from{rotchiffre.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{* rotchiffre.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `rotchiffre.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{rotchiffre.drv}%
+ [2016/05/16 v1.1 Perform simple rotation ciphers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{rotchiffre}[2016/05/16]
+\usepackage{wasysym}
+\begin{document}
+ \DocInput{rotchiffre.dtx}%
+\end{document}
+%</driver>
+% \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{rotchiffre.drv}
+%
+% \title{The \xpackage{rotchiffre} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package implements chiffres ROT13 with its variants
+% ROT5, ROT18, and ROT47.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Motivation}
+%
+% In the newsgroup \xnewsgroup{comp.text.tex} there was a discussion
+% \cite{fontspecthread}
+% about package \xpackage{fontspec}. Stephan Hennig provided
+% an example to implement ROT13 as OpenType feature \cite{rot13modern}.
+% And Robin Fairbairns requested a CTAN upload \cite{rot13robin} \smiley.
+%
+% But I think it would be not fair to the users of old \TeX\ engines
+% without OpenType support that they will not be able to
+% decrypt texts generated by the new package \smiley.
+% Therefore I have written this package that implements ROT13
+% even for \iniTeX. Also other variants ROT5, ROT18, ROT47 are
+% provided.
+%
+% \subsection{Usage}
+%
+% \begin{declcs}{EdefRot} \M{type} \M{cmd} \M{text}
+% \end{declcs}
+% The \meta{text} is expanded and sanitized. All tokens
+% are letters with catcode 12 (other) with the exeption of
+% the space token that has character code 32 (0x20) and
+% catcode 10 (space). This follows \hologo{TeX}'s convention of
+% \cs{string} and \cs{meaning}.
+%
+% The chiffre type is specified by \meta{type} it takes
+% a number. For example, ROT13 is specified by |13|.
+% The selected chiffre is applied to \meta{text} and
+% the result is stored in macro \meta{cmd}.
+%
+% The following table lists the supported rotation chiffres.
+% \begin{center}
+% \renewcommand*{\arraystretch}{1.2}
+% \begin{tabular}{lll}
+% chiffre & from & to\\
+% \hline
+% \textbf{ROT13} & |A|-|Z| & |N|-|Z|\,|A|-|M|\\
+% & |a|-|z| & |n|-|z|\,|a|-|m|\\
+% \hline
+% \textbf{ROT5} & |0|-|9| & |5|-|9|\,|0|-|4|\\
+% \hline
+% \textbf{ROT18} & |A|-|Z|\,|0|-|9| & |S|-|Z|\,|0|-|9|\,|A|-|R|\\
+% & |a|-|z| & |n|-|z|\,|a|-|m|\\
+% \hline
+% \textbf{ROT47} & |!|-|~| & |P|-|~|\,|!|-|O|\\
+% \end{tabular}
+% \end{center}
+% In case of ROT47 the range is the ASCII range from character codes
+% 33 (0x21) `|!|' upto 126 (0xFE) `|~|'.
+%
+% The specifications of the algorithms are taken from the description
+% in Wikipedia \cite{wiki:rot13:de,wiki:rot13:en}, ROT18 is further
+% specified by ``computerfreak'' \cite{cf:rot18}.
+%
+% \subsubsection{Examples}
+%
+% The famous English pangram \cite{lazydog} is converted by
+% \begin{quote}
+% |\EdefRot{13}\result{The quick brown fox jumps over the lazy dog}|
+% \end{quote}
+% The result is stored in macro \cs{result} with
+% the following contents:
+% \begin{quote}
+% \EdefRot{13}\result{The quick brown fox jumps over the lazy dog}
+% \texttt{\result}
+% \end{quote}
+%
+% Command names are converted to strings before. Therefore the
+% text should not contain \hologo{TeX} markup, example:
+% \begin{quote}
+% \def\Input{Hello\par World}
+% \EdefRot{13}\result\Input
+% |\EdefRot{13}\result{\texttt{Hello}\par\textit{World}}|\\
+% \cs{result} $\rightarrow$ \texttt{\result}
+% \end{quote}
+% But macros can be used that contain text. They are expanded.
+% \begin{quote}
+% \def\Name{Heiko}
+% \def\Email{heiko.oberdiek at googlemail.com}
+% \EdefRot{13}\result{Hello \Name\space<\Email>}
+% |\newcommand{\Name}{Heiko}|\\
+% |\newcommand{\Email}{heiko.oberdiek at googlemail.com}|\\
+% |\EdefRot{13}\result{Hello \Name\space<\Email>}|\\
+% \cs{result} $\rightarrow$ \texttt{\result}
+% \end{quote}
+%
+%
+% \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@rotchiffre.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{rotchiffre}{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@rotchiffre.sty\endcsname
+\ProvidesPackage{rotchiffre}%
+ [2016/05/16 v1.1 Perform simple rotation ciphers (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 RotCh@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\RotCh@AtEnd{%
+ \RotCh@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\RotCh@AtEnd{\RotCh@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Loading resources}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+ \input ltxcmds.sty\relax
+ \input pdfescape.sty\relax
+\else
+ \RequirePackage{infwarerr}[2010/04/08]%
+ \RequirePackage{ltxcmds}[2010/03/01]%
+ \RequirePackage{pdfescape}[2010/03/01]%
+\fi
+% \end{macrocode}
+%
+% \subsection{\cs{EdefRot} as robust macro}
+%
+% The main macro \cs{EdefRot} is made robust if
+% \hologo{eTeX} or \hologo{LaTeX} are present.
+% \begin{macro}{\EdefRot}
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \ltx@IfUndefined{DeclareRobustCommand}{%
+ \def\RotCh@temp{\def\EdefRot##1}%
+ }{%
+ \def\RotCh@temp{\DeclareRobustCommand*\EdefRot[1]}%
+ }%
+}{%
+ \def\RotCh@temp{\protected\def\EdefRot##1}%
+}
+\RotCh@temp{%
+ \RotCh@GetNumber{#1}%
+ \ltx@IfUndefined{RotCh@rot@\romannumeral\RotCh@number}{%
+ \@PackageError{rotchiffre}{%
+ Unknown chiffre ROT\RotCh@number
+ }\@ehc
+ \EdefSanitize
+ }{%
+ \RotCh@rot
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\RotCh@GetNumber}
+% If \hologo{eTeX} is active, then
+% the chiffre number can be an expression supported
+% by \cs{numexpr}.
+% \begin{macrocode}
+\ltx@IfUndefined{numexpr}{%
+ \def\RotCh@GetNumber#1{%
+ \edef\RotCh@number{\number#1}%
+ }%
+}{%
+ \def\RotCh@GetNumber#1{%
+ \edef\RotCh@number{\the\numexpr#1\relax}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Set \cs{lccode} on a range of characters}
+%
+% \begin{macro}{\RotCh@count}
+% \begin{macrocode}
+\countdef\RotCh@count=255 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\RotCh@count@end}
+% \begin{macrocode}
+\countdef\RotCh@count@end=2 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{RotCh@RangeIgnore}
+% \begin{macrocode}
+\def\RotCh@RangeIgnore{%
+ \RotCh@loop{%
+ \lccode\RotCh@count=\ltx@zero
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\RotCh@RangeSet}
+% \begin{macrocode}
+\ltx@IfUndefined{numexpr}{%
+ \countdef\RotCh@count@temp=4 %
+ \def\RotCh@RangeSet#1{%
+ \RotCh@loop{%
+ \RotCh@count@temp=\RotCh@count
+ \advance\RotCh@count@temp #1 %
+ \lccode\RotCh@count=\RotCh@count@temp
+ }%
+ }%
+}{%
+ \def\RotCh@RangeSet#1{%
+ \RotCh@loop{%
+ \lccode\RotCh@count=\numexpr\RotCh@count#1\relax
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\RotCh@loop}
+% \begin{macrocode}
+\def\RotCh@loop#1#2#3{%
+ \RotCh@count=#2 %
+ \RotCh@count@end=#3 %
+ \def\RotCh@action{#1}%
+ \RotCh@@loop
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{RotCh@@loop}
+% \begin{macrocode}
+\def\RotCh@@loop{%
+ \RotCh@action
+ \ifnum\RotCh@count<\RotCh@count@end
+ \advance\RotCh@count\ltx@one
+ \expandafter\RotCh@@loop
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Chiffres}
+%
+% \subsubsection{ROT13}
+%
+% \begin{macro}{\RotCh@rot@xiii}
+% \begin{macrocode}
+\def\RotCh@rot@xiii{%
+ \RotCh@RangeIgnore{0}{64}%
+ \RotCh@RangeSet{+13}{65}{77}%
+ \RotCh@RangeSet{-13}{78}{90}%
+ \RotCh@RangeIgnore{91}{96}%
+ \RotCh@RangeSet{+13}{97}{109}%
+ \RotCh@RangeSet{-13}{110}{122}%
+ \RotCh@RangeIgnore{123}{255}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{ROT5}
+%
+% \begin{macro}{\RotCh@rot@v}
+% \begin{macrocode}
+\def\RotCh@rot@v{%
+ \RotCh@RangeIgnore{0}{47}%
+ \RotCh@RangeSet{+5}{48}{52}%
+ \RotCh@RangeSet{-5}{53}{57}%
+ \RotCh@RangeIgnore{58}{255}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{ROT18}
+%
+% \begin{macro}{\RotCh@rot@xviii}
+% \begin{macrocode}
+\def\RotCh@rot@xviii{%
+ \RotCh@RangeIgnore{0}{47}%
+ \RotCh@RangeSet{+25}{48}{57}%
+ \RotCh@RangeIgnore{58}{64}%
+ \RotCh@RangeSet{+18}{65}{72}%
+ \RotCh@RangeSet{-25}{73}{82}%
+ \RotCh@RangeSet{-18}{83}{90}%
+ \RotCh@RangeIgnore{91}{96}%
+ \RotCh@RangeSet{+13}{97}{109}%
+ \RotCh@RangeSet{-13}{110}{122}%
+ \RotCh@RangeIgnore{123}{255}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{ROT47}
+%
+% \begin{macro}{\RotCh@rot@xlvii}
+% \begin{macrocode}
+\def\RotCh@rot@xlvii{%
+ \RotCh@RangeIgnore{0}{32}%
+ \RotCh@RangeSet{+47}{33}{79}%
+ \RotCh@RangeSet{-47}{80}{126}%
+ \RotCh@RangeIgnore{127}{255}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{RotCh@rot} with big char support}
+%
+% Some modern \hologo{TeX} engines support characters with more
+% than eight bits (codes greater as 255). \hologo{LuaTeX} and
+% \hologo{XeTeX} are detected by the caret notation that is
+% extended by these engines.
+% \begin{macrocode}
+\begingroup
+ \catcode0=9 %
+ \catcode`\^=7 %
+ \catcode`\^^^=12 %
+ \def\x{^^^^0000}%
+\expandafter\endgroup
+\ifx\x\ltx@empty
+% \end{macrocode}
+%
+% \begin{macro}{\RotCh@toks}
+% \begin{macrocode}
+ \toksdef\RotCh@toks=0 %
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\RotCh@rot}
+% \begin{macrocode}
+ \long\def\RotCh@rot#1#2{%
+ \EdefSanitize#1{#2}%
+ \begingroup
+ \csname RotCh@rot@\romannumeral\RotCh@number\endcsname
+ \RotCh@toks={}%
+ \expandafter\RotCh@SplitSpace#1 \@nil
+ \expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{%
+ \the\RotCh@toks
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\RotCh@SplitSpace}
+% \begin{macrocode}
+ \def\RotCh@temp#1{%
+ \def\RotCh@SplitSpace##1 ##2\@nil{%
+ \RotCh@Add##1\relax
+ \ifx\relax##2\relax
+ \expandafter\ltx@gobble
+ \else
+ \RotCh@toks\expandafter{\the\RotCh@toks#1}%
+ \expandafter\ltx@firstofone
+ \fi
+ {%
+ \RotCh@SplitSpace##2\@nil
+ }%
+ }%
+ }%
+ \RotCh@temp{ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\RotCh@Add}
+% \begin{macrocode}
+ \def\RotCh@Add#1{%
+ \ifx#1\relax
+ \else
+ \ifnum`#1>126 %
+ \RotCh@toks\expandafter{\the\RotCh@toks#1}%
+ \else
+ \lowercase{%
+ \RotCh@toks\expandafter{\the\RotCh@toks#1}%
+ }%
+ \fi
+ \expandafter\RotCh@Add
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% \subsection{\cs{RotCh@rot} without big char support}
+%
+% \begin{macro}{\RotCh@rot}
+% \begin{macrocode}
+ \long\def\RotCh@rot#1#2{%
+ \EdefSanitize#1{#2}%
+ \begingroup
+ \csname RotCh@rot@\romannumeral\RotCh@number\endcsname
+ \lowercase\expandafter{\expandafter\endgroup
+ \expandafter\def\expandafter#1\expandafter{#1}%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RotCh@AtEnd%
+%</package>
+% \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 rotchiffre.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \subsubsection{Preamble}
+%
+% \begin{macrocode}
+%<*test2>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\^=7 %
+\font\rmfont=ec-lmtt10\relax
+\rmfont
+\showboxbreadth=10000 %
+\showboxdepth=10000 %
+\errorcontextlines=10000
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input rotchiffre.sty\relax
+\else
+ \RequirePackage{rotchiffre}[2016/05/16]%
+ \RequirePackage{ifluatex}[2010/03/01]%
+ \RequirePackage{ifxetex}[2010/09/12]%
+\fi
+\catcode`\@=11 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname @onelevel@sanitize\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname detokenize\endcsname\relax
+ \def\strip@prefix#1->{}%
+ \def\@onelevel@sanitize#1{%
+ \edef#1{%
+ \expandafter\strip@prefix\meaning#1%
+ }%
+ }%
+ \else
+ \def\@onelevel@sanitize#1{%
+ \edef#1{%
+ \detokenize\expandafter{#1}%
+ }%
+ }%
+ \fi
+\fi
+\def\msg#{\immediate\write16}
+\def\empty{}
+\begingroup
+ \def\x#1{%
+ \def\space{#1}%
+ \def\spacesII{#1#1}%
+ \def\spacesIII{#1#1#1}%
+ \def\spacesIV{#1#1#1#1}%
+ }%
+\expandafter\endgroup\x{ }
+% \end{macrocode}
+% \begin{macrocode}
+\def\PrintStr#1#2{%
+ \begingroup
+ \@onelevel@sanitize#2%
+ \msg{#1: [#2]}% hash-ok
+ \endgroup
+}
+\def\CheckResult{%
+ \PrintStr{Result}\StrResult
+ \ifx\StrExpect\StrResult
+ \msg{==> Ok}%
+ \else
+ \begingroup
+ \edef\x{\endgroup
+ \errmessage{Test failed (\chiffre)!}%
+ }\x
+ \fi
+}
+\long\def\test#1#2{%
+ \msg{}%
+ \begingroup
+ \setbox0=\hbox{%
+ \edef\StrInput{#1}%
+ \@onelevel@sanitize\StrInput
+ \PrintStr{ Input}\StrInput
+ \edef\StrExpect{#2}%
+ \@onelevel@sanitize\StrExpect
+ \PrintStr{Expect}\StrExpect
+ \action{#1}%
+ \CheckResult
+ }%
+ \ifdim\wd0=0pt %
+ \else
+ \showbox0 %
+ \fi
+ \endgroup
+}
+\def\cmd#1{%
+ \msg{* CMD: ROT#1}%
+ \def\chiffre{ROT#1}%
+ \def\action{\EdefRot{#1}\StrResult}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\TestIgnore#1{%
+ \test{#1}{#1}%
+}
+\begingroup
+ \lccode`\P=`\%%
+ \lccode`\B=`\\%
+ \lccode`\H=`\#%
+\lowercase{\endgroup
+ \def\PercentChar{P}%
+ \def\BackslashChar{B}%
+ \def\HashChar{H}%
+}
+\def\TestI{%
+ \TestIgnore{%
+ \space!"\HashChar$\PercentChar&'()*+,-./%
+ :;<=>?@%
+ [\BackslashChar]^_`%
+ \string{|\string}\string~%
+ }%
+}
+\begingroup
+ \catcode0=12 %
+ \lccode`A=1 %
+ \lccode`B=2 %
+ \lccode`C=3 %
+ \lccode`D=4 %
+ \lccode`E=5 %
+ \lccode`F=6 %
+ \lccode`G=7 %
+ \lccode`H=8 %
+ \lccode`I=9 %
+ \lccode`J=10 %
+ \lccode`K=11 %
+ \lccode`L=12 %
+ \lccode`M=13 %
+ \lccode`N=14 %
+ \lccode`O=15 %
+ \lccode`P=16 %
+ \lccode`Q=17 %
+ \lccode`R=18 %
+ \lccode`S=19 %
+ \lccode`T=20 %
+ \lccode`U=21 %
+ \lccode`V=22 %
+ \lccode`W=23 %
+ \lccode`X=24 %
+ \lccode`Y=25 %
+ \lccode`Z=26 %
+ \lccode`a=27 %
+ \lccode`b=28 %
+ \lccode`c=29 %
+ \lccode`d=30 %
+ \lccode`e=31 %
+ \lccode`f=127 %
+ \lccode`g=128 %
+ \lccode`h=129 %
+ \lccode`y=254 %
+ \lccode`z=255 %
+\lowercase{\endgroup
+ \def\TestC{%
+ \TestIgnore{%
+ ^^@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefhyz%
+ }%
+ }%
+ \def\TestZ{%
+ \TestIgnore{^^@}%
+ }%
+}
+% \end{macrocode}
+%
+% \subsubsection{ROT13}
+%
+% \begin{macrocode}
+\cmd{13}
+\test{%
+ 0123456789%
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ%
+ abcdefghijklmnopqrstuvwxyz%
+}{%
+ 0123456789%
+ NOPQRSTUVWXYZABCDEFGHIJKLM%
+ nopqrstuvwxyzabcdefghijklm%
+}
+\TestI
+\TestC
+\test{}{}
+\test{A}{N}
+\test{N}{A}
+\test{ }{ }
+\test{0a}{0n}
+\test{\spacesIV}{\spacesIV}
+\test{{}}{{}}
+\test{\par}{\noexpand\cne}
+% \end{macrocode}
+%
+% \subsubsection{ROT5}
+%
+% \begin{macrocode}
+\cmd{5}
+\test{%
+ 0123456789%
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ%
+ abcdefghijklmnopqrstuvwxyz%
+}{%
+ 5678901234%
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ%
+ abcdefghijklmnopqrstuvwxyz%
+}
+\TestI
+\TestC
+% \end{macrocode}
+%
+% \subsubsection{ROT18}
+%
+% \begin{macrocode}
+\cmd{18}
+\test{%
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%
+ abcdefghijklmnopqrstuvwxyz%
+}{%
+ STUVWXYZ0123456789ABCDEFGHIJKLMNOPQR%
+ nopqrstuvwxyzabcdefghijklm%
+}
+\TestI
+\TestC
+% \end{macrocode}
+%
+% \subsubsection{ROT47}
+%
+% \begin{macrocode}
+\cmd{47}
+\test{%
+ !"\HashChar$\PercentChar&'()*+,-./%
+ 0123456789%
+ :;<=>?@%
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ%
+ [\BackslashChar]^_`%
+ abcdefghijklmnopqrstuvwxyz%
+ \string{|\string}\string~%
+}{%
+ PQRSTUVWXYZ%
+ [\BackslashChar]^_`%
+ abcdefghijklmnopqrstuvwxyz%
+ \string{|\string}\string~%
+ !"\HashChar$\PercentChar&'()*+,-./%
+ 0123456789%
+ :;<=>?@%
+ ABCDEFGHIJKLMNO%
+}
+\TestZ
+\TestC
+% \end{macrocode}
+%
+% \subsubsection{Big chars}
+%
+% \begin{macrocode}
+\chardef\temp=0 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname XeTeXrevision\endcsname\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ifluatex.sty\relax
+ \else
+ \RequirePackage{ifluatex}[2010/03/01]%
+ \fi
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname luatexversion\endcsname\relax
+ \else
+ \chardef\temp=1 %
+ \fi
+\else
+ \chardef\temp=1 %
+\fi
+\ifcase\temp
+ \csname @@end\expandafter\endcsname\expandafter\end
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\msg{* Big chars}
+\cmd{5}
+\test{}{}
+\test{ }{ }
+\test{ 0 1 }{ 5 6 }
+\begingroup
+ \lccode`A=300 %
+ \lccode`B=1000 %
+ \lccode`C=10000 %
+\lowercase{\endgroup
+ \TestIgnore{ABC}%
+ \TestIgnore{x A By zC xAy AxB}%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\csname @@end\endcsname\end
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/rotchiffre}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/rotchiffre.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/rotchiffre.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[\CTAN{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 rotchiffre.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@{}}
+% rotchiffre.sty & tex/generic/oberdiek/rotchiffre.sty\\
+% rotchiffre.pdf & doc/latex/oberdiek/rotchiffre.pdf\\
+% test/rotchiffre-test1.tex & doc/latex/oberdiek/test/rotchiffre-test1.tex\\
+% test/rotchiffre-test2.tex & doc/latex/oberdiek/test/rotchiffre-test2.tex\\
+% rotchiffre.dtx & source/latex/oberdiek/rotchiffre.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk rotchiffre.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{rotchiffre.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 rotchiffre.dtx
+%makeindex -s gind.ist rotchiffre.idx
+%pdflatex rotchiffre.dtx
+%makeindex -s gind.ist rotchiffre.idx
+%pdflatex rotchiffre.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{rotchiffre.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='rotchiffre'>
+ <name>rotchiffre</name>
+ <caption>Perform simple rotation cyphers.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2010'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ The package defines a command <tt>\EdefRot</tt> that defines a
+ macro (whose name is given as an argument) to the rotation of the
+ given string. Available rotations are <tt>ROT13</tt> (for
+ letters), <tt>ROT5</tt> (for digits), <tt>ROT18</tt> (for digits
+ and letters together) and <tt>ROT47</tt> (for all ASCII
+ characters).
+ <p/>
+ The package is part of the
+ <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/rotchiffre.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/rotchiffre.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \raggedright
+%
+% \bibitem{fontspecthread}
+% Stephan Hennig et.\,al.:
+% \textit{fontspec: no ligatures with Times New Roman};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:4cdbed27$0$6765$9b4e6d93@newsspool3.arcor-online.net},
+% 2010-11-11.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/browse_thread/thread/6266f98e998ce333/d7b32e9dcc610c87}}
+%
+% \bibitem{rot13modern}
+% Stephan Hennig:
+% \textit{Re: fontspec: no ligatures with Times New Roman};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:4cdc2abe$0$6762$9b4e6d93@newsspool3.arcor-online.net},
+% 2010-11-11.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/d7b32e9dcc610c87}}
+%
+% \bibitem{rot13robin}
+% Robin Fairbairns:
+% \textit{Re: fontspec: no ligatures with Times New Roman};
+% newsgroup \xnewsgroup{comp.text.tex},
+% \url{news:qf4obmua0v.fsf@sxp10.cl.cam.ac.uk},
+% 2010-11-12.\\
+% {\small
+% \url{http://groups.google.com/group/comp.text.tex/msg/7c03e91407144704}}
+%
+% \bibitem{wiki:rot13:de}
+% Wikipedia/German:
+% \textit{ROT13};
+% 2010-10-26.
+% {\small
+% \url{http://de.wikipedia.org/wiki/ROT13}}
+%
+% \bibitem{wiki:rot13:en}
+% Wikipedia/English:
+% \textit{ROT13};
+% 2010-11-11.
+% {\small
+% \url{http://en.wikipedia.org/wiki/ROT13}}
+%
+% \bibitem{cf:rot18}
+% Computerfreak/German: \textit{ROT-18};
+% 2010-04-12.\\
+% {\small
+% \url{http://www.compufreak.info/2010/04/12/rot-18/}}
+%
+% \bibitem{lazydog}
+% Wikipedia/English: \textit{The quick brown fox jumps over the lazy dog};
+% 2010-11-09.\\
+% {\small
+% \url{http://en.wikipedia.org/wiki/The_quick_brown_fox_jumps_over_the_lazy_dog}}
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2010/11/12 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/rotchiffre.pdf b/macros/latex/contrib/oberdiek/rotchiffre.pdf
new file mode 100644
index 0000000000..28a7c33fe7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/rotchiffre.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/scrindex.dtx b/macros/latex/contrib/oberdiek/scrindex.dtx
new file mode 100644
index 0000000000..07578c4285
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/scrindex.dtx
@@ -0,0 +1,777 @@
+% \iffalse meta-comment
+%
+% File: scrindex.dtx
+% Version: 2016/05/16 v1.2
+% Info: Package index with KOMA-Script classes
+%
+% Copyright (C) 2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file scrindex.dtx
+% and the derived files
+% scrindex.sty, scrindex.pdf, scrindex.ins, scrindex.drv,
+% scrindex-example1.tex, scrindex-example2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/scrindex.dtx
+% CTAN:macros/latex/contrib/oberdiek/scrindex.pdf
+%
+% Unpacking:
+% (a) If scrindex.ins is present:
+% tex scrindex.ins
+% (b) Without scrindex.ins:
+% tex scrindex.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{scrindex.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If scrindex.drv is present:
+% latex scrindex.drv
+% (b) Without scrindex.drv:
+% latex scrindex.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 scrindex.dtx
+% makeindex -s gind.ist scrindex.idx
+% pdflatex scrindex.dtx
+% makeindex -s gind.ist scrindex.idx
+% pdflatex scrindex.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/scrindex.sty
+% TDS:doc/latex/oberdiek/scrindex.pdf
+% TDS:doc/latex/oberdiek/scrindex-example1.tex
+% TDS:doc/latex/oberdiek/scrindex-example2.tex
+% TDS:source/latex/oberdiek/scrindex.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: scrindex 2016/05/16 v1.2 Package index with KOMA-Script classes (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: scrindex
+Version: 2016/05/16 v1.2
+
+Copyright (C) 2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file scrindex.dtx
+and the derived files
+ scrindex.sty, scrindex.pdf, scrindex.ins, scrindex.drv,
+ scrindex-example1.tex, scrindex-example2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{scrindex.ins}{\from{scrindex.dtx}{install}}%
+ \file{scrindex.drv}{\from{scrindex.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{scrindex.sty}{\from{scrindex.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{scrindex-example1.tex}{\from{scrindex.dtx}{example1}}%
+ \file{scrindex-example2.tex}{\from{scrindex.dtx}{example2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{scrindex.xml}{\from{scrindex.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{* scrindex.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `scrindex.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{scrindex.drv}%
+ [2016/05/16 v1.2 Package index with KOMA-Script classes (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{calc}
+\begin{document}
+ \DocInput{scrindex.dtx}%
+\end{document}
+%</driver>
+% \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{scrindex.drv}
+%
+% \title{The \xpackage{scrindex} package}
+% \date{2016/05/16 v1.2}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package redefines environment `theindex' of package \xpackage{index},
+% if a class from KOMA-Script is loaded. Also option \xoption{idxtotoc}
+% is supported. Index preambles can be given either by means of package
+% \xpackage{index} or via the interface provided by KOMA-Script.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% Package \xpackage{index}, written by David M.\ Jones, detects
+% the standard classes |article|, |report|, and |book|. It
+% redefines environment `theindex' for its needs.
+% However, it does not know other classes such as KOMA-Script.
+% This package closes the compatibiliy gap between KOMA-Script's
+% classes and package \xpackage{index}.
+%
+% Environment |theindex| is redefined to support both package
+% \xpackage{index} and KOMA-Script's classes. Thus both
+% the prologe of package \xpackage{index} and the preamble
+% of KOMA-Script's classes are available. Also class option |idxtotoc|
+% of KOMA-Script is supported.
+%
+% \subsection{Usage}
+%
+% The package \xpackage{scrindex} is loaded without options:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage{scrindex}
+%\end{verbatim}
+%\end{quote}
+%
+% It loads package \xpackage{index} and requests version 2004/01/20
+% or later. \LaTeX's package interface allows multiple calls
+% of the same package. The package is loaded at its first
+% package loading command. At later times \LaTeX\ only checks
+% options and a requested version date. Therefore it does not harm
+% to add |\usepackage{index}| before or after |\usepackage{scrindex}|.
+%
+% Also the class does not matter. Environment |theindex| is only
+% redefined for a supported class:
+% \begin{itemize}
+% \item |scrartcl|
+% \item |scrreprt|
+% \item |scrbook|
+% \end{itemize}
+%
+% \subsection{Preambles}
+%
+% Both the prologue of package \xpackage{index} and the preamble
+% of KOMA-Script's classes are supported. The position depends on
+% the class.
+%
+% \subsubsection{Class \xclass{scrartcl}}
+%
+% \begin{macrocode}
+%<*example1>
+\documentclass{scrartcl}
+\usepackage{scrindex}
+\setindexpreamble{Preamble of \texttt{scrartcl}\dotfill EOL}
+\makeindex
+\begin{document}
+\section{First Section}
+\index{first}
+\index{section}
+\printindex[default]%
+ [Prologue of package \texttt{index}\dotfill EOL]%
+\end{document}
+%</example1>
+% \end{macrocode}
+% The prologue of package \xpackage{index} is first set straight
+% after the section title spanning both columns.
+% Then the preamble of KOMA-Script follows
+% in the first left column.
+%
+% \medskip
+% \begin{quote}
+% \renewcommand*{\arraystretch}{1.2}
+% \begin{tabular}{|p{.45\linewidth}|p{.45\linewidth}|}
+% \hline
+% \multicolumn{2}{|l|}{\textbf{Index}}\\[1ex]
+% \multicolumn{2}{|p{.9\linewidth+2\tabcolsep}|}{^^A
+% Prologue of package \texttt{index}\dotfill EOL^^A
+% }\\[1ex]
+% \hline
+% Preamble of \texttt{scrartcl}\dotfill EOL&\\
+% first, 1&\\
+% section, 1&\\
+% \hline
+% \end{tabular}
+% \end{quote}
+%
+% \subsubsection{Classes \xclass{scrreprt} and \xclass{scrbook}}
+%
+% \begin{macrocode}
+%<*example2>
+\documentclass[openany]{scrbook}% or scrreprt
+\usepackage{scrindex}
+\setindexpreamble{Preamble of class \texttt{scrbook}\dotfill EOL}
+\makeindex
+\begin{document}
+\chapter{First Chapter}
+\index{first}
+\index{chapter}
+\printindex[default]%
+ [Prologue of package \texttt{index}\dotfill EOL]%
+\end{document}
+%</example2>
+% \end{macrocode}
+% The order of the two preambles are different for the classes
+% \xclass{scrreprt} and \xclass{scrbook}. First KOMA-Script's
+% chapter preamble is set, then the prologue of package \xpackage{index}
+% follows. Both are set spanning both columns.
+%
+% \medskip
+% \begin{quote}
+% \renewcommand*{\arraystretch}{1.2}
+% \begin{tabular}{|p{.45\linewidth}|p{.45\linewidth}|}
+% \hline
+% \multicolumn{2}{|l|}{\textbf{Index}}\\[1ex]
+% \multicolumn{2}{|p{.9\linewidth+2\tabcolsep}|}{^^A
+% Preamble of class \texttt{scrbook}\dotfill EOL^^A
+% }\\
+% \multicolumn{2}{|p{.9\linewidth+2\tabcolsep}|}{^^A
+% Prologue of package \xpackage{index}\dotfill EOL^^A
+% }\\[1ex]
+% \hline
+% chapter, 1&\\
+% first, 1&\\
+% \hline
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{scrindex}
+ [2016/05/16 v1.2 Package index with KOMA-Script classes (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{index}[2004/01/20]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@ifclassloaded{scrartcl}{%
+ \renewenvironment{theindex}{%
+ \edef\indexname{%
+ \the\@nameuse{idxtitle@\@indextype}%
+ }%
+ \if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+ \idx@heading
+ \thispagestyle{\indexpagestyle}%
+ \columnseprule\z@
+ \columnsep 35\p@
+ \index@preamble\par\nobreak
+ \parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \parfillskip\z@ \@plus 1fil\relax
+ \let\item\@idxitem
+ }{%
+ \if@restonecol
+ \onecolumn
+ \else
+ \clearpage
+ \fi
+ }%
+ \@ifclasswith{scrartcl}{idxtotoc}{%
+ \renewcommand*{\idx@heading}{%
+ \twocolumn[%
+ \addsec{\indexname}%
+ \ifx\index@prologue\@empty
+ \else
+ \index@prologue
+ \bigskip
+ \fi
+ ]%
+ \@mkboth{\indexname}{\indexname}%
+ }%
+ }{%
+ \renewcommand*{\idx@heading}{%
+ \twocolumn[%
+ \section*{\indexname}%
+ \ifx\index@prologue\@empty
+ \else
+ \index@prologue
+ \bigskip
+ \fi
+ ]%
+ \@mkboth{\indexname}{\indexname}%
+ }%
+ }%
+}{}
+% \end{macrocode}
+% \begin{macrocode}
+\@ifclassloaded{scrreprt}{%
+ \renewenvironment{theindex}{%
+ \edef\indexname{%
+ \the\@nameuse{idxtitle@\@indextype}%
+ }%
+ \if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+ \setchapterpreamble{\index@preamble}%
+ \idx@heading
+ \thispagestyle{\indexpagestyle}%
+ \columnseprule\z@
+ \columnsep 35\p@
+ \parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \parfillskip\z@ \@plus 1fil\relax
+ \let\item\@idxitem
+ }{%
+ \if@restonecol
+ \onecolumn
+ \else
+ \clearpage
+ \fi
+ }%
+ \@ifclasswith{scrreprt}{idxtotoc}{%
+ \renewcommand*{\idx@heading}{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \twocolumn[%
+ \addchap{\indexname}%
+ \ifx\index@prologue\@empty
+ \else
+ \index@prologue
+ \bigskip
+ \fi
+ ]%
+ \@mkboth{\indexname}{\indexname}%
+ }%
+ }{%
+ \renewcommand*{\idx@heading}{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \twocolumn[%
+ \chapter*{\indexname}%
+ \ifx\index@prologue\@empty
+ \else
+ \index@prologue
+ \bigskip
+ \fi
+ ]%
+ \@mkboth{\indexname}{\indexname}%
+ }%
+ }%
+}{}
+% \end{macrocode}
+% \begin{macrocode}
+\@ifclassloaded{scrbook}{%
+ \renewenvironment{theindex}{%
+ \edef\indexname{%
+ \the\@nameuse{idxtitle@\@indextype}%
+ }%
+ \if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+ \setchapterpreamble{\index@preamble}%
+ \idx@heading
+ \thispagestyle{\indexpagestyle}%
+ \columnseprule\z@
+ \columnsep 35\p@
+ \parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \parfillskip\z@ \@plus 1fil\relax
+ \let\item\@idxitem
+ }{%
+ \if@restonecol
+ \onecolumn
+ \else
+ \clearpage
+ \fi
+ }%
+ \@ifclasswith{scrbook}{idxtotoc}{%
+ \renewcommand*{\idx@heading}{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \twocolumn[%
+ \addchap{\indexname}%
+ \ifx\index@prologue\@empty
+ \else
+ \index@prologue
+ \bigskip
+ \fi
+ ]%
+ \@mkboth{\indexname}{\indexname}%
+ }%
+ }{%
+ \renewcommand*{\idx@heading}{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \twocolumn[%
+ \chapter*{\indexname}%
+ \ifx\index@prologue\@empty
+ \else
+ \index@prologue
+ \bigskip
+ \fi
+ ]%
+ \@mkboth{\indexname}{\indexname}%
+ }%
+ }%
+}{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/scrindex}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/scrindex.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/scrindex.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[\CTAN{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 scrindex.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@{}}
+% scrindex.sty & tex/latex/oberdiek/scrindex.sty\\
+% scrindex.pdf & doc/latex/oberdiek/scrindex.pdf\\
+% scrindex-example1.tex & doc/latex/oberdiek/scrindex-example1.tex\\
+% scrindex-example2.tex & doc/latex/oberdiek/scrindex-example2.tex\\
+% scrindex.dtx & source/latex/oberdiek/scrindex.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk scrindex.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{scrindex.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 scrindex.dtx
+%makeindex -s gind.ist scrindex.idx
+%pdflatex scrindex.dtx
+%makeindex -s gind.ist scrindex.idx
+%pdflatex scrindex.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{scrindex.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='scrindex'>
+ <name>scrindex</name>
+ <caption>Make index package work with Koma-script classes.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.2'/>
+ <description>
+ This package redefines environment `theindex' of package `index',
+ if a class from <xref refid='koma-script'>KOMA-Script</xref> is loaded.
+ Also option `idxtotoc' is supported. Index preambles can be given
+ either by means of package `index' or via the interface provided
+ by <xref refid='koma-script'>KOMA-Script</xref>.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/scrindex.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/scrindex.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2008/07/07 v1.0}
+% \item
+% First version, also published in newsgroup \xnewsgroup{de.comp.text.tex}:\\
+% \URL{``\link{Re: Z\"ahler bei \cs{index}}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/39575b5e2f29be1e}
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.1}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.2}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/scrindex.pdf b/macros/latex/contrib/oberdiek/scrindex.pdf
new file mode 100644
index 0000000000..b12323a8e9
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/scrindex.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/selinput.dtx b/macros/latex/contrib/oberdiek/selinput.dtx
new file mode 100644
index 0000000000..a46b866e5c
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/selinput.dtx
@@ -0,0 +1,1050 @@
+% \iffalse meta-comment
+%
+% File: selinput.dtx
+% Version: 2016/05/17 v1.4
+% Info: Semi-automatic input encoding detection
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file selinput.dtx
+% and the derived files
+% selinput.sty, selinput.pdf, selinput.ins, selinput.drv,
+% selinput-test1.tex, selinput-test2.tex, selinput-test3.tex,
+% selinput-test4.tex, selinput-test5.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/selinput.dtx
+% CTAN:macros/latex/contrib/oberdiek/selinput.pdf
+%
+% Unpacking:
+% (a) If selinput.ins is present:
+% tex selinput.ins
+% (b) Without selinput.ins:
+% tex selinput.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{selinput.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If selinput.drv is present:
+% latex selinput.drv
+% (b) Without selinput.drv:
+% latex selinput.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 selinput.dtx
+% makeindex -s gind.ist selinput.idx
+% pdflatex selinput.dtx
+% makeindex -s gind.ist selinput.idx
+% pdflatex selinput.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/selinput.sty
+% TDS:doc/latex/oberdiek/selinput.pdf
+% TDS:doc/latex/oberdiek/test/selinput-test1.tex
+% TDS:doc/latex/oberdiek/test/selinput-test2.tex
+% TDS:doc/latex/oberdiek/test/selinput-test3.tex
+% TDS:doc/latex/oberdiek/test/selinput-test4.tex
+% TDS:doc/latex/oberdiek/test/selinput-test5.tex
+% TDS:source/latex/oberdiek/selinput.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: selinput 2016/05/17 v1.4 Semi-automatic input encoding detection (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: selinput
+Version: 2016/05/17 v1.4
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file selinput.dtx
+and the derived files
+ selinput.sty, selinput.pdf, selinput.ins, selinput.drv,
+ selinput-test1.tex, selinput-test2.tex, selinput-test3.tex,
+ selinput-test4.tex, selinput-test5.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{selinput.ins}{\from{selinput.dtx}{install}}%
+ \file{selinput.drv}{\from{selinput.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{selinput.sty}{\from{selinput.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{selinput-test1.tex}{\from{selinput.dtx}{test,test1}}%
+% \file{selinput-test2.tex}{\from{selinput.dtx}{test,test2}}%
+% \file{selinput-test3.tex}{\from{selinput.dtx}{test,test3}}%
+% \file{selinput-test4.tex}{\from{selinput.dtx}{test,test4}}%
+% \file{selinput-test5.tex}{\from{selinput.dtx}{test,test5}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{selinput.xml}{\from{selinput.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{* selinput.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `selinput.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{selinput.drv}%
+ [2016/05/17 v1.4 Semi-automatic input encoding detection (HO)]%
+\documentclass{ltxdoc}
+\ifx\Umathcode\undefined
+\usepackage[T1]{fontenc}
+\fi
+\usepackage{textcomp}
+\usepackage{lmodern}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{color}
+\begin{document}
+ \DocInput{selinput.dtx}%
+\end{document}
+%</driver>
+% \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{selinput.drv}
+%
+% \title{The \xpackage{selinput} package}
+% \date{2016/05/17 v1.4}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package selects the input encoding by specifying between
+% input characters and their glyph names.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newcommand*{\EM}{\textcolor{blue}}
+% \newcommand*{\ExampleText}{^^A
+% Umlauts:\ \EM{\"A\"O\"U\"a\"o\"u\ss}^^A
+% }
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% \LaTeX\ supports the direct use of 8-bit characters by means
+% of package \xpackage{inputenc}. However you must know
+% and specify the encoding, e.g.:
+% \begin{quote}
+% \ttfamily
+% |\documentclass{article}|\\
+% |\usepackage[|\EM{latin1}|]{inputenc}|\\
+% |% or \usepackage[|\EM{utf8}|]{inputenc}|\\
+% |% or \usepackage[|\EM{??}|]{inputenc}|\\
+% |\begin{document}|\\
+% | |\ExampleText\\
+% |\end{document}|
+% \end{quote}
+%
+% If the document is transferred in an environment that
+% uses a different encoding, then there are programs that
+% convert the input characters. Examples for conversion
+% of file \xfile{test.tex}
+% from encoding latin1 (ISO-8859-1) to UTF-8:
+% \begin{quote}
+% \ttfamily
+% |recode ISO-8859-1..UTF-8 test.tex|\\
+% |recode latin1..utf8 test.tex|\\
+% |iconv --from-code ISO-8859-1|\\
+% \hphantom{iconv}| --to-code UTF-8|\\
+% \hphantom{iconv}| --output testnew.tex|\\
+% \hphantom{iconv}| test.tex|\\
+% |iconv -f latin1 -t utf8 -o testnew.tex test.tex|
+% \end{quote}
+% However, the encoding name for package \xpackage{inputenc}
+% must be changed:
+% \begin{quote}
+% |\usepackage[latin1]{inputenc}| $\rightarrow$
+% |\usepackage[utf8]{inputenc}|\kern-4pt\relax
+% \end{quote}
+% Of course, unless you are using some clever editor
+% that knows package \xpackage{inputenc}, recodes
+% the file and adjusts the option at the same time.
+% But most editors can perhaps recode the file, but
+% they let the option untouched.
+%
+% Therefore package \xpackage{selinput} chooses another way for
+% specifying the input encoding. The encoding name is not needed
+% at all. Some 8-bit characters are identified by their glyph
+% name and the package chooses an appropriate encoding, example:
+% \begin{quote}
+% \ttfamily
+% |\documentclass{article}|\\
+% |\usepackage{selinput}|\\
+% |\SelectInputMappings{|\\
+% | adieresis={|\EM{\"a}|}|,\\
+% | germandbls={|\EM{\ss}|}|,\\
+% | Euro={|\EM{\texteuro}|}|,\\
+% |}|\\
+% |\begin{document}|\\
+% | |\ExampleText\\
+% |\end{document}|
+% \end{quote}
+%
+% \subsection{User interface}
+%
+% \begin{declcs}{SelectInputEncodingList} \M{encoding list}
+% \end{declcs}
+% \cs{SelectInputEncodingList} expects a comma separated list of
+% encoding names. Example:
+% \begin{quote}
+% |\SelectInputEncodingList{utf8,ansinew,mac-roman}|
+% \end{quote}
+% The encodings of package \xpackage{inputenx} are used as default.
+%
+% \begin{declcs}{SelectInputMappings} \M{mapping pairs}
+% \end{declcs}
+% A mapping pair consists of a glyph name and its input
+% character:
+% \begin{quote}
+% |\SelectInputMappings{|\\
+% | adieresis={|\EM{\"a}|}|,\\
+% | germandbls={|\EM{\ss}|}|,\\
+% | Euro={|\EM{\texteuro}|}|,\\
+% |}|
+% \end{quote}
+% The supported glyph names can be found in file \xfile{ix-name.def}
+% of project \xpackage{inputenx} \cite{inputenx}. The names are
+% basically taken from Adobe's glyphlists \cite{adobe:glyphlist,adobe:aglfn}.
+% As many pairs are needed as necessary to identify the encoding.
+% Example with insufficient pairs:
+% \begin{quote}
+% \ttfamily
+% |\SelectInputEncodingSet{latin1,latin9}|\\
+% |\SelectInputMappings{|\\
+% | adieresis={|\EM{\"a}|}|,\\
+% | germandbls={|\EM{\ss}|}|,\\
+% |}|\\
+% \ExampleText| and Euro: |\EM{\textcurrency} (wrong)
+% \end{quote}
+% The first encoding \xoption{latin1} passes the constraints given
+% by the mapping pairs. However the Euro symbol is not part of
+% the encoding. Thus a mapping pair with the Euro symbol
+% solves the problem. In fact the symbol alone already succeeds in selecting
+% between \xoption{latin1} and \xoption{latin9}:
+% \begin{quote}
+% \ttfamily
+% |\SelectInputEncodingSet{latin1,latin9}|\\
+% |\SelectInputMappings{|\\
+% | Euro={|\EM{\texteuro}|},|\\
+% |}|\\
+% \ExampleText| and Euro: |\EM{\texteuro}
+% \end{quote}
+%
+% \subsection{Options}
+%
+% \begin{description}
+% \item[\xoption{warning}:]
+% The selected encoding is written
+% by \cs{PackageInfo} into the \xfile{.log} file only.
+% Option \xoption{warning} changes it to \cs{PackageWarning}.
+% Then the selected encoding is shown on the terminal as well.
+% \item[\xoption{ucs}:]
+% The encoding file \xfile{utf8x} of package \cs{ucs} requires
+% that the package itself is loaded before.
+% If the package is not loaded, then the option \xoption{ucs}
+% will load package \xpackage{ucs} if the detected encoding is
+% UTF-8 (limited to the preamble, packages cannot be loaded later).
+% \item[\xoption{utf8=\dots}:]
+% The option allows to specify other encoding files
+% for UTF-8 than \LaTeX's \xfile{utf8.def}. For example,
+% |utf8=utf-8| will load \xfile{utf-8.def} instead.
+% \end{description}
+%
+% \subsection{Encodings}
+%
+% Package \xpackage{stringenc} \cite{stringenc}
+% is used for testing the encoding. Thus the encoding
+% name must be known by this package. Then the found
+% encoding is loaded by \cs{inputencoding} by package
+% \xpackage{inputenc} or \cs{InputEncoding} if package
+% \xpackage{inputenx} is loaded.
+%
+% The supported encodings are present in the encoding list,
+% thus usually the encoding names do not matter.
+% If the list is set by \cs{SelectInputEncodingList},
+% then you can use the names that work for package
+% \xpackage{inputenc} and are known by package \xpackage{stringenc},
+% for example: \xoption{latin1}, \xoption{x-iso-8859-1}. Encoding
+% file names of package \xpackage{inputenx} are prefixed with \xfile{x-}.
+% The prefix can be dropped, if package \xpackage{inputenx} is loaded.
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{selinput}
+ [2016/05/17 v1.4 Semi-automatic input encoding detection (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{inputenc}
+\RequirePackage{kvsetkeys}[2006/10/19]
+\RequirePackage{stringenc}[2007/06/16]
+\RequirePackage{kvoptions}
+% \end{macrocode}
+% \begin{macro}{\SelectInputEncodingList}
+% \begin{macrocode}
+\newcommand*{\SelectInputEncodingList}{%
+ \let\SIE@EncodingList\@empty
+ \kvsetkeys{SelInputEnc}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SelectInputMappings}
+% \begin{macrocode}
+\newcommand*{\SelectInputMappings}[1]{%
+ \SIE@LoadNameDefs
+ \let\SIE@StringUnicode\@empty
+ \let\SIE@StringDest\@empty
+ \kvsetkeys{SelInputMap}{#1}%
+ \ifx\\SIE@StringUnicode\SIE@StringDest\\%
+ \PackageError{selinput}{%
+ No mappings specified%
+ }\@ehc
+ \else
+ \EdefUnescapeHex\SIE@StringUnicode\SIE@StringUnicode
+ \let\SIE@Encoding\@empty
+ \@for\SIE@EncodingTest:=\SIE@EncodingList\do{%
+ \ifx\SIE@Encoding\@empty
+ \StringEncodingConvertTest\SIE@temp\SIE@StringUnicode
+ {utf16be}\SIE@EncodingTest{%
+ \ifx\SIE@temp\SIE@StringDest
+ \let\SIE@Encoding\SIE@EncodingTest
+ \fi
+ }{}%
+ \fi
+ }%
+ \ifx\SIE@Encoding\@empty
+ \StringEncodingConvertTest\SIE@temp\SIE@StringDest
+ {ascii}{utf16be}{%
+ \def\SIE@Encoding{ascii}%
+ \SIE@Info{selinput}{%
+ Matching encoding not found, but input characters%
+ \MessageBreak
+ are 7-bit (possibly editor replacements).%
+ \MessageBreak
+ Hence using ascii encoding%
+ }%
+ }{}%
+ \fi
+ \ifx\SIE@Encoding\@empty
+ \PackageError{selinput}{%
+ Cannot find a matching encoding%
+ }\@ehd
+ \else
+ \ifx\SIE@Encoding\SIE@EncodingUTFviii
+ \SIE@LoadUnicodePackage
+ \ifx\SIE@UseUTFviii\@empty
+ \else
+ \let\SIE@Encoding\SIE@UseUTFviii
+ \fi
+ \fi
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname InputEncoding\endcsname\relax
+ \inputencoding\SIE@Encoding
+ \else
+ \InputEncoding\SIE@Encoding
+ \fi
+ \SIE@Info{selinput}{Encoding `\SIE@Encoding' selected}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SIE@LoadNameDefs}
+% \begin{macrocode}
+\def\SIE@LoadNameDefs{%
+ \begingroup
+ \endlinechar=\m@ne
+ \catcode92=0 % backslash
+ \catcode123=1 % left curly brace/beginning of group
+ \catcode125=2 % right curly brace/end of group
+ \catcode37=14 % percent/comment character
+ \@makeother\[%
+ \@makeother\]%
+ \@makeother\.%
+ \@makeother\(%
+ \@makeother\)%
+ \@makeother\/%
+ \@makeother\-%
+ \let\InputenxName\SelectInputDefineMapping
+ \InputIfFileExists{ix-name.def}{}{%
+ \PackageError{selinput}{%
+ Missing `ix-name.def' (part of package `inputenx')%
+ }\@ehd
+ }%
+ \global\let\SIE@LoadNameDefs\relax
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SelectInputDefineMapping}
+% \begin{macrocode}
+\newcommand*{\SelectInputDefineMapping}[1]{%
+ \expandafter\gdef\csname SIE@@#1\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\kv@set@family@handler{SelInputMap}{%
+ \@onelevel@sanitize\kv@key
+ \ifx\kv@value\relax
+ \PackageError{selinput}{%
+ Missing input character for `\kv@key'%
+ }\@ehc
+ \else
+ \@onelevel@sanitize\kv@value
+ \ifx\kv@value\@empty
+ \PackageError{selinput}{%
+ Input character got lost?\MessageBreak
+ Missing input character for `\kv@key'%
+ }\@ehc
+ \else
+ \@ifundefined{SIE@@\kv@key}{%
+ \PackageWarning{selinput}{%
+ Missing definition for `\kv@key'%
+ }%
+ }{%
+ \edef\SIE@StringDest{%
+ \SIE@StringDest
+ \kv@value
+ }%
+ \edef\SIE@StringUnicode{%
+ \SIE@StringUnicode
+ \csname SIE@@\kv@key\endcsname
+ }%
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\kv@set@family@handler{SelInputEnc}{%
+ \@onelevel@sanitize\kv@key
+ \ifx\kv@value\relax
+ \ifx\SIE@EncodingList\@empty
+ \let\SIE@EncodingList\kv@key
+ \else
+ \edef\SIE@EncodingList{\SIE@EncodingList,\kv@key}%
+ \fi
+ \else
+ \@onelevel@sanitize\kv@value
+ \PackageError{selinput}{%
+ Illegal key value pair (\kv@key=\kv@value)\MessagBreak
+ in encoding list%
+ }\@ehc
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macro}{\SIE@LoadUnicodePackage}
+% \begin{macrocode}
+\def\SIE@LoadUnicodePackage{%
+ \@ifpackageloaded\SIE@UnicodePackage{}{%
+ \RequirePackage\SIE@UnicodePackage\relax
+ }%
+ \SIE@PatchUCS
+ \global\let\SIE@LoadUnicodePackage\relax
+}
+\let\SIE@show\show
+\def\SIE@PatchUCS{%
+ \AtBeginDocument{%
+ \expandafter\ifx\csname ver@ucsencs.def\endcsname\relax
+ \else
+ \let\show\SIE@show
+ \fi
+ }%
+}
+\SIE@PatchUCS
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \let\SIE@LoadUnicodePackage\relax
+}
+% \end{macrocode}
+% \begin{macro}{\SIE@EncodingUTFviii}
+% \begin{macrocode}
+\def\SIE@EncodingUTFviii{utf8}
+\@onelevel@sanitize\SIE@EncodingUTFviii
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SIE@EncodingUTFviiix}
+% \begin{macrocode}
+\def\SIE@EncodingUTFviiix{utf8x}
+\@onelevel@sanitize\SIE@EncodingUTFviiix
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\let\SIE@UnicodePackage\@empty
+\let\SIE@UseUTFviii\@empty
+\let\SIE@Info\PackageInfo
+% \end{macrocode}
+% \begin{macrocode}
+\SetupKeyvalOptions{%
+ family=SelInput,%
+ prefix=SelInput@%
+}
+\define@key{SelInput}{utf8}{%
+ \def\SIE@UseUTFviii{#1}%
+ \@onelevel@sanitize\SIE@UseUTFviii
+}
+\DeclareBoolOption{ucs}
+\DeclareVoidOption{warning}{%
+ \let\SIE@Info\PackageWarning
+}
+\ProcessKeyvalOptions{SelInput}
+\ifSelInput@ucs
+ \def\SIE@UnicodePackage{ucs}%
+ \ifx\SIE@UseUTFviii\@empty
+ \let\SIE@UseUTFviii\SIE@EncodingUTFviiix
+ \fi
+\else
+ \ifx\SIE@UseUTFviii\@empty
+ \@ifpackageloaded{ucs}{%
+ \let\SIE@UseUTFviii\SIE@EncodingUTFviiix
+ }{%
+ \let\SIE@UseUTFviii\SIE@EncodingUTFviii
+ }%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\SIE@EncodingList}
+% \begin{macrocode}
+\edef\SIE@EncodingList{%
+ utf8,%
+ x-iso-8859-1,%
+ x-iso-8859-15,%
+ x-cp1252,% ansinew
+ x-mac-roman,%
+ x-iso-8859-2,%
+ x-iso-8859-3,%
+ x-iso-8859-4,%
+ x-iso-8859-5,%
+ x-iso-8859-6,%
+ x-iso-8859-7,%
+ x-iso-8859-8,%
+ x-iso-8859-9,%
+ x-iso-8859-10,%
+ x-iso-8859-11,%
+ x-iso-8859-13,%
+ x-iso-8859-14,%
+ x-iso-8859-15,%
+ x-mac-centeuro,%
+ x-mac-cyrillic,%
+ x-koi8-r,%
+ x-cp1250,%
+ x-cp1251,%
+ x-cp1257,%
+ x-cp437,%
+ x-cp850,%
+ x-cp852,%
+ x-cp855,%
+ x-cp858,%
+ x-cp865,%
+ x-cp866,%
+ x-nextstep,%
+ x-dec-mcs%
+}%
+\@onelevel@sanitize\SIE@EncodingList
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Test}
+%
+% \begin{macrocode}
+%<*test>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{minimal}
+\usepackage{textcomp}
+\usepackage{qstest}
+% \end{macrocode}
+% \begin{macrocode}
+%<*test1|test2|test3>
+\makeatletter
+\let\BeginDocumentText\@empty
+\def\TestEncoding#1#2{%
+ \SelectInputMappings{#2}%
+ \Expect*{\SIE@Encoding}{#1}%
+ \Expect*{\inputencodingname}{#1}%
+ \g@addto@macro\BeginDocumentText{%
+ \SelectInputMappings{#2}%
+ \Expect*{\SIE@Encoding}{#1}%
+ \textbf{\SIE@Encoding:} %
+ \kvsetkeys{test}{#2}\par
+ }%
+}
+\def\TestKey#1#2{%
+ \define@key{test}{#1}{%
+ \sbox0{##1}%
+ \sbox2{#2}%
+ \Expect*{wd:\the\wd0, ht:\the\ht0, dp:\the\dp0}%
+ *{wd:\the\wd2, ht:\the\ht2, dp:\the\dp2}%
+ [#1=##1] % hash-ok
+ }%
+}
+\RequirePackage{keyval}
+\TestKey{adieresis}{\"a}
+\TestKey{germandbls}{\ss}
+\TestKey{Euro}{\texteuro}
+\makeatother
+\usepackage[
+ warning,%
+%<test2> utf8=utf-8,
+%<test3> ucs,
+]{selinput}
+%<test1|test3>\inputencoding{ascii}
+%<test2>\inputencoding{utf-8}
+%<test3>\usepackage{ucs}
+\begin{qstest}{preamble}{}
+ \TestEncoding{x-iso-8859-15}{%
+ adieresis=^^e4,%
+ germandbls=^^df,%
+ Euro=^^a4,%
+ }%
+ \TestEncoding{x-cp1252}{%
+ adieresis=^^e4,%
+ germandbls=^^df,%
+ Euro=^^80,%
+ }%
+%<test1> \TestEncoding{utf8}{%
+%<test2> \TestEncoding{utf-8}{%
+%<test3> \TestEncoding{utf8x}{%
+ adieresis=^^c3^^a4,%
+ germandbls=^^c3^^9f,%
+%<!test2> Euro=^^e2^^82^^ac,
+ }%
+\end{qstest}
+%<test3>\let\ifUnicodeOptiongraphics\iffalse
+\begin{document}
+\begin{qstest}{document}{}
+%<test3>\makeatletter
+ \BeginDocumentText
+\end{qstest}
+%</test1|test2|test3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test4>
+\usepackage[warning,ucs]{selinput}
+\SelectInputMappings{%
+ adieresis=^^c3^^a4,%
+ germandbls=^^c3^^9f,%
+ Euro=^^e2^^82^^ac,%
+}
+\begin{qstest}{encoding}{}
+ \Expect*{\inputencodingname}{utf8x}%
+\end{qstest}
+\begin{document}
+ adieresis=^^c3^^a4, %
+ germandbls=^^c3^^9f, %
+ Euro=^^e2^^82^^ac%
+%</test4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test5>
+\usepackage[warning,ucs]{selinput}
+\SelectInputMappings{%
+ adieresis={\"a},%
+ germandbls={{\ss}},%
+ Euro=\texteuro{},%
+}
+\begin{qstest}{encoding}{}
+ \Expect*{\inputencodingname}{ascii}%
+\end{qstest}
+\begin{document}
+ adieresis={\"a}, %
+ germandbls={{\ss}}, %
+ Euro=\texteuro{}%
+%</test5>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\end{document}
+%</test>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/selinput}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/selinput.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/selinput.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[\CTAN{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 selinput.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@{}}
+% selinput.sty & tex/latex/oberdiek/selinput.sty\\
+% selinput.pdf & doc/latex/oberdiek/selinput.pdf\\
+% test/selinput-test1.tex & doc/latex/oberdiek/test/selinput-test1.tex\\
+% test/selinput-test2.tex & doc/latex/oberdiek/test/selinput-test2.tex\\
+% test/selinput-test3.tex & doc/latex/oberdiek/test/selinput-test3.tex\\
+% test/selinput-test4.tex & doc/latex/oberdiek/test/selinput-test4.tex\\
+% test/selinput-test5.tex & doc/latex/oberdiek/test/selinput-test5.tex\\
+% selinput.dtx & source/latex/oberdiek/selinput.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk selinput.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{selinput.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 selinput.dtx
+%makeindex -s gind.ist selinput.idx
+%pdflatex selinput.dtx
+%makeindex -s gind.ist selinput.idx
+%pdflatex selinput.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{selinput.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='selinput'>
+ <name>selinput</name>
+ <caption>Semi-automatic detection of input encoding.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.4'/>
+ <description>
+ This package selects the input encoding by specifying pairs
+ of input characters and their glyph names.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/selinput.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/selinput.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{inputenx}
+% Heiko Oberdiek: \textit{The \xpackage{inputenx} package};
+% 2007-04-11 v1.1;
+% \CTAN{macros/latex/contrib/oberdiek/inputenx.pdf}.
+%
+% \bibitem{adobe:glyphlist}
+% Adobe: \textit{Adobe Glyph List};
+% 2002-09-20 v2.0;
+% \url{http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt}.
+%
+% \bibitem{adobe:aglfn}
+% Adobe: \textit{Adobe Glyph List For New Fonts};
+% 2005-11-18 v1.5;
+% \url{http://partners.adobe.com/public/developer/en/opentype/aglfn13.txt}.
+%
+% \bibitem{stringenc}
+% Heiko Oberdiek: \textit{The \xpackage{stringenc} package};
+% 2007-06-16 v1.1;
+% \CTAN{macros/latex/contrib/oberdiek/stringenc.pdf}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/06/16 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/06/20 v1.1}
+% \item
+% Requested date for package \xpackage{stringenc} fixed.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.2}
+% \item
+% Line end fixed.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.3}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/05/17 v1.4}
+% \item
+% Documentation updates: Avoid T1 encoding with Unicode \TeX.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/selinput.pdf b/macros/latex/contrib/oberdiek/selinput.pdf
new file mode 100644
index 0000000000..5e4f05ad72
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/selinput.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/setouterhbox.dtx b/macros/latex/contrib/oberdiek/setouterhbox.dtx
new file mode 100644
index 0000000000..ff801efd85
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/setouterhbox.dtx
@@ -0,0 +1,1226 @@
+% \iffalse meta-comment
+%
+% File: setouterhbox.dtx
+% Version: 2016/05/16 v1.8
+% Info: Set hbox in outer horizontal mode
+%
+% Copyright (C) 2005-2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 setouterhbox.dtx
+% and the derived files
+% setouterhbox.sty, setouterhbox.pdf, setouterhbox.ins, setouterhbox.drv,
+% setouterhbox-example.tex, setouterhbox-test1.tex,
+% setouterhbox-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/setouterhbox.dtx
+% CTAN:macros/latex/contrib/oberdiek/setouterhbox.pdf
+%
+% Unpacking:
+% (a) If setouterhbox.ins is present:
+% tex setouterhbox.ins
+% (b) Without setouterhbox.ins:
+% tex setouterhbox.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{setouterhbox.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If setouterhbox.drv is present:
+% latex setouterhbox.drv
+% (b) Without setouterhbox.drv:
+% latex setouterhbox.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 setouterhbox.dtx
+% makeindex -s gind.ist setouterhbox.idx
+% pdflatex setouterhbox.dtx
+% makeindex -s gind.ist setouterhbox.idx
+% pdflatex setouterhbox.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/setouterhbox.sty
+% TDS:doc/latex/oberdiek/setouterhbox.pdf
+% TDS:doc/latex/oberdiek/setouterhbox-example.tex
+% TDS:doc/latex/oberdiek/test/setouterhbox-test1.tex
+% TDS:doc/latex/oberdiek/test/setouterhbox-test2.tex
+% TDS:source/latex/oberdiek/setouterhbox.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: setouterhbox 2016/05/16 v1.8 Set hbox in outer horizontal mode (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: setouterhbox
+Version: 2016/05/16 v1.8
+
+Copyright (C) 2005-2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 setouterhbox.dtx
+and the derived files
+ setouterhbox.sty, setouterhbox.pdf, setouterhbox.ins, setouterhbox.drv,
+ setouterhbox-example.tex, setouterhbox-test1.tex,
+ setouterhbox-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{setouterhbox.ins}{\from{setouterhbox.dtx}{install}}%
+ \file{setouterhbox.drv}{\from{setouterhbox.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{setouterhbox.sty}{\from{setouterhbox.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{setouterhbox-example.tex}{\from{setouterhbox.dtx}{example}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{setouterhbox-test1.tex}{\from{setouterhbox.dtx}{test1}}%
+% \file{setouterhbox-test2.tex}{\from{setouterhbox.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{setouterhbox.xml}{\from{setouterhbox.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{* setouterhbox.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `setouterhbox.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{setouterhbox.drv}%
+ [2016/05/16 v1.8 Set hbox in outer horizontal mode (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{setouterhbox.dtx}%
+\end{document}
+%</driver>
+% \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{setouterhbox.drv}
+%
+% \title{The \xpackage{setouterhbox} package}
+% \date{2016/05/16 v1.8}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% If math stuff is set in an \cs{hbox}, then TeX
+% performs some optimization and omits the implicite
+% penalties \cs{binoppenalty} and \cs{relpenalty}.
+% This packages tries to put stuff into an \cs{hbox}
+% without getting lost of those penalties.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% There is a situation in \xpackage{hyperref}'s driver for dvips
+% where the user wants to have links that can be broken across
+% lines. However dvips doesn't support the feature. With option
+% \xoption{breaklinks} \xpackage{hyperref} sets the links as
+% usual, put them in a box and write the link data with
+% box dimensions into the appropriate \cs{special}s.
+% Then, however, it does not set the complete unbreakable
+% box, but it unwrappes the material inside to allow line
+% breaks. Of course line breaking and glue setting will falsify
+% the link dimensions, but line breaking was more important
+% for the user.
+%
+% \subsection{Acknowledgement}
+%
+% Jonathan Fine, Donald Arsenau and me discussed the problem
+% in the newsgroup \xnewsgroup{comp.text.tex} where Damian
+% Menscher has started the thread, see \cite{newsstart}.
+%
+% The discussion was productive and generated many ideas
+% and code examples. In order to have a more permanent
+% result I wrote this package and tried to implement
+% most of the ideas, a kind of summary of the discussion.
+% Thus I want and have to thank Jonathan Fine and Donald Arsenau
+% very much.
+%
+% Two weeks later David Kastrup (posting in
+% \xnewsgroup{comp.text.tex}, \cite{kastrup})
+% remembered an old article of Michael Downes (\cite{downes})
+% in TUGboat, where Michael Downes already presented the
+% method we discuss here. Nowadays we have \eTeX\ that extends
+% the tool set of a \TeX\ macro programmer. Especially useful
+% \eTeX\ was in this package for detecting and dealing with
+% errorneous situations.
+%
+% However also nowadays a perfect solution for the problem
+% is still missing at macro level. Probably someone has
+% to go deep in the internals of the \TeX\ compiler to
+% implement a switch that let penalties stay where otherwise
+% \TeX\ would remove them for optimization reasons.
+%
+% \subsection{Usage}
+%
+% \paragraph{Package loading.}
+% \LaTeX: as usually:
+% \begin{quote}
+% |\usepackage{setouterhbox}|
+% \end{quote}
+% The package can also be included directly, thus \plainTeX\ users
+% write:
+% \begin{quote}
+% |\input setouterhbox.sty|
+% \end{quote}
+%
+% \paragraph{Register allocation.}
+% The material will be put into a box, thus we need to know these
+% box number. If you need to allocate a new box register:
+% \begin{description}
+% \item[\LaTeX:] |\newsavebox{\|\meta{name}|}|
+% \item[\plainTeX:] |\newbox\|\meta{name}
+% \end{description}
+% Then |\|\meta{name} is a command that held the box number.
+%
+% \paragraph{Box wrapping.}
+% \LaTeX\ users put the material in the box with an environment
+% similar to \texttt{lrbox}. The environment \texttt{setouterhbox}
+% uses the same syntax and offers the same features, such
+% as verbatim stuff inside:
+% \begin{quote}
+% |\begin{setouterhbox}{|\meta{box number}|}|\dots
+% |\end{setouterhbox}|
+% \end{quote}
+% Users with \plainTeX\ do not have environments, they use instead:
+% \begin{quote}
+% |\setouterhbox{|\meta{box number}|}|\dots|\endsetouterhbox|
+% \end{quote}
+% In both cases the material is put into an \cs{hbox} and assigned
+% to the given box, denoted by \meta{box number}. Note the
+% assignment is local, the same way \texttt{lrbox} behaves.
+%
+% \paragraph{Unwrapping.}
+% The box material is ready for unwrapping:
+% \begin{quote}
+% |\unhbox|\meta{box number}
+% \end{quote}
+%
+% \subsection{Option \xoption{hyperref}}
+%
+% Package url uses math mode for typesetting urls.
+% Break points are inserted by \cs{binoppenalty} and
+% \cs{relpenalty}. Unhappily these break points are
+% removed, if \xpackage{hyperref}
+% is used with option {breaklinks}
+% and drivers that depend on \xoption{pdfmark}:
+% \xoption{dvips}, \xoption{vtexpdfmark}, \xoption{textures},
+% and \xoption{dvipsone}.
+% Thus the option \xoption{hyperref} enables the method
+% of this package to avoid the removal of \cs{relpenalty}
+% and \cs{binoppenalty}. Thus you get more break points.
+% However, the link areas are still wrong for these
+% drivers, because they are not supporting broken
+% links.
+%
+% Note, you need version 2006/08/16 v6.75c of package \xpackage{hyperref},
+% because starting with this version the necessary hook is provided
+% that package \xpackage{setouterhbox} uses.
+% \begin{quote}
+% |\usepackage[|\dots|]{hyperref}[2006/08/16]|\\
+% |\usepackage[hyperref]{setouterhbox}|
+% \end{quote}
+% Package order does not matter.
+%
+% \subsection{Example}
+%
+% \begin{macrocode}
+%<*example>
+\documentclass[a5paper]{article}
+\usepackage{url}[2005/06/27]
+\usepackage{setouterhbox}
+
+\newsavebox{\testbox}
+
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{2em}
+
+\begin{document}
+\raggedright
+
+\url{http://this.is.a.very.long.host.name/followed/%
+by/a/very_long_long_long_path.html}%
+
+\sbox\testbox{%
+ \url{http://this.is.a.very.long.host.name/followed/%
+ by/a/very_long_long_long_path.html}%
+}%
+\unhbox\testbox
+
+\begin{setouterhbox}{\testbox}%
+ \url{http://this.is.a.very.long.host.name/followed/%
+ by/a/very_long_long_long_path.html}%
+\end{setouterhbox}
+\unhbox\testbox
+
+\end{document}
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% Internal macros are prefixed by \cs{setouterhbox}, |@| is
+% not used inside names, thus we do not need to care of its
+% catcode if we are not using it as \LaTeX\ package.
+%
+% \subsection{Package start stuff}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% Prevent reloading more than one, necessary for \plainTeX:
+% 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@setouterhbox.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{setouterhbox}{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@setouterhbox.sty\endcsname
+\ProvidesPackage{setouterhbox}%
+ [2016/05/16 v1.8 Set hbox in outer horizontal mode (HO)]%
+% \end{macrocode}
+%
+% \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 setouterhboxAtEnd\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\setouterhboxAtEnd{%
+ \setouterhboxAtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{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{96}{12}% `
+\edef\setouterhboxAtEnd{\setouterhboxAtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Interface macros}
+%
+% \begin{macro}{\setouterhboxBox}
+% The method requires a global box assignment. To be on the
+% safe side, a new box register is allocated for this
+% global box assignment.
+% \begin{macrocode}
+\newbox\setouterhboxBox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setouterhboxFailure}
+% Error message for both \plainTeX\ and \LaTeX
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+\else
+ \RequirePackage{infwarerr}[2016/05/16]%
+\fi
+\edef\setouterhboxFailure#1#2{%
+ \expandafter\noexpand\csname @PackageError\endcsname
+ {setouterhbox}{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Main part}
+%
+% eTeX provides much better means for checking
+% error conditions. Thus lines marked by "E" are executed
+% if eTeX is available, otherwise the lines marked by "T" are
+% used.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname lastnodetype\endcsname\relax
+ \catcode`T=9 % ignore
+ \catcode`E=14 % comment
+\else
+ \catcode`T=14 % comment
+ \catcode`E=9 % ignore
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\setouterhboxRemove}
+% Remove all kern, glue, and penalty nodes;
+% poor man's version, if \eTeX\ is not available
+% \begin{macrocode}
+\def\setouterhboxRemove{%
+E \ifnum\lastnodetype<11 %
+E \else
+E \ifnum\lastnodetype>13 %
+E \else
+ \unskip\unkern\unpenalty
+E \expandafter\expandafter\expandafter\setouterhboxRemove
+E \fi
+E \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setouterhbox}
+% Passing the box contents by macro parameter would prevent
+% catcode changes in the box contents like by \cs{verb}.
+% Also \cs{bgroup} and \cs{egroup} does not work, because stuff
+% has to be added at the begin and end of the box, thus
+% the syntax
+% |\setouterhbox{|\meta{box number}|}|\dots|\endsetouterhbox|
+% is used. Also we automatically get an environment \texttt{setouterhbox}
+% if \LaTeX\ is used.
+% \begin{macrocode}
+\def\setouterhbox#1{%
+ \begingroup
+ \def\setouterhboxNum{#1}%
+ \setbox0\vbox\bgroup
+T \kern.123pt\relax % marker
+T \kern0pt\relax % removed by \setouterhboxRemove
+ \begingroup
+ \everypar{}%
+ \noindent
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\endsetouterhbox}
+% Most of the work is done in the end part, thus the heart of
+% the method follows:
+% \begin{macrocode}
+\def\endsetouterhbox{%
+ \endgroup
+% \end{macrocode}
+% Omit the first pass to get the penalties
+% of the second pass.
+% \begin{macrocode}
+ \pretolerance-1 %
+% \end{macrocode}
+% We don't want a third pass with \cs{emergencystretch}.
+% \begin{macrocode}
+ \tolerance10000 %
+ \hsize\maxdimen
+% \end{macrocode}
+% Line is not underfull:
+% \begin{macrocode}
+ \parfillskip 0pt plus 1filll\relax
+ \leftskip0pt\relax
+% \end{macrocode}
+% Suppress underful \cs{hbox} warnings,
+% is explicit line breaks are used.
+% \begin{macrocode}
+ \rightskip0pt plus 1fil\relax
+ \everypar{}%
+% \end{macrocode}
+% Ensure that there is a paragraph and
+% prevents \cs{endgraph} from eating terminal glue:
+% \begin{macrocode}
+ \kern0pt%
+ \endgraf
+ \setouterhboxRemove
+E \ifnum\lastnodetype=1 %
+E \global\setbox\setouterhboxBox\lastbox
+E \loop
+E \setouterhboxRemove
+E \ifnum\lastnodetype=1 %
+E \setbox0=\lastbox
+E \global\setbox\setouterhboxBox=\hbox{%
+E \unhbox0 %
+% \end{macrocode}
+% Remove \cs{rightskip}, a penalty with -10000 is part of the previous line.
+% \begin{macrocode}
+E \unskip
+E \unhbox\setouterhboxBox
+E }%
+E \repeat
+E \else
+E \setouterhboxFailure{%
+E Something is wrong%
+E }{%
+E Could not find expected line.%
+E \MessageBreak
+E (\string\lastnodetype: \number\lastnodetype, expected: 1)%
+E }%
+E \fi
+E \setouterhboxRemove
+T \global\setbox\setouterhboxBox\lastbox
+T \loop
+T \setouterhboxRemove
+T \setbox0=\lastbox
+T \ifcase\ifvoid0 1\else0\fi
+T \global\setbox\setouterhboxBox=\hbox{%
+T \unhbox0 %
+% \end{macrocode}
+% Remove \cs{rightskip}, a penalty with -10000 is part of the previous line.
+% \begin{macrocode}
+T \unskip
+T \unhbox\setouterhboxBox
+T }%
+T \repeat
+T \ifdim.123pt=\lastkern
+T \else
+T \setouterhboxFailure{%
+T Something is wrong%
+T }{%
+T Unexpected stuff was detected before the line.%
+T }%
+T \fi
+T \egroup
+T \ifcase \ifnum\wd0=0 \else 1\fi
+T \ifdim\ht0=.123pt \else 1\fi
+T \ifnum\dp0=0 \else 1\fi
+T 0 %
+E \ifnum\lastnodetype=-1 %
+% \end{macrocode}
+% There was just one line that we have caught.
+% \begin{macrocode}
+ \else
+ \setouterhboxFailure{%
+ Something is wrong%
+ }{%
+ After fetching the line there is more unexpected stuff.%
+E \MessageBreak
+E (\string\lastnodetype: \number\lastnodetype, expected: -1)%
+ }%
+ \fi
+E \egroup
+ \expandafter\endgroup
+ \expandafter\setouterhboxFinish\expandafter{%
+ \number\setouterhboxNum
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Environment support}
+%
+% Check \cs{@currenvir} for the case that \cs{setouterhbox}
+% was called as environment. Then the box assignment
+% must be put after the \cs{endgroup} of |\end{|\dots|}|.
+% \begin{macrocode}
+\def\setouterhboxCurr{setouterhbox}
+\def\setouterhboxLast#1{%
+ \setbox#1\hbox{%
+ \unhbox\setouterhboxBox
+ \unskip % remove \rightskip glue
+ \unskip % remove \parfillskip glue
+ \unpenalty % remove paragraph ending \penalty 10000
+ \unkern % remove explicit kern inserted above
+ }%
+}
+% \end{macrocode}
+% \begin{macro}{\setouterhboxFinish}
+% |#1| is an explicit number.
+% \begin{macrocode}
+\def\setouterhboxFinish#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname @currenvir\endcsname\setouterhboxCurr
+ \aftergroup\setouterhboxLast
+ \aftergroup{%
+ \setouterhboxAfter #1\NIL
+ \aftergroup}%
+ \else
+ \setouterhboxLast{#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setouterhboxAfter}
+% |#1| is an explicit number.
+% \begin{macrocode}
+\def\setouterhboxAfter#1#2\NIL{%
+ \aftergroup#1%
+ \ifx\\#2\\%
+ \else
+ \setouterhboxReturnAfterFi{%
+ \setouterhboxAfter#2\NIL
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setouterhboxReturnAfterFi}
+% A utility macro to get tail recursion.
+% \begin{macrocode}
+\long\def\setouterhboxReturnAfterFi#1\fi{\fi#1}
+% \end{macrocode}
+% \end{macro}
+% Restore catcodes we have need to distinguish between
+% the implementation with and without \eTeX.
+% \begin{macrocode}
+\catcode69=11\relax % E
+\catcode84=11\relax % T
+% \end{macrocode}
+%
+% \subsection{Option \xoption{hyperref}}
+% \begin{macrocode}
+\begingroup
+ \def\x{LaTeX2e}%
+\expandafter\endgroup
+\ifx\x\fmtname
+\else
+ \expandafter\setouterhboxAtEnd
+\fi%
+% \end{macrocode}
+% \begin{macro}{\Hy@setouterhbox}
+% \cs{Hy@setouterhbox} is the internal hook that \xpackage{hyperref}
+% uses since 2006/02/12 v6.75a.
+% \begin{macrocode}
+\DeclareOption{hyperref}{%
+ \long\def\Hy@setouterhbox#1#2{%
+ \setouterhbox{#1}#2\endsetouterhbox
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setouterhboxAtEnd%
+%</package>
+% \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 setouterhbox.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Test with package \xpackage{url}}
+%
+% \begin{macrocode}
+%<*test2>
+\nofiles
+\documentclass[a5paper]{article}
+\usepackage{url}[2005/06/27]
+\usepackage{setouterhbox}
+
+\newsavebox{\testbox}
+
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{2em}
+
+\begin{document}
+\raggedright
+
+\url{http://this.is.a.very.long.host.name/followed/%
+by/a/very_long_long_long_path.html}%
+
+\sbox\testbox{%
+ \url{http://this.is.a.very.long.host.name/followed/%
+ by/a/very_long_long_long_path.html}%
+}%
+\unhbox\testbox
+
+\begin{setouterhbox}{\testbox}%
+ \url{http://this.is.a.very.long.host.name/followed/%
+ by/a/very_long_long_long_path.html}%
+\end{setouterhbox}
+\unhbox\testbox
+
+\end{document}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/setouterhbox}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/setouterhbox.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/setouterhbox.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[\CTAN{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 setouterhbox.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@{}}
+% setouterhbox.sty & tex/generic/oberdiek/setouterhbox.sty\\
+% setouterhbox.pdf & doc/latex/oberdiek/setouterhbox.pdf\\
+% setouterhbox-example.tex & doc/latex/oberdiek/setouterhbox-example.tex\\
+% test/setouterhbox-test1.tex & doc/latex/oberdiek/test/setouterhbox-test1.tex\\
+% test/setouterhbox-test2.tex & doc/latex/oberdiek/test/setouterhbox-test2.tex\\
+% setouterhbox.dtx & source/latex/oberdiek/setouterhbox.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk setouterhbox.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{setouterhbox.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 setouterhbox.dtx
+%makeindex -s gind.ist setouterhbox.idx
+%pdflatex setouterhbox.dtx
+%makeindex -s gind.ist setouterhbox.idx
+%pdflatex setouterhbox.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{setouterhbox.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='setouterhbox'>
+ <name>setouterhbox</name>
+ <caption>Set hbox in outer horizontal mode.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2005-2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.8'/>
+ <description>
+ If math stuff is set in an <tt>\hbox</tt>, then TeX
+ performs some optimization and omits the implicit
+ penalties <tt>\binoppenalty</tt> and <tt>\relpenalty</tt>.
+ This packages tries to put stuff into an <tt>\hbox</tt>
+ without losing those penalties.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/setouterhbox.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/setouterhbox.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{newsstart}
+% Damian Menscher, \Newsgroup{comp.text.tex},
+% \textit{overlong lines in List of Figures},
+% \nolinkurl{<dh058t$qbd$1@news.ks.uiuc.edu>},
+% 23rd September 2005.
+% \url{http://groups.google.com/group/comp.text.tex/msg/79648d4cf1f8bc13}
+%
+% \bibitem{kastrup}
+% David Kastrup, \Newsgroup{comp.text.tex},
+% \textit{Re: ANN: outerhbox.sty -- collect horizontal material,
+% for unboxing into a paragraph},
+% \nolinkurl{<85y855lrx3.fsf@lola.goethe.zz>},
+% 7th October 2005.
+% \url{http://groups.google.com/group/comp.text.tex/msg/7cf0a345ef932e52}
+%
+% \bibitem{downes}
+% Michael Downes, \textit{Line breaking in \cs{unhbox}ed Text},
+% TUGboat 11 (1990), pp. 605--612.
+%
+% \bibitem{hyperref}
+% Sebastian Rahtz, Heiko Oberdiek:
+% \textit{The \xpackage{hyperref} package};
+% 2006/08/16 v6.75c;
+% \CTAN{macros/latex/contrib/hyperref/}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2005/10/05 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2005/10/07 v1.1}
+% \item
+% Option \xoption{hyperref} added.
+% \end{Version}
+% \begin{Version}{2005/10/18 v1.2}
+% \item
+% Support for explicit line breaks added.
+% \end{Version}
+% \begin{Version}{2006/02/12 v1.3}
+% \item
+% DTX format.
+% \item
+% Documentation extended.
+% \end{Version}
+% \begin{Version}{2006/08/26 v1.4}
+% \item
+% Date of hyperref updated.
+% \end{Version}
+% \begin{Version}{2007/04/26 v1.5}
+% \item
+% Use of package \xpackage{infwarerr}.
+% \end{Version}
+% \begin{Version}{2007/05/17 v1.6}
+% \item
+% Standard header part for generic files.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.7}
+% \item
+% Catcode section added.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.8}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/setouterhbox.pdf b/macros/latex/contrib/oberdiek/setouterhbox.pdf
new file mode 100644
index 0000000000..f765ad1460
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/setouterhbox.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/settobox.dtx b/macros/latex/contrib/oberdiek/settobox.dtx
new file mode 100644
index 0000000000..1e88492ce9
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/settobox.dtx
@@ -0,0 +1,811 @@
+% \iffalse meta-comment
+%
+% File: settobox.dtx
+% Version: 2016/05/16 v1.5
+% Info: Assign box dimensions to length registers
+%
+% Copyright (C) 2000, 2006-2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file settobox.dtx
+% and the derived files
+% settobox.sty, settobox.pdf, settobox.ins, settobox.drv,
+% settobox-example.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/settobox.dtx
+% CTAN:macros/latex/contrib/oberdiek/settobox.pdf
+%
+% Unpacking:
+% (a) If settobox.ins is present:
+% tex settobox.ins
+% (b) Without settobox.ins:
+% tex settobox.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{settobox.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If settobox.drv is present:
+% latex settobox.drv
+% (b) Without settobox.drv:
+% latex settobox.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 settobox.dtx
+% makeindex -s gind.ist settobox.idx
+% pdflatex settobox.dtx
+% makeindex -s gind.ist settobox.idx
+% pdflatex settobox.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/settobox.sty
+% TDS:doc/latex/oberdiek/settobox.pdf
+% TDS:doc/latex/oberdiek/settobox-example.tex
+% TDS:source/latex/oberdiek/settobox.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: settobox 2016/05/16 v1.5 Assign box dimensions to length registers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: settobox
+Version: 2016/05/16 v1.5
+
+Copyright (C) 2000, 2006-2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file settobox.dtx
+and the derived files
+ settobox.sty, settobox.pdf, settobox.ins, settobox.drv,
+ settobox-example.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{settobox.ins}{\from{settobox.dtx}{install}}%
+ \file{settobox.drv}{\from{settobox.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{settobox.sty}{\from{settobox.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{settobox-example.tex}{\from{settobox.dtx}{example}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{settobox.xml}{\from{settobox.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{* settobox.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `settobox.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{settobox.drv}%
+ [2016/05/16 v1.5 Assign box dimensions to length registers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{calc}
+\usepackage{settobox}
+\begin{document}
+ \DocInput{settobox.dtx}%
+\end{document}
+%</driver>
+% \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{settobox.drv}
+%
+% \title{The \xpackage{settobox} package}
+% \date{2016/05/16 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Commands are defined for getting box sizes similar
+% to \LaTeX's \cs{settowidth} commands.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \subsection{Get box dimensions}
+%
+% \begin{declcs}^^A
+% {settoboxwidth}\,\M{\LaTeX\ length}\,\M{\LaTeX\ box}\\
+% \SpecialUsageIndex{\settoboxheight}^^A
+% \cs{settoboxheight}\,\M{\LaTeX\ length}\,\M{\LaTeX\ box}\\
+% \SpecialUsageIndex{\settoboxdepth}^^A
+% \cs{settoboxdepth}\,\M{\LaTeX\ length}\,\M{\LaTeX\ box}\\
+% \SpecialUsageIndex{\settoboxtotalheight}^^A
+% \cs{settoboxtotalheight}\,\M{\LaTeX\ length}\,\M{\LaTeX\ box}
+% \end{declcs}
+% A \meta{\LaTeX\ box} is allocated by \cs{newsavebox}.
+% It can be filled by \cs{sbox} or the environment \texttt{lrbox}.
+% The commands above extract then the desired lengths.
+%
+% \subsection{Set box dimensions}
+%
+% \begin{declcs}^^A
+% {setboxwidth}\,\M{\LaTeX\ box}\,\M{\LaTeX\ length expression}\\
+% \SpecialUsageIndex{\setboxheight}^^A
+% \cs{setboxheight}\,\M{\LaTeX\ box}\,\M{\LaTeX\ length expression}\\
+% \SpecialUsageIndex{\setboxdepth}^^A
+% \cs{setboxdepth}\,\M{\LaTeX\ box}\,\M{\LaTeX\ length expression}
+% \end{declcs}
+% These commands allow the manipulation of the box. Package \xpackage{calc}
+% is supported in the \meta{\LaTeX\ length expression}.
+% Also the following length are available in this expression:
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% \cs{width}& width of the box\\
+% \cs{height}& height of the box\\
+% \cs{depth}& depth of the box\\
+% \cs{totalheight}& totalheight of the box\\
+% \end{tabular}
+% \end{quote}
+% Note, the base point (point at the left margin of the baseline)
+% always remain constant.
+%
+% \subsection{Move box}
+%
+% \begin{declcs}^^A
+% {setboxmoveleft}\,\M{\LaTeX\ box}\,\M{\LaTeX\ length expression}\\
+% \SpecialUsageIndex{\setboxmoveright}^^A
+% \cs{setboxmoveright}\,\M{\LaTeX\ box}\,\M{\LaTeX\ length expression}\\
+% \SpecialUsageIndex{\setboxlower}^^A
+% \cs{setboxlower}\,\M{\LaTeX\ box}\,\M{\LaTeX\ length expression}\\
+% \SpecialUsageIndex{\setboxright}^^A
+% \cs{setboxright}\,\M{\LaTeX\ box}\,\M{\LaTeX\ length expression}
+% \end{declcs}
+% Note, the box is shifted relative to the base point. The base point
+% is always inside the box, however the width and height of the
+% box change along with the movement.
+%
+% \subsection{Example}
+%
+% \subsubsection{Short example}
+%
+% \begin{quote}
+%\begin{verbatim}
+%\newsavebox{\mybox}
+%\newlength{\mylength}
+%\sbox{\mybox}{Hello World}
+%\settoboxwidth{\mylength}{\mybox}
+%\end{verbatim}
+% \end{quote}
+%
+% \subsubsection{Test file that shows box manipulations}
+%
+% \begin{macrocode}
+%<*example>
+%<<END
+\documentclass{article}
+
+\usepackage{settobox}
+\usepackage{calc}
+
+\newsavebox{\mybox}
+
+\setlength{\fboxsep}{0pt}
+\setlength{\parindent}{20pt}
+\setlength{\parskip}{10pt}
+\pagestyle{empty}
+
+% \test{#1}
+% The macro is called with commands in #1 that manipulates
+% the box \mybox. These commands along with the result of
+% the manipulation is shown. Thus the essence of the
+% macro is:
+%
+% a) \sbox{\mybox}{The cracy fox.}
+% b) #1 % manipulates \mybox
+% c) Print #1 commands.
+% d) Print box with frame
+%
+% The implemenation looks more weird:
+\makeatletter
+\newcommand*{\test}[1]{%
+ \par
+ \begingroup
+ \raggedright
+ \edef\x{\detokenize{#1}}%
+ \let\do\@makeother
+ \dospecials
+ \catcode`\~\active
+ \catcode`\ =10\relax
+ \def~{\\}%
+ \noindent
+ \texttt{\scantokens\expandafter{\x}}%
+ \par
+ \endgroup
+ \begingroup
+ \let~\relax
+ \sbox{\mybox}{The cracy fox.}%
+ #1%
+ A---\fbox{\usebox\mybox}---B%
+ \endgroup
+ \par
+}
+\makeatother
+
+\begin{document}
+
+\test{\setboxwidth{\mybox}{1.25\width}}
+\test{\setboxheight{\mybox}{0pt}}
+\test{\setboxheight{\mybox}{2\height}}
+\test{\setboxdepth{\mybox}{\height}}
+\test{\setboxmoveleft{\mybox}{5pt}}
+\test{%
+ \setboxmoveleft{\mybox}{5pt}~%
+ \setboxwidth{\mybox}{\width + 5pt}%
+}
+\test{\setboxmoveright{\mybox}{0.5\width}}
+\test{\setboxlower{\mybox}{\height}}
+\test{\setboxraise{\mybox}{\depth}}
+\test{%
+ \setboxmoveright{\mybox}{5pt}~%
+ \setboxwidth{\mybox}{\width + 5pt}~%
+ \setboxheight{\mybox}{\height + 5pt}~%
+ \setboxdepth{\mybox}{\depth + 5pt}%
+}
+
+\end{document}
+%END
+%</example>
+% \end{macrocode}
+%
+% \noindent
+% The result:
+%
+% \vspace{1ex}
+% \hrule
+%
+% \begingroup
+% \newsavebox{\mybox}
+%
+% \setlength{\fboxsep}{0pt}
+% \setlength{\parindent}{20pt}
+% \setlength{\parskip}{10pt}
+%
+% \makeatletter
+% \newcommand*{\test}[1]{^^A
+% \par
+% \begingroup
+% \raggedright
+% \edef\x{\detokenize{#1}}
+% \let\do\@makeother
+% \dospecials
+% \catcode`\~\active
+% \catcode`\ =10\relax
+% \def~{\\}^^A
+% \noindent
+% \texttt{\scantokens\expandafter{\x}}
+% \par
+% \endgroup
+% \begingroup
+% \let~\relax
+% \sbox{\mybox}{The cracy fox.}
+% #1^^A
+% A---\fbox{\usebox\mybox}---B
+% \endgroup
+% \par
+% }
+% \makeatother
+%
+% \test{\setboxwidth{\mybox}{1.25\width}}
+% \test{\setboxheight{\mybox}{0pt}}
+% \test{\setboxheight{\mybox}{2\height}}
+% \test{\setboxdepth{\mybox}{\height}}
+% \test{\setboxmoveleft{\mybox}{5pt}}
+% \test{^^A
+% \setboxmoveleft{\mybox}{5pt}~^^A
+% \setboxwidth{\mybox}{\width + 5pt}^^A
+% }
+% \test{\setboxmoveright{\mybox}{0.5\width}}
+% \test{\setboxlower{\mybox}{\height}}
+% \test{\setboxraise{\mybox}{\depth}}
+% \test{^^A
+% \setboxmoveright{\mybox}{5pt}~^^A
+% \setboxwidth{\mybox}{\width + 5pt}~^^A
+% \setboxheight{\mybox}{\height + 5pt}~^^A
+% \setboxdepth{\mybox}{\depth + 5pt}^^A
+% }
+%
+% \endgroup
+% \vspace{1ex}
+% \hrule
+% \vspace{4ex}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{settobox}%
+ [2016/05/16 v1.5 Assign box dimensions to length registers (HO)]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand*{\settoboxwidth}[2]{\setlength{#1}{\wd#2}}
+\newcommand*{\settoboxheight}[2]{\setlength{#1}{\ht#2}}
+\newcommand*{\settoboxdepth}[2]{\setlength{#1}{\dp#2}}
+\newcommand*{\settoboxtotalheight}[2]{%
+ \setlength{#1}{\ht#2}%
+ \addtolength{#1}{\dp#2}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\setboxwidth}
+% \begin{macrocode}
+\newcommand*{\setboxwidth}[2]{%
+ \settobox@length\wd{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setboxheight}
+% \begin{macrocode}
+\newcommand*{\setboxheight}[2]{%
+ \settobox@length\ht{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setboxheight}
+% \begin{macrocode}
+\newcommand*{\setboxdepth}[2]{%
+ \settobox@length\dp{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setboxmoveleft}
+% \begin{macrocode}
+\newcommand*{\setboxmoveleft}[2]{%
+ \settobox@horiz{-}{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setboxmoveright}
+% \begin{macrocode}
+\newcommand*{\setboxmoveright}[2]{%
+ \settobox@horiz{}{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setboxlower}
+% \begin{macrocode}
+\newcommand*{\setboxlower}[2]{%
+ \settobox@vert\lower{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setboxraise}
+% \begin{macrocode}
+\newcommand*{\setboxraise}[2]{%
+ \settobox@vert\raise{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\settobox@length}
+% The work for the \cs{setbox...} commands is done by
+% \cs{settobox@length}. Inside the length expression
+% \cs{width}, \cs{height}, \cs{depth}, \cs{totalheight}
+% are set to the dimensions of the box.\\
+% \begin{tabular}{@{}ll@{}}
+% |#1|:& the property of the box that is to be changed
+% (\cs{wd}, \cs{ht}, \cs{dp})\\
+% |#2|:& the box\\
+% |#3|:& length expression
+% \end{tabular}
+% \begin{macrocode}
+\def\settobox@length#1#2#3{%
+ \settobox@calc{#2}{#3}{#1#2=##1sp\relax}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\settobox@horiz}
+% \begin{macrocode}
+\def\settobox@horiz#1#2#3{%
+ \settobox@calc{#2}{#3}{\setbox#2=\hbox{\kern#1##1sp\copy#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\settobox@vert}
+% \begin{macrocode}
+\def\settobox@vert#1#2#3{%
+ \settobox@calc{#2}{#3}{\setbox#2=\hbox{#1##1sp\copy#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\settobox@calc}
+% \begin{macrocode}
+\def\settobox@calc#1#2#3{%
+ \begingroup
+ \def\width{\wd#1}%
+ \def\height{\ht#1}%
+ \def\depth{\dp#1}%
+ \dimen@\ht#1\relax
+ \advance\dimen@\dp#1\relax
+ \def\totalheight{\dimen@}%
+ \setlength{\dimen@}{#2}%
+ \count@\dimen@
+ \def\x##1{\endgroup
+ #3%
+ }%
+ \expandafter\x\expandafter{\the\count@}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/settobox}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/settobox.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/settobox.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[\CTAN{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 settobox.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@{}}
+% settobox.sty & tex/latex/oberdiek/settobox.sty\\
+% settobox.pdf & doc/latex/oberdiek/settobox.pdf\\
+% settobox-example.tex & doc/latex/oberdiek/settobox-example.tex\\
+% settobox.dtx & source/latex/oberdiek/settobox.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk settobox.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{settobox.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 settobox.dtx
+%makeindex -s gind.ist settobox.idx
+%pdflatex settobox.dtx
+%makeindex -s gind.ist settobox.idx
+%pdflatex settobox.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{settobox.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='settobox'>
+ <name>settobox</name>
+ <caption>Assigning dimensions of a box to a length register.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2000,2006-2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.5'/>
+ <description>
+ Commands to assist the reuse of boxes (set up by <tt>\sbox</tt> or
+ by the <tt>lrbox</tt> environment); the <tt>\settobox...</tt>
+ commands behave similarly to the <tt>\settowidth</tt> (etc.)
+ commands. For example:
+ <pre>
+ \newsavebox{\mybox}
+ \newlength{\mylength}
+ \sbox{\mybox}{Hello World}
+ \settoboxwidth{\mylength}{\mybox}
+ </pre>
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/settobox.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/settobox.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2000/02/11 v1.0}
+% \item
+% First public release, written as answer in the
+% newsgroup \xnewsgroup{de.comp.text.tex}:
+% \URL{``\link{Die Hoehe von Minipages und Bild}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/c3f6446f54f66c02}
+% \end{Version}
+% \begin{Version}{2000/09/07 v1.1}
+% \item
+% Documentation added.
+% \item
+% CTAN release.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.2}
+% \item
+% \cs{setboxwidth}, \cs{setboxheight}, \cs{setboxdepth} added.
+% \item
+% Box move commands added.
+% \item
+% DTX framework.
+% \item
+% LPPL 1.3
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.3}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.4}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.5}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/settobox.pdf b/macros/latex/contrib/oberdiek/settobox.pdf
new file mode 100644
index 0000000000..6b867bd670
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/settobox.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/soulutf8.dtx b/macros/latex/contrib/oberdiek/soulutf8.dtx
new file mode 100644
index 0000000000..11e355236e
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/soulutf8.dtx
@@ -0,0 +1,1931 @@
+% \iffalse meta-comment
+%
+% File: soulutf8.dtx
+% Version: 2016/05/16 v1.1
+% Info: Permit use of UTF-8 characters in soul
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 soulutf8.dtx
+% and the derived files
+% soulutf8.sty, soulutf8.pdf, soulutf8.ins, soulutf8.drv,
+% soulutf8-test1.tex, soulutf8-test2.tex, soulutf8-test3.tex,
+% soulutf8-test4.tex, soulutf8-test5.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/soulutf8.dtx
+% CTAN:macros/latex/contrib/oberdiek/soulutf8.pdf
+%
+% Unpacking:
+% (a) If soulutf8.ins is present:
+% tex soulutf8.ins
+% (b) Without soulutf8.ins:
+% tex soulutf8.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{soulutf8.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If soulutf8.drv is present:
+% latex soulutf8.drv
+% (b) Without soulutf8.drv:
+% latex soulutf8.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 soulutf8.dtx
+% makeindex -s gind.ist soulutf8.idx
+% pdflatex soulutf8.dtx
+% makeindex -s gind.ist soulutf8.idx
+% pdflatex soulutf8.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/soulutf8.sty
+% TDS:doc/latex/oberdiek/soulutf8.pdf
+% TDS:doc/latex/oberdiek/test/soulutf8-test1.tex
+% TDS:doc/latex/oberdiek/test/soulutf8-test2.tex
+% TDS:doc/latex/oberdiek/test/soulutf8-test3.tex
+% TDS:doc/latex/oberdiek/test/soulutf8-test4.tex
+% TDS:doc/latex/oberdiek/test/soulutf8-test5.tex
+% TDS:source/latex/oberdiek/soulutf8.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: soulutf8 2016/05/16 v1.1 Permit use of UTF-8 characters in soul (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: soulutf8
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 soulutf8.dtx
+and the derived files
+ soulutf8.sty, soulutf8.pdf, soulutf8.ins, soulutf8.drv,
+ soulutf8-test1.tex, soulutf8-test2.tex, soulutf8-test3.tex,
+ soulutf8-test4.tex, soulutf8-test5.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{soulutf8.ins}{\from{soulutf8.dtx}{install}}%
+ \file{soulutf8.drv}{\from{soulutf8.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{soulutf8.sty}{\from{soulutf8.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{soulutf8-test1.tex}{\from{soulutf8.dtx}{test1}}%
+% \file{soulutf8-test2.tex}{\from{soulutf8.dtx}{test2,utf8}}%
+% \file{soulutf8-test3.tex}{\from{soulutf8.dtx}{test3,utf8x}}%
+% \file{soulutf8-test4.tex}{\from{soulutf8.dtx}{test4,utf8,noetex}}%
+% \file{soulutf8-test5.tex}{\from{soulutf8.dtx}{test5,utf8x,noetex}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{soulutf8.xml}{\from{soulutf8.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{* soulutf8.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `soulutf8.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{soulutf8.drv}%
+ [2016/05/16 v1.1 Permit use of UTF-8 characters in soul (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{soulutf8.dtx}%
+\end{document}
+%</driver>
+% \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{soulutf8.drv}
+%
+% \title{The \xpackage{soulutf8} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package extends package \xpackage{soul} and adds some support
+% for UTF-8. Namely the input encodings \xfile{utf8.def}
+% from package \xpackage{inputenc} and
+% package \xpackage{ucs}'s \xfile{utf8x.def} are supported.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% This package \xpackage{soulutf8} does not have own options and does not
+% define new user commands.
+% Any option is passed to package \xpackage{soul} \cite{soul}
+% that is loaded first.
+% Then some internal macros of \xpackage{soul} are redefined to add
+% support for UTF-8.
+% The following input encodings are supported:
+% \begin{quote}
+% \begin{tabular}{@{}lll@{}}
+% \texttt{utf8} & \LaTeX\ base &
+% \xfile{TDS:tex/latex/base/utf8.def} \cite{utf8}\\
+% \texttt{utf8x} & Package \xpackage{ucs} &
+% \xfile{TDS:tex/latex/ucs/utf8x.def} \cite{ucs}\\
+% \end{tabular}
+% \end{quote}
+% UTF-8 byte sequences are added as token group to a word, even
+% if these UTF-8 characters are some kind of hyphen or space.
+% As exception the following three Unicode characters are handled specially:
+% \begin{quote}
+% \begin{tabular}{lll}
+% Slot & Name & Action\\
+% \hline
+% \texttt{U+00A0} & NO-BREAK SPACE & like |~|\\
+% \texttt{U+2013} & EN DASH & |--|\\
+% \texttt{U+2014} & EM DASH & |---|
+% \end{tabular}
+%
+% \subsection{Patch}
+%
+% Also package \xpackage{soulutf8} tries to patch package \xpackage{soul}
+% to improve its behaviour:
+% \begin{itemize}
+% \item
+% A problem with additional levels of curly braces is fixed.
+% As advantage more implicite kernings are detected.
+% However, the result may be incompatible with the
+% original behaviour of package \xpackage{soul} because
+% of these respected implicite kernings.
+% \item
+% \eTeX\ , especially \cs{unexpanded} is supported.
+% This allows a better protection of token groups
+% (|\mbox{|\dots|}|, math, \dots).
+% \end{itemize}
+% \end{quote}
+%
+% \subsection{Future}
+%
+% Currently package \xpackage{soul} does not seem to be
+% maintained. Nevertheless if there will be a new version that
+% adds support for UTF-8, then this package may become
+% obsolete.
+%
+% \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@soulutf8.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{soulutf8}{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@soulutf8.sty\endcsname
+\ProvidesPackage{soulutf8}%
+ [2016/05/16 v1.1 Permit use of UTF-8 characters in soul (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 SOuL@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\SOuL@AtEnd{%
+ \SOuL@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{10}{12}% ^^J
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{34}{12}% "
+\TMP@EnsureCode{36}{3}% $
+\TMP@EnsureCode{39}{12}% '
+\TMP@EnsureCode{40}{12}% (
+\TMP@EnsureCode{41}{12}% )
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{58}{12}% :
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{94}{7}% ^
+\TMP@EnsureCode{96}{12}% `
+\TMP@EnsureCode{126}\active % ~
+\TMP@EnsureCode{128}{12}% ^^80
+\TMP@EnsureCode{147}{12}% ^^93
+\TMP@EnsureCode{148}{12}% ^^94
+\TMP@EnsureCode{160}{12}% ^^a0
+\TMP@EnsureCode{194}{12}% ^^c2
+\TMP@EnsureCode{226}{12}% ^^e2
+\edef\SOuL@AtEnd{\SOuL@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Loading packages}
+%
+% Package \xpackage{soul} uses \cs{documentclass} to detect \LaTeX.
+% \begin{macrocode}
+\ifx\documentclass\@undefined
+% \end{macrocode}
+%
+% \subsubsection{\plainTeX}
+%
+% First we check, whether package \xpackage{soul} is already loaded.
+% \begin{macrocode}
+ \expandafter\ifx\csname SOUL@\endcsname\relax
+% \end{macrocode}
+% In case of \plainTeX\ package \xpackage{soul} defines some
+% macros in a simple manner that will break the definitions of
+% \xfile{miniltx.tex}, for example. Therefore these macros
+% are first saved and restored afterwards.
+% \begin{macrocode}
+ \let\SOuL@orgDeclareRobustCommand\DeclareRobustCommand
+ \let\SOuL@orgnewcommand \newcommand
+ \let\SOuL@orgDeclareOption \DeclareOption
+ \let\SOuL@orgPackageError \PackageError
+ \def\SOuL@restorelatexcmds{%
+ \let\DeclareRobustCommand\SOuL@orgDeclareRobustCommand
+ \let\newcommand \SOuL@orgnewcommand
+ \let\DeclareOption \SOuL@orgDeclareOption
+ \let\PackageError \SOuL@orgPackageError
+ }%
+ \input soul.sty\relax
+ \SOuL@restorelatexcmds
+ \fi
+% \end{macrocode}
+% \begin{macro}{\SOUL@error}
+% Package \xpackage{soul}'s use of \cs{PackageError} is replaced
+% by \cs{@PackageError} of package \xpackage{infwarerr}.
+% \begin{macrocode}
+ \input infwarerr.sty\relax
+ \let\SOuL@orgSOUL@error\SOUL@error
+ \def\SOUL@error{%
+ \begingroup
+ \let\PackageError\@PackageError
+ \SOuL@orgSOUL@error
+ \endgroup
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \input etexcmds.sty\relax
+% \end{macrocode}
+% \begin{macro}{\@onelevel@sanitize}
+% Define \LaTeX's \cs{@onelevel@sanitize} if not already available.
+% \begin{macrocode}
+ \expandafter\ifx\csname @onelevel@sanitize\endcsname\relax
+ \def\@onelevel@sanitize#1{%
+ \edef#1{%
+ \expandafter\strip@prefix\meaning#1%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\strip@prefix}
+% \begin{macrocode}
+ \def\strip@prefix#1>{}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \fi
+\else
+% \end{macrocode}
+%
+% \subsubsection{\LaTeX}
+% \begin{macrocode}
+ \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{soul}}%
+ \ProcessOptions\relax
+ \RequirePackage{soul}[2003/11/17]%
+ \RequirePackage{infwarerr}[2016/05/16]%
+ \RequirePackage{etexcmds}[2016/05/16]%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{\eTeX}
+%
+% In \plainTeX\ command \cs{+} is an \emph{outer} macro.
+% Therefore numbers are used to avoid problems.
+% \begin{macrocode}
+\ifetex@unexpanded
+ \catcode33=14 % '!': comment
+ \catcode43=9 % '+': ignore
+\else
+ \catcode33=9 % '!': ignore
+ \catcode43=14 % '+': comment
+\fi
+% \end{macrocode}
+%
+% \subsection{Macro for redefinitions}
+%
+% \begin{macro}{\SOuL@redefine}
+% \begin{macrocode}
+\def\SOuL@redefine#1{%
+ \begingroup
+ \def\SOuL@cmd{#1}%
+ \afterassignment\SOuL@cmdcheck
+ \def\SOuL@temp
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOuL@cmdcheck}
+% \begin{macrocode}
+\def\SOuL@cmdcheck{%
+ \expandafter\ifx\SOuL@cmd\SOuL@temp
+ \else
+ \edef\SOuL@temp*{\expandafter\string\SOuL@cmd}%
+ \@PackageWarningNoLine{soulutf8}{%
+ Command \SOuL@temp* has changed.\MessageBreak
+ Supported versions of package `soul': 2003/11/17.\MessageBreak
+ Depending on the unknown changes the redefinition\MessageBreak
+ of \SOuL@temp* may not behave correctly%
+ }%
+ \fi
+ \expandafter\endgroup
+ \expandafter\def\SOuL@cmd
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Redefinition of \cs{SOUL@eval}}
+%
+% \begin{macro}{\SOUL@eval}
+% Macro \cs{SOUL@eval} is redefined to add detection of
+% the first byte of a UTF-8 sequence. Because \cs{SOUL@eval}
+% is overwritten, a warning is issued, if the contents of
+% \cs{SOUL@eval} is not as expected.
+% \begin{macrocode}
+\SOuL@redefine\SOUL@eval{%
+% \end{macrocode}
+% First the expected definition.
+% \begin{macrocode}
+ \def\SOUL@n*##1{\SOUL@scan}%
+ \if\noexpand\SOUL@@\SOUL@spc
+ \else
+ \SOUL@ignorespacesfalse
+ \fi
+ \ifnum\SOUL@minus=\thr@@
+ \SOUL@flushminus
+ \else\ifnum\SOUL@comma=\tw@
+ \SOUL@flushcomma
+ \else\ifnum\SOUL@apo=\tw@
+ \SOUL@flushapo
+ \else\ifnum\SOUL@grave=\tw@
+ \SOUL@flushgrave
+ \fi\fi\fi\fi
+ \ifx\SOUL@@-\else\SOUL@flushminus\fi
+ \ifx\SOUL@@,\else\SOUL@flushcomma\fi
+ \ifx\SOUL@@'\else\SOUL@flushapo\fi
+ \ifx\SOUL@@`\else\SOUL@flushgrave\fi
+ \ifx\SOUL@@-%
+ \advance\SOUL@minus\@ne
+ \else\ifx\SOUL@@,%
+ \advance\SOUL@comma\@ne
+ \else\ifx\SOUL@@'%
+ \advance\SOUL@apo\@ne
+ \else\ifx\SOUL@@`%
+ \advance\SOUL@grave\@ne
+ \else
+ \SOUL@flushminus
+ \SOUL@flushcomma
+ \SOUL@flushapo
+ \SOUL@flushgrave
+ \ifx\SOUL@@\SOUL@stop
+ \def\SOUL@n*{%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ }%
+ \else\ifx\SOUL@@\par
+ \def\SOUL@n*\par{\par\leavevmode\SOUL@scan}%
+ \else\if\noexpand\SOUL@@\SOUL@spc
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \ifSOUL@ignorespaces
+ \else
+ \SOUL@everyspace{}%
+ \fi
+ \def\SOUL@n* {\SOUL@scan}%
+ \else\ifx\SOUL@@\\%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \SOUL@everyspace{\unskip\nobreak\hfil\break}%
+ \SOUL@ignorespacestrue
+ \else\ifx\SOUL@@~%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \SOUL@everyspace{\nobreak}%
+ \else\ifx\SOUL@@\slash
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen{/}%
+ \SOUL@exhyphen{/}%
+ \else\ifx\SOUL@@\mbox
+ \def\SOUL@n*{\SOUL@addprotect}%
+ \else\ifx\SOUL@@\hbox
+ \def\SOUL@n*{\SOUL@addprotect}%
+ \else\ifx\SOUL@@\soulomit
+ \def\SOUL@n*\soulomit##1{%
+ \SOUL@doword
+ {\spaceskip\SOUL@spaceskip##1}%
+ \SOUL@scan
+ }%
+ \else\ifx\SOUL@@\break
+ \SOUL@doword
+ \break
+ \else\ifx\SOUL@@\linebreak
+ \SOUL@doword
+ \SOUL@everyspace{\linebreak}%
+ \else\ifcat\bgroup\noexpand\SOUL@@
+ \def\SOUL@n*{\SOUL@addgroup{}}%
+ \else\ifcat$\noexpand\SOUL@@
+ \def\SOUL@n*{\SOUL@addmath}%
+ \else
+ \def\SOUL@n*{\SOUL@dotoken}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi
+ \SOUL@n*%
+}{%
+% \end{macrocode}
+% Now the redefined version follows.
+% \begin{macrocode}
+ \def\SOUL@n*##1{\SOUL@scan}%
+ \if\noexpand\SOUL@@\SOUL@spc
+ \else
+ \SOUL@ignorespacesfalse
+ \fi
+ \ifnum\SOUL@minus=\thr@@
+ \SOUL@flushminus
+ \else\ifnum\SOUL@comma=\tw@
+ \SOUL@flushcomma
+ \else\ifnum\SOUL@apo=\tw@
+ \SOUL@flushapo
+ \else\ifnum\SOUL@grave=\tw@
+ \SOUL@flushgrave
+ \fi\fi\fi\fi
+ \ifx\SOUL@@-\else\SOUL@flushminus\fi
+ \ifx\SOUL@@,\else\SOUL@flushcomma\fi
+ \ifx\SOUL@@'\else\SOUL@flushapo\fi
+ \ifx\SOUL@@`\else\SOUL@flushgrave\fi
+ \ifx\SOUL@@-%
+ \advance\SOUL@minus\@ne
+ \else\ifx\SOUL@@,%
+ \advance\SOUL@comma\@ne
+ \else\ifx\SOUL@@'%
+ \advance\SOUL@apo\@ne
+ \else\ifx\SOUL@@`%
+ \advance\SOUL@grave\@ne
+ \else
+ \SOUL@flushminus
+ \SOUL@flushcomma
+ \SOUL@flushapo
+ \SOUL@flushgrave
+ \ifx\SOUL@@\SOUL@stop
+ \def\SOUL@n*{%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ }%
+ \else\ifx\SOUL@@\par
+ \def\SOUL@n*\par{\par\leavevmode\SOUL@scan}%
+ \else\if\noexpand\SOUL@@\SOUL@spc
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \ifSOUL@ignorespaces
+ \else
+ \SOUL@everyspace{}%
+ \fi
+ \def\SOUL@n* {\SOUL@scan}%
+ \else\ifx\SOUL@@\\%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \SOUL@everyspace{\unskip\nobreak\hfil\break}%
+ \SOUL@ignorespacestrue
+ \else\ifx\SOUL@@~%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \SOUL@everyspace{\nobreak}%
+ \else\ifx\SOUL@@\slash
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen{/}%
+ \SOUL@exhyphen{/}%
+ \else\ifx\SOUL@@\mbox
+ \def\SOUL@n*{\SOUL@addprotect}%
+ \else\ifx\SOUL@@\hbox
+ \def\SOUL@n*{\SOUL@addprotect}%
+ \else\ifx\SOUL@@\soulomit
+ \def\SOUL@n*\soulomit##1{%
+ \SOUL@doword
+ {\spaceskip\SOUL@spaceskip##1}%
+ \SOUL@scan
+ }%
+ \else\ifx\SOUL@@\break
+ \SOUL@doword
+ \break
+ \else\ifx\SOUL@@\linebreak
+ \SOUL@doword
+ \SOUL@everyspace{\linebreak}%
+ \else\ifcat\bgroup\noexpand\SOUL@@
+ \def\SOUL@n*{\SOUL@addgroup{}}%
+ \else\ifcat$\noexpand\SOUL@@
+ \def\SOUL@n*{\SOUL@addmath}%
+ \else
+% \end{macrocode}
+% The current token is examined to detect the start of
+% a UTF-8 sequence.
+% \begin{macrocode}
+ \SOuL@analyzeutfviii
+ \ifcase\SOuL@octets
+ \SOuL@analyzeutfviiix
+ \fi
+ \ifcase\SOuL@octets
+ \def\SOUL@n*{\SOUL@dotoken}%
+ \or % 1
+ \or % 2
+ \def\SOUL@n*{\SOuL@addtwooctets}%
+ \or % 3
+ \def\SOUL@n*{\SOuL@addthreeoctets}%
+ \or % 4
+ \def\SOUL@n*{\SOuL@addfouroctets}%
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi
+ \SOUL@n*%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{UTF-8 analysis}
+%
+% \subsubsection{Help strings}
+%
+% \begin{macrocode}
+\def\SOuL@defsanitizedstring#1#2{%
+ \expandafter\def\csname SOuL@string#1\endcsname{#2}%
+ \expandafter\@onelevel@sanitize\csname SOuL@string#1\endcsname
+}
+\SOuL@defsanitizedstring{UTFviii}{UTFviii@}
+\SOuL@defsanitizedstring{octets}{@octets}
+\SOuL@defsanitizedstring{two}{two}
+\SOuL@defsanitizedstring{three}{three}
+\SOuL@defsanitizedstring{four}{four}
+\SOuL@defsanitizedstring{macrocolon}{macro:}
+\SOuL@defsanitizedstring{csnameu}{csname u8-}
+\SOuL@defsanitizedstring{undeferr}{utf@viii@undeferr}
+\def\SOuL@stringendash{^^e2^^80^^93}
+\def\SOuL@stringemdash{^^e2^^80^^94}
+\def\SOuL@stringnobreakspace{^^c2^^a0}
+\edef\SOuL@charhash{\string #}
+\edef\SOuL@chartwo{\string 2}
+\edef\SOuL@charthree{\string 3}
+\def\SOuL@empty{}
+% \end{macrocode}
+%
+% \subsubsection{Support for \xfile{utf8.def}}
+%
+% \begin{macro}{\SOuL@analyzeutfviii}
+% \begin{macrocode}
+\begingroup
+ \edef\x{\endgroup
+ \def\noexpand\SOuL@analyzeutfviii{%
+ \noexpand\expandafter\noexpand\SOuL@checkutfviii
+ \noexpand\meaning\noexpand\SOUL@@
+ \SOuL@stringUTFviii\SOuL@stringoctets
+ \noexpand\@nil
+ }%
+ \def\noexpand\SOuL@checkutfviii
+ ##1\SOuL@stringUTFviii##2\SOuL@stringoctets##3\noexpand\@nil
+ }%
+\x{%
+ \def\SOuL@temp{#2}%
+ \chardef\SOuL@octets=%
+ \ifx\SOuL@temp\SOuL@stringtwo
+ \tw@
+ \else\ifx\SOuL@temp\SOuL@stringthree
+ \thr@@
+ \else\ifx\SOuL@temp\SOuL@stringfour
+ 4 %
+ \else
+ \z@
+ \fi\fi\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Support for \xfile{utf8x.def}}
+%
+% \begin{macro}{\SOuL@analyzeutfviiix}
+% \begin{macrocode}
+\begingroup
+ \edef\x{\endgroup
+ \def\noexpand\SOuL@analyzeutfviiix{%
+ \noexpand\expandafter\noexpand\SOuL@checkutfviiix
+ \noexpand\meaning\noexpand\SOUL@@
+ \SOuL@stringmacrocolon\SOuL@charhash1{}{}{}{}%
+ \SOuL@stringcsnameu\SOuL@stringundeferr
+ \noexpand\@nil
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOuL@checkutfviiix}
+% \begin{macrocode}
+ \def\noexpand\SOuL@checkutfviiix
+ ##1\SOuL@stringmacrocolon\SOuL@charhash1##2##3##4##5##6%
+ \SOuL@stringcsnameu##7\SOuL@stringundeferr##8\noexpand\@nil
+ }%
+\x{%
+ \def\SOuL@temp{#7}%
+ \ifx\SOuL@temp\SOuL@empty
+ \chardef\SOuL@octets=\z@
+ \else
+ \def\SOuL@temp{#5}%
+ \ifx\SOuL@temp\SOuL@charthree
+ \chardef\SOuL@octets=4 %
+ \else
+ \def\SOuL@temp{#3}%
+ \ifx\SOuL@temp\SOuL@chartwo
+ \chardef\SOuL@octets=\thr@@
+ \else
+ \chardef\SOuL@octets=\tw@
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Actions for UTF-8 sequences}
+%
+% \begin{macro}{\SOuL@addtwooctets}
+% \begin{macrocode}
+\def\SOuL@addtwooctets#1#2{%
+ \def\SOuL@temp{#1#2}%
+ \@onelevel@sanitize\SOuL@temp
+ \ifx\SOuL@temp\SOuL@stringnobreakspace
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \SOUL@everyspace{\nobreak}%
+ \let\SOuL@next\SOUL@scan
+ \else
+ \def\SOuL@next{%
+! \SOUL@addtoken{{\noexpand#1\noexpand#2}}%
++ \SOUL@addtoken{{\etex@unexpanded{#1#2}}}%
+ }%
+ \fi
+ \SOuL@next
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOuL@addthreeoctets}
+% \begin{macrocode}
+\def\SOuL@addthreeoctets#1#2#3{%
+ \def\SOuL@temp{#1#2#3}%
+ \@onelevel@sanitize\SOuL@temp
+ \ifx\SOuL@temp\SOuL@stringendash
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen{-}%
+ \SOUL@exhyphen{--}%
+ \let\SOuL@next\SOUL@scan
+ \else
+ \ifx\SOuL@temp\SOuL@stringemdash
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen{-}%
+ \SOUL@exhyphen{---}%
+ \let\SOuL@next\SOUL@scan
+ \else
+ \def\SOuL@next{%
+! \SOUL@addtoken{{\noexpand#1\noexpand#2\noexpand#3}}%
++ \SOUL@addtoken{{\etex@unexpanded{#1#2#3}}}%
+ }%
+ \fi
+ \fi
+ \SOuL@next
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOuL@addfouroctets}
+% \begin{macrocode}
+\def\SOuL@addfouroctets#1#2#3#4{%
+! \SOUL@addtoken{{\noexpand#1\noexpand#2\noexpand#3\noexpand#4}}%
++ \SOUL@addtoken{{\etex@unexpanded{#1#2#3#4}}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Redefinition of \cs{SOUL@splittoken}}
+%
+% \begin{macro}{\SOUL@splittoken}
+% Macro \cs{SOUL@splittoken} separates the first token
+% or token group from a word and redefines the word to contain
+% the remaining tokens. However if the remaining tokens are
+% a token group, then the curly braces will be removed and
+% the token group is splitted by the next call of \cs{SOUL@splittoken}.
+% The redefinition avoids the removal of curly braces around the
+% remaining tokens.
+% \begin{macrocode}
+\SOuL@redefine\SOUL@splittoken#1#2\SOUL@stop{%
+ \global\SOUL@token={#1}%
+ \global\SOUL@word={#2}%
+}#1{%
+ \global\SOUL@token={#1}%
+ \SOuL@remainingtoken\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOuL@remainingtoken}
+% \begin{macrocode}
+\def\SOuL@remainingtoken#1\SOUL@stop{%
+ \global\SOUL@word=\expandafter{\@gobble#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Patches}
+%
+% The fixed \cs{SOUL@splittoken} allows to remove the double
+% sets of curly braces in other macros of package \xpackage{soul}.
+% The benefit is that implicite kernings are more often detected
+% and fixes a bug in package \xpackage{soul}. The disadvantage is
+% incompatibility. The width of the resulting strings may change.
+% \begin{macro}{\SOUL@flushcomma}
+% \begin{macrocode}
+\SOuL@redefine\SOUL@flushcomma{%
+ \ifcase\SOUL@comma
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word,}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{{,,}}}}\x
+ \fi
+ \SOUL@comma\z@
+}{%
+ \ifcase\SOUL@comma
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word,}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{,,}}}\x
+ \fi
+ \SOUL@comma\z@
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOUL@flushapo}
+% \begin{macrocode}
+\SOuL@redefine\SOUL@flushapo{%
+ \ifcase\SOUL@apo
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word'}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{{''}}}}\x
+ \fi
+ \SOUL@apo\z@
+}{%
+ \ifcase\SOUL@apo
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word'}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{''}}}\x
+ \fi
+ \SOUL@apo\z@
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOUL@flushgrave}
+% \begin{macrocode}
+\SOuL@redefine\SOUL@flushgrave{%
+ \ifcase\SOUL@grave
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word`}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{{``}}}}\x
+ \fi
+ \SOUL@grave\z@
+}{%
+ \ifcase\SOUL@grave
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word`}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{``}}}\x
+ \fi
+ \SOUL@grave\z@
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOUL@addgroup}
+% \begin{macrocode}
+\SOuL@redefine\SOUL@addgroup#1#2{%
+ {%
+ \let\protect\noexpand
+ \edef\x{%
+ \global\SOUL@word={%
+ \the\SOUL@word
+ {{\noexpand#1#2}}%
+ }%
+ }%
+ \x
+ }%
+ \SOUL@scan
+}#1#2{%
+ \begingroup
+ \let\protect\noexpand
+ \edef\x{\endgroup
+ \SOUL@word={%
+ \the\SOUL@word
+! {\noexpand#1{#2}}%
++ {\etex@unexpanded{#1{#2}}}%
+ }%
+ }%
+ \x
+ \SOUL@scan
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOUL@addmath}
+% \begin{macrocode}
+\SOuL@redefine\SOUL@addmath$#1${%
+ {%
+ \let\protect\noexpand
+ \edef\x{%
+ \global\SOUL@word={%
+ \the\SOUL@word
+ {{\hbox{$#1$}}}%
+ }%
+ }%
+ \x
+ }%
+ \SOUL@scan
+}$#1${%
+ \begingroup
+ \let\protect\noexpand
+ \edef\x{\endgroup
+ \SOUL@word={%
+ \the\SOUL@word
+! {\hbox{$#1$}}%
++ {\etex@unexpanded{\hbox{$#1$}}}%
+ }%
+ }%
+ \x
+ \SOUL@scan
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SOUL@addprotect}
+% \begin{macrocode}
+\SOuL@redefine\SOUL@addprotect#1#2{%
+ {%
+ \let\protect\noexpand
+ \edef\x{%
+ \global\SOUL@word={%
+ \the\SOUL@word
+ {{\hbox{#2}}}%
+ }%
+ }%
+ \x
+ }%
+ \SOUL@scan
+}#1#2{%
+ \begingroup
+ \let\protect\noexpand
+ \edef\x{\endgroup
+ \SOUL@word={%
+ \the\SOUL@word
+! {\hbox{#2}}%
++ {\etex@unexpanded{\hbox{#2}}}%
+ }%
+ }%
+ \x
+ \SOUL@scan
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SOUL@addtoken}
+% \begin{macrocode}
++ \SOuL@redefine\SOUL@addtoken#1{%
++ \edef\x{%
++ \SOUL@word={%
++ \the\SOUL@word
++ \noexpand#1%
++ }%
++ }%
++ \x
++ \SOUL@scan
++ }#1{%
++ \edef\x{%
++ \SOUL@word={%
++ \the\SOUL@word
++ \etex@unexpanded{#1}%
++ }%
++ }%
++ \x
++ \SOUL@scan
++ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\SOuL@AtEnd%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \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 soulutf8.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{\LaTeX\space tests}
+%
+% \begin{macrocode}
+%<*test2|test3|test4|test5>
+% \end{macrocode}
+% \begin{macrocode}
+%<noetex>\let\SavedUnexpanded\unexpanded
+%<noetex>\let\unexpanded\UNDEFINED
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage{textcomp}
+\usepackage[ngerman]{babel}
+\expandafter\def\csname ver@hypdestopt.sty\endcsname{}
+\usepackage[unicode]{hyperref}
+\usepackage{bookmark}
+\usepackage{color}
+\usepackage{soul}[2003/11/17]
+\makeatletter
+\newcommand*{\@ifDefined}[1]{%
+ \@ifundefined{#1}{%
+ \@latex@error{%
+ \expandafter\noexpand\csname#1\endcsname undefined%
+ }\@ehc
+ }%
+}
+\newcommand*{\SaveOrg}[1]{%
+ \@ifdefinable{ORG@SOUL@#1}{%
+ \@ifDefined{SOUL@#1}{%
+ \expandafter\let\csname ORG@SOUL@#1\expandafter\endcsname
+ \csname SOUL@#1\endcsname
+ }%
+ }%
+}
+\newcommand*{\RestoreOrg}[1]{%
+ \@ifDefined{ORG@SOUL@#1}{%
+ \@ifDefined{SOUL@#1}{%
+ \expandafter\let\csname SOUL@#1\expandafter\endcsname
+ \csname ORG@SOUL@#1\endcsname
+ }%
+ }%
+}
+\makeatother
+\SaveOrg{eval}
+\SaveOrg{splittoken}
+\SaveOrg{flushcomma}
+\SaveOrg{flushapo}
+\SaveOrg{grave}
+\SaveOrg{addgroup}
+\SaveOrg{addmath}
+\SaveOrg{addprotect}
+\SaveOrg{addtoken}
+\usepackage{soulutf8}[2016/05/16]
+% \end{macrocode}
+% \begin{macrocode}
+%<noetex>\let\unexpanded\SavedUnexpanded
+% \end{macrocode}
+% Input encoding \xfile{utf8}.
+% \begin{macrocode}
+%<*utf8>
+\usepackage[utf8]{inputenc}
+\DeclareUnicodeCharacter{00A0}{\nobreakspace}
+%</utf8>
+% \end{macrocode}
+% Input encoding \xfile{utf8x}. Package \xpackage{ucs}
+% has a nasty bug, that it redefines \cs{show}.
+% \begin{macrocode}
+%<*utf8x>
+\let\origshow\show
+\usepackage[utf8x]{inputenc}
+\AtBeginDocument{%
+ \let\show\origshow
+}
+%</utf8x>
+% \end{macrocode}
+%
+% \subsubsection{Driver definitions}
+%
+% \begin{macrocode}
+\makeatletter
+% \end{macrocode}
+% \begin{macro}{\an}
+% The definition for \cs{an} is taken from the documentation of
+% package \xpackage{soul}.
+% \begin{macrocode}
+\DeclareRobustCommand*{\an}{%
+ \def\SOUL@preamble{$^{^P}$}%
+ \def\SOUL@everyspace##1{##1\texttt{\char`\ }\linebreak[2]}%
+ \def\SOUL@postamble{$^{^E}$}%
+ \def\SOUL@everyhyphen{$^{^-}$\linebreak[1]}%
+ \def\SOUL@everyexhyphen##1{##1$^{^=}$}%
+ \def\SOUL@everysyllable{$^{^S}$}%
+ \def\SOUL@everytoken{\the\SOUL@token$^{^T}$}%
+ \def\SOUL@everylowerthan{$^{^L}$}%
+ \SOUL@
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sy}
+% The definition for \cs{sy} is taken from the documentation of
+% package \xpackage{soul}.
+% \begin{macrocode}
+\DeclareRobustCommand*{\sy}{%
+ \SOUL@setup
+ \def\SOUL@preamble{%
+ \lefthyphenmin=\z@
+ \righthyphenmin=\z@
+ }%
+ \def\SOUL@everyspace##1{##1\space}%
+ \def\SOUL@everysyllable{\the\SOUL@syllable}%
+ \def\SOUL@everyhyphen{%
+ \discretionary{%
+ \SOUL@setkern\SOUL@hyphkern
+ \SOUL@sethyphenchar
+ }{}{%
+ \hbox{\kern1pt$\cdot$}%
+ }%
+ }%
+ \def\SOUL@everyexhyphen##1{%
+ \SOUL@setkern\SOUL@hyphkern
+ \hbox{##1}%
+ \discretionary{}{}{%
+ \SOUL@setkern\SOUL@charkern
+ }%
+ }%
+ \SOUL@
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\soulH}
+% \begin{macrocode}
+\DeclareRobustCommand*{\soulH}{%
+ \def\SOUL@preamble{%
+ \gdef\SOULH{}%
+ \soulHadd{[}%
+ }%
+ \def\SOUL@everyspace##1{%
+ \soulHadd{Sp}%
+ }%
+ \def\SOUL@postamble{%
+ \soulHadd{]}%
+ }%
+ \def\SOUL@everyhyphen{%
+ \soulHadd{Hy}%
+ }%
+ \def\SOUL@everyexhyphen##1{%
+ \soulHadd{Exhy}%
+ }%
+ \def\SOUL@everysyllable{%
+ \soulHadd{Sy}%
+ }%
+ \def\SOUL@everytoken{%
+ \soulHadd{T}%
+ }%
+ \def\SOUL@everylowerthan{%
+ \soulHadd{<}%
+ }%
+ \SOUL@
+}
+\newcommand*{\soulHadd}[1]{%
+ #1%
+ \expandafter\gdef\expandafter\soulHstring\expandafter{%
+ \soulHstring
+ #1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Test macros}
+%
+% \begin{macrocode}
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+% \end{macrocode}
+% \begin{macrocode}
+\newsavebox\boxA
+\newsavebox\boxB
+\newsavebox\boxC
+% \end{macrocode}
+% \begin{macro}{\TestDriver}
+% \begin{macrocode}
+\newcommand*{\TestDriver}[4]{%
+ \subsection{Driver #1}%
+ \@PackageInfo{soulutf8-test}{* Driver #1}%
+ \expandafter\let\expandafter\testdriver\csname #1\endcsname
+ \def\teststringA{#3}%
+ \def\teststringB{#4}%
+ \begin{qstest}{string-#2-driver-#1}{string,#2,driver,#1}%
+ \@PackageInfo{soulutf8-test}{* Version: soulutf8}%
+ \global\let\soulHstring\@empty
+ \setbox0=\hbox{\expandafter\testdriver\expandafter{\teststringA}}%
+ \let\HstringA\soulHstring
+ \SetTestVBox{\boxA}{\teststringA}%
+ %
+ \@PackageInfo{soulutf8-test}{* Version: soul + patch}%
+ \global\let\soulHstring\@empty
+ \RestoreOrg{eval}%
+ \setbox2=\hbox{\expandafter\testdriver\expandafter{\teststringB}}%
+ \let\HstringB\soulHstring
+ \SetTestVBox{\boxB}{\teststringB}%
+ %
+ \@PackageInfo{soulutf8-test}{* Version: original soul}%
+ \global\let\soulHstring\@empty
+ \RestoreOrg{splittoken}%
+ \RestoreOrg{flushcomma}%
+ \RestoreOrg{flushapo}%
+ \RestoreOrg{grave}%
+ \RestoreOrg{addgroup}%
+ \RestoreOrg{addmath}%
+ \RestoreOrg{addprotect}%
+ \RestoreOrg{addtoken}%
+ \setbox4=\hbox{\expandafter\testdriver\expandafter{\teststringB}}%
+ \let\HstringC\soulHstring
+ \SetTestVBox{\boxC}{\teststringB}%
+ %
+ \TestInfo{0}{soulutf8}%
+ \TestInfo{2}{soul + patch}%
+ \TestInfo{4}{original soul}%
+ \TestInfoVBox
+ \showboxdepth=\maxdimen
+ \showboxbreadth=\maxdimen
+ \tracingonline=\@ne
+ \Expect*{\HstringA}*{\HstringB}%
+ \Expect*{\HstringA}*{\HstringC}%
+ \Expect*{\the\wd0}*{\the\wd2}%
+ \ifdim\wd0=\wd2 %
+ \else
+ \showbox0 %
+ \showbox2 %
+ \fi
+ \Expect*{\the\ht0}*{\the\ht2}%
+ \Expect*{\the\dp0}*{\the\dp2}%
+ \Expect*{\the\wd\boxB}*{\the\wd\boxA}%
+ \Expect*{\the\wd\boxC}*{\the\wd\boxA}%
+ \Expect*{\the\ht\boxB}*{\the\ht\boxA}%
+ \ifdim\ht\boxB=\ht\boxA
+ \else
+ \showbox\boxA
+ \showbox\boxB
+ \fi
+ \Expect*{\the\ht\boxC}*{\the\ht\boxA}%
+ \Expect*{\the\dp\boxB}*{\the\dp\boxA}%
+ \Expect*{\the\dp\boxC}*{\the\dp\boxA}%
+ \end{qstest}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SetTestVBox}
+% \begin{macrocode}
+\newcommand*{\SetTestVBox}[2]{%
+ \setbox#1=\vbox{%
+ \hsize=0pt\relax
+ \hfuzz=100mm\relax
+ \expandafter\testdriver\expandafter{#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TestInfo}
+% \begin{macrocode}
+\newcommand*{\TestInfo}[2]{%
+ \par
+ \noindent
+ \copy#1\relax
+ \hfill
+ \begingroup
+ \small
+ \ifdim\wd0=\wd2\relax
+ \ifdim\wd0=\wd4\relax
+ \else
+ \ifnum#1=2 %
+ \raisebox{.5\baselineskip}[0pt][0pt]{%
+ \llap{$\}$ }%
+ \rlap{width = \the\wd#1\relax\space$\{$}%
+ \phantom{width = 999.99999pt}%
+ \qquad
+ }%
+ \else
+ \ifnum#1=4 %
+ \rlap{width = \the\wd#1}%
+ \phantom{width = 999.99999pt}%
+ \qquad
+ \fi
+ \fi
+ \fi
+ \else
+ \begingroup
+ \bfseries
+ \rlap{width = \the\wd#1}%
+ \phantom{width = 999.99999pt}%
+ \endgroup
+ \qquad
+ \fi
+ \rlap{(#2)}%
+ \phantom{(original soul)}%
+ \endgroup
+ \par
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TestInfoVBox}
+% \begin{macrocode}
+\newcommand*{\TestInfoVBox}{%
+ \par
+ \noindent
+ \mbox{\vrule\relax\space\copy\boxA}%
+ \ifdim\ht\boxA=\ht\boxB
+ \else
+ \hfill
+ \begingroup
+ \small
+ \rlap{(soulutf8)}%
+ \phantom{(soulutf8)}%
+ \endgroup
+ \par
+ \noindent
+ \mbox{\vrule\relax\space\copy\boxB}%
+ \hfill
+ \begingroup
+ \small
+ \rlap{(soul)}%
+ \phantom{(soulutf8)}%
+ \endgroup
+ \fi
+ \par
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Test}
+% \begin{macrocode}
+\makeatletter
+\newcommand*{\Test}[3]{%
+ \clearpage
+ \begingroup
+ \def\linebreak{\textbackslash linebreak }%
+ \def\\{\textbackslash\textbackslash}%
+ \def\soulomit##1{%
+ \textbackslash soulomit\textbraceleft##1\textbraceright
+ }%
+ \def\mbox##1{%
+ \textbackslash mbox\textbraceleft##1\textbraceright
+ }%
+ \def\abc{\textbackslash abc }%
+ \def\texttt##1{%
+ \textbackslash texttt\textbraceleft##1\textbraceright
+ }%
+ \def\c##1{%
+ \textbackslash c\textbraceleft##1\textbraceright
+ }%
+%<*utf8x>
+ \count@=128 %
+ \loop
+ \ifnum\count@<256 %
+ \lccode`\~=\count@
+ \lowercase{%
+ \def~{\noexpand~}%
+ }%
+ \advance\count@\@ne
+ \repeat
+%</utf8x>
+ \csname protected@edef\endcsname\x{\endgroup
+ \noexpand\section{String #1: #2}%
+ }%
+ \x
+ \TestDriver{so}{#1}{#2}{#3}%
+ \TestDriver{caps}{#1}{#2}{#3}%
+ \TestDriver{ul}{#1}{#2}{#3}%
+ \TestDriver{st}{#1}{#2}{#3}%
+ \TestDriver{hl}{#1}{#2}{#3}%
+ \TestDriver{an}{#1}{#2}{#3}%
+ \TestDriver{sy}{#1}{#2}{#3}%
+ \TestDriver{soulH}{#1}{#2}{#3}%
+}
+\makeatother
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Testing}
+%
+% \begin{macrocode}
+\begin{document}
+ \Test A{}{}%
+ \Test B{Hello World}{Hello World}%
+ \Test C{%
+ Umlauts: ^^c3^^84^^c3^^96^^c3^^9c^^c3^^a4^^c3^^b6^^c3^^bc^^c3^^9f%
+ }{%
+ Umlauts: \"A\"O\"U\"a\"o\"u\ss
+ }%
+ \Test D{Euro: ^^e2^^82^^ac}{Euro: \texteuro}%
+ \Test E{Stra^^c3^^9fe}{Stra\ss e}%
+ \Test F{R^^c3^^b6mer}{R\"omer}%
+ \Test G{A^^e2^^80^^93B^^e2^^80^^94C}{A--B---C}%
+ \Test H{X^^c2^^a0Y}{X~Y}%
+ \Test I{A^^c5^^a4}{A\v T}%
+ \Test J{A,B,,C,,,D,,,,E}{A,B,,C,,,D,,,,E}%
+ \Test K{A'B''C'''D''''E}{A'B''C'''D''''E}%
+ \Test L{A`B``C```D````E}{A`B``C```D````E}%
+ \Test M{A$x$B}{A$x$B}%
+ \Test N{A\mbox{abc}B}{A\mbox{abc}B}%
+ \Test O{,,TA''}{,,TA''}%
+ \Test P{{!`}Hola{?`}}{{!`}Hola{?`}}%
+ \Test Q{re-sent\slash x}{re-sent\slash x}%
+ \Test R{new\\line}{new\\line}%
+ \Test S{foo\linebreak bar}{foo\linebreak bar}%
+ \Test T{Virchow{sche}}{Virchow{sche}}%
+ \Test U{A\soulomit{foo}B}{A\soulomit{foo}B}%
+ \Test V{A\texttt{xyz}B}{A\texttt{xyz}B}%
+ \Test W{ffi}{ffi}%
+ \Test X{f{}f{}i}{f{}f{}i}%
+ \Test Y{f\mbox{}f\mbox{}i}{f\mbox{}f\mbox{}i}%
+ \Test Z{\c{\"a}}{{\c{\"a}}}%
+%<*test2|test3>
+ \let\abcx\UNDEFINED
+ \def\abc{%
+ \begingroup
+ \def\abcx{x}%
+ \abcx
+ \endgroup
+ }%
+ \Test{AA}{[{x\abc x}]}{[{xxx}]}%
+%</test2|test3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\end{document}
+% \end{macrocode}
+% \begin{macrocode}
+%</test2|test3|test4|test5>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/soulutf8}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/soulutf8.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/soulutf8.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[\CTAN{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 soulutf8.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@{}}
+% soulutf8.sty & tex/generic/oberdiek/soulutf8.sty\\
+% soulutf8.pdf & doc/latex/oberdiek/soulutf8.pdf\\
+% test/soulutf8-test1.tex & doc/latex/oberdiek/test/soulutf8-test1.tex\\
+% test/soulutf8-test2.tex & doc/latex/oberdiek/test/soulutf8-test2.tex\\
+% test/soulutf8-test3.tex & doc/latex/oberdiek/test/soulutf8-test3.tex\\
+% test/soulutf8-test4.tex & doc/latex/oberdiek/test/soulutf8-test4.tex\\
+% test/soulutf8-test5.tex & doc/latex/oberdiek/test/soulutf8-test5.tex\\
+% soulutf8.dtx & source/latex/oberdiek/soulutf8.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk soulutf8.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{soulutf8.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 soulutf8.dtx
+%makeindex -s gind.ist soulutf8.idx
+%pdflatex soulutf8.dtx
+%makeindex -s gind.ist soulutf8.idx
+%pdflatex soulutf8.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{soulutf8.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='soulutf8'>
+ <name>soulutf8</name>
+ <caption>Permit use of UTF-8 characters in soul.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ This package extends package <xref refid='soul'>soul</xref> and adds
+ some support for UTF-8. Namely the input encodings in
+ &#x2018;<tt>utf8.def</tt>&#x2019; from package
+ <xref refid='inputenc'>inputenc</xref> and
+ &#x2018;<tt>utf8x.def</tt>&#x2019; from package
+ <xref refid='unicode'>ucs</xref> are supported.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/soulutf8.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/soulutf8.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{soul}
+% Melchior Franz: \textit{The \xpackage{soul} package};
+% 2003/11/17;\\
+% \CTAN{macros/latex/contrib/soul/}.
+%
+% \bibitem{ucs}
+% Dominique P. G. Unruh: \textit{\xpackage{ucs.sty} -- Unicode Support};
+% 2004/10/17;\\
+% \CTAN{macros/latex/contrib/unicode/}.
+%
+% \bibitem{utf8}
+% Frank Mittelbach, Chris Rowley:
+% \textit{Providing some UTF-8 support via \xpackage{inputenc}};
+% 2006/03/30;\\
+% \CTAN{macros/latex/base/utf8ienc.dtx}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2007/09/09 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/soulutf8.pdf b/macros/latex/contrib/oberdiek/soulutf8.pdf
new file mode 100644
index 0000000000..cc93e0d6e4
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/soulutf8.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/stackrel.dtx b/macros/latex/contrib/oberdiek/stackrel.dtx
new file mode 100644
index 0000000000..880d2ed92b
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/stackrel.dtx
@@ -0,0 +1,542 @@
+% \iffalse meta-comment
+%
+% File: stackrel.dtx
+% Version: 2016/05/16 v1.3
+% Info: Adding subscript option to stackrel
+%
+% Copyright (C) 2006, 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file stackrel.dtx
+% and the derived files
+% stackrel.sty, stackrel.pdf, stackrel.ins, stackrel.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/stackrel.dtx
+% CTAN:macros/latex/contrib/oberdiek/stackrel.pdf
+%
+% Unpacking:
+% (a) If stackrel.ins is present:
+% tex stackrel.ins
+% (b) Without stackrel.ins:
+% tex stackrel.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{stackrel.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If stackrel.drv is present:
+% latex stackrel.drv
+% (b) Without stackrel.drv:
+% latex stackrel.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 stackrel.dtx
+% makeindex -s gind.ist stackrel.idx
+% pdflatex stackrel.dtx
+% makeindex -s gind.ist stackrel.idx
+% pdflatex stackrel.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/stackrel.sty
+% TDS:doc/latex/oberdiek/stackrel.pdf
+% TDS:source/latex/oberdiek/stackrel.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: stackrel 2016/05/16 v1.3 Adding subscript option to stackrel (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: stackrel
+Version: 2016/05/16 v1.3
+
+Copyright (C) 2006, 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file stackrel.dtx
+and the derived files
+ stackrel.sty, stackrel.pdf, stackrel.ins, stackrel.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{stackrel.ins}{\from{stackrel.dtx}{install}}%
+ \file{stackrel.drv}{\from{stackrel.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{stackrel.sty}{\from{stackrel.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{stackrel.xml}{\from{stackrel.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{* stackrel.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `stackrel.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{stackrel.drv}%
+ [2016/05/16 v1.3 Adding subscript option to stackrel (HO)]%
+\documentclass{ltxdoc}
+\usepackage{amsmath}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{stackrel}[2016/05/16]
+\begin{document}
+ \DocInput{stackrel.dtx}%
+\end{document}
+%</driver>
+% \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{stackrel.drv}
+%
+% \title{The \xpackage{stackrel} package}
+% \date{2016/05/16 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package adds an optional argument to \cs{stackrel} for
+% putting something below the relational symbol and defines
+% \cs{stackbin} for binary symbols.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% \LaTeX's \cs{stackrel} allows a superscript above a relational symbol,
+% but pure \LaTeX\ does not provide a macro for putting a subscript
+% below the symbol. This is supported by \AmS\LaTeX's \cs{underset}
+% macro that works on both relational and binary symbols. A combination
+% of \cs{underset} and \cs{overset} can be used to put \mbox{sub-} and
+% superscripts to the same symbol.
+%
+% This package \xpackage{stackrel} extends the syntax of \cs{stackrel}
+% by adding an optional argument for the subscript position.
+% It follows the syntax of extensible arrows of packages
+% \xpackage{amsmath} and \xpackage{mathtools}.
+%
+% \begin{declcs}{stackrel}
+% |[|\meta{subscript}|]| \M{superscript} \M{rel}\\
+% \cs{stackbin}
+% |[|\meta{subscript}|]| \M{superscript} \M{bin}
+% \end{declcs}
+% Example:
+% \begin{quote}
+% |A \stackbin[\text{and}]{}{+} B \stackrel[x]{!}{=} C|\\
+% $A \stackbin[\text{and}]{}{+} B \stackrel[x]{!}{=} C$
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{stackrel}
+ [2016/05/16 v1.3 Adding subscript option to stackrel (HO)]%
+% \end{macrocode}
+%
+% Given the original definition of \cs{stackrel} the addition
+% of the optional argument is straightforward. If an argument
+% is empty, then the corresponding sub- or superscript is
+% suppressed.
+%
+% Depending on the available resources (\eTeX, \pdfTeX)
+% three methods are given for testing emptyness. All tests
+% allow the hash to be used inside the arguments without
+% doubling (for the unlikely case that someone wants to
+% define macros with arguments).
+% \begin{macro}{\stack@relbin}
+% \begin{macrocode}
+\RequirePackage{etexcmds}[2007/09/09]
+\ifetex@unexpanded
+ \RequirePackage{pdftexcmds}[2016/05/16]%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdf@strcmp\endcsname\relax
+ \newcommand*{\stack@relbin}[3][]{%
+ \mathop{#3}\limits
+ \edef\reserved@a{\etex@unexpanded{#1}}%
+ \ifx\reserved@a\@empty\else_{#1}\fi
+ \edef\reserved@a{\etex@unexpanded{#2}}%
+ \ifx\reserved@a\@empty\else^{#2}\fi
+ \egroup
+ }%
+ \else
+ \newcommand*{\stack@relbin}[3][]{%
+ \mathop{#3}\limits
+ \ifcase\pdf@strcmp{\detokenize{#1}}{}\else_{#1}\fi
+ \ifcase\pdf@strcmp{\detokenize{#2}}{}\else^{#2}\fi
+ \egroup
+ }%
+ \fi
+\else
+ \newcommand*{\stack@relbin}[3][]{%
+ \mathop{#3}\limits
+ \toks@{#1}%
+ \edef\reserved@a{\the\toks@}%
+ \ifx\reserved@a\@empty\else_{#1}\fi
+ \toks@{#2}%
+ \edef\reserved@a{\the\toks@}%
+ \ifx\reserved@a\@empty\else^{#2}\fi
+ \egroup
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\stackrel}
+% \begin{macrocode}
+\renewcommand*{\stackrel}{%
+ \mathrel\bgroup\stack@relbin
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\stackbin}
+% \begin{macrocode}
+\newcommand*{\stackbin}{%
+ \mathbin\bgroup\stack@relbin
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/stackrel}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/stackrel.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/stackrel.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[\CTAN{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 stackrel.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@{}}
+% stackrel.sty & tex/latex/oberdiek/stackrel.sty\\
+% stackrel.pdf & doc/latex/oberdiek/stackrel.pdf\\
+% stackrel.dtx & source/latex/oberdiek/stackrel.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk stackrel.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{stackrel.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 stackrel.dtx
+%makeindex -s gind.ist stackrel.idx
+%pdflatex stackrel.dtx
+%makeindex -s gind.ist stackrel.idx
+%pdflatex stackrel.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{stackrel.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='stackrel'>
+ <name>stackrel</name>
+ <caption>Enhancement to the \stackrel command.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006,2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ This package adds an optional argument to <tt>\stackrel</tt> for
+ putting something below the relational symbol and defines
+ <tt>\stackbin</tt> for binary symbols.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/stackrel.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/stackrel.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2006/12/02 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/05/06 v1.1}
+% \item
+% Uses package \xpackage{etexcmds}.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.2}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.3}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \clearpage
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/stackrel.pdf b/macros/latex/contrib/oberdiek/stackrel.pdf
new file mode 100644
index 0000000000..89aba3dcfe
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/stackrel.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/stampinclude.dtx b/macros/latex/contrib/oberdiek/stampinclude.dtx
new file mode 100644
index 0000000000..e7b087e078
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/stampinclude.dtx
@@ -0,0 +1,691 @@
+% \iffalse meta-comment
+%
+% File: stampinclude.dtx
+% Version: 2016/05/16 v1.1
+% Info: Include files based on time stamps
+%
+% Copyright (C) 2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file stampinclude.dtx
+% and the derived files
+% stampinclude.sty, stampinclude.pdf, stampinclude.ins, stampinclude.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/stampinclude.dtx
+% CTAN:macros/latex/contrib/oberdiek/stampinclude.pdf
+%
+% Unpacking:
+% (a) If stampinclude.ins is present:
+% tex stampinclude.ins
+% (b) Without stampinclude.ins:
+% tex stampinclude.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{stampinclude.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If stampinclude.drv is present:
+% latex stampinclude.drv
+% (b) Without stampinclude.drv:
+% latex stampinclude.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 stampinclude.dtx
+% makeindex -s gind.ist stampinclude.idx
+% pdflatex stampinclude.dtx
+% makeindex -s gind.ist stampinclude.idx
+% pdflatex stampinclude.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/stampinclude.sty
+% TDS:doc/latex/oberdiek/stampinclude.pdf
+% TDS:source/latex/oberdiek/stampinclude.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: stampinclude 2016/05/16 v1.1 Include files based on time stamps (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: stampinclude
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file stampinclude.dtx
+and the derived files
+ stampinclude.sty, stampinclude.pdf, stampinclude.ins, stampinclude.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{stampinclude.ins}{\from{stampinclude.dtx}{install}}%
+ \file{stampinclude.drv}{\from{stampinclude.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{stampinclude.sty}{\from{stampinclude.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{stampinclude.xml}{\from{stampinclude.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{* stampinclude.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `stampinclude.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{stampinclude.drv}%
+ [2016/05/16 v1.1 Include files based on time stamps (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{stampinclude.dtx}%
+\end{document}
+%</driver>
+% \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{stampinclude.drv}
+%
+% \title{The \xpackage{stampinclude} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package replaces \cs{includeonly} and selects the files for
+% \cs{include} by inspecting the time stamp of the \xext{aux} file.
+% The file is selected for inclusion if the \xext{aux} file does
+% not yet exist or is older than the corresponding \xext{tex} file.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+% \label{sec:intro}
+%
+% \LaTeX\ provides two commands \cs{include} and \cs{includeonly}
+% that helps in organizing large projects.
+% Example for a master file:
+%\begin{quote}
+%\begin{verbatim}
+%\documentclass{book}
+% % \includeonly{}
+%\begin{document}
+% \include{fileA}
+% \include{fileB}
+% \include{fileC}
+%\end{document}
+%\end{verbatim}
+%\end{quote}
+% All files are read and compiled if \cs{includeonly} is not
+% executed. Otherwise you can give \cs{includeonly} a list
+% of files in the preamble, e.g.:
+% \begin{quote}
+% |\includeonly{fileA,fileC}|
+% \end{quote}
+% Now only files \xfile{fileA.tex} and \xfile{fileC.tex} are read
+% and compiled.
+%
+% If you change file \xfile{fileB.tex} and want to see only this
+% file, then you must change the line with \cs{includeonly} to
+% \begin{quote}
+% |\includeonly{fileB}|
+% \end{quote}
+% It is tedious to do this again and again, if different files
+% are changed.
+%
+% Package \xpackage{askinclude} \cite{askinclude}
+% offers a solution for this problem. It interactively asks
+% for the files to be included and saves the user from
+% editing the master file.
+%
+% This package \xpackage{stampinclude} goes another way.
+% \LaTeX\ reads and writes a separate \xext{aux} file for each
+% file that is included by \cs{include}. There \LaTeX\ remembers
+% counter valuses. Changed \xext{tex}
+% files can therefore be detected by comparing the file date stamp of
+% the \xext{tex} file with the date stamp of its \xext{aux} file.
+% Since version 1.30.0 \pdfTeX\ provides \cs{pdffilemoddate}
+% that reads the file date stamp. Thus this package uses this
+% command and redefines
+% \cs{include} to include the files that do not have \xext{aux}
+% files yet or that are newer than its \xext{aux} file.
+% \cs{includeonly} is ignored.
+%
+% \subsection{Usage}
+%
+% The package is loaded as normal \LaTeX\ package without options:
+% \begin{quote}
+% |\usepackage{stampinclude}|
+% \end{quote}
+% Alternatively the package may be loaded on the command line
+% (Example for shell `bash'):
+% \begin{center}
+% |latex '\AtBeginDocument{\usepackage{stampinclude}}\input{master}'|
+% \end{center}
+% Without \cs{AtBeginDocument} (and \cs{RequirePackage} instead of
+% \cs{usepackage}) \TeX\ would name the document \xfile{stampinclude.dvi}
+% instead of \xfile{master.dvi}.
+%
+% \subsection{Limitations}
+%
+% \subsubsection{Other file dependencies}
+%
+% A file that is included by \cs{include} may input ore reference
+% other files:
+% \begin{itemize}
+% \item other \TeX\ files using \cs{input},
+% \item graphics files (\cs{includegraphics}),
+% \item listings of external files,
+% \item ...
+% \end{itemize}
+% Updates of those files are not detected by this package.
+% It limits the date stamp comparison of an \xext{aux} file
+% to its \xext{tex} file.
+%
+% \subsubsection{\cs{include} dependencies}
+%
+% In the example, given in the introduction \ref{sec:intro},
+% three files \xfile{fileA}, \xfile{fileB}, and \xfile{fileC}
+% are included in this order. Now file \xfile{fileA} is changed by adding
+% four pages, \xfile{fileB} remains untouched, and \xfile{fileC} is
+% also updated. Then the package only selects \xfile{fileA} and
+% \xfile{fileC} for inclusion. File \xfile{fileB} is not included.
+% But \LaTeX\ has stored the counter values that are active
+% at the end of \xfile{fileB} in \xfile{fileB.aux} in one of the
+% previous runs when \xfile{fileB} was included.
+% However the later addition of four pages in \xfile{fileA}
+% was not known at that time. Therefore \xfile{fileB.aux}
+% is out of date and the inclusion of file \xfile{fileC}
+% starts with wrong counter values (especially the page counter).
+%
+% \subsubsection{Summary}
+%
+% This package \xpackage{stampinclude} and the \cs{include} feature
+% helps in accelerating the \LaTeX\ compilation.
+% But it is not intended for generating the final version.
+% For the final version of the document it is better to include
+% \emph{all} files to get all counter values right.
+% Then this package and any \cs{includeonly} lines should be commented out:
+%\begin{quote}
+% |% \usepackage{stampinclude}|\\
+% |% \includeonly{...}|
+%\end{quote}
+%
+% \subsection{Requirements}
+%
+% \begin{itemize}
+% \item \pdfTeX\ v1.30.0 (because of \cs{pdffilemoddate}
+% and \cs{pdfstrcmp}),\\
+% both modes for DVI and PDF are supported.
+% \item Alternatively Lua\TeX\ may be used.
+% It lacks \cs{pdffilemoddate} and \cs{pdfstrcmp}. But its services
+% are provided by package \xpackage{pdftexcmds} \cite{pdftexcmds}
+% that is automatically loaded.
+% \end{itemize}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{stampinclude}
+ [2016/05/16 v1.1 Include files based on time stamps (HO)]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{pdftexcmds}[2007/12/12]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\begingroup
+ \chardef\x=1 %
+ \expandafter\ifx\csname pdf@filemoddate\endcsname\relax
+ \chardef\x=0 %
+ \fi
+ \expandafter\ifx\csname pdf@strcmp\endcsname\relax
+ \chardef\x=0 %
+ \fi
+\expandafter\endgroup\ifcase\x
+ \PackageWarningNoLine{stampinclude}{%
+ \string\pdffilemoddate\space or %
+ \string\pdfstrcmp\space are not found,\MessageBreak
+ that are provided by pdfTeX >= 1.30.0.\MessageBreak
+ Also LuaTeX is not detected.\MessageBreak
+ Therefore package loading is aborted%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\SInc@org@include}
+% \begin{macrocode}
+\let\SInc@org@include\@include
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@include}
+% \begin{macrocode}
+\def\@include#1 {%
+ \IfFileExists{#1.aux}{%
+ \ifnum\pdf@strcmp{\pdf@filemoddate{#1.aux}}%
+ {\pdf@filemoddate{#1.tex}}<0 %
+ \ifx\@partlist\@empty
+ \gdef\@partlist{{#1}}%
+ \else
+ \g@addto@macro\@partlist{,{#1}}%
+ \fi
+ \fi
+ }{%
+ \ifx\@partlist\@empty
+ \gdef\@partlist{{#1}}%
+ \else
+ \g@addto@macro\@partlist{,{#1}}%
+ \fi
+ }%
+ \SInc@org@include{#1} \relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\includeonly}
+% Macro \cs{includeonly} is ignored.
+% \begin{macrocode}
+\renewcommand*{\includeonly}[1]{%
+ \PackageInfo{stampinclude}{%
+ Ignoring \string\includeonly
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Simulate \cs{includeonly}.
+% \begin{macrocode}
+\@partswtrue
+\gdef\@partlist{}
+% \end{macrocode}
+%
+% Print included files at end of document.
+% \begin{macrocode}
+\AtEndDocument{%
+ \begingroup
+ \expandafter\let\expandafter\@partlist\expandafter\@empty
+ \expandafter\@for\expandafter\reserved@a
+ \expandafter:\expandafter=\@partlist\do{%
+ \ifx\@partlist\@empty
+ \edef\@partlist{\reserved@a}%
+ \else
+ \edef\@partlist{\@partlist, \reserved@a}%
+ \fi
+ }%
+ \typeout{********************%
+ ********************%
+ ********************%
+ ******************%
+ }%
+ \ifx\@partlist\@empty
+ \typeout{[stampinclude] No included files.}%
+ \else
+ \typeout{[stampinclude] Included files:}%
+ \typeout{\@partlist}%
+ \fi
+ \typeout{********************%
+ ********************%
+ ********************%
+ ******************%
+ }%
+ \endgroup
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/stampinclude}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/stampinclude.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/stampinclude.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[\CTAN{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 stampinclude.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@{}}
+% stampinclude.sty & tex/latex/oberdiek/stampinclude.sty\\
+% stampinclude.pdf & doc/latex/oberdiek/stampinclude.pdf\\
+% stampinclude.dtx & source/latex/oberdiek/stampinclude.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk stampinclude.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{stampinclude.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 stampinclude.dtx
+%makeindex -s gind.ist stampinclude.idx
+%pdflatex stampinclude.dtx
+%makeindex -s gind.ist stampinclude.idx
+%pdflatex stampinclude.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{stampinclude.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='stampinclude'>
+ <name>stampinclude</name>
+ <caption>Inclusion based on .aux file date stamps.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.1'/>
+ <description>
+ This package replaces <tt>\includeonly</tt> and selects the files for
+ <tt>\include</tt> by inspecting the timestamp of the <tt>.aux</tt> file.
+ The file is selected for inclusion if the <tt>.aux</tt> file does
+ not yet exist or is older than the corresponding <tt>.tex</tt> file.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/stampinclude.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/stampinclude.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{thebibliography}{9}
+% \bibitem{askinclude}
+% Pablo A. Straub, Heiko Oberdiek:
+% \textit{The \xpackage{askinclude} package};
+% 2007/10/23 v2.0;
+% \CTAN{macros/latex/contrib/oberdiek/askinclude.pdf}.
+%
+% \bibitem{pdftexcmds}
+% Heiko Oberdiek:
+% \textit{The \xpackage{pdftexcmds} package};
+% 2007/12/12 v0.3;
+% \CTAN{macros/latex/contrib/oberdiek/pdftexcmds.pdf}.
+%
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2008/07/14 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/stampinclude.pdf b/macros/latex/contrib/oberdiek/stampinclude.pdf
new file mode 100644
index 0000000000..b1538ef370
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/stampinclude.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/stringenc.dtx b/macros/latex/contrib/oberdiek/stringenc.dtx
new file mode 100644
index 0000000000..31c9813636
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/stringenc.dtx
@@ -0,0 +1,6893 @@
+% \iffalse meta-comment
+%
+% File: stringenc.dtx
+% Version: 2016/05/16 v1.11
+% Info: Convert strings between diff. encodings
+%
+% Copyright (C) 2007-2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 stringenc.dtx
+% and the derived files
+% stringenc.sty, stringenc.pdf, stringenc.ins, stringenc.drv,
+% se-utf32be.def, se-utf32le.def, se-utf8.def, se-utf16le.def,
+% se-pdfdoc.def, se-iso-8859-1.def, se-cp1252.def,
+% se-ascii.def, se-ascii-print.def, se-clean7bit.def,
+% se-iso-8859-2.def, se-iso-8859-3.def, se-iso-8859-4.def,
+% se-iso-8859-5.def, se-iso-8859-6.def, se-iso-8859-7.def,
+% se-iso-8859-8.def, se-iso-8859-9.def, se-iso-8859-10.def,
+% se-iso-8859-11.def, se-iso-8859-13.def, se-iso-8859-14.def,
+% se-iso-8859-15.def, se-iso-8859-16.def, se-koi8-r.def,
+% se-nextstep.def, se-mac-centeuro.def, se-mac-cyrillic.def,
+% se-mac-roman.def, se-dec-mcs.def, se-cp437.def,
+% se-cp850.def, se-cp852.def, se-cp855.def, se-cp858.def,
+% se-cp865.def, se-cp866.def, se-cp1250.def, se-cp1251.def,
+% se-cp1257.def, stringenc-test1.tex, stringenc-test2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/stringenc.dtx
+% CTAN:macros/latex/contrib/oberdiek/stringenc.pdf
+%
+% Unpacking:
+% (a) If stringenc.ins is present:
+% tex stringenc.ins
+% (b) Without stringenc.ins:
+% tex stringenc.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{stringenc.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If stringenc.drv is present:
+% latex stringenc.drv
+% (b) Without stringenc.drv:
+% latex stringenc.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 stringenc.dtx
+% makeindex -s gind.ist stringenc.idx
+% pdflatex stringenc.dtx
+% makeindex -s gind.ist stringenc.idx
+% pdflatex stringenc.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/stringenc.sty
+% TDS:tex/generic/oberdiek/se-utf32be.def
+% TDS:tex/generic/oberdiek/se-utf32le.def
+% TDS:tex/generic/oberdiek/se-utf8.def
+% TDS:tex/generic/oberdiek/se-utf16le.def
+% TDS:tex/generic/oberdiek/se-pdfdoc.def
+% TDS:tex/generic/oberdiek/se-iso-8859-1.def
+% TDS:tex/generic/oberdiek/se-cp1252.def
+% TDS:tex/generic/oberdiek/se-ascii.def
+% TDS:tex/generic/oberdiek/se-ascii-print.def
+% TDS:tex/generic/oberdiek/se-clean7bit.def
+% TDS:tex/generic/oberdiek/se-iso-8859-2.def
+% TDS:tex/generic/oberdiek/se-iso-8859-3.def
+% TDS:tex/generic/oberdiek/se-iso-8859-4.def
+% TDS:tex/generic/oberdiek/se-iso-8859-5.def
+% TDS:tex/generic/oberdiek/se-iso-8859-6.def
+% TDS:tex/generic/oberdiek/se-iso-8859-7.def
+% TDS:tex/generic/oberdiek/se-iso-8859-8.def
+% TDS:tex/generic/oberdiek/se-iso-8859-9.def
+% TDS:tex/generic/oberdiek/se-iso-8859-10.def
+% TDS:tex/generic/oberdiek/se-iso-8859-11.def
+% TDS:tex/generic/oberdiek/se-iso-8859-13.def
+% TDS:tex/generic/oberdiek/se-iso-8859-14.def
+% TDS:tex/generic/oberdiek/se-iso-8859-15.def
+% TDS:tex/generic/oberdiek/se-iso-8859-16.def
+% TDS:tex/generic/oberdiek/se-koi8-r.def
+% TDS:tex/generic/oberdiek/se-nextstep.def
+% TDS:tex/generic/oberdiek/se-mac-centeuro.def
+% TDS:tex/generic/oberdiek/se-mac-cyrillic.def
+% TDS:tex/generic/oberdiek/se-mac-roman.def
+% TDS:tex/generic/oberdiek/se-dec-mcs.def
+% TDS:tex/generic/oberdiek/se-cp437.def
+% TDS:tex/generic/oberdiek/se-cp850.def
+% TDS:tex/generic/oberdiek/se-cp852.def
+% TDS:tex/generic/oberdiek/se-cp855.def
+% TDS:tex/generic/oberdiek/se-cp858.def
+% TDS:tex/generic/oberdiek/se-cp865.def
+% TDS:tex/generic/oberdiek/se-cp866.def
+% TDS:tex/generic/oberdiek/se-cp1250.def
+% TDS:tex/generic/oberdiek/se-cp1251.def
+% TDS:tex/generic/oberdiek/se-cp1257.def
+% TDS:doc/latex/oberdiek/stringenc.pdf
+% TDS:doc/latex/oberdiek/test/stringenc-test1.tex
+% TDS:doc/latex/oberdiek/test/stringenc-test2.tex
+% TDS:source/latex/oberdiek/stringenc.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: stringenc 2016/05/16 v1.11 Convert strings between diff. encodings (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: stringenc
+Version: 2016/05/16 v1.11
+
+Copyright (C) 2007-2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 stringenc.dtx
+and the derived files
+ stringenc.sty, stringenc.pdf, stringenc.ins, stringenc.drv,
+ se-utf32be.def, se-utf32le.def, se-utf8.def, se-utf16le.def,
+ se-pdfdoc.def, se-iso-8859-1.def, se-cp1252.def,
+ se-ascii.def, se-ascii-print.def, se-clean7bit.def,
+ se-iso-8859-2.def, se-iso-8859-3.def, se-iso-8859-4.def,
+ se-iso-8859-5.def, se-iso-8859-6.def, se-iso-8859-7.def,
+ se-iso-8859-8.def, se-iso-8859-9.def, se-iso-8859-10.def,
+ se-iso-8859-11.def, se-iso-8859-13.def, se-iso-8859-14.def,
+ se-iso-8859-15.def, se-iso-8859-16.def, se-koi8-r.def,
+ se-nextstep.def, se-mac-centeuro.def, se-mac-cyrillic.def,
+ se-mac-roman.def, se-dec-mcs.def, se-cp437.def,
+ se-cp850.def, se-cp852.def, se-cp855.def, se-cp858.def,
+ se-cp865.def, se-cp866.def, se-cp1250.def, se-cp1251.def,
+ se-cp1257.def, stringenc-test1.tex, stringenc-test2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{stringenc.ins}{\from{stringenc.dtx}{install}}%
+ \file{stringenc.drv}{\from{stringenc.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{stringenc.sty}{\from{stringenc.dtx}{package}}%
+ \file{se-utf32be.def}{\from{stringenc.dtx}{utf32,utf32be}}%
+ \file{se-utf32le.def}{\from{stringenc.dtx}{utf32,utf32le}}%
+ \file{se-utf8.def}{\from{stringenc.dtx}{utf8}}%
+ \file{se-utf16le.def}{\from{stringenc.dtx}{utf16le}}%
+ \file{se-pdfdoc.def}{\from{stringenc.dtx}{pdfdoc}}%
+ \file{se-iso-8859-1.def}{\from{stringenc.dtx}{iso-8859-1}}%
+ \file{se-cp1252.def}{\from{stringenc.dtx}{cp1252}}%
+ \file{se-ascii.def}{\from{stringenc.dtx}{ascii}}%
+ \file{se-ascii-print.def}{\from{stringenc.dtx}{ascii-print}}%
+ \file{se-clean7bit.def}{\from{stringenc.dtx}{clean7bit}}%
+ \file{se-iso-8859-2.def}{\from{stringenc.dtx}{general,iso-8859-2}}%
+ \file{se-iso-8859-3.def}{\from{stringenc.dtx}{general,iso-8859-3}}%
+ \file{se-iso-8859-4.def}{\from{stringenc.dtx}{general,iso-8859-4}}%
+ \file{se-iso-8859-5.def}{\from{stringenc.dtx}{general,iso-8859-5}}%
+ \file{se-iso-8859-6.def}{\from{stringenc.dtx}{general,iso-8859-6}}%
+ \file{se-iso-8859-7.def}{\from{stringenc.dtx}{general,iso-8859-7}}%
+ \file{se-iso-8859-8.def}{\from{stringenc.dtx}{general,iso-8859-8}}%
+ \file{se-iso-8859-9.def}{\from{stringenc.dtx}{general,iso-8859-9}}%
+ \file{se-iso-8859-10.def}{\from{stringenc.dtx}{general,iso-8859-10}}%
+ \file{se-iso-8859-11.def}{\from{stringenc.dtx}{general,iso-8859-11}}%
+ \file{se-iso-8859-13.def}{\from{stringenc.dtx}{general,iso-8859-13}}%
+ \file{se-iso-8859-14.def}{\from{stringenc.dtx}{general,iso-8859-14}}%
+ \file{se-iso-8859-15.def}{\from{stringenc.dtx}{general,iso-8859-15}}%
+ \file{se-iso-8859-16.def}{\from{stringenc.dtx}{general,iso-8859-16}}%
+ \file{se-koi8-r.def}{\from{stringenc.dtx}{general,koi8-r}}%
+ \file{se-nextstep.def}{\from{stringenc.dtx}{general,nextstep}}%
+ \file{se-mac-centeuro.def}{\from{stringenc.dtx}{general,mac-centeuro}}%
+ \file{se-mac-cyrillic.def}{\from{stringenc.dtx}{general,mac-cyrillic}}%
+ \file{se-mac-roman.def}{\from{stringenc.dtx}{general,mac-roman}}%
+ \file{se-dec-mcs.def}{\from{stringenc.dtx}{general,dec-mcs}}%
+ \file{se-cp437.def}{\from{stringenc.dtx}{general,cp437}}%
+ \file{se-cp850.def}{\from{stringenc.dtx}{general,cp850}}%
+ \file{se-cp852.def}{\from{stringenc.dtx}{general,cp852}}%
+ \file{se-cp855.def}{\from{stringenc.dtx}{general,cp855}}%
+ \file{se-cp858.def}{\from{stringenc.dtx}{general,cp858}}%
+ \file{se-cp865.def}{\from{stringenc.dtx}{general,cp865}}%
+ \file{se-cp866.def}{\from{stringenc.dtx}{general,cp866}}%
+ \file{se-cp1250.def}{\from{stringenc.dtx}{general,cp1250}}%
+ \file{se-cp1251.def}{\from{stringenc.dtx}{general,cp1251}}%
+ \file{se-cp1257.def}{\from{stringenc.dtx}{general,cp1257}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{stringenc-test1.tex}{\from{stringenc.dtx}{test1}}%
+% \file{stringenc-test2.tex}{\from{stringenc.dtx}{test2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{stringenc.xml}{\from{stringenc.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{* stringenc.sty, se-utf32be.def, se-utf32le.def, se-utf8.def,}
+\Msg{* se-utf16le.def, se-pdfdoc.def, se-iso-8859-1.def,}
+\Msg{* se-cp1252.def, se-ascii.def, se-ascii-print.def,}
+\Msg{* se-clean7bit.def, se-iso-8859-2.def, se-iso-8859-3.def,}
+\Msg{* se-iso-8859-4.def, se-iso-8859-5.def, se-iso-8859-6.def,}
+\Msg{* se-iso-8859-7.def, se-iso-8859-8.def, se-iso-8859-9.def,}
+\Msg{* se-iso-8859-10.def, se-iso-8859-11.def, se-iso-8859-13.def,}
+\Msg{* se-iso-8859-14.def, se-iso-8859-15.def, se-iso-8859-16.def,}
+\Msg{* se-koi8-r.def, se-nextstep.def, se-mac-centeuro.def,}
+\Msg{* se-mac-cyrillic.def, se-mac-roman.def, se-dec-mcs.def,}
+\Msg{* se-cp437.def, se-cp850.def, se-cp852.def, se-cp855.def,}
+\Msg{* se-cp858.def, se-cp865.def, se-cp866.def, se-cp1250.def,}
+\Msg{* se-cp1251.def, se-cp1257.def}
+\Msg{*}
+\Msg{* To produce the documentation run the file `stringenc.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{stringenc.drv}%
+ [2016/05/16 v1.11 Convert strings between diff. encodings (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{longtable}
+\begin{document}
+ \DocInput{stringenc.dtx}%
+\end{document}
+%</driver>
+% \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{stringenc.drv}
+%
+% \title{The \xpackage{stringenc} package}
+% \date{2016/05/16 v1.11}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides \cs{StringEncodingConvert} for converting
+% a string between different encodings.
+% Both \LaTeX\ and \plainTeX\ are supported.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{User interface}
+%
+% \begin{declcs}{StringEncodingConvert} \M{cmd} \M{string} \M{from} \M{to}
+% \end{declcs}
+% Macro \cs{StringEncodingConvert} converts \meta{string} from encoding
+% \meta{from} to encoding \meta{to} and stores the result in macro
+% \meta{cmd}. If the string contains macros, then they are expanded.
+% This can be prevented by \eTeX's \cs{detokenize}:
+%\begin{quote}
+%\begin{verbatim}
+%\StringEncodingConvert\Result{%
+% \detokenize{Hello \textbf{world}!}%
+%}{ascii}{utf8}
+%\end{verbatim}
+%\end{quote}
+% or using \LaTeX's \cs{@onelevel@sanitize}:
+%\begin{quote}
+%\begin{verbatim}
+%\makeatletter
+%\newcommand*{\HelloWorld}{Hello \textbf{world}!}
+%\sanitize@onelevel\HelloWorld
+%\StringEncodingConvert\Result\HelloWorld{ascii}{utf8}
+%\makeatother
+%\end{verbatim}
+%\end{quote}
+%
+% \begin{declcs}{StringEncodingSuccessFailure} \M{success} \M{failure}
+% \end{declcs}
+% When \cs{StringEncodingConvert} converts a string
+% it sets a flag that indicates whether the operation
+% was successful. The conversion can fail, if
+% the input is faulty or the string cannot be encoded
+% in the new encoding. Faulty characters are dropped.
+% Macro \cs{StringEncodingSuccessFailure} calls code \meta{success}
+% if the conversion was successful, otherwise \meta{failure}
+% is called.
+% Example:
+%\begin{quote}
+%\begin{verbatim}
+%\StringEncodingConvert\Result{Hello world!}{ascii}{utf8}
+%\StringEncodingSuccessFailure{%
+% % \Result contains the successfully converted string.
+%}{%
+% % Problems during conversion. \Result is empty or
+% % misses some characters.
+%}
+%\end{verbatim}
+%\end{quote}
+%
+% \begin{declcs}{StringEncodingConvertTest}
+% \M{cmd} \M{string} \M{from} \M{to} \M{success} \M{failure}
+% \end{declcs}
+% Macro \cs{StringEncodingConvertTest} is more efficient
+% than \cs{StringEncodingConvert} if the converted string
+% does not interest in case of an error,
+% because the conversion stops at the first error.
+% If \meta{string} can be successfully converted from encoding
+% \meta{from} to encoding \meta{to}, then macro \meta{cmd} contains
+% the result and code \meta{success} is executed. Otherwise
+% code \meta{failure} is executed, the contents of \meta{cmd} is
+% undefined.
+%
+% \begin{declcs}{StringEncodingList}
+% \end{declcs}
+% Macro \cs{StringEncodingList} contains a comma separated
+% list of supported encodings (without alias names).
+%
+% \subsection{Supported encodings}
+%
+% \begin{longtable}{@{}ll@{}}
+% \xoption{ascii}, \xoption{us-ascii} & ASCII encoding,\\
+% & 8bit characters disabled\\
+% \xoption{ascii-print}, \xoption{ascii-printable}
+% & printable ASCII characters\\
+% & including space (0x20--0x7E)\\
+% \xoption{clean7bit} & \texttt{\%\%DocumentData:\ Clean7Bit}\\
+% & bytes 0x1B to 0x7E, 0x0A (LF),\\
+% & 0x0D (CR), 0x09 (TAB)\\
+% \xoption{cp437}, \xoption{cp437de} & Code page 437\\
+% \xoption{cp850} & Code page 850\\
+% \xoption{cp852} & Code page 852\\
+% \xoption{cp855} & Code page 855\\
+% \xoption{cp858} & Code page 858\\
+% \xoption{cp865} & Code page 865\\
+% \xoption{cp866} & Code page 866\\
+% \xoption{cp1250} & Code page 1250\\
+% \xoption{cp1251} & Code page 1251\\
+% \xoption{cp1252}, \xoption{ansinew} & Code page 1252\\
+% \xoption{cp1257} & Code page 1257\\
+% \xoption{dec-mcs}, \xoption{decmulti} & DEC Multinational\\
+% \xoption{koi8-r} & KOI8-R (RFC1489)\\
+% \xoption{iso-8859-1}, \xoption{latin1} & ISO-8859-1\\
+% \xoption{iso-8859-2}, \xoption{latin2} & ISO-8859-2\\
+% \xoption{iso-8859-3}, \xoption{latin3} & ISO-8859-3\\
+% \xoption{iso-8859-4}, \xoption{latin4} & ISO-8859-4\\
+% \xoption{iso-8859-5}, \xoption{iso88595} & ISO-8859-5\\
+% \xoption{iso-8859-6} & ISO-8859-6\\
+% \xoption{iso-8859-7} & ISO-8859-7\\
+% \xoption{iso-8859-8} & ISO-8859-8\\
+% \xoption{iso-8859-9}, \xoption{latin5} & ISO-8859-9\\
+% \xoption{iso-8859-10}, \xoption{latin6} & ISO-8859-10\\
+% \xoption{iso-8859-11} & ISO-8859-11\\
+% \xoption{iso-8859-13}, \xoption{latin7} & ISO-8859-13\\
+% \xoption{iso-8859-14}, \xoption{latin8} & ISO-8859-14\\
+% \xoption{iso-8859-15}, \xoption{latin9} & ISO-8859-15\\
+% \xoption{iso-8859-16}, \xoption{latin10} & ISO-8859-16\\
+% \xoption{mac-centeuro}, \xoption{mac-ce}, \xoption{macce}& MAC OS Central European\\
+% \xoption{mac-cyrillic}, \xoption{maccyr}, \xoption{mac-ukrainian}, \xoption{macukr}
+% & MAC OS Cyrillic\\
+% \xoption{mac-roman}, \xoption{applemac} & MAC OS Roman\\
+% \xoption{nextstep}, \xoption{next} & NextStep Encoding\\
+% \xoption{pdfdoc} & PDFDocEncoding\\
+% \xoption{utf8}, \xoption{utf-8} & UTF-8\\
+% \xoption{utf16be}, \xoption{utf-16be}, \xoption{utf16}, \xoption{utf-16}
+% & UTF-16BE\\
+% \xoption{utf16le}, \xoption{utf-16le} & UTF-16LE\\
+% \xoption{utf32be}, \xoption{utf-32be}, \xoption{utf32}, \xoption{utf-32}
+% & UTF-32BE\\
+% \xoption{utf32le}, \xoption{utf-32le} & UTF-32LE\\
+% \end{longtable}
+%
+% \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@stringenc.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{stringenc}{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@stringenc.sty\endcsname
+\ProvidesPackage{stringenc}%
+ [2016/05/16 v1.11 Convert strings between diff. encodings (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 SE@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#3{%
+ \edef\SE@AtEnd{%
+ \SE@AtEnd
+ #1#2=\the#1#2\relax
+ }%
+ #1#2=#3\relax
+}
+\TMP@EnsureCode\catcode{34}{12}% "
+\TMP@EnsureCode\catcode{36}{3}% $
+\TMP@EnsureCode\catcode{38}{4}% &
+\TMP@EnsureCode\catcode{39}{12}% '
+\TMP@EnsureCode\catcode{40}{12}% (
+\TMP@EnsureCode\catcode{41}{12}% )
+\TMP@EnsureCode\catcode{42}{12}% *
+\TMP@EnsureCode\catcode{43}{12}% +
+\TMP@EnsureCode\catcode{44}{12}% ,
+\TMP@EnsureCode\catcode{45}{12}% -
+\TMP@EnsureCode\catcode{46}{12}% .
+\TMP@EnsureCode\catcode{47}{12}% /
+\TMP@EnsureCode\catcode{58}{12}% :
+\TMP@EnsureCode\catcode{60}{12}% <
+\TMP@EnsureCode\catcode{62}{12}% >
+\TMP@EnsureCode\catcode{91}{12}% [
+\TMP@EnsureCode\catcode{93}{12}% ]
+\TMP@EnsureCode\catcode{94}{7}% ^
+\TMP@EnsureCode\catcode{96}{12}% `
+\TMP@EnsureCode\uccode{34}{0}% "
+\TMP@EnsureCode\uccode{48}{0}% 0
+\TMP@EnsureCode\uccode{61}{0}% =
+\edef\SE@AtEnd{\SE@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Tools}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input infwarerr.sty\relax
+ \input ltxcmds.sty\relax
+ \input pdfescape.sty\relax
+\else
+ \RequirePackage{infwarerr}[2007/09/09]%
+ \RequirePackage{ltxcmds}[2010/03/01]%
+ \RequirePackage{pdfescape}[2010/03/01]%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\SE@GobbleEight}
+% \begin{macrocode}
+\long\def\SE@GobbleEight#1#2#3#4#5#6#7#8{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@CarTwo}
+% \begin{macrocode}
+\long\def\SE@CarTwo#1#2#3\@nil{#1#2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@PrefixFrom}
+% \begin{macrocode}
+\def\SE@PrefixFrom{SE<}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@PrefixSurrogateFrom}
+% \begin{macrocode}
+\def\SE@PrefixSurrogateFrom{SE<<}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@PrefixTo}
+% \begin{macrocode}
+\def\SE@PrefixTo{SE>}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@PrefixSurrogateTo}
+% \begin{macrocode}
+\def\SE@PrefixSurrogateTo{SE>>}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@ResultAdd}
+% \begin{macrocode}
+\def\SE@ResultAdd#1{%
+ \edef\SE@result{\SE@result#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname newif\endcsname\relax
+% \end{macrocode}
+% \begin{macro}{\SE@newif}
+% \begin{macrocode}
+ \def\SE@newif#1{%
+ \begingroup
+ \escapechar=-1 %
+ \expandafter\endgroup
+ \expandafter\SE@@newif\string#1\@nil
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@@newif}
+% \begin{macrocode}
+ \def\SE@@newif#1#2#3\@nil{%
+ \expandafter\edef\csname#3true\endcsname{%
+ \let
+ \expandafter\noexpand\csname if#3\endcsname
+ \expandafter\noexpand\csname iftrue\endcsname
+ }%
+ \expandafter\edef\csname#3false\endcsname{%
+ \let
+ \expandafter\noexpand\csname if#3\endcsname
+ \expandafter\noexpand\csname iffalse\endcsname
+ }%
+ \csname#3false\endcsname
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\else
+% \end{macrocode}
+% \begin{macro}{\SE@newif}
+% \begin{macrocode}
+ \expandafter\let\expandafter\SE@newif\csname newif\endcsname
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\SE@newif\ifSE@invalid
+% \end{macrocode}
+%
+% \begin{macro}{\SE@InvalidCharacter}
+% \begin{macrocode}
+\def\SE@InvalidCharacter{%
+ \SE@invalidtrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@ConvertTo}
+% The input string |#2| of macro \cs{SE@ConvertTo} is given
+% as hex string in UTF-16. It is converted to encoding |#3| and
+% the result is stored in macro |#1|.
+% \begin{macrocode}
+\def\SE@ConvertTo#1#2#3{%
+ \let\SE@result\ltx@empty
+ \EdefSanitize\SE@encoding{#3}%
+ \expandafter\ifx\csname\SE@PrefixTo\SE@encoding\endcsname\relax
+ \StringEncodingLoad\SE@encoding
+ \fi
+ \expandafter\ifx\csname\SE@PrefixTo\SE@encoding\endcsname\relax
+ \@PackageError{stringenc}{%
+ Conversion to encoding `\SE@encoding'\MessageBreak
+ is not supported%
+ }\@ehc
+ \else
+ \expandafter\let\expandafter\SE@ConvertNormal
+ \csname\SE@PrefixTo\SE@encoding\endcsname
+ \expandafter\let\expandafter\SE@ConvertSurrogate
+ \csname\SE@PrefixSurrogateTo\SE@encoding\endcsname
+ \SE@@ConvertTo#2\relax\relax\relax\relax
+ \fi
+ \let#1\SE@result
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@@ConvertTo}
+% \begin{macrocode}
+\def\SE@@ConvertTo#1#2#3#4{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifx#4\relax
+ \let\SE@next\relax
+ \SE@InvalidCharacter
+ \else
+ \let\SE@next\SE@@ConvertTo
+ \ifnum"#1#2#3#4<"D800 %
+ \SE@ConvertNormal#1#2#3#4%
+ \else
+ \ifnum"#1#2#3#4>"DFFF %
+ \SE@ConvertNormal#1#2#3#4%
+ \else
+ \ifnum"#1#2#3#4>"DBFF %
+ \SE@InvalidCharacter
+ \else
+ \def\SE@high{#1#2#3#4}%
+ \let\SE@next\SE@@ScanLow
+ \fi
+ \fi
+ \fi
+ \ifSE@TestMode
+ \ifSE@invalid
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \fi
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@SkipRemaining}
+% \begin{macrocode}
+\def\SE@SkipRemaining#1\relax{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@@ScanLow}
+% \begin{macrocode}
+\def\SE@@ScanLow#1#2#3#4{%
+ \ifx#4\relax
+ \SE@InvalidCharacter
+ \let\SE@next\relax
+ \else
+ \ifcase\ifnum"#1#2#3#4<"DC00 %
+ \ltx@zero
+ \else
+ \ifnum"#1#2#3#4>"DFFF %
+ \ltx@zero
+ \else
+ \ltx@one
+ \fi
+ \fi
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \else
+ \def\SE@next{SE@@ConvertTo#1#2#3#4}%
+ \fi
+ \else
+ \ifx\SE@ConvertSurrogate\relax
+ \else
+ \expandafter\SE@ConvertSurrogate\SE@high#1#2#3#4%
+ \fi
+ \let\SE@next\SE@@ConvertTo
+ \ifSE@TestMode
+ \ifSE@invalid
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \fi
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@ConvertFrom}
+% The input string |#2| of macro \cs{SE@ConvertTo} is given
+% as hex string in encoding |#3|. It is converted to UTF-16 and
+% the result is stored in macro |#1|.
+% \begin{macrocode}
+\def\SE@ConvertFrom#1#2#3{%
+ \let\SE@result\ltx@empty
+ \EdefSanitize\SE@encoding{#3}%
+ \expandafter\ifx\csname\SE@PrefixFrom\SE@encoding\endcsname\relax
+ \StringEncodingLoad\SE@encoding
+ \fi
+ \expandafter\ifx\csname\SE@PrefixFrom\SE@encoding\endcsname\relax
+ \@PackageError{stringenc}{%
+ Conversion from encoding `\SE@encoding'\MessageBreak
+ is not supported%
+ }\@ehc
+ \else
+ \csname\SE@PrefixFrom\SE@encoding\endcsname{#2}%
+ \fi
+ \let#1\SE@result
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\StringEncodingLoad}
+% Macro \cs{StringEncodingLoad} loads an encoding definition
+% file. However the loading can occur everywhere, even inside
+% verbatim settings. Therefore we must ensure the catcodes
+% of all used special characters. The exception are digits
+% and letters.
+% \begin{macrocode}
+\def\StringEncodingLoad#1{%
+ \begingroup
+ \catcode32=10 % space/space
+ \catcode35=6 % #/parameter
+ \catcode37=14 % percent/comment character
+ \catcode92=0 % backslash/escape character
+ \catcode123=1 % {/beginning of group
+ \catcode125=2 % }/end of group
+ \endlinechar=-1 %
+ \SE@MakeLetters @ABCDEFGHIKLMNOPRSTU%
+ abcdefghiklmnoprstuvwxyz\relax
+ \SE@MakeOthers "-./:<=>[]0123456789\relax
+ \expandafter\ifx\csname ProvidesFile\endcsname\relax
+ \def\ProvidesFile##1[##2]{%
+ \immediate\write-1{File: ##1 ##2}%
+ }%
+ \fi
+ \SE@InputIfFileExists{se-#1.def}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@MakeLetters}
+% \begin{macrocode}
+\def\SE@MakeLetters#1{%
+ \ifx#1\relax
+ \else
+ \catcode`#1=11 %
+ \expandafter\SE@MakeLetters
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@MakeOthers}
+% \begin{macrocode}
+\def\SE@MakeOthers#1{%
+ \ifx#1\relax
+ \else
+ \catcode`#1=12 %
+ \expandafter\SE@MakeOthers
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@InputIfFileExists}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname IfFileExists\endcsname\relax
+ \input pdftexcmds.sty\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdf@filesize\endcsname\relax
+ \def\SE@InputIfFileExists#1{%
+ \expandafter\ifx\csname @inputcheck\endcsname\relax
+ \csname newread\endcsname\@inputcheck
+ \fi
+ \openin\@inputcheck#1\relax
+ \ifeof\@inputcheck
+ \SE@FileNotFound{#1}%
+ \else
+ \SE@Input{#1}%
+ \fi
+ }%
+ \else
+ \def\SE@InputIfFileExists#1{%
+ \expandafter\expandafter\expandafter
+ \ifx\expandafter\expandafter\expandafter\\\pdf@filesize{#1}\\%
+ \SE@FileNotFound{#1}%
+ \else
+ \SE@Input{#1}%
+ \fi
+ }%
+ \fi
+\else
+ \def\SE@InputIfFileExists#1{%
+ \IfFileExists{#1}{%
+ \SE@Input{#1}%
+ }{%
+ \SE@FileNotFound{#1}%
+ }%
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@FileNotFound}
+% \begin{macrocode}
+\def\SE@FileNotFound#1{%
+ \@PackageWarning{stringenc}{%
+ Encoding file `#1'\MessageBreak
+ not found%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@Input}
+% \begin{macrocode}
+\def\SE@Input{%
+ \@ifnextchar\bgroup\@iinput\@@input
+}
+\ifx\input\SE@Input
+ \def\SE@Input#1{%
+ \input{#1}%
+ }%
+\else
+ \def\SE@Input#1{%
+ \input#1\relax
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSE@numexpr}
+% \begin{macrocode}
+\SE@newif\ifSE@numexpr
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+\else
+ \SE@numexprtrue
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ifSE@numexpr
+ \catcode36=9 % $ ignore
+ \catcode38=14 % & comment
+\else
+ \catcode36=14 % $ comment
+ \catcode38=9 % & ignore
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\SE@Nibble@NumToHex}
+% \begin{macrocode}
+\def\SE@Nibble@NumToHex#1{%
+$ \ifcase\numexpr#1\relax
+& \ifcase\expandafter\ltx@firstofone\expandafter{\number#1} %
+ 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
+ 8\or 9\or A\or B\or C\or D\or E\or F%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@Nibble@NumToBin}
+% \begin{macrocode}
+\def\SE@Nibble@NumToBin#1{%
+$ \ifcase\numexpr#1\relax
+& \ifcase\expandafter\ltx@firstofone\expandafter{\number#1} %
+ 0000\or
+ 0001\or
+ 0010\or
+ 0011\or
+ 0100\or
+ 0101\or
+ 0110\or
+ 0111\or
+ 1000\or
+ 1001\or
+ 1010\or
+ 1011\or
+ 1100\or
+ 1101\or
+ 1110\or
+ 1111%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@Nibbles@BinToHex}
+% \begin{macrocode}
+\def\SE@Nibbles@BinToHex#1{%
+ \expandafter\SE@@Nibbles@BinToHex#1\ltx@empty\ltx@empty
+ \ltx@empty\ltx@empty
+}
+\def\SE@@Nibbles@BinToHex#1#2#3#4{%
+ \ifx#1\ltx@empty
+ \else
+$ \SE@Nibble@NumToHex{%
+$ \numexpr#4+2*(#3+2*(#2+2*#1))\relax
+$ }%
+& \ifnum#1>\ltx@zero
+& \ifnum#2>\ltx@zero
+& \ifnum#3>\ltx@zero
+& \ifnum#4>\ltx@zero
+& F%
+& \else
+& E%
+& \fi
+& \else
+& \ifnum#4>\ltx@zero
+& D%
+& \else
+& C%
+& \fi
+& \fi
+& \else
+& \ifnum#3>\ltx@zero
+& \ifnum#4>\ltx@zero
+& B%
+& \else
+& A%
+& \fi
+& \else
+& \ifnum#4>\ltx@zero
+& 9%
+& \else
+& 8%
+& \fi
+& \fi
+& \fi
+& \else
+& \ifnum#2>\ltx@zero
+& \ifnum#3>\ltx@zero
+& \ifnum#4>\ltx@zero
+& 7%
+& \else
+& 6%
+& \fi
+& \else
+& \ifnum#4>\ltx@zero
+& 5%
+& \else
+& 4%
+& \fi
+& \fi
+& \else
+& \ifnum#3>\ltx@zero
+& \ifnum#4>\ltx@zero
+& 3%
+& \else
+& 2%
+& \fi
+& \else
+& \ifnum#4>\ltx@zero
+& 1%
+& \else
+& 0%
+& \fi
+& \fi
+& \fi
+& \fi
+ \expandafter\SE@@Nibbles@BinToHex
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@Add}
+% \begin{macrocode}
+\def\SE@Add#1#2#3{%
+$ \edef#1{\the\numexpr(#2)+(#3)\relax}%
+& \begingroup
+& \count\ltx@zero=#2\relax
+& \advance\count\ltx@zero by#3\relax
+& \edef\x{\endgroup
+& \def\noexpand#1{\the\count\ltx@zero}%
+& }%
+& \x
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@MapDeclare}
+% \begin{macrocode}
+\def\SE@MapDeclare#1#2#3{%
+ \SE@MapDeclareFrom{#1}{#2}{#3}%
+ \SE@MapDeclareTo{#1}{#2}{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@MapDeclareFrom}
+% \begin{macrocode}
+\def\SE@MapDeclareFrom#1#2#3{%
+ \expandafter\gdef\csname SE->#1@#2\endcsname{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@MapDeclareTo}
+% \begin{macrocode}
+\def\SE@MapDeclareTo#1#2#3{%
+ \expandafter\gdef\csname SE<-#1@#3\endcsname{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@MapConvertFrom}
+% \begin{macrocode}
+\def\SE@MapConvertFrom#1#2{%
+$ \ifcsname SE->#1@#2\endcsname
+$ \SE@ResultAdd{\csname SE->#1@#2\endcsname}%
+$ \else
+$ \SE@InvalidCharacter
+$ \ifSE@TestMode
+$ \let\SE@next\SE@SkipRemaining
+$ \fi
+$ \fi
+& \begingroup\expandafter\expandafter\expandafter\endgroup
+& \expandafter\ifx\csname SE->#1@#2\endcsname\relax
+& \SE@InvalidCharacter
+& \ifSE@TestMode
+& \let\SE@next\SE@SkipRemaining
+& \fi
+& \else
+& \SE@ResultAdd{\csname SE->#1@#2\endcsname}%
+& \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@MapConvertTo}
+% \begin{macrocode}
+\def\SE@MapConvertTo#1#2{%
+$ \ifcsname SE<-#1@#2\endcsname
+$ \SE@ResultAdd{\csname SE<-#1@#2\endcsname}%
+$ \else
+$ \SE@InvalidCharacter
+$ \fi
+& \begingroup\expandafter\expandafter\expandafter\endgroup
+& \expandafter\ifx\csname SE<-#1@#2\endcsname\relax
+& \SE@InvalidCharacter
+& \else
+& \SE@ResultAdd{\csname SE<-#1@#2\endcsname}%
+& \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\StringEncodingConvert}
+% \begin{macrocode}
+\def\StringEncodingConvert#1#2#3#4{%
+ \EdefSanitize\SE@from{#3}%
+ \EdefSanitize\SE@to{#4}%
+ \expandafter\ifx\csname SE@alias@\SE@from\endcsname\relax
+ \else
+ \EdefSanitize\SE@from{\csname SE@alias@\SE@from\endcsname}%
+ \fi
+ \expandafter\ifx\csname SE@alias@\SE@to\endcsname\relax
+ \else
+ \EdefSanitize\SE@to{\csname SE@alias@\SE@to\endcsname}%
+ \fi
+ \ifx\SE@to\SE@utfxvi
+ \let\SE@to\SE@utfxvibe
+ \else
+ \ifx\SE@to\SE@utfxxxii
+ \let\SE@to\SE@utfxxxiibe
+ \fi
+ \fi
+ \SE@invalidfalse
+ \EdefEscapeHex\SE@result{#2}%
+ \ifx\SE@from\SE@utfxvi
+ \SE@CheckByteOrderTwo
+ \else
+ \ifx\SE@from\SE@utfxvibe
+ \SE@RemoveByteOrderTwo{FEFF}%
+ \else
+ \ifx\SE@from\SE@utfxvile
+ \SE@RemoveByteOrderTwo{FFFE}%
+ \else
+ \ifx\SE@from\SE@utfxxxii
+ \SE@CheckByteOrderFour
+ \else
+ \ifx\SE@from\SE@utfxxxiibe
+ \SE@RemoveByteOrderFour{0}{FEFF}%
+ \else
+ \ifx\SE@from\SE@utfxxxiile
+ \SE@RemoveByteOrderFour{FFFE}{0}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifx\SE@from\SE@to
+ \else
+ \ifx\SE@from\SE@utfxvibe
+ \else
+ \expandafter\SE@ConvertFrom\expandafter\SE@result
+ \expandafter{\SE@result}\SE@from
+ \fi
+ \ifx\SE@to\SE@utfxvibe
+ \else
+ \expandafter\SE@ConvertTo\expandafter\SE@result
+ \expandafter{\SE@result}\SE@to
+ \fi
+ \fi
+ \EdefUnescapeHex#1\SE@result
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\StringEncodingSuccessFailure}
+% \begin{macrocode}
+\def\StringEncodingSuccessFailure{%
+ \ifSE@invalid
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\StringEncodingConvertTest}
+% \begin{macrocode}
+\def\StringEncodingConvertTest#1#2#3#4{%
+ \SE@TestModetrue
+ \StringEncodingConvert{#1}{#2}{#3}{#4}%
+ \SE@TestModefalse
+ \StringEncodingSuccessFailure
+}
+\SE@newif\ifSE@TestMode
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@utfxvi}
+% \begin{macrocode}
+\EdefSanitize\SE@utfxvi{utf16}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@utfxvibe}
+% \begin{macrocode}
+\EdefSanitize\SE@utfxvibe{utf16be}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@utfxvile}
+% \begin{macrocode}
+\EdefSanitize\SE@utfxvile{utf16le}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@utfxxxii}
+% \begin{macrocode}
+\EdefSanitize\SE@utfxxxii{utf32}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@utfxxxiibe}
+% \begin{macrocode}
+\EdefSanitize\SE@utfxxxiibe{utf32be}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@utfxxxiile}
+% \begin{macrocode}
+\EdefSanitize\SE@utfxxxiile{utf32le}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@CheckByteOrderTwo}
+% Macro \cs{SE@CheckByteOrderTwo} checks the first two
+% bytes of the string \cs{SE@result} for the byte order mark.
+% It sets the encoding \cs{SE@from} to |utf16be| or |utf16le|.
+% The byte order mark is silently removed.
+% Encoding |utf16be| is used if the byte order mark is not available.
+% \begin{macrocode}
+\def\SE@CheckByteOrderTwo{%
+ \expandafter\SE@@CheckByteOrderTwo\SE@result0000\@nil
+}
+\def\SE@@CheckByteOrderTwo#1#2#3#4#5\@nil{%
+ \ifnum"#1#2#3#4="FEFF %
+ \let\SE@from\SE@utfxvibe
+ \edef\SE@result{\expandafter\ltx@gobblefour\SE@result}%
+ \else
+ \ifnum"#3#4#1#2="FEFF %
+ \let\SE@from\SE@utfxvile
+ \edef\SE@result{\expandafter\ltx@gobblefour\SE@result}%
+ \else
+ \let\SE@from\SE@utfxvibe
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@CheckByteOrderFour}
+% Macro \cs{SE@CheckByteOrderFour} checks the first four
+% bytes of the string \cs{SE@result} for the byte order mark.
+% It sets the encoding \cs{SE@from} to |utf32be| or |utf32le|.
+% The byte order mark is silently removed.
+% Encoding |utf32be| is used if the byte order mark is not available.
+% \begin{macrocode}
+\def\SE@CheckByteOrderFour{%
+ \expandafter\SE@@CheckByteOrderFour\SE@result00000000\@nil
+}
+\def\SE@@CheckByteOrderFour#1#2#3#4#5#6#7#8#9\@nil{%
+ \let\SE@from\SE@utfxxxiibe
+ \ifnum"#1#2#3#4=\ltx@zero
+ \ifnum"#5#6#7#8="FEFF %
+ \edef\SE@result{\expandafter\SE@GobbleEight\SE@result}%
+ \fi
+ \else
+ \ifnum"#7#8#5#6=\ltx@zero
+ \ifnum"#3#4#1#2="FEFF %
+ \let\SE@from\SE@utfxxxiile
+ \edef\SE@result{\expandafter\SE@GobbleEight\SE@result}%
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SE@RemoveByteOrderTwo}
+% \begin{macrocode}
+\def\SE@RemoveByteOrderTwo{%
+ \expandafter\SE@@RemoveByteOrderTwo\SE@result
+ \ltx@empty\ltx@empty\ltx@empty\ltx@empty\@nil
+}
+\def\SE@@RemoveByteOrderTwo#1#2#3#4#5\@nil#6{%
+ \ifnum"0#1#2#3#4="#6 %
+ \edef\SE@result{#5}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SE@RemoveByteOrderFour}
+% \begin{macrocode}
+\def\SE@RemoveByteOrderFour#1#2{%
+ \def\SE@a{"#1 }%
+ \def\SE@b{"#2 }%
+ \expandafter\SE@@RemoveByteOrderFour\SE@result
+ \ltx@empty\ltx@empty\ltx@empty\ltx@empty
+ \ltx@empty\ltx@empty\ltx@empty\ltx@empty
+ \@nil
+}
+\def\SE@@RemoveByteOrderFour#1#2#3#4#5#6#7#8#9\@nil{%
+ \ifnum"0#1#2#3#4=\SE@a
+ \ifnum"0#5#6#7#8=\SE@b
+ \edef\SE@result{#9}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Encoding aliases}
+%
+% \begin{macro}{\SE@EncodingAlias}
+% \begin{macrocode}
+\def\SE@EncodingAlias#1#2{%
+ \expandafter\def\csname SE@alias@#1\endcsname{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\SE@EncodingAlias{ansinew}{cp1252}
+\SE@EncodingAlias{applemac}{mac-roman}
+\SE@EncodingAlias{ascii-printable}{ascii-print}
+\SE@EncodingAlias{cp437de}{cp437}
+\SE@EncodingAlias{decmulti}{dec-mcs}
+\SE@EncodingAlias{latin1}{iso-8859-1}
+\SE@EncodingAlias{latin2}{iso-8859-2}
+\SE@EncodingAlias{latin3}{iso-8859-3}
+\SE@EncodingAlias{latin4}{iso-8859-4}
+\SE@EncodingAlias{latin5}{iso-8859-9}
+\SE@EncodingAlias{latin6}{iso-8859-10}
+\SE@EncodingAlias{latin7}{iso-8859-13}
+\SE@EncodingAlias{latin8}{iso-8859-14}
+\SE@EncodingAlias{latin9}{iso-8859-15}
+\SE@EncodingAlias{latin10}{iso-8859-16}
+\SE@EncodingAlias{mac-ce}{mac-centeuro}
+\SE@EncodingAlias{mac-ukrainian}{mac-cyrillic}
+\SE@EncodingAlias{macce}{mac-centeuro}
+\SE@EncodingAlias{maccyr}{mac-cyrillic}
+\SE@EncodingAlias{macukr}{mac-cyrillic}
+\SE@EncodingAlias{next}{nextstep}
+\SE@EncodingAlias{us-ascii}{ascii}
+\SE@EncodingAlias{utf-8}{utf8}
+\SE@EncodingAlias{utf-16}{utf16}
+\SE@EncodingAlias{utf-16be}{utf16be}
+\SE@EncodingAlias{utf-16le}{utf16le}
+\SE@EncodingAlias{utf-32}{utf32}
+\SE@EncodingAlias{utf-32be}{utf32be}
+\SE@EncodingAlias{utf-32le}{utf32le}
+% \end{macrocode}
+% All encodings of package \xpackage{inputenx} are supported.
+% \begin{macrocode}
+\def\SE@temp#1{%
+ \SE@EncodingAlias{x-#1}{#1}%
+}
+\SE@temp{ascii}
+\SE@temp{ascii-print}
+\SE@temp{clean7bit}
+\SE@temp{cp437}
+\SE@temp{cp850}
+\SE@temp{cp852}
+\SE@temp{cp855}
+\SE@temp{cp858}
+\SE@temp{cp865}
+\SE@temp{cp866}
+\SE@temp{cp1250}
+\SE@temp{cp1251}
+\SE@temp{cp1252}
+\SE@temp{cp1257}
+\SE@temp{dec-mcs}
+\SE@temp{koi8-r}
+\SE@temp{iso-8859-1}
+\SE@temp{iso-8859-2}
+\SE@temp{iso-8859-3}
+\SE@temp{iso-8859-4}
+\SE@temp{iso-8859-5}
+\SE@temp{iso-8859-6}
+\SE@temp{iso-8859-7}
+\SE@temp{iso-8859-8}
+\SE@temp{iso-8859-9}
+\SE@temp{iso-8859-10}
+\SE@temp{iso-8859-11}
+\SE@temp{iso-8859-13}
+\SE@temp{iso-8859-14}
+\SE@temp{iso-8859-15}
+\SE@temp{iso-8859-16}
+\SE@temp{mac-centeuro}
+\SE@temp{mac-cyrillic}
+\SE@temp{mac-roman}
+\SE@temp{nextstep}
+% \end{macrocode}
+%
+% \begin{macro}{\StringEncodingList}
+% \begin{macrocode}
+\def\StringEncodingList{%
+ ascii,%
+ ascii-print,%
+ clean7bit,%
+ cp437,%
+ cp850,%
+ cp852,%
+ cp855,%
+ cp858,%
+ cp865,%
+ cp866,%
+ cp1250,%
+ cp1251,%
+ cp1252,%
+ cp1257,%
+ dec-mcs,%
+ iso-8859-1,%
+ iso-8859-2,%
+ iso-8859-3,%
+ iso-8859-4,%
+ iso-8859-5,%
+ iso-8859-6,%
+ iso-8859-7,%
+ iso-8859-8,%
+ iso-8859-9,%
+ iso-8859-10,%
+ iso-8859-11,%
+ iso-8859-13,%
+ iso-8859-14,%
+ iso-8859-15,%
+ iso-8859-16,%
+ koi8-r,%
+ mac-centeuro,%
+ mac-cyrillic,%
+ mac-roman,%
+ nextstep,%
+ pdfdoc,%
+ utf8,%
+ utf16le,%
+ utf32be,%
+ utf32le%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \subsection{Encoding files}
+%
+% \subsubsection{UTF-32BE, UTF-32LE}
+%
+% \begin{macrocode}
+%<*utf32>
+%<utf32be>\ProvidesFile{se-utf32be.def}[2016/05/16 v1.11 stringenc: UTF-32BE]
+%<utf32le>\ProvidesFile{se-utf32le.def}[2016/05/16 v1.11 stringenc: UTF-32LE]
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<utf32be>\expandafter\gdef\csname\SE@PrefixTo utf32be\endcsname#1#2#3#4{%
+%<utf32be> \SE@ResultAdd{0000#1#2#3#4}%
+%<utf32le>\expandafter\gdef\csname\SE@PrefixTo utf32le\endcsname#1#2#3#4{%
+%<utf32le> \SE@ResultAdd{#3#4#1#20000}%
+}
+% \end{macrocode}
+% \noindent
+% UTF-16: |#1:1101 #2:11ww #3:wwhh #4:hhhh|
+% |#5:1101 #6:11ll #7:llll #8:llll|\\
+% UTF-32: |0000 000u uuuu hhhh hhhh hhll llll llll|\\
+% |wwww = uuuuu - 1|
+% \begin{macrocode}
+%<utf32be>\expandafter\gdef\csname\SE@PrefixSurrogateTo utf32be\endcsname
+%<utf32le>\expandafter\gdef\csname\SE@PrefixSurrogateTo utf32le\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \edef\SE@w{\SE@Nibble@NumToBin{"#2}}%
+ \edef\SE@a{\SE@Nibble@NumToBin{"#3}}%
+ \edef\SE@c{\SE@Nibble@NumToBin{"#6}}%
+ \edef\SE@w{%
+ \expandafter\ltx@gobbletwo\SE@w
+ \expandafter\SE@CarTwo\SE@a\@nil
+ }%
+ \edef\SE@w{%
+ \SE@Nibbles@BinToHex\SE@w
+ }%
+ \SE@Add\SE@w{\expandafter"\SE@w}\ltx@one
+ \edef\SE@a{%
+ \expandafter\ltx@gobbletwo\SE@a
+ \SE@Nibble@NumToBin{"#4}%
+ \expandafter\ltx@gobbletwo\SE@c
+ }%
+%<utf32be> \SE@ResultAdd{%
+%<utf32le> \SE@utfxxxii@le@add{%
+ 00%
+ \ifnum\SE@w>15 %
+ 10%
+ \else
+ 0%
+ \SE@Nibble@NumToHex\SE@w
+ \fi
+ \SE@Nibbles@BinToHex\SE@a
+ #7#8%
+ }%
+}
+%<*utf32le>
+\gdef\SE@utfxxxii@le@add#1{%
+ \edef\SE@temp{#1}%
+ \SE@ResultAdd{%
+ \expandafter\SE@utfxxxii@le@switch\SE@temp
+ }%
+}
+\gdef\SE@utfxxxii@le@switch#1#2#3#4#5#6#7#8{%
+ #7#8#5#6#3#4#1#2%
+}
+%</utf32le>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*utf32be>
+\expandafter\gdef\csname\SE@PrefixFrom utf32be\endcsname#1{%
+ \expandafter\SE@utfxxxii@be@from#1\relax\relax\relax\relax
+ \relax\relax\relax\relax
+}
+\gdef\SE@utfxxxii@be@from#1#2#3#4#5#6#7#8{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifx#8\relax
+ \let\SE@next\relax
+ \SE@InvalidCharacter
+ \else
+ \let\SE@next\SE@utfxxxii@be@from
+ \SE@utfxxxii@from#1#2#3#4#5#6#7#8%
+ \fi
+ \fi
+ \SE@next
+}
+%</utf32be>
+%<*utf32le>
+\expandafter\gdef\csname\SE@PrefixFrom utf32le\endcsname#1{%
+ \expandafter\SE@utfxxxii@le@from#1\relax\relax\relax\relax
+ \relax\relax\relax\relax
+}
+\gdef\SE@utfxxxii@le@from#1#2#3#4#5#6#7#8{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifx#8\relax
+ \let\SE@next\relax
+ \SE@InvalidCharacter
+ \else
+ \let\SE@next\SE@utfxxxii@le@from
+ \SE@utfxxxii@from#7#8#5#6#3#4#1#2%
+ \fi
+ \fi
+ \SE@next
+}
+%</utf32le>
+% \end{macrocode}
+% \begin{macrocode}
+\gdef\SE@utfxxxii@from#1#2#3#4#5#6#7#8{%
+ \ifcase\ifnum"#1#2>\ltx@zero
+ \ltx@zero
+ \else
+ \ifnum"#3#4#5#6#7#8>"10FFFF %
+ \ltx@zero
+ \else
+ \ifnum"#3#4#5#6#7#8<"D800 %
+ \ltx@one
+ \else
+ \ifnum"#3#4#5#6#7#8>"DFFF %
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \fi
+ \fi
+ \fi
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \ifcase"#3#4 %
+ \SE@ResultAdd{#5#6#7#8}%
+ \else
+ \edef\SE@low{\SE@Nibble@NumToBin{"#6}}%
+ \SE@Add\SE@high{"#3#4}{-1}%
+ \edef\SE@high{%
+ 10\SE@Nibble@NumToBin\SE@high
+ \SE@Nibble@NumToBin{"#5}%
+ \expandafter\SE@CarTwo\SE@low\@nil
+ }%
+ \edef\SE@low{%
+ 11\expandafter\ltx@gobbletwo\SE@low
+ }%
+ \SE@ResultAdd{%
+ D\SE@Nibbles@BinToHex\SE@high
+ D\SE@Nibbles@BinToHex\SE@low
+ #7#8%
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</utf32>
+% \end{macrocode}
+%
+% \subsubsection{UTF-8}
+%
+% \begin{macrocode}
+%<*utf8>
+\ProvidesFile{se-utf8.def}[2016/05/16 v1.11 stringenc: UTF-8]
+% \end{macrocode}
+%
+% \noindent
+% 1 Byte: |0000 0000 0xxx xxxx -> 0xxx xxxx|\\
+% 2 Bytes: |0000 0yyy yyxx xxxx -> 110y yyyy 10xx xxxx|\\
+% 3 Bytes: |zzzz yyyy yyxx xxxx -> 1110 zzzz 10yy yyyy 10xx xxxx|
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixTo utf8\endcsname#1#2#3#4{%
+ \ifnum"#1#2#3#4<"80 %
+ \SE@ResultAdd{#3#4}%
+ \else
+ \ifnum"#1#2#3#4<"800 %
+ \edef\SE@temp{%
+ \SE@Nibble@NumToBin{"#3}%
+ }%
+ \edef\SE@temp{%
+ 11%
+ \SE@Nibble@NumToBin{"#2}%
+ \expandafter\SE@CarTwo\SE@temp\@nil
+ 10%
+ \expandafter\ltx@gobbletwo\SE@temp
+ }%
+ \SE@ResultAdd{%
+ \SE@Nibbles@BinToHex\SE@temp
+ #4%
+ }%
+ \else
+ \edef\SE@temp{%
+ \SE@Nibble@NumToBin{"#3}%
+ }%
+ \edef\SE@temp{%
+ 10%
+ \SE@Nibble@NumToBin{"#2}%
+ \expandafter\SE@CarTwo\SE@temp\@nil
+ 10%
+ \expandafter\ltx@gobbletwo\SE@temp
+ }%
+ \SE@ResultAdd{%
+ E#1%
+ \SE@Nibbles@BinToHex\SE@temp
+ #4%
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \noindent
+% UTF-16: |#1:1101 #2:10ww #3:wwzz #4:zzyy|
+% |#5:1101 #6:11yy #7:yyxx #8:xxxx|\\
+% UTF-32: |0000 0000 000u uuuu zzzz yyyy yyxx xxxx|\\
+% UTF-8: |1111 0uuu 10uu zzzz 10yy yyyy 10xx xxxx|
+% |wwww = uuuuu - 1|
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixSurrogateTo utf8\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \edef\SE@w{\SE@Nibble@NumToBin{"#2}}%
+ \edef\SE@a{\SE@Nibble@NumToBin{"#3}}%
+ \edef\SE@b{\SE@Nibble@NumToBin{"#4}}%
+ \edef\SE@c{\SE@Nibble@NumToBin{"#6}}%
+ \edef\SE@d{\SE@Nibble@NumToBin{"#7}}%
+ \edef\SE@w{%
+ \expandafter\ltx@gobbletwo\SE@w
+ \expandafter\SE@CarTwo\SE@a\@nil
+ }%
+ \edef\SE@w{%
+ \SE@Nibbles@BinToHex\SE@w
+ }%
+ \SE@Add\SE@w{\expandafter"\SE@w}\ltx@one
+ \ifnum\SE@w>15 %
+ \def\SE@char{1}%
+ \SE@Add\SE@w\SE@w{-16}%
+ \else
+ \def\SE@char{0}%
+ \fi
+ \edef\SE@w{\SE@Nibble@NumToBin\SE@w}%
+ \edef\SE@temp{%
+ 0\SE@char
+ \expandafter\SE@CarTwo\SE@w\@nil
+ 10%
+ \expandafter\ltx@gobbletwo\SE@w
+ \expandafter\ltx@gobbletwo\SE@a
+ \expandafter\SE@CarTwo\SE@b\@nil
+ 10%
+ \expandafter\ltx@gobbletwo\SE@b
+ \expandafter\ltx@gobbletwo\SE@c
+ \expandafter\SE@CarTwo\SE@d\@nil
+ 10%
+ \expandafter\ltx@gobbletwo\SE@d
+ }%
+ \SE@ResultAdd{%
+ F%
+ \SE@Nibbles@BinToHex\SE@temp
+ #8%
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixFrom utf8\endcsname#1{%
+ \let\SE@temp\ltx@empty
+ \let\SE@next\SE@utfviii@filter
+ \expandafter\SE@utfviii@filter#1\relax\relax
+ \ifcase\ifSE@TestMode
+ \ifSE@invalid
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \else
+ \ltx@zero
+ \fi
+ \expandafter\SE@utfviii@from\SE@temp\relax\relax\relax\relax
+ \relax\relax\relax\relax
+ \fi
+}
+% \end{macrocode}
+% Invalid bytes in UTF-8: C0-C1, F5-FF
+% \begin{macrocode}
+\gdef\SE@utfviii@filter#1#2{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifcase\ifnum"#1#2>"F4 %
+ \ltx@zero
+ \else
+ \ifnum"#1#2="C0 %
+ \ltx@zero
+ \else
+ \ifnum"#1#2="C1 %
+ \ltx@zero
+ \else
+ \ltx@one
+ \fi
+ \fi
+ \fi
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \edef\SE@temp{\SE@temp#1#2}%
+ \fi
+ \fi
+ \SE@next
+}
+\gdef\SE@utfviii@from#1#2#3#4#5#6#7#8{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifnum"#1<8 % 0xxx xxxx
+ \SE@ResultAdd{00#1#2}%
+ \def\SE@next{\SE@utfviii@from#3#4#5#6#7#8}%
+ \else
+ \ifnum"#1<12 % 10xx xxxx
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \else
+ \def\SE@next{\SE@utfviii@from#3#4#5#6#7#8}%
+ \fi
+ \else
+ \ifx#3\relax
+ \let\SE@next\relax
+ \SE@InvalidCharacter
+ \else
+ \ifcase\SE@utfviii@CheckCont#3%
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \else
+ \def\SE@next{\SE@utfviii@from#3#4#5#6#7#8}%
+ \fi
+ \else
+ \ifnum"#1<14 % 110y yyyy 10xx xxxx
+ % 0000 0yyy yyxx xxxx
+ \edef\SE@temp{%
+ \SE@Nibble@NumToBin{"#3}%
+ }%
+ \edef\SE@temp{%
+ 0\ifodd"#1 1\else 0\fi
+ \SE@Nibble@NumToBin{"#2}%
+ \expandafter\ltx@gobbletwo\SE@temp
+ }%
+ \SE@ResultAdd{%
+ 0%
+ \SE@Nibbles@BinToHex\SE@temp
+ #4%
+ }%
+ \def\SE@next{\SE@utfviii@from#5#6#7#8}%
+ \else
+ \ifx#5\relax
+ \let\SE@next\relax
+ \SE@InvalidCharacter
+ \else
+ \ifcase\SE@utfviii@CheckCont#5%
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \else
+ \def\SE@next{\SE@utfviii@from#5#6#7#8}%
+ \fi
+ \else
+ \ifnum"#1=14 % 1110 zzzz 10yy yyyy 10xx xxxx
+ % zzzz yyyy yyxx xxxx
+ \ifcase\ifnum"#2="D %
+ \ifnum"#3#4>"9F %
+ \ltx@zero
+ \else
+ \ltx@one
+ \fi
+ \else
+ \ifnum"#2=\ltx@zero
+ \ifnum"#3<"A %
+ \ltx@zero
+ \else
+ \ltx@one
+ \fi
+ \else
+ \ltx@one
+ \fi
+ \fi
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \else
+ \def\SE@next{\SE@utfviii@from#7#8}%
+ \fi
+ \else
+ \edef\SE@a{\SE@Nibble@NumToBin{"#3}}%
+ \edef\SE@b{\SE@Nibble@NumToBin{"#5}}%
+ \edef\SE@temp{%
+ \expandafter\ltx@gobbletwo\SE@a
+ \SE@Nibble@NumToBin{"#4}%
+ \expandafter\ltx@gobbletwo\SE@b
+ }%
+ \SE@ResultAdd{%
+ #2%
+ \SE@Nibbles@BinToHex\SE@temp
+ #6%
+ }%
+ \def\SE@next{\SE@utfviii@from#7#8}%
+ \fi
+ \else
+ \ifx#7\relax
+ \let\SE@next\relax
+ \SE@InvalidCharacter
+ \else
+ \ifcase\SE@utfviii@CheckCont#7%
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \else
+ \def\SE@next{\SE@utfviii@from#7#8}%
+ \fi
+ \else
+ \let\SE@next\SE@utfviii@from
+ \ifnum"#2<8 % 1111 0uuu 10uu zzzz 10yy yyyy 10xx xxxx
+ % 1101 10ww wwzz zzyy 1101 11yy yyxx xxxx
+ \edef\SE@w{\SE@Nibble@NumToBin{"#3}}%
+ \edef\SE@w{%
+ 00%
+ \SE@Nibble@NumToBin{"#2}%
+ \expandafter\ltx@gobbletwo\SE@w
+ }%
+ \edef\SE@w{\SE@Nibbles@BinToHex\SE@w}%
+ \SE@Add\SE@w{\expandafter"\SE@w}{-1}%
+ \ifnum\SE@w>15 %
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \ifnum\SE@w<\ltx@zero
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \edef\SE@a{\SE@Nibble@NumToBin{"#5}}%
+ \edef\SE@b{\SE@Nibble@NumToBin{"#7}}%
+ \edef\SE@temp{%
+ 10%
+ \SE@Nibble@NumToBin\SE@w
+ \SE@Nibble@NumToBin{"#4}%
+ \expandafter\ltx@gobbletwo\SE@a
+ 1101%
+ 11%
+ \SE@Nibble@NumToBin{"#6}%
+ \expandafter\ltx@gobbletwo\SE@b
+ }%
+ \SE@ResultAdd{%
+ D%
+ \SE@Nibbles@BinToHex\SE@temp
+ #8%
+ }%
+ \fi
+ \fi
+ \else
+ \SE@InvalidCharacter
+ \if\SE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+% \begin{macrocode}
+\gdef\SE@utfviii@CheckCont#1{%
+ \ifnum"#1<8 %
+ \ltx@zero
+ \else
+ \ifnum"#1<12 %
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</utf8>
+% \end{macrocode}
+%
+% \subsubsection{UTF-16LE}
+%
+% \begin{macrocode}
+%<*utf16le>
+\ProvidesFile{se-utf16le.def}[2016/05/16 v1.11 stringenc: UTF-16LE]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixTo utf16le\endcsname#1#2#3#4{%
+ \SE@ResultAdd{#3#4#1#2}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixSurrogateTo utf16le\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \SE@ResultAdd{#3#4#1#2#7#8#5#6}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixFrom utf16le\endcsname#1{%
+ \expandafter\SE@utfxvile@from#1\relax\relax\relax\relax
+}
+\gdef\SE@utfxvile@from#1#2#3#4{%
+ \ifx#1\relax
+ \else
+ \ifx#4\relax
+ \SE@InvalidCharacter
+ \else
+ \SE@ResultAdd{#3#4#1#2}%
+ \fi
+ \expandafter\SE@utfxvile@from
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</utf16le>
+% \end{macrocode}
+%
+% \subsubsection{PDFDocEncoding}
+%
+% \begin{macrocode}
+%<*pdfdoc>
+\ProvidesFile{se-pdfdoc.def}[2016/05/16 v1.11 stringenc: PDFDocEncoding]
+% \end{macrocode}
+%
+% Pass ranges 32..126 and 160..255 through and use
+% the mapping system for the other characters.
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixTo pdfdoc\endcsname#1#2#3#4{%
+ \ifcase\ifnum"#1#2#3#4<256 %
+ \ifnum"#1#2#3#4>160 %
+ \ltx@zero
+ \else
+ \ifnum"#1#2#3#4<127 %
+ \ifnum"#1#2#3#4>31 %
+ \ltx@zero
+ \else
+ \ltx@one
+ \fi
+ \else
+ \ltx@one
+ \fi
+ \fi
+ \else
+ \ltx@one
+ \fi
+ \SE@ResultAdd{#3#4}%
+ \else
+ \SE@MapConvertTo{pdfdoc}{#1#2#3#4}%
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixSurrogateTo pdfdoc\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \SE@InvalidCharacter
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixFrom pdfdoc\endcsname#1{%
+ \let\SE@next\SE@pdfdoc@from
+ \expandafter\SE@pdfdoc@from#1\relax\relax
+}
+\gdef\SE@pdfdoc@from#1#2{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifcase\ifnum"#1#2>160 %
+ \ifnum"#1#2="AD %
+ 2 %
+ \else
+ \ltx@zero
+ \fi
+ \else
+ \ifnum"#1#2<127 %
+ \ifnum"#1#2>31 %
+ \ltx@zero
+ \else
+ \ltx@one
+ \fi
+ \else
+ \ltx@one
+ \fi
+ \fi
+ \SE@ResultAdd{00#1#2}%
+ \or
+ \SE@MapConvertFrom{pdfdoc}{#1#2}%
+ \else
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\SE@MapDeclare{pdfdoc}{09}{0009}
+\SE@MapDeclare{pdfdoc}{0A}{000A}
+\SE@MapDeclare{pdfdoc}{0D}{000D}
+\SE@MapDeclare{pdfdoc}{18}{02D8}
+\SE@MapDeclare{pdfdoc}{19}{02C7}
+\SE@MapDeclare{pdfdoc}{1A}{02C6}
+\SE@MapDeclare{pdfdoc}{1B}{02D9}
+\SE@MapDeclare{pdfdoc}{1C}{02DD}
+\SE@MapDeclare{pdfdoc}{1D}{02DB}
+\SE@MapDeclare{pdfdoc}{1E}{02DA}
+\SE@MapDeclare{pdfdoc}{1F}{02DC}
+\SE@MapDeclare{pdfdoc}{80}{2022}
+\SE@MapDeclare{pdfdoc}{81}{2020}
+\SE@MapDeclare{pdfdoc}{82}{2021}
+\SE@MapDeclare{pdfdoc}{83}{2026}
+\SE@MapDeclare{pdfdoc}{84}{2014}
+\SE@MapDeclare{pdfdoc}{85}{2013}
+\SE@MapDeclare{pdfdoc}{86}{0192}
+\SE@MapDeclare{pdfdoc}{87}{2044}
+\SE@MapDeclare{pdfdoc}{88}{2039}
+\SE@MapDeclare{pdfdoc}{89}{203A}
+\SE@MapDeclare{pdfdoc}{8A}{2212}
+\SE@MapDeclare{pdfdoc}{8B}{2030}
+\SE@MapDeclare{pdfdoc}{8C}{201E}
+\SE@MapDeclare{pdfdoc}{8D}{201C}
+\SE@MapDeclare{pdfdoc}{8E}{201D}
+\SE@MapDeclare{pdfdoc}{8F}{2018}
+\SE@MapDeclare{pdfdoc}{90}{2019}
+\SE@MapDeclare{pdfdoc}{91}{201A}
+\SE@MapDeclare{pdfdoc}{92}{2122}
+\SE@MapDeclare{pdfdoc}{93}{FB01}
+\SE@MapDeclare{pdfdoc}{94}{FB02}
+\SE@MapDeclare{pdfdoc}{95}{0141}
+\SE@MapDeclare{pdfdoc}{96}{0152}
+\SE@MapDeclare{pdfdoc}{97}{0160}
+\SE@MapDeclare{pdfdoc}{98}{0178}
+\SE@MapDeclare{pdfdoc}{99}{017D}
+\SE@MapDeclare{pdfdoc}{9A}{0131}
+\SE@MapDeclare{pdfdoc}{9B}{0142}
+\SE@MapDeclare{pdfdoc}{9C}{0153}
+\SE@MapDeclare{pdfdoc}{9D}{0161}
+\SE@MapDeclare{pdfdoc}{9E}{017E}
+\SE@MapDeclare{pdfdoc}{A0}{20AC}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pdfdoc>
+% \end{macrocode}
+%
+% \subsubsection{ISO-8859-1}
+%
+% \begin{macrocode}
+%<*iso-8859-1>
+\ProvidesFile{se-iso-8859-1.def}[2016/05/16 v1.11 stringenc: ISO-8859-1]
+% \end{macrocode}
+%
+% Excluded area: 0x80..0x9F
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixTo iso-8859-1\endcsname#1#2#3#4{%
+ \ifcase\ifnum"#1#2=\ltx@zero
+ \ifnum"#3#4<"80 %
+ \ltx@one
+ \else
+ \ifnum"#3#4>"9F %
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \fi
+ \else
+ \ltx@zero
+ \fi
+ \SE@InvalidCharacter
+ \else
+ \SE@ResultAdd{#3#4}%
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixSurrogateTo iso-8859-1\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \SE@InvalidCharacter
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixFrom iso-8859-1\endcsname#1{%
+ \let\SE@next\SE@isoone@from
+ \expandafter\SE@isoone@from#1\relax\relax
+}
+\gdef\SE@isoone@from#1#2{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifcase\ifnum"#1#2<"80 %
+ \ltx@one
+ \else
+ \ifnum"#1#2>"9F %
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \fi
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \SE@ResultAdd{00#1#2}%
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</iso-8859-1>
+% \end{macrocode}
+%
+% \subsubsection{CP1252}
+%
+% \begin{macrocode}
+%<*cp1252>
+\ProvidesFile{se-cp1252.def}[2016/05/16 v1.11 stringenc: cp1252]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixTo cp1252\endcsname#1#2#3#4{%
+ \ifcase\ifnum"#1#2=\ltx@zero
+ \ifnum"#3#4<"80 %
+ \ltx@one
+ \else
+ \ifnum"#3#4>"9F %
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \fi
+ \else
+ \ltx@zero
+ \fi
+ \SE@MapConvertTo{cp1252}{#1#2#3#4}%
+ \else
+ \SE@ResultAdd{#3#4}%
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixSurrogateTo cp1252\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \SE@InvalidCharacter
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixFrom cp1252\endcsname#1{%
+ \let\SE@next\SE@ansinew@from
+ \expandafter\SE@ansinew@from#1\relax\relax
+}
+\gdef\SE@ansinew@from#1#2{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifcase\ifnum"#1#2<"80 %
+ \ltx@one
+ \else
+ \ifnum"#1#2>"9F %
+ \ltx@one
+ \else
+ \ltx@zero
+ \fi
+ \fi
+ \SE@MapConvertFrom{cp1252}{#1#2}%
+ \else
+ \SE@ResultAdd{00#1#2}%
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+%
+% \begingroup
+% \makeatletter
+% \let\saved@macro@font\macro@font
+% \def\macro@font{\saved@macro@font\scriptsize}
+% \begin{macrocode}
+\SE@MapDeclare{cp1252}{80}{20AC}% EURO SIGN
+\SE@MapDeclare{cp1252}{82}{201A}% SINGLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{cp1252}{83}{0192}% LATIN SMALL LETTER F WITH HOOK
+\SE@MapDeclare{cp1252}{84}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{cp1252}{85}{2026}% HORIZONTAL ELLIPSIS
+\SE@MapDeclare{cp1252}{86}{2020}% DAGGER
+\SE@MapDeclare{cp1252}{87}{2021}% DOUBLE DAGGER
+\SE@MapDeclare{cp1252}{88}{02C6}% MODIFIER LETTER CIRCUMFLEX ACCENT
+\SE@MapDeclare{cp1252}{89}{2030}% PER MILLE SIGN
+\SE@MapDeclare{cp1252}{8A}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{cp1252}{8B}{2039}% SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1252}{8C}{0152}% LATIN CAPITAL LIGATURE OE
+\SE@MapDeclare{cp1252}{8E}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{cp1252}{91}{2018}% LEFT SINGLE QUOTATION MARK
+\SE@MapDeclare{cp1252}{92}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{cp1252}{93}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{cp1252}{94}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{cp1252}{95}{2022}% BULLET
+\SE@MapDeclare{cp1252}{96}{2013}% EN DASH
+\SE@MapDeclare{cp1252}{97}{2014}% EM DASH
+\SE@MapDeclare{cp1252}{98}{02DC}% SMALL TILDE
+\SE@MapDeclare{cp1252}{99}{2122}% TRADE MARK SIGN
+\SE@MapDeclare{cp1252}{9A}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{cp1252}{9B}{203A}% SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1252}{9C}{0153}% LATIN SMALL LIGATURE OE
+\SE@MapDeclare{cp1252}{9E}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{cp1252}{9F}{0178}% LATIN CAPITAL LETTER Y WITH DIAERESIS
+% \end{macrocode}
+% \endgroup
+%
+% \begin{macrocode}
+%</cp1252>
+% \end{macrocode}
+%
+% \subsubsection{US-ASCII}
+%
+% \begin{macrocode}
+%<*ascii>
+\ProvidesFile{se-ascii.def}[2016/05/16 v1.11 stringenc: US-ASCII]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixTo ascii\endcsname#1#2#3#4{%
+ \ifnum"#1#2#3<8 %
+ \SE@ResultAdd{#3#4}%
+ \else
+ \SE@InvalidCharacter
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixSurrogateTo ascii\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \SE@InvalidCharacter
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixFrom ascii\endcsname#1{%
+ \let\SE@next\SE@ascii@from
+ \expandafter\SE@ascii@from#1\relax\relax
+}
+\gdef\SE@ascii@from#1#2{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifnum"#1>7 %
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \SE@ResultAdd{00#1#2}%
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</ascii>
+% \end{macrocode}
+%
+% \subsubsection{Encoding \xoption{ascii-print}}
+%
+% \begin{macrocode}
+%<*ascii-print>
+\ProvidesFile{se-ascii-print.def}%
+ [2016/05/16 v1.11 stringenc: Printable ASCII characters]%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixTo ascii-print\endcsname#1#2#3#4{%
+ \ifnum"#1#2=\ltx@zero
+ \ifnum"#3#4<127 %
+ \ifnum"#3#4>31 %
+ \SE@ResultAdd{#3#4}%
+ \else
+ \SE@InvalidCharacter
+ \fi
+ \else
+ \SE@InvalidCharacter
+ \fi
+ \else
+ \SE@InvalidCharacter
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixSurrogateTo ascii-print\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \SE@InvalidCharacter
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixFrom ascii-print\endcsname#1{%
+ \let\SE@next\SE@ascii@print@from
+ \expandafter\SE@ascii@print@from#1\relax\relax
+}
+\gdef\SE@ascii@print@from#1#2{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifnum"#1#2>126 %
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \ifnum"#1#2<32 %
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \SE@ResultAdd{00#1#2}%
+ \fi
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</ascii-print>
+% \end{macrocode}
+%
+% \subsubsection{Clean7Bit}
+%
+% \begin{macrocode}
+%<*clean7bit>
+\ProvidesFile{se-clean7bit.def}[2016/05/16 v1.11 stringenc: Clean7Bit]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixTo clean7bit\endcsname#1#2#3#4{%
+ \ifnum"#1#2#3<8 %
+ \ifnum"#3#4<128 %
+ \ifnum"#3#4>26 %
+ \SE@ResultAdd{#3#4}%
+ \else
+ \ifnum"#3#4=10 %
+ \SE@ResultAdd{0A}%
+ \else
+ \ifnum"#3#4=13 %
+ \SE@ResultAdd{0D}%
+ \else
+ \ifnum"#3#4=9 %
+ \SE@ResultAdd{09}%
+ \else
+ \SE@InvalidCharacter
+ \fi
+ \fi
+ \fi
+ \fi
+ \else
+ \SE@InvalidCharacter
+ \fi
+ \else
+ \SE@InvalidCharacter
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixSurrogateTo clean7bit\endcsname
+ #1#2#3#4#5#6#7#8{%
+ \SE@InvalidCharacter
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\gdef\csname\SE@PrefixFrom clean7bit\endcsname#1{%
+ \let\SE@next\SE@cleansevenbit@from
+ \expandafter\SE@cleansevenbit@from#1\relax\relax
+}
+\gdef\SE@cleansevenbit@from#1#2{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifnum"#1#2>126 %
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \else
+ \ifnum"#1#2<27 %
+ \ifnum"#1#2=10 %
+ \SE@ResultAdd{0010}%
+ \else
+ \ifnum"#1#2=13 %
+ \SE@ResultAdd{000D}%
+ \else
+ \ifnum"#1#2=9 %
+ \SE@ResultAdd{0009}%
+ \else
+ \SE@InvalidCharacter
+ \ifSE@TestMode
+ \let\SE@next\SE@SkipRemaining
+ \fi
+ \fi
+ \fi
+ \else
+ \SE@ResultAdd{00#1#2}%
+ \fi
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</clean7bit>
+% \end{macrocode}
+%
+% \subsubsection{Other encodings (8 bit)}
+%
+% \begin{macrocode}
+%<*iso-8859-2>
+\ProvidesFile{se-iso-8859-2.def}[2016/05/16 v1.11 stringenc: ISO-8859-2]
+\def\SE@this{iso-8859-2}
+%</iso-8859-2>
+%<*iso-8859-3>
+\ProvidesFile{se-iso-8859-3.def}[2016/05/16 v1.11 stringenc: ISO-8859-3]
+\def\SE@this{iso-8859-3}
+%</iso-8859-3>
+%<*iso-8859-4>
+\ProvidesFile{se-iso-8859-4.def}[2016/05/16 v1.11 stringenc: ISO-8859-4]
+\def\SE@this{iso-8859-4}
+%</iso-8859-4>
+%<*iso-8859-5>
+\ProvidesFile{se-iso-8859-5.def}[2016/05/16 v1.11 stringenc: ISO-8859-5]
+\def\SE@this{iso-8859-5}
+%</iso-8859-5>
+%<*iso-8859-6>
+\ProvidesFile{se-iso-8859-6.def}[2016/05/16 v1.11 stringenc: ISO-8859-6]
+\def\SE@this{iso-8859-6}
+%</iso-8859-6>
+%<*iso-8859-7>
+\ProvidesFile{se-iso-8859-7.def}[2016/05/16 v1.11 stringenc: ISO-8859-7]
+\def\SE@this{iso-8859-7}
+%</iso-8859-7>
+%<*iso-8859-8>
+\ProvidesFile{se-iso-8859-8.def}[2016/05/16 v1.11 stringenc: ISO-8859-8]
+\def\SE@this{iso-8859-8}
+%</iso-8859-8>
+%<*iso-8859-9>
+\ProvidesFile{se-iso-8859-9.def}[2016/05/16 v1.11 stringenc: ISO-8859-9]
+\def\SE@this{iso-8859-9}
+%</iso-8859-9>
+%<*iso-8859-10>
+\ProvidesFile{se-iso-8859-10.def}[2016/05/16 v1.11 stringenc: ISO-8859-10]
+\def\SE@this{iso-8859-10}
+%</iso-8859-10>
+%<*iso-8859-11>
+\ProvidesFile{se-iso-8859-11.def}[2016/05/16 v1.11 stringenc: ISO-8859-11]
+\def\SE@this{iso-8859-11}
+%</iso-8859-11>
+%<*iso-8859-13>
+\ProvidesFile{se-iso-8859-13.def}[2016/05/16 v1.11 stringenc: ISO-8859-13]
+\def\SE@this{iso-8859-13}
+%</iso-8859-13>
+%<*iso-8859-14>
+\ProvidesFile{se-iso-8859-14.def}[2016/05/16 v1.11 stringenc: ISO-8859-14]
+\def\SE@this{iso-8859-14}
+%</iso-8859-14>
+%<*iso-8859-15>
+\ProvidesFile{se-iso-8859-15.def}[2016/05/16 v1.11 stringenc: ISO-8859-15]
+\def\SE@this{iso-8859-15}
+%</iso-8859-15>
+%<*iso-8859-16>
+\ProvidesFile{se-iso-8859-16.def}[2016/05/16 v1.11 stringenc: ISO-8859-16]
+\def\SE@this{iso-8859-16}
+%</iso-8859-16>
+%<*koi8-r>
+\ProvidesFile{se-koi8-r.def}[2016/05/16 v1.11 stringenc: KOI8-R]
+\def\SE@this{koi8-r}
+%</koi8-r>
+%<*nextstep>
+\ProvidesFile{se-nextstep.def}[2016/05/16 v1.11 stringenc: NextStep]
+\def\SE@this{nextstep}
+%</nextstep>
+%<*mac-centeuro>
+\ProvidesFile{se-mac-centeuro.def}[2016/05/16 v1.11 stringenc: Mac OS Central European]
+\def\SE@this{mac-centeuro}
+%</mac-centeuro>
+%<*mac-cyrillic>
+\ProvidesFile{se-mac-cyrillic.def}[2016/05/16 v1.11 stringenc: Mac OS Cyrillic]
+\def\SE@this{mac-cyrillic}
+%</mac-cyrillic>
+%<*mac-roman>
+\ProvidesFile{se-mac-roman.def}[2016/05/16 v1.11 stringenc: Mac OS Roman]
+\def\SE@this{mac-roman}
+%</mac-roman>
+%<*dec-mcs>
+\ProvidesFile{se-dec-mcs.def}[2016/05/16 v1.11 stringenc: DEC-MCS]
+\def\SE@this{dec-mcs}
+%</dec-mcs>
+%<*cp437>
+\ProvidesFile{se-cp437.def}[2016/05/16 v1.11 stringenc: cp437]
+\def\SE@this{cp437}
+%</cp437>
+%<*cp850>
+\ProvidesFile{se-cp850.def}[2016/05/16 v1.11 stringenc: cp850]
+\def\SE@this{cp850}
+%</cp850>
+%<*cp852>
+\ProvidesFile{se-cp852.def}[2016/05/16 v1.11 stringenc: cp852]
+\def\SE@this{cp852}
+%</cp852>
+%<*cp855>
+\ProvidesFile{se-cp855.def}[2016/05/16 v1.11 stringenc: cp855]
+\def\SE@this{cp855}
+%</cp855>
+%<*cp858>
+\ProvidesFile{se-cp858.def}[2016/05/16 v1.11 stringenc: cp858]
+\def\SE@this{cp858}
+%</cp858>
+%<*cp865>
+\ProvidesFile{se-cp865.def}[2016/05/16 v1.11 stringenc: cp865]
+\def\SE@this{cp865}
+%</cp865>
+%<*cp866>
+\ProvidesFile{se-cp866.def}[2016/05/16 v1.11 stringenc: cp866]
+\def\SE@this{cp866}
+%</cp866>
+%<*cp1250>
+\ProvidesFile{se-cp1250.def}[2016/05/16 v1.11 stringenc: cp1250]
+\def\SE@this{cp1250}
+%</cp1250>
+%<*cp1251>
+\ProvidesFile{se-cp1251.def}[2016/05/16 v1.11 stringenc: cp1251]
+\def\SE@this{cp1251}
+%</cp1251>
+%<*cp1257>
+\ProvidesFile{se-cp1257.def}[2016/05/16 v1.11 stringenc: cp1257]
+\def\SE@this{cp1257}
+%</cp1257>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% \begin{macrocode}
+\def\SE@to@general#1#2#3#4{%
+ \ifnum"#1#2#3#4<128 %
+ \SE@ResultAdd{#3#4}%
+ \else
+ \SE@MapConvertTo\SE@encoding{#1#2#3#4}%
+ \fi
+}
+\def\SE@to@general@surrogate#1#2#3#4#5#6#7#8{%
+ \SE@InvalidCharacter
+}
+\def\SE@from@general#1{%
+ \let\SE@next\SE@@from@general
+ \expandafter\SE@@from@general#1\relax\relax
+}
+\def\SE@@from@general#1#2{%
+ \ifx#1\relax
+ \let\SE@next\relax
+ \else
+ \ifnum"#1<8 % "#1#2<128
+ \SE@ResultAdd{00#1#2}%
+ \else
+ \SE@MapConvertFrom\SE@encoding{#1#2}%
+ \fi
+ \fi
+ \SE@next
+}
+% \end{macrocode}
+% \begin{macrocode}
+\SE@AtEnd%
+%</package>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*general>
+% \end{macrocode}
+%
+% Pass range 0..127 through and use
+% the mapping system for the other characters.
+% \begin{macrocode}
+\global\expandafter\let\csname\SE@PrefixTo\SE@this\endcsname
+ \SE@to@general
+\global\expandafter\let\csname\SE@PrefixSurrogateTo\SE@this\endcsname
+ \SE@to@general@surrogate
+\global\expandafter\let\csname\SE@PrefixFrom\SE@this\endcsname
+ \SE@from@general
+% \end{macrocode}
+% \begin{macrocode}
+%</general>
+% \end{macrocode}
+%
+% \begingroup
+% \makeatletter
+% \let\saved@macro@font\macro@font
+% \def\macro@font{\saved@macro@font\scriptsize}
+% \paragraph{iso-8859-2}
+% \begin{macrocode}
+%<*iso-8859-2>
+\SE@MapDeclare{iso-8859-2}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-2}{A1}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-2}{A2}{02D8}% BREVE
+\SE@MapDeclare{iso-8859-2}{A3}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\SE@MapDeclare{iso-8859-2}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{iso-8859-2}{A5}{013D}% LATIN CAPITAL LETTER L WITH CARON
+\SE@MapDeclare{iso-8859-2}{A6}{015A}% LATIN CAPITAL LETTER S WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-2}{A8}{00A8}% DIAERESIS
+\SE@MapDeclare{iso-8859-2}{A9}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-2}{AA}{015E}% LATIN CAPITAL LETTER S WITH CEDILLA
+\SE@MapDeclare{iso-8859-2}{AB}{0164}% LATIN CAPITAL LETTER T WITH CARON
+\SE@MapDeclare{iso-8859-2}{AC}{0179}% LATIN CAPITAL LETTER Z WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-2}{AE}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-2}{AF}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-2}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-2}{B1}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-2}{B2}{02DB}% OGONEK
+\SE@MapDeclare{iso-8859-2}{B3}{0142}% LATIN SMALL LETTER L WITH STROKE
+\SE@MapDeclare{iso-8859-2}{B4}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{iso-8859-2}{B5}{013E}% LATIN SMALL LETTER L WITH CARON
+\SE@MapDeclare{iso-8859-2}{B6}{015B}% LATIN SMALL LETTER S WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{B7}{02C7}% CARON
+\SE@MapDeclare{iso-8859-2}{B8}{00B8}% CEDILLA
+\SE@MapDeclare{iso-8859-2}{B9}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-2}{BA}{015F}% LATIN SMALL LETTER S WITH CEDILLA
+\SE@MapDeclare{iso-8859-2}{BB}{0165}% LATIN SMALL LETTER T WITH CARON
+\SE@MapDeclare{iso-8859-2}{BC}{017A}% LATIN SMALL LETTER Z WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{BD}{02DD}% DOUBLE ACUTE ACCENT
+\SE@MapDeclare{iso-8859-2}{BE}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-2}{BF}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-2}{C0}{0154}% LATIN CAPITAL LETTER R WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-2}{C3}{0102}% LATIN CAPITAL LETTER A WITH BREVE
+\SE@MapDeclare{iso-8859-2}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-2}{C5}{0139}% LATIN CAPITAL LETTER L WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{C6}{0106}% LATIN CAPITAL LETTER C WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{C7}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-2}{C8}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-2}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{CA}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-2}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-2}{CC}{011A}% LATIN CAPITAL LETTER E WITH CARON
+\SE@MapDeclare{iso-8859-2}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-2}{CF}{010E}% LATIN CAPITAL LETTER D WITH CARON
+\SE@MapDeclare{iso-8859-2}{D0}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\SE@MapDeclare{iso-8859-2}{D1}{0143}% LATIN CAPITAL LETTER N WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{D2}{0147}% LATIN CAPITAL LETTER N WITH CARON
+\SE@MapDeclare{iso-8859-2}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-2}{D5}{0150}% LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{iso-8859-2}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-2}{D7}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{iso-8859-2}{D8}{0158}% LATIN CAPITAL LETTER R WITH CARON
+\SE@MapDeclare{iso-8859-2}{D9}{016E}% LATIN CAPITAL LETTER U WITH RING ABOVE
+\SE@MapDeclare{iso-8859-2}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{DB}{0170}% LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{iso-8859-2}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-2}{DD}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{DE}{0162}% LATIN CAPITAL LETTER T WITH CEDILLA
+\SE@MapDeclare{iso-8859-2}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{iso-8859-2}{E0}{0155}% LATIN SMALL LETTER R WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-2}{E3}{0103}% LATIN SMALL LETTER A WITH BREVE
+\SE@MapDeclare{iso-8859-2}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-2}{E5}{013A}% LATIN SMALL LETTER L WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{E6}{0107}% LATIN SMALL LETTER C WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{E7}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-2}{E8}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-2}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{EA}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-2}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-2}{EC}{011B}% LATIN SMALL LETTER E WITH CARON
+\SE@MapDeclare{iso-8859-2}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-2}{EF}{010F}% LATIN SMALL LETTER D WITH CARON
+\SE@MapDeclare{iso-8859-2}{F0}{0111}% LATIN SMALL LETTER D WITH STROKE
+\SE@MapDeclare{iso-8859-2}{F1}{0144}% LATIN SMALL LETTER N WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{F2}{0148}% LATIN SMALL LETTER N WITH CARON
+\SE@MapDeclare{iso-8859-2}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-2}{F5}{0151}% LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{iso-8859-2}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-2}{F7}{00F7}% DIVISION SIGN
+\SE@MapDeclare{iso-8859-2}{F8}{0159}% LATIN SMALL LETTER R WITH CARON
+\SE@MapDeclare{iso-8859-2}{F9}{016F}% LATIN SMALL LETTER U WITH RING ABOVE
+\SE@MapDeclare{iso-8859-2}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{FB}{0171}% LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{iso-8859-2}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-2}{FD}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{iso-8859-2}{FE}{0163}% LATIN SMALL LETTER T WITH CEDILLA
+\SE@MapDeclare{iso-8859-2}{FF}{02D9}% DOT ABOVE
+%</iso-8859-2>
+% \end{macrocode}
+% \paragraph{iso-8859-3}
+% \begin{macrocode}
+%<*iso-8859-3>
+\SE@MapDeclare{iso-8859-3}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-3}{A1}{0126}% LATIN CAPITAL LETTER H WITH STROKE
+\SE@MapDeclare{iso-8859-3}{A2}{02D8}% BREVE
+\SE@MapDeclare{iso-8859-3}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{iso-8859-3}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{iso-8859-3}{A6}{0124}% LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-3}{A8}{00A8}% DIAERESIS
+\SE@MapDeclare{iso-8859-3}{A9}{0130}% LATIN CAPITAL LETTER I WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-3}{AA}{015E}% LATIN CAPITAL LETTER S WITH CEDILLA
+\SE@MapDeclare{iso-8859-3}{AB}{011E}% LATIN CAPITAL LETTER G WITH BREVE
+\SE@MapDeclare{iso-8859-3}{AC}{0134}% LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-3}{AF}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-3}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-3}{B1}{0127}% LATIN SMALL LETTER H WITH STROKE
+\SE@MapDeclare{iso-8859-3}{B2}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{iso-8859-3}{B3}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{iso-8859-3}{B4}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{iso-8859-3}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{iso-8859-3}{B6}{0125}% LATIN SMALL LETTER H WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{iso-8859-3}{B8}{00B8}% CEDILLA
+\SE@MapDeclare{iso-8859-3}{B9}{0131}% LATIN SMALL LETTER DOTLESS I
+\SE@MapDeclare{iso-8859-3}{BA}{015F}% LATIN SMALL LETTER S WITH CEDILLA
+\SE@MapDeclare{iso-8859-3}{BB}{011F}% LATIN SMALL LETTER G WITH BREVE
+\SE@MapDeclare{iso-8859-3}{BC}{0135}% LATIN SMALL LETTER J WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{BD}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{iso-8859-3}{BF}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-3}{C0}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{C5}{010A}% LATIN CAPITAL LETTER C WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-3}{C6}{0108}% LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{C7}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-3}{C8}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{CA}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{CC}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{CF}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{D1}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{iso-8859-3}{D2}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{D5}{0120}% LATIN CAPITAL LETTER G WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-3}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{D7}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{iso-8859-3}{D8}{011C}% LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{D9}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{DB}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{DD}{016C}% LATIN CAPITAL LETTER U WITH BREVE
+\SE@MapDeclare{iso-8859-3}{DE}{015C}% LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{iso-8859-3}{E0}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{E5}{010B}% LATIN SMALL LETTER C WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-3}{E6}{0109}% LATIN SMALL LETTER C WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{E7}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-3}{E8}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{EA}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{EC}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{EF}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{F1}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{iso-8859-3}{F2}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{F5}{0121}% LATIN SMALL LETTER G WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-3}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{F7}{00F7}% DIVISION SIGN
+\SE@MapDeclare{iso-8859-3}{F8}{011D}% LATIN SMALL LETTER G WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{F9}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-3}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-3}{FB}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-3}{FD}{016D}% LATIN SMALL LETTER U WITH BREVE
+\SE@MapDeclare{iso-8859-3}{FE}{015D}% LATIN SMALL LETTER S WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-3}{FF}{02D9}% DOT ABOVE
+%</iso-8859-3>
+% \end{macrocode}
+% \paragraph{iso-8859-4}
+% \begin{macrocode}
+%<*iso-8859-4>
+\SE@MapDeclare{iso-8859-4}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-4}{A1}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-4}{A2}{0138}% LATIN SMALL LETTER KRA
+\SE@MapDeclare{iso-8859-4}{A3}{0156}% LATIN CAPITAL LETTER R WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{iso-8859-4}{A5}{0128}% LATIN CAPITAL LETTER I WITH TILDE
+\SE@MapDeclare{iso-8859-4}{A6}{013B}% LATIN CAPITAL LETTER L WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-4}{A8}{00A8}% DIAERESIS
+\SE@MapDeclare{iso-8859-4}{A9}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-4}{AA}{0112}% LATIN CAPITAL LETTER E WITH MACRON
+\SE@MapDeclare{iso-8859-4}{AB}{0122}% LATIN CAPITAL LETTER G WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{AC}{0166}% LATIN CAPITAL LETTER T WITH STROKE
+\SE@MapDeclare{iso-8859-4}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-4}{AE}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-4}{AF}{00AF}% MACRON
+\SE@MapDeclare{iso-8859-4}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-4}{B1}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-4}{B2}{02DB}% OGONEK
+\SE@MapDeclare{iso-8859-4}{B3}{0157}% LATIN SMALL LETTER R WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{B4}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{iso-8859-4}{B5}{0129}% LATIN SMALL LETTER I WITH TILDE
+\SE@MapDeclare{iso-8859-4}{B6}{013C}% LATIN SMALL LETTER L WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{B7}{02C7}% CARON
+\SE@MapDeclare{iso-8859-4}{B8}{00B8}% CEDILLA
+\SE@MapDeclare{iso-8859-4}{B9}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-4}{BA}{0113}% LATIN SMALL LETTER E WITH MACRON
+\SE@MapDeclare{iso-8859-4}{BB}{0123}% LATIN SMALL LETTER G WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{BC}{0167}% LATIN SMALL LETTER T WITH STROKE
+\SE@MapDeclare{iso-8859-4}{BD}{014A}% LATIN CAPITAL LETTER ENG
+\SE@MapDeclare{iso-8859-4}{BE}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-4}{BF}{014B}% LATIN SMALL LETTER ENG
+\SE@MapDeclare{iso-8859-4}{C0}{0100}% LATIN CAPITAL LETTER A WITH MACRON
+\SE@MapDeclare{iso-8859-4}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-4}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-4}{C3}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-4}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-4}{C5}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-4}{C6}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{iso-8859-4}{C7}{012E}% LATIN CAPITAL LETTER I WITH OGONEK
+\SE@MapDeclare{iso-8859-4}{C8}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-4}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-4}{CA}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-4}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-4}{CC}{0116}% LATIN CAPITAL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-4}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-4}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-4}{CF}{012A}% LATIN CAPITAL LETTER I WITH MACRON
+\SE@MapDeclare{iso-8859-4}{D0}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\SE@MapDeclare{iso-8859-4}{D1}{0145}% LATIN CAPITAL LETTER N WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{D2}{014C}% LATIN CAPITAL LETTER O WITH MACRON
+\SE@MapDeclare{iso-8859-4}{D3}{0136}% LATIN CAPITAL LETTER K WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-4}{D5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-4}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-4}{D7}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{iso-8859-4}{D8}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-4}{D9}{0172}% LATIN CAPITAL LETTER U WITH OGONEK
+\SE@MapDeclare{iso-8859-4}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-4}{DB}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-4}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-4}{DD}{0168}% LATIN CAPITAL LETTER U WITH TILDE
+\SE@MapDeclare{iso-8859-4}{DE}{016A}% LATIN CAPITAL LETTER U WITH MACRON
+\SE@MapDeclare{iso-8859-4}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{iso-8859-4}{E0}{0101}% LATIN SMALL LETTER A WITH MACRON
+\SE@MapDeclare{iso-8859-4}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-4}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-4}{E3}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-4}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-4}{E5}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-4}{E6}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{iso-8859-4}{E7}{012F}% LATIN SMALL LETTER I WITH OGONEK
+\SE@MapDeclare{iso-8859-4}{E8}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-4}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-4}{EA}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-4}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-4}{EC}{0117}% LATIN SMALL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-4}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-4}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-4}{EF}{012B}% LATIN SMALL LETTER I WITH MACRON
+\SE@MapDeclare{iso-8859-4}{F0}{0111}% LATIN SMALL LETTER D WITH STROKE
+\SE@MapDeclare{iso-8859-4}{F1}{0146}% LATIN SMALL LETTER N WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{F2}{014D}% LATIN SMALL LETTER O WITH MACRON
+\SE@MapDeclare{iso-8859-4}{F3}{0137}% LATIN SMALL LETTER K WITH CEDILLA
+\SE@MapDeclare{iso-8859-4}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-4}{F5}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-4}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-4}{F7}{00F7}% DIVISION SIGN
+\SE@MapDeclare{iso-8859-4}{F8}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-4}{F9}{0173}% LATIN SMALL LETTER U WITH OGONEK
+\SE@MapDeclare{iso-8859-4}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-4}{FB}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-4}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-4}{FD}{0169}% LATIN SMALL LETTER U WITH TILDE
+\SE@MapDeclare{iso-8859-4}{FE}{016B}% LATIN SMALL LETTER U WITH MACRON
+\SE@MapDeclare{iso-8859-4}{FF}{02D9}% DOT ABOVE
+%</iso-8859-4>
+% \end{macrocode}
+% \paragraph{iso-8859-5}
+% \begin{macrocode}
+%<*iso-8859-5>
+\SE@MapDeclare{iso-8859-5}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-5}{A1}{0401}% CYRILLIC CAPITAL LETTER IO
+\SE@MapDeclare{iso-8859-5}{A2}{0402}% CYRILLIC CAPITAL LETTER DJE
+\SE@MapDeclare{iso-8859-5}{A3}{0403}% CYRILLIC CAPITAL LETTER GJE
+\SE@MapDeclare{iso-8859-5}{A4}{0404}% CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\SE@MapDeclare{iso-8859-5}{A5}{0405}% CYRILLIC CAPITAL LETTER DZE
+\SE@MapDeclare{iso-8859-5}{A6}{0406}% CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+\SE@MapDeclare{iso-8859-5}{A7}{0407}% CYRILLIC CAPITAL LETTER YI
+\SE@MapDeclare{iso-8859-5}{A8}{0408}% CYRILLIC CAPITAL LETTER JE
+\SE@MapDeclare{iso-8859-5}{A9}{0409}% CYRILLIC CAPITAL LETTER LJE
+\SE@MapDeclare{iso-8859-5}{AA}{040A}% CYRILLIC CAPITAL LETTER NJE
+\SE@MapDeclare{iso-8859-5}{AB}{040B}% CYRILLIC CAPITAL LETTER TSHE
+\SE@MapDeclare{iso-8859-5}{AC}{040C}% CYRILLIC CAPITAL LETTER KJE
+\SE@MapDeclare{iso-8859-5}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-5}{AE}{040E}% CYRILLIC CAPITAL LETTER SHORT U
+\SE@MapDeclare{iso-8859-5}{AF}{040F}% CYRILLIC CAPITAL LETTER DZHE
+\SE@MapDeclare{iso-8859-5}{B0}{0410}% CYRILLIC CAPITAL LETTER A
+\SE@MapDeclare{iso-8859-5}{B1}{0411}% CYRILLIC CAPITAL LETTER BE
+\SE@MapDeclare{iso-8859-5}{B2}{0412}% CYRILLIC CAPITAL LETTER VE
+\SE@MapDeclare{iso-8859-5}{B3}{0413}% CYRILLIC CAPITAL LETTER GHE
+\SE@MapDeclare{iso-8859-5}{B4}{0414}% CYRILLIC CAPITAL LETTER DE
+\SE@MapDeclare{iso-8859-5}{B5}{0415}% CYRILLIC CAPITAL LETTER IE
+\SE@MapDeclare{iso-8859-5}{B6}{0416}% CYRILLIC CAPITAL LETTER ZHE
+\SE@MapDeclare{iso-8859-5}{B7}{0417}% CYRILLIC CAPITAL LETTER ZE
+\SE@MapDeclare{iso-8859-5}{B8}{0418}% CYRILLIC CAPITAL LETTER I
+\SE@MapDeclare{iso-8859-5}{B9}{0419}% CYRILLIC CAPITAL LETTER SHORT I
+\SE@MapDeclare{iso-8859-5}{BA}{041A}% CYRILLIC CAPITAL LETTER KA
+\SE@MapDeclare{iso-8859-5}{BB}{041B}% CYRILLIC CAPITAL LETTER EL
+\SE@MapDeclare{iso-8859-5}{BC}{041C}% CYRILLIC CAPITAL LETTER EM
+\SE@MapDeclare{iso-8859-5}{BD}{041D}% CYRILLIC CAPITAL LETTER EN
+\SE@MapDeclare{iso-8859-5}{BE}{041E}% CYRILLIC CAPITAL LETTER O
+\SE@MapDeclare{iso-8859-5}{BF}{041F}% CYRILLIC CAPITAL LETTER PE
+\SE@MapDeclare{iso-8859-5}{C0}{0420}% CYRILLIC CAPITAL LETTER ER
+\SE@MapDeclare{iso-8859-5}{C1}{0421}% CYRILLIC CAPITAL LETTER ES
+\SE@MapDeclare{iso-8859-5}{C2}{0422}% CYRILLIC CAPITAL LETTER TE
+\SE@MapDeclare{iso-8859-5}{C3}{0423}% CYRILLIC CAPITAL LETTER U
+\SE@MapDeclare{iso-8859-5}{C4}{0424}% CYRILLIC CAPITAL LETTER EF
+\SE@MapDeclare{iso-8859-5}{C5}{0425}% CYRILLIC CAPITAL LETTER HA
+\SE@MapDeclare{iso-8859-5}{C6}{0426}% CYRILLIC CAPITAL LETTER TSE
+\SE@MapDeclare{iso-8859-5}{C7}{0427}% CYRILLIC CAPITAL LETTER CHE
+\SE@MapDeclare{iso-8859-5}{C8}{0428}% CYRILLIC CAPITAL LETTER SHA
+\SE@MapDeclare{iso-8859-5}{C9}{0429}% CYRILLIC CAPITAL LETTER SHCHA
+\SE@MapDeclare{iso-8859-5}{CA}{042A}% CYRILLIC CAPITAL LETTER HARD SIGN
+\SE@MapDeclare{iso-8859-5}{CB}{042B}% CYRILLIC CAPITAL LETTER YERU
+\SE@MapDeclare{iso-8859-5}{CC}{042C}% CYRILLIC CAPITAL LETTER SOFT SIGN
+\SE@MapDeclare{iso-8859-5}{CD}{042D}% CYRILLIC CAPITAL LETTER E
+\SE@MapDeclare{iso-8859-5}{CE}{042E}% CYRILLIC CAPITAL LETTER YU
+\SE@MapDeclare{iso-8859-5}{CF}{042F}% CYRILLIC CAPITAL LETTER YA
+\SE@MapDeclare{iso-8859-5}{D0}{0430}% CYRILLIC SMALL LETTER A
+\SE@MapDeclare{iso-8859-5}{D1}{0431}% CYRILLIC SMALL LETTER BE
+\SE@MapDeclare{iso-8859-5}{D2}{0432}% CYRILLIC SMALL LETTER VE
+\SE@MapDeclare{iso-8859-5}{D3}{0433}% CYRILLIC SMALL LETTER GHE
+\SE@MapDeclare{iso-8859-5}{D4}{0434}% CYRILLIC SMALL LETTER DE
+\SE@MapDeclare{iso-8859-5}{D5}{0435}% CYRILLIC SMALL LETTER IE
+\SE@MapDeclare{iso-8859-5}{D6}{0436}% CYRILLIC SMALL LETTER ZHE
+\SE@MapDeclare{iso-8859-5}{D7}{0437}% CYRILLIC SMALL LETTER ZE
+\SE@MapDeclare{iso-8859-5}{D8}{0438}% CYRILLIC SMALL LETTER I
+\SE@MapDeclare{iso-8859-5}{D9}{0439}% CYRILLIC SMALL LETTER SHORT I
+\SE@MapDeclare{iso-8859-5}{DA}{043A}% CYRILLIC SMALL LETTER KA
+\SE@MapDeclare{iso-8859-5}{DB}{043B}% CYRILLIC SMALL LETTER EL
+\SE@MapDeclare{iso-8859-5}{DC}{043C}% CYRILLIC SMALL LETTER EM
+\SE@MapDeclare{iso-8859-5}{DD}{043D}% CYRILLIC SMALL LETTER EN
+\SE@MapDeclare{iso-8859-5}{DE}{043E}% CYRILLIC SMALL LETTER O
+\SE@MapDeclare{iso-8859-5}{DF}{043F}% CYRILLIC SMALL LETTER PE
+\SE@MapDeclare{iso-8859-5}{E0}{0440}% CYRILLIC SMALL LETTER ER
+\SE@MapDeclare{iso-8859-5}{E1}{0441}% CYRILLIC SMALL LETTER ES
+\SE@MapDeclare{iso-8859-5}{E2}{0442}% CYRILLIC SMALL LETTER TE
+\SE@MapDeclare{iso-8859-5}{E3}{0443}% CYRILLIC SMALL LETTER U
+\SE@MapDeclare{iso-8859-5}{E4}{0444}% CYRILLIC SMALL LETTER EF
+\SE@MapDeclare{iso-8859-5}{E5}{0445}% CYRILLIC SMALL LETTER HA
+\SE@MapDeclare{iso-8859-5}{E6}{0446}% CYRILLIC SMALL LETTER TSE
+\SE@MapDeclare{iso-8859-5}{E7}{0447}% CYRILLIC SMALL LETTER CHE
+\SE@MapDeclare{iso-8859-5}{E8}{0448}% CYRILLIC SMALL LETTER SHA
+\SE@MapDeclare{iso-8859-5}{E9}{0449}% CYRILLIC SMALL LETTER SHCHA
+\SE@MapDeclare{iso-8859-5}{EA}{044A}% CYRILLIC SMALL LETTER HARD SIGN
+\SE@MapDeclare{iso-8859-5}{EB}{044B}% CYRILLIC SMALL LETTER YERU
+\SE@MapDeclare{iso-8859-5}{EC}{044C}% CYRILLIC SMALL LETTER SOFT SIGN
+\SE@MapDeclare{iso-8859-5}{ED}{044D}% CYRILLIC SMALL LETTER E
+\SE@MapDeclare{iso-8859-5}{EE}{044E}% CYRILLIC SMALL LETTER YU
+\SE@MapDeclare{iso-8859-5}{EF}{044F}% CYRILLIC SMALL LETTER YA
+\SE@MapDeclare{iso-8859-5}{F0}{2116}% NUMERO SIGN
+\SE@MapDeclare{iso-8859-5}{F1}{0451}% CYRILLIC SMALL LETTER IO
+\SE@MapDeclare{iso-8859-5}{F2}{0452}% CYRILLIC SMALL LETTER DJE
+\SE@MapDeclare{iso-8859-5}{F3}{0453}% CYRILLIC SMALL LETTER GJE
+\SE@MapDeclare{iso-8859-5}{F4}{0454}% CYRILLIC SMALL LETTER UKRAINIAN IE
+\SE@MapDeclare{iso-8859-5}{F5}{0455}% CYRILLIC SMALL LETTER DZE
+\SE@MapDeclare{iso-8859-5}{F6}{0456}% CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+\SE@MapDeclare{iso-8859-5}{F7}{0457}% CYRILLIC SMALL LETTER YI
+\SE@MapDeclare{iso-8859-5}{F8}{0458}% CYRILLIC SMALL LETTER JE
+\SE@MapDeclare{iso-8859-5}{F9}{0459}% CYRILLIC SMALL LETTER LJE
+\SE@MapDeclare{iso-8859-5}{FA}{045A}% CYRILLIC SMALL LETTER NJE
+\SE@MapDeclare{iso-8859-5}{FB}{045B}% CYRILLIC SMALL LETTER TSHE
+\SE@MapDeclare{iso-8859-5}{FC}{045C}% CYRILLIC SMALL LETTER KJE
+\SE@MapDeclare{iso-8859-5}{FD}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-5}{FE}{045E}% CYRILLIC SMALL LETTER SHORT U
+\SE@MapDeclare{iso-8859-5}{FF}{045F}% CYRILLIC SMALL LETTER DZHE
+%</iso-8859-5>
+% \end{macrocode}
+% \paragraph{iso-8859-6}
+% \begin{macrocode}
+%<*iso-8859-6>
+\SE@MapDeclare{iso-8859-6}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-6}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{iso-8859-6}{AC}{060C}% ARABIC COMMA
+\SE@MapDeclare{iso-8859-6}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-6}{BB}{061B}% ARABIC SEMICOLON
+\SE@MapDeclare{iso-8859-6}{BF}{061F}% ARABIC QUESTION MARK
+\SE@MapDeclare{iso-8859-6}{C1}{0621}% ARABIC LETTER HAMZA
+\SE@MapDeclare{iso-8859-6}{C2}{0622}% ARABIC LETTER ALEF WITH MADDA ABOVE
+\SE@MapDeclare{iso-8859-6}{C3}{0623}% ARABIC LETTER ALEF WITH HAMZA ABOVE
+\SE@MapDeclare{iso-8859-6}{C4}{0624}% ARABIC LETTER WAW WITH HAMZA ABOVE
+\SE@MapDeclare{iso-8859-6}{C5}{0625}% ARABIC LETTER ALEF WITH HAMZA BELOW
+\SE@MapDeclare{iso-8859-6}{C6}{0626}% ARABIC LETTER YEH WITH HAMZA ABOVE
+\SE@MapDeclare{iso-8859-6}{C7}{0627}% ARABIC LETTER ALEF
+\SE@MapDeclare{iso-8859-6}{C8}{0628}% ARABIC LETTER BEH
+\SE@MapDeclare{iso-8859-6}{C9}{0629}% ARABIC LETTER TEH MARBUTA
+\SE@MapDeclare{iso-8859-6}{CA}{062A}% ARABIC LETTER TEH
+\SE@MapDeclare{iso-8859-6}{CB}{062B}% ARABIC LETTER THEH
+\SE@MapDeclare{iso-8859-6}{CC}{062C}% ARABIC LETTER JEEM
+\SE@MapDeclare{iso-8859-6}{CD}{062D}% ARABIC LETTER HAH
+\SE@MapDeclare{iso-8859-6}{CE}{062E}% ARABIC LETTER KHAH
+\SE@MapDeclare{iso-8859-6}{CF}{062F}% ARABIC LETTER DAL
+\SE@MapDeclare{iso-8859-6}{D0}{0630}% ARABIC LETTER THAL
+\SE@MapDeclare{iso-8859-6}{D1}{0631}% ARABIC LETTER REH
+\SE@MapDeclare{iso-8859-6}{D2}{0632}% ARABIC LETTER ZAIN
+\SE@MapDeclare{iso-8859-6}{D3}{0633}% ARABIC LETTER SEEN
+\SE@MapDeclare{iso-8859-6}{D4}{0634}% ARABIC LETTER SHEEN
+\SE@MapDeclare{iso-8859-6}{D5}{0635}% ARABIC LETTER SAD
+\SE@MapDeclare{iso-8859-6}{D6}{0636}% ARABIC LETTER DAD
+\SE@MapDeclare{iso-8859-6}{D7}{0637}% ARABIC LETTER TAH
+\SE@MapDeclare{iso-8859-6}{D8}{0638}% ARABIC LETTER ZAH
+\SE@MapDeclare{iso-8859-6}{D9}{0639}% ARABIC LETTER AIN
+\SE@MapDeclare{iso-8859-6}{DA}{063A}% ARABIC LETTER GHAIN
+\SE@MapDeclare{iso-8859-6}{E0}{0640}% ARABIC TATWEEL
+\SE@MapDeclare{iso-8859-6}{E1}{0641}% ARABIC LETTER FEH
+\SE@MapDeclare{iso-8859-6}{E2}{0642}% ARABIC LETTER QAF
+\SE@MapDeclare{iso-8859-6}{E3}{0643}% ARABIC LETTER KAF
+\SE@MapDeclare{iso-8859-6}{E4}{0644}% ARABIC LETTER LAM
+\SE@MapDeclare{iso-8859-6}{E5}{0645}% ARABIC LETTER MEEM
+\SE@MapDeclare{iso-8859-6}{E6}{0646}% ARABIC LETTER NOON
+\SE@MapDeclare{iso-8859-6}{E7}{0647}% ARABIC LETTER HEH
+\SE@MapDeclare{iso-8859-6}{E8}{0648}% ARABIC LETTER WAW
+\SE@MapDeclare{iso-8859-6}{E9}{0649}% ARABIC LETTER ALEF MAKSURA
+\SE@MapDeclare{iso-8859-6}{EA}{064A}% ARABIC LETTER YEH
+\SE@MapDeclare{iso-8859-6}{EB}{064B}% ARABIC FATHATAN
+\SE@MapDeclare{iso-8859-6}{EC}{064C}% ARABIC DAMMATAN
+\SE@MapDeclare{iso-8859-6}{ED}{064D}% ARABIC KASRATAN
+\SE@MapDeclare{iso-8859-6}{EE}{064E}% ARABIC FATHA
+\SE@MapDeclare{iso-8859-6}{EF}{064F}% ARABIC DAMMA
+\SE@MapDeclare{iso-8859-6}{F0}{0650}% ARABIC KASRA
+\SE@MapDeclare{iso-8859-6}{F1}{0651}% ARABIC SHADDA
+\SE@MapDeclare{iso-8859-6}{F2}{0652}% ARABIC SUKUN
+%</iso-8859-6>
+% \end{macrocode}
+% \paragraph{iso-8859-7}
+% \begin{macrocode}
+%<*iso-8859-7>
+\SE@MapDeclare{iso-8859-7}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-7}{A1}{2018}% LEFT SINGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-7}{A2}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-7}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{iso-8859-7}{A4}{20AC}% EURO SIGN
+\SE@MapDeclare{iso-8859-7}{A5}{20AF}% DRACHMA SIGN
+\SE@MapDeclare{iso-8859-7}{A6}{00A6}% BROKEN BAR
+\SE@MapDeclare{iso-8859-7}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-7}{A8}{00A8}% DIAERESIS
+\SE@MapDeclare{iso-8859-7}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{iso-8859-7}{AA}{037A}% GREEK YPOGEGRAMMENI
+\SE@MapDeclare{iso-8859-7}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-7}{AC}{00AC}% NOT SIGN
+\SE@MapDeclare{iso-8859-7}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-7}{AF}{2015}% HORIZONTAL BAR
+\SE@MapDeclare{iso-8859-7}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-7}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{iso-8859-7}{B2}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{iso-8859-7}{B3}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{iso-8859-7}{B4}{0384}% GREEK TONOS
+\SE@MapDeclare{iso-8859-7}{B5}{0385}% GREEK DIALYTIKA TONOS
+\SE@MapDeclare{iso-8859-7}{B6}{0386}% GREEK CAPITAL LETTER ALPHA WITH TONOS
+\SE@MapDeclare{iso-8859-7}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{iso-8859-7}{B8}{0388}% GREEK CAPITAL LETTER EPSILON WITH TONOS
+\SE@MapDeclare{iso-8859-7}{B9}{0389}% GREEK CAPITAL LETTER ETA WITH TONOS
+\SE@MapDeclare{iso-8859-7}{BA}{038A}% GREEK CAPITAL LETTER IOTA WITH TONOS
+\SE@MapDeclare{iso-8859-7}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-7}{BC}{038C}% GREEK CAPITAL LETTER OMICRON WITH TONOS
+\SE@MapDeclare{iso-8859-7}{BD}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{iso-8859-7}{BE}{038E}% GREEK CAPITAL LETTER UPSILON WITH TONOS
+\SE@MapDeclare{iso-8859-7}{BF}{038F}% GREEK CAPITAL LETTER OMEGA WITH TONOS
+\SE@MapDeclare{iso-8859-7}{C0}{0390}% GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+\SE@MapDeclare{iso-8859-7}{C1}{0391}% GREEK CAPITAL LETTER ALPHA
+\SE@MapDeclare{iso-8859-7}{C2}{0392}% GREEK CAPITAL LETTER BETA
+\SE@MapDeclare{iso-8859-7}{C3}{0393}% GREEK CAPITAL LETTER GAMMA
+\SE@MapDeclare{iso-8859-7}{C4}{0394}% GREEK CAPITAL LETTER DELTA
+\SE@MapDeclare{iso-8859-7}{C5}{0395}% GREEK CAPITAL LETTER EPSILON
+\SE@MapDeclare{iso-8859-7}{C6}{0396}% GREEK CAPITAL LETTER ZETA
+\SE@MapDeclare{iso-8859-7}{C7}{0397}% GREEK CAPITAL LETTER ETA
+\SE@MapDeclare{iso-8859-7}{C8}{0398}% GREEK CAPITAL LETTER THETA
+\SE@MapDeclare{iso-8859-7}{C9}{0399}% GREEK CAPITAL LETTER IOTA
+\SE@MapDeclare{iso-8859-7}{CA}{039A}% GREEK CAPITAL LETTER KAPPA
+\SE@MapDeclare{iso-8859-7}{CB}{039B}% GREEK CAPITAL LETTER LAMDA
+\SE@MapDeclare{iso-8859-7}{CC}{039C}% GREEK CAPITAL LETTER MU
+\SE@MapDeclare{iso-8859-7}{CD}{039D}% GREEK CAPITAL LETTER NU
+\SE@MapDeclare{iso-8859-7}{CE}{039E}% GREEK CAPITAL LETTER XI
+\SE@MapDeclare{iso-8859-7}{CF}{039F}% GREEK CAPITAL LETTER OMICRON
+\SE@MapDeclare{iso-8859-7}{D0}{03A0}% GREEK CAPITAL LETTER PI
+\SE@MapDeclare{iso-8859-7}{D1}{03A1}% GREEK CAPITAL LETTER RHO
+\SE@MapDeclare{iso-8859-7}{D3}{03A3}% GREEK CAPITAL LETTER SIGMA
+\SE@MapDeclare{iso-8859-7}{D4}{03A4}% GREEK CAPITAL LETTER TAU
+\SE@MapDeclare{iso-8859-7}{D5}{03A5}% GREEK CAPITAL LETTER UPSILON
+\SE@MapDeclare{iso-8859-7}{D6}{03A6}% GREEK CAPITAL LETTER PHI
+\SE@MapDeclare{iso-8859-7}{D7}{03A7}% GREEK CAPITAL LETTER CHI
+\SE@MapDeclare{iso-8859-7}{D8}{03A8}% GREEK CAPITAL LETTER PSI
+\SE@MapDeclare{iso-8859-7}{D9}{03A9}% GREEK CAPITAL LETTER OMEGA
+\SE@MapDeclare{iso-8859-7}{DA}{03AA}% GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+\SE@MapDeclare{iso-8859-7}{DB}{03AB}% GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+\SE@MapDeclare{iso-8859-7}{DC}{03AC}% GREEK SMALL LETTER ALPHA WITH TONOS
+\SE@MapDeclare{iso-8859-7}{DD}{03AD}% GREEK SMALL LETTER EPSILON WITH TONOS
+\SE@MapDeclare{iso-8859-7}{DE}{03AE}% GREEK SMALL LETTER ETA WITH TONOS
+\SE@MapDeclare{iso-8859-7}{DF}{03AF}% GREEK SMALL LETTER IOTA WITH TONOS
+\SE@MapDeclare{iso-8859-7}{E0}{03B0}% GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+\SE@MapDeclare{iso-8859-7}{E1}{03B1}% GREEK SMALL LETTER ALPHA
+\SE@MapDeclare{iso-8859-7}{E2}{03B2}% GREEK SMALL LETTER BETA
+\SE@MapDeclare{iso-8859-7}{E3}{03B3}% GREEK SMALL LETTER GAMMA
+\SE@MapDeclare{iso-8859-7}{E4}{03B4}% GREEK SMALL LETTER DELTA
+\SE@MapDeclare{iso-8859-7}{E5}{03B5}% GREEK SMALL LETTER EPSILON
+\SE@MapDeclare{iso-8859-7}{E6}{03B6}% GREEK SMALL LETTER ZETA
+\SE@MapDeclare{iso-8859-7}{E7}{03B7}% GREEK SMALL LETTER ETA
+\SE@MapDeclare{iso-8859-7}{E8}{03B8}% GREEK SMALL LETTER THETA
+\SE@MapDeclare{iso-8859-7}{E9}{03B9}% GREEK SMALL LETTER IOTA
+\SE@MapDeclare{iso-8859-7}{EA}{03BA}% GREEK SMALL LETTER KAPPA
+\SE@MapDeclare{iso-8859-7}{EB}{03BB}% GREEK SMALL LETTER LAMDA
+\SE@MapDeclare{iso-8859-7}{EC}{03BC}% GREEK SMALL LETTER MU
+\SE@MapDeclare{iso-8859-7}{ED}{03BD}% GREEK SMALL LETTER NU
+\SE@MapDeclare{iso-8859-7}{EE}{03BE}% GREEK SMALL LETTER XI
+\SE@MapDeclare{iso-8859-7}{EF}{03BF}% GREEK SMALL LETTER OMICRON
+\SE@MapDeclare{iso-8859-7}{F0}{03C0}% GREEK SMALL LETTER PI
+\SE@MapDeclare{iso-8859-7}{F1}{03C1}% GREEK SMALL LETTER RHO
+\SE@MapDeclare{iso-8859-7}{F2}{03C2}% GREEK SMALL LETTER FINAL SIGMA
+\SE@MapDeclare{iso-8859-7}{F3}{03C3}% GREEK SMALL LETTER SIGMA
+\SE@MapDeclare{iso-8859-7}{F4}{03C4}% GREEK SMALL LETTER TAU
+\SE@MapDeclare{iso-8859-7}{F5}{03C5}% GREEK SMALL LETTER UPSILON
+\SE@MapDeclare{iso-8859-7}{F6}{03C6}% GREEK SMALL LETTER PHI
+\SE@MapDeclare{iso-8859-7}{F7}{03C7}% GREEK SMALL LETTER CHI
+\SE@MapDeclare{iso-8859-7}{F8}{03C8}% GREEK SMALL LETTER PSI
+\SE@MapDeclare{iso-8859-7}{F9}{03C9}% GREEK SMALL LETTER OMEGA
+\SE@MapDeclare{iso-8859-7}{FA}{03CA}% GREEK SMALL LETTER IOTA WITH DIALYTIKA
+\SE@MapDeclare{iso-8859-7}{FB}{03CB}% GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+\SE@MapDeclare{iso-8859-7}{FC}{03CC}% GREEK SMALL LETTER OMICRON WITH TONOS
+\SE@MapDeclare{iso-8859-7}{FD}{03CD}% GREEK SMALL LETTER UPSILON WITH TONOS
+\SE@MapDeclare{iso-8859-7}{FE}{03CE}% GREEK SMALL LETTER OMEGA WITH TONOS
+%</iso-8859-7>
+% \end{macrocode}
+% \paragraph{iso-8859-8}
+% \begin{macrocode}
+%<*iso-8859-8>
+\SE@MapDeclare{iso-8859-8}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-8}{A2}{00A2}% CENT SIGN
+\SE@MapDeclare{iso-8859-8}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{iso-8859-8}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{iso-8859-8}{A5}{00A5}% YEN SIGN
+\SE@MapDeclare{iso-8859-8}{A6}{00A6}% BROKEN BAR
+\SE@MapDeclare{iso-8859-8}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-8}{A8}{00A8}% DIAERESIS
+\SE@MapDeclare{iso-8859-8}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{iso-8859-8}{AA}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{iso-8859-8}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-8}{AC}{00AC}% NOT SIGN
+\SE@MapDeclare{iso-8859-8}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-8}{AE}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{iso-8859-8}{AF}{00AF}% MACRON
+\SE@MapDeclare{iso-8859-8}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-8}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{iso-8859-8}{B2}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{iso-8859-8}{B3}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{iso-8859-8}{B4}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{iso-8859-8}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{iso-8859-8}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{iso-8859-8}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{iso-8859-8}{B8}{00B8}% CEDILLA
+\SE@MapDeclare{iso-8859-8}{B9}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{iso-8859-8}{BA}{00F7}% DIVISION SIGN
+\SE@MapDeclare{iso-8859-8}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-8}{BC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{iso-8859-8}{BD}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{iso-8859-8}{BE}{00BE}% VULGAR FRACTION THREE QUARTERS
+\SE@MapDeclare{iso-8859-8}{DF}{2017}% DOUBLE LOW LINE
+\SE@MapDeclare{iso-8859-8}{E0}{05D0}% HEBREW LETTER ALEF
+\SE@MapDeclare{iso-8859-8}{E1}{05D1}% HEBREW LETTER BET
+\SE@MapDeclare{iso-8859-8}{E2}{05D2}% HEBREW LETTER GIMEL
+\SE@MapDeclare{iso-8859-8}{E3}{05D3}% HEBREW LETTER DALET
+\SE@MapDeclare{iso-8859-8}{E4}{05D4}% HEBREW LETTER HE
+\SE@MapDeclare{iso-8859-8}{E5}{05D5}% HEBREW LETTER VAV
+\SE@MapDeclare{iso-8859-8}{E6}{05D6}% HEBREW LETTER ZAYIN
+\SE@MapDeclare{iso-8859-8}{E7}{05D7}% HEBREW LETTER HET
+\SE@MapDeclare{iso-8859-8}{E8}{05D8}% HEBREW LETTER TET
+\SE@MapDeclare{iso-8859-8}{E9}{05D9}% HEBREW LETTER YOD
+\SE@MapDeclare{iso-8859-8}{EA}{05DA}% HEBREW LETTER FINAL KAF
+\SE@MapDeclare{iso-8859-8}{EB}{05DB}% HEBREW LETTER KAF
+\SE@MapDeclare{iso-8859-8}{EC}{05DC}% HEBREW LETTER LAMED
+\SE@MapDeclare{iso-8859-8}{ED}{05DD}% HEBREW LETTER FINAL MEM
+\SE@MapDeclare{iso-8859-8}{EE}{05DE}% HEBREW LETTER MEM
+\SE@MapDeclare{iso-8859-8}{EF}{05DF}% HEBREW LETTER FINAL NUN
+\SE@MapDeclare{iso-8859-8}{F0}{05E0}% HEBREW LETTER NUN
+\SE@MapDeclare{iso-8859-8}{F1}{05E1}% HEBREW LETTER SAMEKH
+\SE@MapDeclare{iso-8859-8}{F2}{05E2}% HEBREW LETTER AYIN
+\SE@MapDeclare{iso-8859-8}{F3}{05E3}% HEBREW LETTER FINAL PE
+\SE@MapDeclare{iso-8859-8}{F4}{05E4}% HEBREW LETTER PE
+\SE@MapDeclare{iso-8859-8}{F5}{05E5}% HEBREW LETTER FINAL TSADI
+\SE@MapDeclare{iso-8859-8}{F6}{05E6}% HEBREW LETTER TSADI
+\SE@MapDeclare{iso-8859-8}{F7}{05E7}% HEBREW LETTER QOF
+\SE@MapDeclare{iso-8859-8}{F8}{05E8}% HEBREW LETTER RESH
+\SE@MapDeclare{iso-8859-8}{F9}{05E9}% HEBREW LETTER SHIN
+\SE@MapDeclare{iso-8859-8}{FA}{05EA}% HEBREW LETTER TAV
+\SE@MapDeclare{iso-8859-8}{FD}{200E}% LEFT-TO-RIGHT MARK
+\SE@MapDeclare{iso-8859-8}{FE}{200F}% RIGHT-TO-LEFT MARK
+%</iso-8859-8>
+% \end{macrocode}
+% \paragraph{iso-8859-9}
+% \begin{macrocode}
+%<*iso-8859-9>
+\SE@MapDeclare{iso-8859-9}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-9}{A1}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{iso-8859-9}{A2}{00A2}% CENT SIGN
+\SE@MapDeclare{iso-8859-9}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{iso-8859-9}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{iso-8859-9}{A5}{00A5}% YEN SIGN
+\SE@MapDeclare{iso-8859-9}{A6}{00A6}% BROKEN BAR
+\SE@MapDeclare{iso-8859-9}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-9}{A8}{00A8}% DIAERESIS
+\SE@MapDeclare{iso-8859-9}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{iso-8859-9}{AA}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{iso-8859-9}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-9}{AC}{00AC}% NOT SIGN
+\SE@MapDeclare{iso-8859-9}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-9}{AE}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{iso-8859-9}{AF}{00AF}% MACRON
+\SE@MapDeclare{iso-8859-9}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-9}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{iso-8859-9}{B2}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{iso-8859-9}{B3}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{iso-8859-9}{B4}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{iso-8859-9}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{iso-8859-9}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{iso-8859-9}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{iso-8859-9}{B8}{00B8}% CEDILLA
+\SE@MapDeclare{iso-8859-9}{B9}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{iso-8859-9}{BA}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{iso-8859-9}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-9}{BC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{iso-8859-9}{BD}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{iso-8859-9}{BE}{00BE}% VULGAR FRACTION THREE QUARTERS
+\SE@MapDeclare{iso-8859-9}{BF}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{iso-8859-9}{C0}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{C3}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-9}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{C5}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-9}{C6}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{iso-8859-9}{C7}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-9}{C8}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{CA}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{CC}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{CF}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{D0}{011E}% LATIN CAPITAL LETTER G WITH BREVE
+\SE@MapDeclare{iso-8859-9}{D1}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{iso-8859-9}{D2}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{D5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-9}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{D7}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{iso-8859-9}{D8}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-9}{D9}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{DB}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{DD}{0130}% LATIN CAPITAL LETTER I WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-9}{DE}{015E}% LATIN CAPITAL LETTER S WITH CEDILLA
+\SE@MapDeclare{iso-8859-9}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{iso-8859-9}{E0}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{E3}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-9}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{E5}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-9}{E6}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{iso-8859-9}{E7}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-9}{E8}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{EA}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{EC}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{EF}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{F0}{011F}% LATIN SMALL LETTER G WITH BREVE
+\SE@MapDeclare{iso-8859-9}{F1}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{iso-8859-9}{F2}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{F5}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-9}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{F7}{00F7}% DIVISION SIGN
+\SE@MapDeclare{iso-8859-9}{F8}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-9}{F9}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-9}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-9}{FB}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-9}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-9}{FD}{0131}% LATIN SMALL LETTER DOTLESS I
+\SE@MapDeclare{iso-8859-9}{FE}{015F}% LATIN SMALL LETTER S WITH CEDILLA
+\SE@MapDeclare{iso-8859-9}{FF}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+%</iso-8859-9>
+% \end{macrocode}
+% \paragraph{iso-8859-10}
+% \begin{macrocode}
+%<*iso-8859-10>
+\SE@MapDeclare{iso-8859-10}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-10}{A1}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-10}{A2}{0112}% LATIN CAPITAL LETTER E WITH MACRON
+\SE@MapDeclare{iso-8859-10}{A3}{0122}% LATIN CAPITAL LETTER G WITH CEDILLA
+\SE@MapDeclare{iso-8859-10}{A4}{012A}% LATIN CAPITAL LETTER I WITH MACRON
+\SE@MapDeclare{iso-8859-10}{A5}{0128}% LATIN CAPITAL LETTER I WITH TILDE
+\SE@MapDeclare{iso-8859-10}{A6}{0136}% LATIN CAPITAL LETTER K WITH CEDILLA
+\SE@MapDeclare{iso-8859-10}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-10}{A8}{013B}% LATIN CAPITAL LETTER L WITH CEDILLA
+\SE@MapDeclare{iso-8859-10}{A9}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\SE@MapDeclare{iso-8859-10}{AA}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-10}{AB}{0166}% LATIN CAPITAL LETTER T WITH STROKE
+\SE@MapDeclare{iso-8859-10}{AC}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-10}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-10}{AE}{016A}% LATIN CAPITAL LETTER U WITH MACRON
+\SE@MapDeclare{iso-8859-10}{AF}{014A}% LATIN CAPITAL LETTER ENG
+\SE@MapDeclare{iso-8859-10}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-10}{B1}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-10}{B2}{0113}% LATIN SMALL LETTER E WITH MACRON
+\SE@MapDeclare{iso-8859-10}{B3}{0123}% LATIN SMALL LETTER G WITH CEDILLA
+\SE@MapDeclare{iso-8859-10}{B4}{012B}% LATIN SMALL LETTER I WITH MACRON
+\SE@MapDeclare{iso-8859-10}{B5}{0129}% LATIN SMALL LETTER I WITH TILDE
+\SE@MapDeclare{iso-8859-10}{B6}{0137}% LATIN SMALL LETTER K WITH CEDILLA
+\SE@MapDeclare{iso-8859-10}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{iso-8859-10}{B8}{013C}% LATIN SMALL LETTER L WITH CEDILLA
+\SE@MapDeclare{iso-8859-10}{B9}{0111}% LATIN SMALL LETTER D WITH STROKE
+\SE@MapDeclare{iso-8859-10}{BA}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-10}{BB}{0167}% LATIN SMALL LETTER T WITH STROKE
+\SE@MapDeclare{iso-8859-10}{BC}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-10}{BD}{2015}% HORIZONTAL BAR
+\SE@MapDeclare{iso-8859-10}{BE}{016B}% LATIN SMALL LETTER U WITH MACRON
+\SE@MapDeclare{iso-8859-10}{BF}{014B}% LATIN SMALL LETTER ENG
+\SE@MapDeclare{iso-8859-10}{C0}{0100}% LATIN CAPITAL LETTER A WITH MACRON
+\SE@MapDeclare{iso-8859-10}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-10}{C3}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-10}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{C5}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-10}{C6}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{iso-8859-10}{C7}{012E}% LATIN CAPITAL LETTER I WITH OGONEK
+\SE@MapDeclare{iso-8859-10}{C8}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-10}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{CA}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-10}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{CC}{0116}% LATIN CAPITAL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-10}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-10}{CF}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{D0}{00D0}% LATIN CAPITAL LETTER ETH (Icelandic)
+\SE@MapDeclare{iso-8859-10}{D1}{0145}% LATIN CAPITAL LETTER N WITH CEDILLA
+\SE@MapDeclare{iso-8859-10}{D2}{014C}% LATIN CAPITAL LETTER O WITH MACRON
+\SE@MapDeclare{iso-8859-10}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-10}{D5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-10}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{D7}{0168}% LATIN CAPITAL LETTER U WITH TILDE
+\SE@MapDeclare{iso-8859-10}{D8}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-10}{D9}{0172}% LATIN CAPITAL LETTER U WITH OGONEK
+\SE@MapDeclare{iso-8859-10}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{DB}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-10}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{DD}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{DE}{00DE}% LATIN CAPITAL LETTER THORN (Icelandic)
+\SE@MapDeclare{iso-8859-10}{DF}{00DF}% LATIN SMALL LETTER SHARP S (German)
+\SE@MapDeclare{iso-8859-10}{E0}{0101}% LATIN SMALL LETTER A WITH MACRON
+\SE@MapDeclare{iso-8859-10}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-10}{E3}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-10}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{E5}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-10}{E6}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{iso-8859-10}{E7}{012F}% LATIN SMALL LETTER I WITH OGONEK
+\SE@MapDeclare{iso-8859-10}{E8}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-10}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{EA}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-10}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{EC}{0117}% LATIN SMALL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-10}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-10}{EF}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{F0}{00F0}% LATIN SMALL LETTER ETH (Icelandic)
+\SE@MapDeclare{iso-8859-10}{F1}{0146}% LATIN SMALL LETTER N WITH CEDILLA
+\SE@MapDeclare{iso-8859-10}{F2}{014D}% LATIN SMALL LETTER O WITH MACRON
+\SE@MapDeclare{iso-8859-10}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-10}{F5}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-10}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{F7}{0169}% LATIN SMALL LETTER U WITH TILDE
+\SE@MapDeclare{iso-8859-10}{F8}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-10}{F9}{0173}% LATIN SMALL LETTER U WITH OGONEK
+\SE@MapDeclare{iso-8859-10}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{FB}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-10}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-10}{FD}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{iso-8859-10}{FE}{00FE}% LATIN SMALL LETTER THORN (Icelandic)
+\SE@MapDeclare{iso-8859-10}{FF}{0138}% LATIN SMALL LETTER KRA
+%</iso-8859-10>
+% \end{macrocode}
+% \paragraph{iso-8859-11}
+% \begin{macrocode}
+%<*iso-8859-11>
+\SE@MapDeclare{iso-8859-11}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-11}{A1}{0E01}% THAI CHARACTER KO KAI
+\SE@MapDeclare{iso-8859-11}{A2}{0E02}% THAI CHARACTER KHO KHAI
+\SE@MapDeclare{iso-8859-11}{A3}{0E03}% THAI CHARACTER KHO KHUAT
+\SE@MapDeclare{iso-8859-11}{A4}{0E04}% THAI CHARACTER KHO KHWAI
+\SE@MapDeclare{iso-8859-11}{A5}{0E05}% THAI CHARACTER KHO KHON
+\SE@MapDeclare{iso-8859-11}{A6}{0E06}% THAI CHARACTER KHO RAKHANG
+\SE@MapDeclare{iso-8859-11}{A7}{0E07}% THAI CHARACTER NGO NGU
+\SE@MapDeclare{iso-8859-11}{A8}{0E08}% THAI CHARACTER CHO CHAN
+\SE@MapDeclare{iso-8859-11}{A9}{0E09}% THAI CHARACTER CHO CHING
+\SE@MapDeclare{iso-8859-11}{AA}{0E0A}% THAI CHARACTER CHO CHANG
+\SE@MapDeclare{iso-8859-11}{AB}{0E0B}% THAI CHARACTER SO SO
+\SE@MapDeclare{iso-8859-11}{AC}{0E0C}% THAI CHARACTER CHO CHOE
+\SE@MapDeclare{iso-8859-11}{AD}{0E0D}% THAI CHARACTER YO YING
+\SE@MapDeclare{iso-8859-11}{AE}{0E0E}% THAI CHARACTER DO CHADA
+\SE@MapDeclare{iso-8859-11}{AF}{0E0F}% THAI CHARACTER TO PATAK
+\SE@MapDeclare{iso-8859-11}{B0}{0E10}% THAI CHARACTER THO THAN
+\SE@MapDeclare{iso-8859-11}{B1}{0E11}% THAI CHARACTER THO NANGMONTHO
+\SE@MapDeclare{iso-8859-11}{B2}{0E12}% THAI CHARACTER THO PHUTHAO
+\SE@MapDeclare{iso-8859-11}{B3}{0E13}% THAI CHARACTER NO NEN
+\SE@MapDeclare{iso-8859-11}{B4}{0E14}% THAI CHARACTER DO DEK
+\SE@MapDeclare{iso-8859-11}{B5}{0E15}% THAI CHARACTER TO TAO
+\SE@MapDeclare{iso-8859-11}{B6}{0E16}% THAI CHARACTER THO THUNG
+\SE@MapDeclare{iso-8859-11}{B7}{0E17}% THAI CHARACTER THO THAHAN
+\SE@MapDeclare{iso-8859-11}{B8}{0E18}% THAI CHARACTER THO THONG
+\SE@MapDeclare{iso-8859-11}{B9}{0E19}% THAI CHARACTER NO NU
+\SE@MapDeclare{iso-8859-11}{BA}{0E1A}% THAI CHARACTER BO BAIMAI
+\SE@MapDeclare{iso-8859-11}{BB}{0E1B}% THAI CHARACTER PO PLA
+\SE@MapDeclare{iso-8859-11}{BC}{0E1C}% THAI CHARACTER PHO PHUNG
+\SE@MapDeclare{iso-8859-11}{BD}{0E1D}% THAI CHARACTER FO FA
+\SE@MapDeclare{iso-8859-11}{BE}{0E1E}% THAI CHARACTER PHO PHAN
+\SE@MapDeclare{iso-8859-11}{BF}{0E1F}% THAI CHARACTER FO FAN
+\SE@MapDeclare{iso-8859-11}{C0}{0E20}% THAI CHARACTER PHO SAMPHAO
+\SE@MapDeclare{iso-8859-11}{C1}{0E21}% THAI CHARACTER MO MA
+\SE@MapDeclare{iso-8859-11}{C2}{0E22}% THAI CHARACTER YO YAK
+\SE@MapDeclare{iso-8859-11}{C3}{0E23}% THAI CHARACTER RO RUA
+\SE@MapDeclare{iso-8859-11}{C4}{0E24}% THAI CHARACTER RU
+\SE@MapDeclare{iso-8859-11}{C5}{0E25}% THAI CHARACTER LO LING
+\SE@MapDeclare{iso-8859-11}{C6}{0E26}% THAI CHARACTER LU
+\SE@MapDeclare{iso-8859-11}{C7}{0E27}% THAI CHARACTER WO WAEN
+\SE@MapDeclare{iso-8859-11}{C8}{0E28}% THAI CHARACTER SO SALA
+\SE@MapDeclare{iso-8859-11}{C9}{0E29}% THAI CHARACTER SO RUSI
+\SE@MapDeclare{iso-8859-11}{CA}{0E2A}% THAI CHARACTER SO SUA
+\SE@MapDeclare{iso-8859-11}{CB}{0E2B}% THAI CHARACTER HO HIP
+\SE@MapDeclare{iso-8859-11}{CC}{0E2C}% THAI CHARACTER LO CHULA
+\SE@MapDeclare{iso-8859-11}{CD}{0E2D}% THAI CHARACTER O ANG
+\SE@MapDeclare{iso-8859-11}{CE}{0E2E}% THAI CHARACTER HO NOKHUK
+\SE@MapDeclare{iso-8859-11}{CF}{0E2F}% THAI CHARACTER PAIYANNOI
+\SE@MapDeclare{iso-8859-11}{D0}{0E30}% THAI CHARACTER SARA A
+\SE@MapDeclare{iso-8859-11}{D1}{0E31}% THAI CHARACTER MAI HAN-AKAT
+\SE@MapDeclare{iso-8859-11}{D2}{0E32}% THAI CHARACTER SARA AA
+\SE@MapDeclare{iso-8859-11}{D3}{0E33}% THAI CHARACTER SARA AM
+\SE@MapDeclare{iso-8859-11}{D4}{0E34}% THAI CHARACTER SARA I
+\SE@MapDeclare{iso-8859-11}{D5}{0E35}% THAI CHARACTER SARA II
+\SE@MapDeclare{iso-8859-11}{D6}{0E36}% THAI CHARACTER SARA UE
+\SE@MapDeclare{iso-8859-11}{D7}{0E37}% THAI CHARACTER SARA UEE
+\SE@MapDeclare{iso-8859-11}{D8}{0E38}% THAI CHARACTER SARA U
+\SE@MapDeclare{iso-8859-11}{D9}{0E39}% THAI CHARACTER SARA UU
+\SE@MapDeclare{iso-8859-11}{DA}{0E3A}% THAI CHARACTER PHINTHU
+\SE@MapDeclare{iso-8859-11}{DF}{0E3F}% THAI CURRENCY SYMBOL BAHT
+\SE@MapDeclare{iso-8859-11}{E0}{0E40}% THAI CHARACTER SARA E
+\SE@MapDeclare{iso-8859-11}{E1}{0E41}% THAI CHARACTER SARA AE
+\SE@MapDeclare{iso-8859-11}{E2}{0E42}% THAI CHARACTER SARA O
+\SE@MapDeclare{iso-8859-11}{E3}{0E43}% THAI CHARACTER SARA AI MAIMUAN
+\SE@MapDeclare{iso-8859-11}{E4}{0E44}% THAI CHARACTER SARA AI MAIMALAI
+\SE@MapDeclare{iso-8859-11}{E5}{0E45}% THAI CHARACTER LAKKHANGYAO
+\SE@MapDeclare{iso-8859-11}{E6}{0E46}% THAI CHARACTER MAIYAMOK
+\SE@MapDeclare{iso-8859-11}{E7}{0E47}% THAI CHARACTER MAITAIKHU
+\SE@MapDeclare{iso-8859-11}{E8}{0E48}% THAI CHARACTER MAI EK
+\SE@MapDeclare{iso-8859-11}{E9}{0E49}% THAI CHARACTER MAI THO
+\SE@MapDeclare{iso-8859-11}{EA}{0E4A}% THAI CHARACTER MAI TRI
+\SE@MapDeclare{iso-8859-11}{EB}{0E4B}% THAI CHARACTER MAI CHATTAWA
+\SE@MapDeclare{iso-8859-11}{EC}{0E4C}% THAI CHARACTER THANTHAKHAT
+\SE@MapDeclare{iso-8859-11}{ED}{0E4D}% THAI CHARACTER NIKHAHIT
+\SE@MapDeclare{iso-8859-11}{EE}{0E4E}% THAI CHARACTER YAMAKKAN
+\SE@MapDeclare{iso-8859-11}{EF}{0E4F}% THAI CHARACTER FONGMAN
+\SE@MapDeclare{iso-8859-11}{F0}{0E50}% THAI DIGIT ZERO
+\SE@MapDeclare{iso-8859-11}{F1}{0E51}% THAI DIGIT ONE
+\SE@MapDeclare{iso-8859-11}{F2}{0E52}% THAI DIGIT TWO
+\SE@MapDeclare{iso-8859-11}{F3}{0E53}% THAI DIGIT THREE
+\SE@MapDeclare{iso-8859-11}{F4}{0E54}% THAI DIGIT FOUR
+\SE@MapDeclare{iso-8859-11}{F5}{0E55}% THAI DIGIT FIVE
+\SE@MapDeclare{iso-8859-11}{F6}{0E56}% THAI DIGIT SIX
+\SE@MapDeclare{iso-8859-11}{F7}{0E57}% THAI DIGIT SEVEN
+\SE@MapDeclare{iso-8859-11}{F8}{0E58}% THAI DIGIT EIGHT
+\SE@MapDeclare{iso-8859-11}{F9}{0E59}% THAI DIGIT NINE
+\SE@MapDeclare{iso-8859-11}{FA}{0E5A}% THAI CHARACTER ANGKHANKHU
+\SE@MapDeclare{iso-8859-11}{FB}{0E5B}% THAI CHARACTER KHOMUT
+%</iso-8859-11>
+% \end{macrocode}
+% \paragraph{iso-8859-13}
+% \begin{macrocode}
+%<*iso-8859-13>
+\SE@MapDeclare{iso-8859-13}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-13}{A1}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-13}{A2}{00A2}% CENT SIGN
+\SE@MapDeclare{iso-8859-13}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{iso-8859-13}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{iso-8859-13}{A5}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{iso-8859-13}{A6}{00A6}% BROKEN BAR
+\SE@MapDeclare{iso-8859-13}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-13}{A8}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-13}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{iso-8859-13}{AA}{0156}% LATIN CAPITAL LETTER R WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-13}{AC}{00AC}% NOT SIGN
+\SE@MapDeclare{iso-8859-13}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-13}{AE}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{iso-8859-13}{AF}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{iso-8859-13}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-13}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{iso-8859-13}{B2}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{iso-8859-13}{B3}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{iso-8859-13}{B4}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-13}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{iso-8859-13}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{iso-8859-13}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{iso-8859-13}{B8}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-13}{B9}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{iso-8859-13}{BA}{0157}% LATIN SMALL LETTER R WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-13}{BC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{iso-8859-13}{BD}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{iso-8859-13}{BE}{00BE}% VULGAR FRACTION THREE QUARTERS
+\SE@MapDeclare{iso-8859-13}{BF}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{iso-8859-13}{C0}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-13}{C1}{012E}% LATIN CAPITAL LETTER I WITH OGONEK
+\SE@MapDeclare{iso-8859-13}{C2}{0100}% LATIN CAPITAL LETTER A WITH MACRON
+\SE@MapDeclare{iso-8859-13}{C3}{0106}% LATIN CAPITAL LETTER C WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-13}{C5}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-13}{C6}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-13}{C7}{0112}% LATIN CAPITAL LETTER E WITH MACRON
+\SE@MapDeclare{iso-8859-13}{C8}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-13}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{CA}{0179}% LATIN CAPITAL LETTER Z WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{CB}{0116}% LATIN CAPITAL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-13}{CC}{0122}% LATIN CAPITAL LETTER G WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{CD}{0136}% LATIN CAPITAL LETTER K WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{CE}{012A}% LATIN CAPITAL LETTER I WITH MACRON
+\SE@MapDeclare{iso-8859-13}{CF}{013B}% LATIN CAPITAL LETTER L WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{D0}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-13}{D1}{0143}% LATIN CAPITAL LETTER N WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{D2}{0145}% LATIN CAPITAL LETTER N WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{D4}{014C}% LATIN CAPITAL LETTER O WITH MACRON
+\SE@MapDeclare{iso-8859-13}{D5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-13}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-13}{D7}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{iso-8859-13}{D8}{0172}% LATIN CAPITAL LETTER U WITH OGONEK
+\SE@MapDeclare{iso-8859-13}{D9}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\SE@MapDeclare{iso-8859-13}{DA}{015A}% LATIN CAPITAL LETTER S WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{DB}{016A}% LATIN CAPITAL LETTER U WITH MACRON
+\SE@MapDeclare{iso-8859-13}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-13}{DD}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-13}{DE}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-13}{DF}{00DF}% LATIN SMALL LETTER SHARP S (German)
+\SE@MapDeclare{iso-8859-13}{E0}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-13}{E1}{012F}% LATIN SMALL LETTER I WITH OGONEK
+\SE@MapDeclare{iso-8859-13}{E2}{0101}% LATIN SMALL LETTER A WITH MACRON
+\SE@MapDeclare{iso-8859-13}{E3}{0107}% LATIN SMALL LETTER C WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-13}{E5}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-13}{E6}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-13}{E7}{0113}% LATIN SMALL LETTER E WITH MACRON
+\SE@MapDeclare{iso-8859-13}{E8}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-13}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{EA}{017A}% LATIN SMALL LETTER Z WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{EB}{0117}% LATIN SMALL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-13}{EC}{0123}% LATIN SMALL LETTER G WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{ED}{0137}% LATIN SMALL LETTER K WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{EE}{012B}% LATIN SMALL LETTER I WITH MACRON
+\SE@MapDeclare{iso-8859-13}{EF}{013C}% LATIN SMALL LETTER L WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{F0}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-13}{F1}{0144}% LATIN SMALL LETTER N WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{F2}{0146}% LATIN SMALL LETTER N WITH CEDILLA
+\SE@MapDeclare{iso-8859-13}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{F4}{014D}% LATIN SMALL LETTER O WITH MACRON
+\SE@MapDeclare{iso-8859-13}{F5}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-13}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-13}{F7}{00F7}% DIVISION SIGN
+\SE@MapDeclare{iso-8859-13}{F8}{0173}% LATIN SMALL LETTER U WITH OGONEK
+\SE@MapDeclare{iso-8859-13}{F9}{0142}% LATIN SMALL LETTER L WITH STROKE
+\SE@MapDeclare{iso-8859-13}{FA}{015B}% LATIN SMALL LETTER S WITH ACUTE
+\SE@MapDeclare{iso-8859-13}{FB}{016B}% LATIN SMALL LETTER U WITH MACRON
+\SE@MapDeclare{iso-8859-13}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-13}{FD}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-13}{FE}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-13}{FF}{2019}% RIGHT SINGLE QUOTATION MARK
+%</iso-8859-13>
+% \end{macrocode}
+% \paragraph{iso-8859-14}
+% \begin{macrocode}
+%<*iso-8859-14>
+\SE@MapDeclare{iso-8859-14}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-14}{A1}{1E02}% LATIN CAPITAL LETTER B WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{A2}{1E03}% LATIN SMALL LETTER B WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{iso-8859-14}{A4}{010A}% LATIN CAPITAL LETTER C WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{A5}{010B}% LATIN SMALL LETTER C WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{A6}{1E0A}% LATIN CAPITAL LETTER D WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-14}{A8}{1E80}% LATIN CAPITAL LETTER W WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{iso-8859-14}{AA}{1E82}% LATIN CAPITAL LETTER W WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{AB}{1E0B}% LATIN SMALL LETTER D WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{AC}{1EF2}% LATIN CAPITAL LETTER Y WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-14}{AE}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{iso-8859-14}{AF}{0178}% LATIN CAPITAL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{B0}{1E1E}% LATIN CAPITAL LETTER F WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{B1}{1E1F}% LATIN SMALL LETTER F WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{B2}{0120}% LATIN CAPITAL LETTER G WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{B3}{0121}% LATIN SMALL LETTER G WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{B4}{1E40}% LATIN CAPITAL LETTER M WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{B5}{1E41}% LATIN SMALL LETTER M WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{iso-8859-14}{B7}{1E56}% LATIN CAPITAL LETTER P WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{B8}{1E81}% LATIN SMALL LETTER W WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{B9}{1E57}% LATIN SMALL LETTER P WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{BA}{1E83}% LATIN SMALL LETTER W WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{BB}{1E60}% LATIN CAPITAL LETTER S WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{BC}{1EF3}% LATIN SMALL LETTER Y WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{BD}{1E84}% LATIN CAPITAL LETTER W WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{BE}{1E85}% LATIN SMALL LETTER W WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{BF}{1E61}% LATIN SMALL LETTER S WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{C0}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{C3}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-14}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{C5}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-14}{C6}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{iso-8859-14}{C7}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-14}{C8}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{CA}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{CC}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{CF}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{D0}{0174}% LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{D1}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{iso-8859-14}{D2}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{D5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-14}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{D7}{1E6A}% LATIN CAPITAL LETTER T WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{D8}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-14}{D9}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{DB}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{DD}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{DE}{0176}% LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{iso-8859-14}{E0}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{E3}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-14}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{E5}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-14}{E6}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{iso-8859-14}{E7}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-14}{E8}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{EA}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{EC}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{EF}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{F0}{0175}% LATIN SMALL LETTER W WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{F1}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{iso-8859-14}{F2}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{F5}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-14}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{F7}{1E6B}% LATIN SMALL LETTER T WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-14}{F8}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-14}{F9}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-14}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{FB}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-14}{FD}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{iso-8859-14}{FE}{0177}% LATIN SMALL LETTER Y WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-14}{FF}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+%</iso-8859-14>
+% \end{macrocode}
+% \paragraph{iso-8859-15}
+% \begin{macrocode}
+%<*iso-8859-15>
+\SE@MapDeclare{iso-8859-15}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-15}{A1}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{iso-8859-15}{A2}{00A2}% CENT SIGN
+\SE@MapDeclare{iso-8859-15}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{iso-8859-15}{A4}{20AC}% EURO SIGN
+\SE@MapDeclare{iso-8859-15}{A5}{00A5}% YEN SIGN
+\SE@MapDeclare{iso-8859-15}{A6}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-15}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-15}{A8}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-15}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{iso-8859-15}{AA}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{iso-8859-15}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-15}{AC}{00AC}% NOT SIGN
+\SE@MapDeclare{iso-8859-15}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-15}{AE}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{iso-8859-15}{AF}{00AF}% MACRON
+\SE@MapDeclare{iso-8859-15}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-15}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{iso-8859-15}{B2}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{iso-8859-15}{B3}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{iso-8859-15}{B4}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-15}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{iso-8859-15}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{iso-8859-15}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{iso-8859-15}{B8}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-15}{B9}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{iso-8859-15}{BA}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{iso-8859-15}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-15}{BC}{0152}% LATIN CAPITAL LIGATURE OE
+\SE@MapDeclare{iso-8859-15}{BD}{0153}% LATIN SMALL LIGATURE OE
+\SE@MapDeclare{iso-8859-15}{BE}{0178}% LATIN CAPITAL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{BF}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{iso-8859-15}{C0}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{C3}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-15}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{C5}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-15}{C6}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{iso-8859-15}{C7}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-15}{C8}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{CA}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{CC}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{CF}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{D0}{00D0}% LATIN CAPITAL LETTER ETH
+\SE@MapDeclare{iso-8859-15}{D1}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{iso-8859-15}{D2}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{D5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-15}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{D7}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{iso-8859-15}{D8}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-15}{D9}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{DB}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{DD}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{DE}{00DE}% LATIN CAPITAL LETTER THORN
+\SE@MapDeclare{iso-8859-15}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{iso-8859-15}{E0}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{E3}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{iso-8859-15}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{E5}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{iso-8859-15}{E6}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{iso-8859-15}{E7}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-15}{E8}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{EA}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{EC}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{EF}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{F0}{00F0}% LATIN SMALL LETTER ETH
+\SE@MapDeclare{iso-8859-15}{F1}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{iso-8859-15}{F2}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{F5}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{iso-8859-15}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{F7}{00F7}% DIVISION SIGN
+\SE@MapDeclare{iso-8859-15}{F8}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{iso-8859-15}{F9}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-15}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{FB}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-15}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-15}{FD}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{iso-8859-15}{FE}{00FE}% LATIN SMALL LETTER THORN
+\SE@MapDeclare{iso-8859-15}{FF}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+%</iso-8859-15>
+% \end{macrocode}
+% \paragraph{iso-8859-16}
+% \begin{macrocode}
+%<*iso-8859-16>
+\SE@MapDeclare{iso-8859-16}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{iso-8859-16}{A1}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-16}{A2}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{iso-8859-16}{A3}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\SE@MapDeclare{iso-8859-16}{A4}{20AC}% EURO SIGN
+\SE@MapDeclare{iso-8859-16}{A5}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{iso-8859-16}{A6}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-16}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{iso-8859-16}{A8}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{iso-8859-16}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{iso-8859-16}{AA}{0218}% LATIN CAPITAL LETTER S WITH COMMA BELOW
+\SE@MapDeclare{iso-8859-16}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-16}{AC}{0179}% LATIN CAPITAL LETTER Z WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{iso-8859-16}{AE}{017A}% LATIN SMALL LETTER Z WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{AF}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-16}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{iso-8859-16}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{iso-8859-16}{B2}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-16}{B3}{0142}% LATIN SMALL LETTER L WITH STROKE
+\SE@MapDeclare{iso-8859-16}{B4}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-16}{B5}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-16}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{iso-8859-16}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{iso-8859-16}{B8}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{iso-8859-16}{B9}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{iso-8859-16}{BA}{0219}% LATIN SMALL LETTER S WITH COMMA BELOW
+\SE@MapDeclare{iso-8859-16}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{iso-8859-16}{BC}{0152}% LATIN CAPITAL LIGATURE OE
+\SE@MapDeclare{iso-8859-16}{BD}{0153}% LATIN SMALL LIGATURE OE
+\SE@MapDeclare{iso-8859-16}{BE}{0178}% LATIN CAPITAL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{BF}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{iso-8859-16}{C0}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{C3}{0102}% LATIN CAPITAL LETTER A WITH BREVE
+\SE@MapDeclare{iso-8859-16}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{C5}{0106}% LATIN CAPITAL LETTER C WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{C6}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{iso-8859-16}{C7}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-16}{C8}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{CA}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{CC}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{CF}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{D0}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\SE@MapDeclare{iso-8859-16}{D1}{0143}% LATIN CAPITAL LETTER N WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{D2}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{D5}{0150}% LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{iso-8859-16}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{D7}{015A}% LATIN CAPITAL LETTER S WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{D8}{0170}% LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{iso-8859-16}{D9}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{DB}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{DD}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-16}{DE}{021A}% LATIN CAPITAL LETTER T WITH COMMA BELOW
+\SE@MapDeclare{iso-8859-16}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{iso-8859-16}{E0}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{E3}{0103}% LATIN SMALL LETTER A WITH BREVE
+\SE@MapDeclare{iso-8859-16}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{E5}{0107}% LATIN SMALL LETTER C WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{E6}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{iso-8859-16}{E7}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{iso-8859-16}{E8}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{EA}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{EC}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{EF}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{F0}{0111}% LATIN SMALL LETTER D WITH STROKE
+\SE@MapDeclare{iso-8859-16}{F1}{0144}% LATIN SMALL LETTER N WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{F2}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{F5}{0151}% LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{iso-8859-16}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{F7}{015B}% LATIN SMALL LETTER S WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{F8}{0171}% LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{iso-8859-16}{F9}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{iso-8859-16}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{iso-8859-16}{FB}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{iso-8859-16}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{iso-8859-16}{FD}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{iso-8859-16}{FE}{021B}% LATIN SMALL LETTER T WITH COMMA BELOW
+\SE@MapDeclare{iso-8859-16}{FF}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+%</iso-8859-16>
+% \end{macrocode}
+% \paragraph{koi8-r}
+% \begin{macrocode}
+%<*koi8-r>
+\SE@MapDeclare{koi8-r}{80}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\SE@MapDeclare{koi8-r}{81}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\SE@MapDeclare{koi8-r}{82}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\SE@MapDeclare{koi8-r}{83}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\SE@MapDeclare{koi8-r}{84}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\SE@MapDeclare{koi8-r}{85}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\SE@MapDeclare{koi8-r}{86}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\SE@MapDeclare{koi8-r}{87}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\SE@MapDeclare{koi8-r}{88}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\SE@MapDeclare{koi8-r}{89}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\SE@MapDeclare{koi8-r}{8A}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\SE@MapDeclare{koi8-r}{8B}{2580}% UPPER HALF BLOCK
+\SE@MapDeclare{koi8-r}{8C}{2584}% LOWER HALF BLOCK
+\SE@MapDeclare{koi8-r}{8D}{2588}% FULL BLOCK
+\SE@MapDeclare{koi8-r}{8E}{258C}% LEFT HALF BLOCK
+\SE@MapDeclare{koi8-r}{8F}{2590}% RIGHT HALF BLOCK
+\SE@MapDeclare{koi8-r}{90}{2591}% LIGHT SHADE
+\SE@MapDeclare{koi8-r}{91}{2592}% MEDIUM SHADE
+\SE@MapDeclare{koi8-r}{92}{2593}% DARK SHADE
+\SE@MapDeclare{koi8-r}{93}{2320}% TOP HALF INTEGRAL
+\SE@MapDeclare{koi8-r}{94}{25A0}% BLACK SQUARE
+\SE@MapDeclare{koi8-r}{95}{2219}% BULLET OPERATOR
+\SE@MapDeclare{koi8-r}{96}{221A}% SQUARE ROOT
+\SE@MapDeclare{koi8-r}{97}{2248}% ALMOST EQUAL TO
+\SE@MapDeclare{koi8-r}{98}{2264}% LESS-THAN OR EQUAL TO
+\SE@MapDeclare{koi8-r}{99}{2265}% GREATER-THAN OR EQUAL TO
+\SE@MapDeclare{koi8-r}{9A}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{koi8-r}{9B}{2321}% BOTTOM HALF INTEGRAL
+\SE@MapDeclare{koi8-r}{9C}{00B0}% DEGREE SIGN
+\SE@MapDeclare{koi8-r}{9D}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{koi8-r}{9E}{00B7}% MIDDLE DOT
+\SE@MapDeclare{koi8-r}{9F}{00F7}% DIVISION SIGN
+\SE@MapDeclare{koi8-r}{A0}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\SE@MapDeclare{koi8-r}{A1}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\SE@MapDeclare{koi8-r}{A2}{2552}% BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{koi8-r}{A3}{0451}% CYRILLIC SMALL LETTER IO
+\SE@MapDeclare{koi8-r}{A4}{2553}% BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{koi8-r}{A5}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\SE@MapDeclare{koi8-r}{A6}{2555}% BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{koi8-r}{A7}{2556}% BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{koi8-r}{A8}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\SE@MapDeclare{koi8-r}{A9}{2558}% BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{koi8-r}{AA}{2559}% BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{koi8-r}{AB}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\SE@MapDeclare{koi8-r}{AC}{255B}% BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{koi8-r}{AD}{255C}% BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{koi8-r}{AE}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\SE@MapDeclare{koi8-r}{AF}{255E}% BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{koi8-r}{B0}{255F}% BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{koi8-r}{B1}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\SE@MapDeclare{koi8-r}{B2}{2561}% BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{koi8-r}{B3}{0401}% CYRILLIC CAPITAL LETTER IO
+\SE@MapDeclare{koi8-r}{B4}{2562}% BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{koi8-r}{B5}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\SE@MapDeclare{koi8-r}{B6}{2564}% BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{koi8-r}{B7}{2565}% BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{koi8-r}{B8}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\SE@MapDeclare{koi8-r}{B9}{2567}% BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{koi8-r}{BA}{2568}% BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{koi8-r}{BB}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\SE@MapDeclare{koi8-r}{BC}{256A}% BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{koi8-r}{BD}{256B}% BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{koi8-r}{BE}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\SE@MapDeclare{koi8-r}{BF}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{koi8-r}{C0}{044E}% CYRILLIC SMALL LETTER YU
+\SE@MapDeclare{koi8-r}{C1}{0430}% CYRILLIC SMALL LETTER A
+\SE@MapDeclare{koi8-r}{C2}{0431}% CYRILLIC SMALL LETTER BE
+\SE@MapDeclare{koi8-r}{C3}{0446}% CYRILLIC SMALL LETTER TSE
+\SE@MapDeclare{koi8-r}{C4}{0434}% CYRILLIC SMALL LETTER DE
+\SE@MapDeclare{koi8-r}{C5}{0435}% CYRILLIC SMALL LETTER IE
+\SE@MapDeclare{koi8-r}{C6}{0444}% CYRILLIC SMALL LETTER EF
+\SE@MapDeclare{koi8-r}{C7}{0433}% CYRILLIC SMALL LETTER GHE
+\SE@MapDeclare{koi8-r}{C8}{0445}% CYRILLIC SMALL LETTER HA
+\SE@MapDeclare{koi8-r}{C9}{0438}% CYRILLIC SMALL LETTER I
+\SE@MapDeclare{koi8-r}{CA}{0439}% CYRILLIC SMALL LETTER SHORT I
+\SE@MapDeclare{koi8-r}{CB}{043A}% CYRILLIC SMALL LETTER KA
+\SE@MapDeclare{koi8-r}{CC}{043B}% CYRILLIC SMALL LETTER EL
+\SE@MapDeclare{koi8-r}{CD}{043C}% CYRILLIC SMALL LETTER EM
+\SE@MapDeclare{koi8-r}{CE}{043D}% CYRILLIC SMALL LETTER EN
+\SE@MapDeclare{koi8-r}{CF}{043E}% CYRILLIC SMALL LETTER O
+\SE@MapDeclare{koi8-r}{D0}{043F}% CYRILLIC SMALL LETTER PE
+\SE@MapDeclare{koi8-r}{D1}{044F}% CYRILLIC SMALL LETTER YA
+\SE@MapDeclare{koi8-r}{D2}{0440}% CYRILLIC SMALL LETTER ER
+\SE@MapDeclare{koi8-r}{D3}{0441}% CYRILLIC SMALL LETTER ES
+\SE@MapDeclare{koi8-r}{D4}{0442}% CYRILLIC SMALL LETTER TE
+\SE@MapDeclare{koi8-r}{D5}{0443}% CYRILLIC SMALL LETTER U
+\SE@MapDeclare{koi8-r}{D6}{0436}% CYRILLIC SMALL LETTER ZHE
+\SE@MapDeclare{koi8-r}{D7}{0432}% CYRILLIC SMALL LETTER VE
+\SE@MapDeclare{koi8-r}{D8}{044C}% CYRILLIC SMALL LETTER SOFT SIGN
+\SE@MapDeclare{koi8-r}{D9}{044B}% CYRILLIC SMALL LETTER YERU
+\SE@MapDeclare{koi8-r}{DA}{0437}% CYRILLIC SMALL LETTER ZE
+\SE@MapDeclare{koi8-r}{DB}{0448}% CYRILLIC SMALL LETTER SHA
+\SE@MapDeclare{koi8-r}{DC}{044D}% CYRILLIC SMALL LETTER E
+\SE@MapDeclare{koi8-r}{DD}{0449}% CYRILLIC SMALL LETTER SHCHA
+\SE@MapDeclare{koi8-r}{DE}{0447}% CYRILLIC SMALL LETTER CHE
+\SE@MapDeclare{koi8-r}{DF}{044A}% CYRILLIC SMALL LETTER HARD SIGN
+\SE@MapDeclare{koi8-r}{E0}{042E}% CYRILLIC CAPITAL LETTER YU
+\SE@MapDeclare{koi8-r}{E1}{0410}% CYRILLIC CAPITAL LETTER A
+\SE@MapDeclare{koi8-r}{E2}{0411}% CYRILLIC CAPITAL LETTER BE
+\SE@MapDeclare{koi8-r}{E3}{0426}% CYRILLIC CAPITAL LETTER TSE
+\SE@MapDeclare{koi8-r}{E4}{0414}% CYRILLIC CAPITAL LETTER DE
+\SE@MapDeclare{koi8-r}{E5}{0415}% CYRILLIC CAPITAL LETTER IE
+\SE@MapDeclare{koi8-r}{E6}{0424}% CYRILLIC CAPITAL LETTER EF
+\SE@MapDeclare{koi8-r}{E7}{0413}% CYRILLIC CAPITAL LETTER GHE
+\SE@MapDeclare{koi8-r}{E8}{0425}% CYRILLIC CAPITAL LETTER HA
+\SE@MapDeclare{koi8-r}{E9}{0418}% CYRILLIC CAPITAL LETTER I
+\SE@MapDeclare{koi8-r}{EA}{0419}% CYRILLIC CAPITAL LETTER SHORT I
+\SE@MapDeclare{koi8-r}{EB}{041A}% CYRILLIC CAPITAL LETTER KA
+\SE@MapDeclare{koi8-r}{EC}{041B}% CYRILLIC CAPITAL LETTER EL
+\SE@MapDeclare{koi8-r}{ED}{041C}% CYRILLIC CAPITAL LETTER EM
+\SE@MapDeclare{koi8-r}{EE}{041D}% CYRILLIC CAPITAL LETTER EN
+\SE@MapDeclare{koi8-r}{EF}{041E}% CYRILLIC CAPITAL LETTER O
+\SE@MapDeclare{koi8-r}{F0}{041F}% CYRILLIC CAPITAL LETTER PE
+\SE@MapDeclare{koi8-r}{F1}{042F}% CYRILLIC CAPITAL LETTER YA
+\SE@MapDeclare{koi8-r}{F2}{0420}% CYRILLIC CAPITAL LETTER ER
+\SE@MapDeclare{koi8-r}{F3}{0421}% CYRILLIC CAPITAL LETTER ES
+\SE@MapDeclare{koi8-r}{F4}{0422}% CYRILLIC CAPITAL LETTER TE
+\SE@MapDeclare{koi8-r}{F5}{0423}% CYRILLIC CAPITAL LETTER U
+\SE@MapDeclare{koi8-r}{F6}{0416}% CYRILLIC CAPITAL LETTER ZHE
+\SE@MapDeclare{koi8-r}{F7}{0412}% CYRILLIC CAPITAL LETTER VE
+\SE@MapDeclare{koi8-r}{F8}{042C}% CYRILLIC CAPITAL LETTER SOFT SIGN
+\SE@MapDeclare{koi8-r}{F9}{042B}% CYRILLIC CAPITAL LETTER YERU
+\SE@MapDeclare{koi8-r}{FA}{0417}% CYRILLIC CAPITAL LETTER ZE
+\SE@MapDeclare{koi8-r}{FB}{0428}% CYRILLIC CAPITAL LETTER SHA
+\SE@MapDeclare{koi8-r}{FC}{042D}% CYRILLIC CAPITAL LETTER E
+\SE@MapDeclare{koi8-r}{FD}{0429}% CYRILLIC CAPITAL LETTER SHCHA
+\SE@MapDeclare{koi8-r}{FE}{0427}% CYRILLIC CAPITAL LETTER CHE
+\SE@MapDeclare{koi8-r}{FF}{042A}% CYRILLIC CAPITAL LETTER HARD SIGN
+%</koi8-r>
+% \end{macrocode}
+% \paragraph{nextstep}
+% \begin{macrocode}
+%<*nextstep>
+\SE@MapDeclare{nextstep}{80}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{nextstep}{81}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{nextstep}{82}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{nextstep}{83}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{84}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{nextstep}{85}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{nextstep}{86}{00C5}% LATIN CAPITAL LETTER A WITH RING
+\SE@MapDeclare{nextstep}{87}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{nextstep}{88}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{nextstep}{89}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{nextstep}{8A}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{8B}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{nextstep}{8C}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{nextstep}{8D}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{nextstep}{8E}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{8F}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{nextstep}{90}{00D0}% LATIN CAPITAL LETTER ETH
+\SE@MapDeclare{nextstep}{91}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{nextstep}{92}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{nextstep}{93}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{nextstep}{94}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{95}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{nextstep}{96}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{nextstep}{97}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{nextstep}{98}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{nextstep}{99}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{9A}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{nextstep}{9B}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{nextstep}{9C}{00DE}% LATIN CAPITAL LETTER THORN
+\SE@MapDeclare{nextstep}{9D}{00B5}% MICRO SIGN
+\SE@MapDeclare{nextstep}{9E}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{nextstep}{9F}{00F7}% DIVISION SIGN
+\SE@MapDeclare{nextstep}{A0}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{nextstep}{A1}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{nextstep}{A2}{00A2}% CENT SIGN
+\SE@MapDeclare{nextstep}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{nextstep}{A4}{2044}% FRACTION SLASH
+\SE@MapDeclare{nextstep}{A5}{00A5}% YEN SIGN
+\SE@MapDeclare{nextstep}{A6}{0192}% LATIN SMALL LETTER F WITH HOOK
+\SE@MapDeclare{nextstep}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{nextstep}{A8}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{nextstep}{A9}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{nextstep}{AA}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{nextstep}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{nextstep}{AC}{2039}% SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{nextstep}{AD}{203A}% SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{nextstep}{AE}{FB01}% LATIN SMALL LIGATURE FI
+\SE@MapDeclare{nextstep}{AF}{FB02}% LATIN SMALL LIGATURE FL
+\SE@MapDeclare{nextstep}{B0}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{nextstep}{B1}{2013}% EN DASH
+\SE@MapDeclare{nextstep}{B2}{2020}% DAGGER
+\SE@MapDeclare{nextstep}{B3}{2021}% DOUBLE DAGGER
+\SE@MapDeclare{nextstep}{B4}{00B7}% MIDDLE DOT
+\SE@MapDeclare{nextstep}{B5}{00A6}% BROKEN BAR
+\SE@MapDeclare{nextstep}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{nextstep}{B7}{2022}% BULLET
+\SE@MapDeclare{nextstep}{B8}{201A}% SINGLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{nextstep}{B9}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{nextstep}{BA}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{nextstep}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{nextstep}{BC}{2026}% HORIZONTAL ELLIPSIS
+\SE@MapDeclare{nextstep}{BD}{2030}% PER MILLE SIGN
+\SE@MapDeclare{nextstep}{BE}{00AC}% NOT SIGN
+\SE@MapDeclare{nextstep}{BF}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{nextstep}{C0}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{nextstep}{C1}{02CB}% MODIFIER LETTER GRAVE ACCENT
+\SE@MapDeclare{nextstep}{C2}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{nextstep}{C3}{02C6}% MODIFIER LETTER CIRCUMFLEX ACCENT
+\SE@MapDeclare{nextstep}{C4}{02DC}% SMALL TILDE
+\SE@MapDeclare{nextstep}{C5}{00AF}% MACRON
+\SE@MapDeclare{nextstep}{C6}{02D8}% BREVE
+\SE@MapDeclare{nextstep}{C7}{02D9}% DOT ABOVE
+\SE@MapDeclare{nextstep}{C8}{00A8}% DIAERESIS
+\SE@MapDeclare{nextstep}{C9}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{nextstep}{CA}{02DA}% RING ABOVE
+\SE@MapDeclare{nextstep}{CB}{00B8}% CEDILLA
+\SE@MapDeclare{nextstep}{CC}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{nextstep}{CD}{02DD}% DOUBLE ACUTE ACCENT
+\SE@MapDeclare{nextstep}{CE}{02DB}% OGONEK
+\SE@MapDeclare{nextstep}{CF}{02C7}% CARON
+\SE@MapDeclare{nextstep}{D0}{2014}% EM DASH
+\SE@MapDeclare{nextstep}{D1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{nextstep}{D2}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{nextstep}{D3}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{nextstep}{D4}{00BE}% VULGAR FRACTION THREE QUARTERS
+\SE@MapDeclare{nextstep}{D5}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{nextstep}{D6}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{nextstep}{D7}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{D8}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{nextstep}{D9}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{nextstep}{DA}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{nextstep}{DB}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{nextstep}{DC}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{nextstep}{DD}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{nextstep}{DE}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{DF}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{nextstep}{E0}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{nextstep}{E1}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{nextstep}{E2}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{nextstep}{E3}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{nextstep}{E4}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{E5}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{nextstep}{E6}{00F0}% LATIN SMALL LETTER ETH
+\SE@MapDeclare{nextstep}{E7}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{nextstep}{E8}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\SE@MapDeclare{nextstep}{E9}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{nextstep}{EA}{0152}% LATIN CAPITAL LIGATURE OE
+\SE@MapDeclare{nextstep}{EB}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{nextstep}{EC}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{nextstep}{ED}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{nextstep}{EE}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{EF}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{nextstep}{F0}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{nextstep}{F1}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{nextstep}{F2}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{nextstep}{F3}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{nextstep}{F4}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{nextstep}{F5}{0131}% LATIN SMALL LETTER DOTLESS I
+\SE@MapDeclare{nextstep}{F6}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{nextstep}{F7}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{nextstep}{F8}{0142}% LATIN SMALL LETTER L WITH STROKE
+\SE@MapDeclare{nextstep}{F9}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{nextstep}{FA}{0153}% LATIN SMALL LIGATURE OE
+\SE@MapDeclare{nextstep}{FB}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{nextstep}{FC}{00FE}% LATIN SMALL LETTER THORN
+\SE@MapDeclare{nextstep}{FD}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+%</nextstep>
+% \end{macrocode}
+% \paragraph{mac-centeuro}
+% \begin{macrocode}
+%<*mac-centeuro>
+\SE@MapDeclare{mac-centeuro}{80}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{mac-centeuro}{81}{0100}% LATIN CAPITAL LETTER A WITH MACRON
+\SE@MapDeclare{mac-centeuro}{82}{0101}% LATIN SMALL LETTER A WITH MACRON
+\SE@MapDeclare{mac-centeuro}{83}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{84}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{mac-centeuro}{85}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{mac-centeuro}{86}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{mac-centeuro}{87}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{88}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{mac-centeuro}{89}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{mac-centeuro}{8A}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{mac-centeuro}{8B}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{mac-centeuro}{8C}{0106}% LATIN CAPITAL LETTER C WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{8D}{0107}% LATIN SMALL LETTER C WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{8E}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{8F}{0179}% LATIN CAPITAL LETTER Z WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{90}{017A}% LATIN SMALL LETTER Z WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{91}{010E}% LATIN CAPITAL LETTER D WITH CARON
+\SE@MapDeclare{mac-centeuro}{92}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{93}{010F}% LATIN SMALL LETTER D WITH CARON
+\SE@MapDeclare{mac-centeuro}{94}{0112}% LATIN CAPITAL LETTER E WITH MACRON
+\SE@MapDeclare{mac-centeuro}{95}{0113}% LATIN SMALL LETTER E WITH MACRON
+\SE@MapDeclare{mac-centeuro}{96}{0116}% LATIN CAPITAL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{mac-centeuro}{97}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{98}{0117}% LATIN SMALL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{mac-centeuro}{99}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{mac-centeuro}{9A}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{mac-centeuro}{9B}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{mac-centeuro}{9C}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{9D}{011A}% LATIN CAPITAL LETTER E WITH CARON
+\SE@MapDeclare{mac-centeuro}{9E}{011B}% LATIN SMALL LETTER E WITH CARON
+\SE@MapDeclare{mac-centeuro}{9F}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{mac-centeuro}{A0}{2020}% DAGGER
+\SE@MapDeclare{mac-centeuro}{A1}{00B0}% DEGREE SIGN
+\SE@MapDeclare{mac-centeuro}{A2}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{mac-centeuro}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{mac-centeuro}{A4}{00A7}% SECTION SIGN
+\SE@MapDeclare{mac-centeuro}{A5}{2022}% BULLET
+\SE@MapDeclare{mac-centeuro}{A6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{mac-centeuro}{A7}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{mac-centeuro}{A8}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{mac-centeuro}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{mac-centeuro}{AA}{2122}% TRADE MARK SIGN
+\SE@MapDeclare{mac-centeuro}{AB}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{mac-centeuro}{AC}{00A8}% DIAERESIS
+\SE@MapDeclare{mac-centeuro}{AD}{2260}% NOT EQUAL TO
+\SE@MapDeclare{mac-centeuro}{AE}{0123}% LATIN SMALL LETTER G WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{AF}{012E}% LATIN CAPITAL LETTER I WITH OGONEK
+\SE@MapDeclare{mac-centeuro}{B0}{012F}% LATIN SMALL LETTER I WITH OGONEK
+\SE@MapDeclare{mac-centeuro}{B1}{012A}% LATIN CAPITAL LETTER I WITH MACRON
+\SE@MapDeclare{mac-centeuro}{B2}{2264}% LESS-THAN OR EQUAL TO
+\SE@MapDeclare{mac-centeuro}{B3}{2265}% GREATER-THAN OR EQUAL TO
+\SE@MapDeclare{mac-centeuro}{B4}{012B}% LATIN SMALL LETTER I WITH MACRON
+\SE@MapDeclare{mac-centeuro}{B5}{0136}% LATIN CAPITAL LETTER K WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{B6}{2202}% PARTIAL DIFFERENTIAL
+\SE@MapDeclare{mac-centeuro}{B7}{2211}% N-ARY SUMMATION
+\SE@MapDeclare{mac-centeuro}{B8}{0142}% LATIN SMALL LETTER L WITH STROKE
+\SE@MapDeclare{mac-centeuro}{B9}{013B}% LATIN CAPITAL LETTER L WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{BA}{013C}% LATIN SMALL LETTER L WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{BB}{013D}% LATIN CAPITAL LETTER L WITH CARON
+\SE@MapDeclare{mac-centeuro}{BC}{013E}% LATIN SMALL LETTER L WITH CARON
+\SE@MapDeclare{mac-centeuro}{BD}{0139}% LATIN CAPITAL LETTER L WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{BE}{013A}% LATIN SMALL LETTER L WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{BF}{0145}% LATIN CAPITAL LETTER N WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{C0}{0146}% LATIN SMALL LETTER N WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{C1}{0143}% LATIN CAPITAL LETTER N WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{C2}{00AC}% NOT SIGN
+\SE@MapDeclare{mac-centeuro}{C3}{221A}% SQUARE ROOT
+\SE@MapDeclare{mac-centeuro}{C4}{0144}% LATIN SMALL LETTER N WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{C5}{0147}% LATIN CAPITAL LETTER N WITH CARON
+\SE@MapDeclare{mac-centeuro}{C6}{2206}% INCREMENT
+\SE@MapDeclare{mac-centeuro}{C7}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{C8}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{C9}{2026}% HORIZONTAL ELLIPSIS
+\SE@MapDeclare{mac-centeuro}{CA}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{mac-centeuro}{CB}{0148}% LATIN SMALL LETTER N WITH CARON
+\SE@MapDeclare{mac-centeuro}{CC}{0150}% LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{mac-centeuro}{CD}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{mac-centeuro}{CE}{0151}% LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{mac-centeuro}{CF}{014C}% LATIN CAPITAL LETTER O WITH MACRON
+\SE@MapDeclare{mac-centeuro}{D0}{2013}% EN DASH
+\SE@MapDeclare{mac-centeuro}{D1}{2014}% EM DASH
+\SE@MapDeclare{mac-centeuro}{D2}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{D3}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{D4}{2018}% LEFT SINGLE QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{D5}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{D6}{00F7}% DIVISION SIGN
+\SE@MapDeclare{mac-centeuro}{D7}{25CA}% LOZENGE
+\SE@MapDeclare{mac-centeuro}{D8}{014D}% LATIN SMALL LETTER O WITH MACRON
+\SE@MapDeclare{mac-centeuro}{D9}{0154}% LATIN CAPITAL LETTER R WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{DA}{0155}% LATIN SMALL LETTER R WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{DB}{0158}% LATIN CAPITAL LETTER R WITH CARON
+\SE@MapDeclare{mac-centeuro}{DC}{2039}% SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{DD}{203A}% SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{DE}{0159}% LATIN SMALL LETTER R WITH CARON
+\SE@MapDeclare{mac-centeuro}{DF}{0156}% LATIN CAPITAL LETTER R WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{E0}{0157}% LATIN SMALL LETTER R WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{E1}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{mac-centeuro}{E2}{201A}% SINGLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{E3}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{mac-centeuro}{E4}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{mac-centeuro}{E5}{015A}% LATIN CAPITAL LETTER S WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{E6}{015B}% LATIN SMALL LETTER S WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{E7}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{E8}{0164}% LATIN CAPITAL LETTER T WITH CARON
+\SE@MapDeclare{mac-centeuro}{E9}{0165}% LATIN SMALL LETTER T WITH CARON
+\SE@MapDeclare{mac-centeuro}{EA}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{EB}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{mac-centeuro}{EC}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{mac-centeuro}{ED}{016A}% LATIN CAPITAL LETTER U WITH MACRON
+\SE@MapDeclare{mac-centeuro}{EE}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{EF}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{mac-centeuro}{F0}{016B}% LATIN SMALL LETTER U WITH MACRON
+\SE@MapDeclare{mac-centeuro}{F1}{016E}% LATIN CAPITAL LETTER U WITH RING ABOVE
+\SE@MapDeclare{mac-centeuro}{F2}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{F3}{016F}% LATIN SMALL LETTER U WITH RING ABOVE
+\SE@MapDeclare{mac-centeuro}{F4}{0170}% LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{mac-centeuro}{F5}{0171}% LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{mac-centeuro}{F6}{0172}% LATIN CAPITAL LETTER U WITH OGONEK
+\SE@MapDeclare{mac-centeuro}{F7}{0173}% LATIN SMALL LETTER U WITH OGONEK
+\SE@MapDeclare{mac-centeuro}{F8}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{F9}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{mac-centeuro}{FA}{0137}% LATIN SMALL LETTER K WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{FB}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{mac-centeuro}{FC}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\SE@MapDeclare{mac-centeuro}{FD}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{mac-centeuro}{FE}{0122}% LATIN CAPITAL LETTER G WITH CEDILLA
+\SE@MapDeclare{mac-centeuro}{FF}{02C7}% CARON
+%</mac-centeuro>
+% \end{macrocode}
+% \paragraph{mac-cyrillic}
+% \begin{macrocode}
+%<*mac-cyrillic>
+\SE@MapDeclare{mac-cyrillic}{80}{0410}% CYRILLIC CAPITAL LETTER A
+\SE@MapDeclare{mac-cyrillic}{81}{0411}% CYRILLIC CAPITAL LETTER BE
+\SE@MapDeclare{mac-cyrillic}{82}{0412}% CYRILLIC CAPITAL LETTER VE
+\SE@MapDeclare{mac-cyrillic}{83}{0413}% CYRILLIC CAPITAL LETTER GHE
+\SE@MapDeclare{mac-cyrillic}{84}{0414}% CYRILLIC CAPITAL LETTER DE
+\SE@MapDeclare{mac-cyrillic}{85}{0415}% CYRILLIC CAPITAL LETTER IE
+\SE@MapDeclare{mac-cyrillic}{86}{0416}% CYRILLIC CAPITAL LETTER ZHE
+\SE@MapDeclare{mac-cyrillic}{87}{0417}% CYRILLIC CAPITAL LETTER ZE
+\SE@MapDeclare{mac-cyrillic}{88}{0418}% CYRILLIC CAPITAL LETTER I
+\SE@MapDeclare{mac-cyrillic}{89}{0419}% CYRILLIC CAPITAL LETTER SHORT I
+\SE@MapDeclare{mac-cyrillic}{8A}{041A}% CYRILLIC CAPITAL LETTER KA
+\SE@MapDeclare{mac-cyrillic}{8B}{041B}% CYRILLIC CAPITAL LETTER EL
+\SE@MapDeclare{mac-cyrillic}{8C}{041C}% CYRILLIC CAPITAL LETTER EM
+\SE@MapDeclare{mac-cyrillic}{8D}{041D}% CYRILLIC CAPITAL LETTER EN
+\SE@MapDeclare{mac-cyrillic}{8E}{041E}% CYRILLIC CAPITAL LETTER O
+\SE@MapDeclare{mac-cyrillic}{8F}{041F}% CYRILLIC CAPITAL LETTER PE
+\SE@MapDeclare{mac-cyrillic}{90}{0420}% CYRILLIC CAPITAL LETTER ER
+\SE@MapDeclare{mac-cyrillic}{91}{0421}% CYRILLIC CAPITAL LETTER ES
+\SE@MapDeclare{mac-cyrillic}{92}{0422}% CYRILLIC CAPITAL LETTER TE
+\SE@MapDeclare{mac-cyrillic}{93}{0423}% CYRILLIC CAPITAL LETTER U
+\SE@MapDeclare{mac-cyrillic}{94}{0424}% CYRILLIC CAPITAL LETTER EF
+\SE@MapDeclare{mac-cyrillic}{95}{0425}% CYRILLIC CAPITAL LETTER HA
+\SE@MapDeclare{mac-cyrillic}{96}{0426}% CYRILLIC CAPITAL LETTER TSE
+\SE@MapDeclare{mac-cyrillic}{97}{0427}% CYRILLIC CAPITAL LETTER CHE
+\SE@MapDeclare{mac-cyrillic}{98}{0428}% CYRILLIC CAPITAL LETTER SHA
+\SE@MapDeclare{mac-cyrillic}{99}{0429}% CYRILLIC CAPITAL LETTER SHCHA
+\SE@MapDeclare{mac-cyrillic}{9A}{042A}% CYRILLIC CAPITAL LETTER HARD SIGN
+\SE@MapDeclare{mac-cyrillic}{9B}{042B}% CYRILLIC CAPITAL LETTER YERU
+\SE@MapDeclare{mac-cyrillic}{9C}{042C}% CYRILLIC CAPITAL LETTER SOFT SIGN
+\SE@MapDeclare{mac-cyrillic}{9D}{042D}% CYRILLIC CAPITAL LETTER E
+\SE@MapDeclare{mac-cyrillic}{9E}{042E}% CYRILLIC CAPITAL LETTER YU
+\SE@MapDeclare{mac-cyrillic}{9F}{042F}% CYRILLIC CAPITAL LETTER YA
+\SE@MapDeclare{mac-cyrillic}{A0}{2020}% DAGGER
+\SE@MapDeclare{mac-cyrillic}{A1}{00B0}% DEGREE SIGN
+\SE@MapDeclare{mac-cyrillic}{A2}{0490}% CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+\SE@MapDeclare{mac-cyrillic}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{mac-cyrillic}{A4}{00A7}% SECTION SIGN
+\SE@MapDeclare{mac-cyrillic}{A5}{2022}% BULLET
+\SE@MapDeclare{mac-cyrillic}{A6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{mac-cyrillic}{A7}{0406}% CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+\SE@MapDeclare{mac-cyrillic}{A8}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{mac-cyrillic}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{mac-cyrillic}{AA}{2122}% TRADE MARK SIGN
+\SE@MapDeclare{mac-cyrillic}{AB}{0402}% CYRILLIC CAPITAL LETTER DJE
+\SE@MapDeclare{mac-cyrillic}{AC}{0452}% CYRILLIC SMALL LETTER DJE
+\SE@MapDeclare{mac-cyrillic}{AD}{2260}% NOT EQUAL TO
+\SE@MapDeclare{mac-cyrillic}{AE}{0403}% CYRILLIC CAPITAL LETTER GJE
+\SE@MapDeclare{mac-cyrillic}{AF}{0453}% CYRILLIC SMALL LETTER GJE
+\SE@MapDeclare{mac-cyrillic}{B0}{221E}% INFINITY
+\SE@MapDeclare{mac-cyrillic}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{mac-cyrillic}{B2}{2264}% LESS-THAN OR EQUAL TO
+\SE@MapDeclare{mac-cyrillic}{B3}{2265}% GREATER-THAN OR EQUAL TO
+\SE@MapDeclare{mac-cyrillic}{B4}{0456}% CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+\SE@MapDeclare{mac-cyrillic}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{mac-cyrillic}{B6}{0491}% CYRILLIC SMALL LETTER GHE WITH UPTURN
+\SE@MapDeclare{mac-cyrillic}{B7}{0408}% CYRILLIC CAPITAL LETTER JE
+\SE@MapDeclare{mac-cyrillic}{B8}{0404}% CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\SE@MapDeclare{mac-cyrillic}{B9}{0454}% CYRILLIC SMALL LETTER UKRAINIAN IE
+\SE@MapDeclare{mac-cyrillic}{BA}{0407}% CYRILLIC CAPITAL LETTER YI
+\SE@MapDeclare{mac-cyrillic}{BB}{0457}% CYRILLIC SMALL LETTER YI
+\SE@MapDeclare{mac-cyrillic}{BC}{0409}% CYRILLIC CAPITAL LETTER LJE
+\SE@MapDeclare{mac-cyrillic}{BD}{0459}% CYRILLIC SMALL LETTER LJE
+\SE@MapDeclare{mac-cyrillic}{BE}{040A}% CYRILLIC CAPITAL LETTER NJE
+\SE@MapDeclare{mac-cyrillic}{BF}{045A}% CYRILLIC SMALL LETTER NJE
+\SE@MapDeclare{mac-cyrillic}{C0}{0458}% CYRILLIC SMALL LETTER JE
+\SE@MapDeclare{mac-cyrillic}{C1}{0405}% CYRILLIC CAPITAL LETTER DZE
+\SE@MapDeclare{mac-cyrillic}{C2}{00AC}% NOT SIGN
+\SE@MapDeclare{mac-cyrillic}{C3}{221A}% SQUARE ROOT
+\SE@MapDeclare{mac-cyrillic}{C4}{0192}% LATIN SMALL LETTER F WITH HOOK
+\SE@MapDeclare{mac-cyrillic}{C5}{2248}% ALMOST EQUAL TO
+\SE@MapDeclare{mac-cyrillic}{C6}{2206}% INCREMENT
+\SE@MapDeclare{mac-cyrillic}{C7}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-cyrillic}{C8}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-cyrillic}{C9}{2026}% HORIZONTAL ELLIPSIS
+\SE@MapDeclare{mac-cyrillic}{CA}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{mac-cyrillic}{CB}{040B}% CYRILLIC CAPITAL LETTER TSHE
+\SE@MapDeclare{mac-cyrillic}{CC}{045B}% CYRILLIC SMALL LETTER TSHE
+\SE@MapDeclare{mac-cyrillic}{CD}{040C}% CYRILLIC CAPITAL LETTER KJE
+\SE@MapDeclare{mac-cyrillic}{CE}{045C}% CYRILLIC SMALL LETTER KJE
+\SE@MapDeclare{mac-cyrillic}{CF}{0455}% CYRILLIC SMALL LETTER DZE
+\SE@MapDeclare{mac-cyrillic}{D0}{2013}% EN DASH
+\SE@MapDeclare{mac-cyrillic}{D1}{2014}% EM DASH
+\SE@MapDeclare{mac-cyrillic}{D2}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{mac-cyrillic}{D3}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{mac-cyrillic}{D4}{2018}% LEFT SINGLE QUOTATION MARK
+\SE@MapDeclare{mac-cyrillic}{D5}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{mac-cyrillic}{D6}{00F7}% DIVISION SIGN
+\SE@MapDeclare{mac-cyrillic}{D7}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{mac-cyrillic}{D8}{040E}% CYRILLIC CAPITAL LETTER SHORT U
+\SE@MapDeclare{mac-cyrillic}{D9}{045E}% CYRILLIC SMALL LETTER SHORT U
+\SE@MapDeclare{mac-cyrillic}{DA}{040F}% CYRILLIC CAPITAL LETTER DZHE
+\SE@MapDeclare{mac-cyrillic}{DB}{045F}% CYRILLIC SMALL LETTER DZHE
+\SE@MapDeclare{mac-cyrillic}{DC}{2116}% NUMERO SIGN
+\SE@MapDeclare{mac-cyrillic}{DD}{0401}% CYRILLIC CAPITAL LETTER IO
+\SE@MapDeclare{mac-cyrillic}{DE}{0451}% CYRILLIC SMALL LETTER IO
+\SE@MapDeclare{mac-cyrillic}{DF}{044F}% CYRILLIC SMALL LETTER YA
+\SE@MapDeclare{mac-cyrillic}{E0}{0430}% CYRILLIC SMALL LETTER A
+\SE@MapDeclare{mac-cyrillic}{E1}{0431}% CYRILLIC SMALL LETTER BE
+\SE@MapDeclare{mac-cyrillic}{E2}{0432}% CYRILLIC SMALL LETTER VE
+\SE@MapDeclare{mac-cyrillic}{E3}{0433}% CYRILLIC SMALL LETTER GHE
+\SE@MapDeclare{mac-cyrillic}{E4}{0434}% CYRILLIC SMALL LETTER DE
+\SE@MapDeclare{mac-cyrillic}{E5}{0435}% CYRILLIC SMALL LETTER IE
+\SE@MapDeclare{mac-cyrillic}{E6}{0436}% CYRILLIC SMALL LETTER ZHE
+\SE@MapDeclare{mac-cyrillic}{E7}{0437}% CYRILLIC SMALL LETTER ZE
+\SE@MapDeclare{mac-cyrillic}{E8}{0438}% CYRILLIC SMALL LETTER I
+\SE@MapDeclare{mac-cyrillic}{E9}{0439}% CYRILLIC SMALL LETTER SHORT I
+\SE@MapDeclare{mac-cyrillic}{EA}{043A}% CYRILLIC SMALL LETTER KA
+\SE@MapDeclare{mac-cyrillic}{EB}{043B}% CYRILLIC SMALL LETTER EL
+\SE@MapDeclare{mac-cyrillic}{EC}{043C}% CYRILLIC SMALL LETTER EM
+\SE@MapDeclare{mac-cyrillic}{ED}{043D}% CYRILLIC SMALL LETTER EN
+\SE@MapDeclare{mac-cyrillic}{EE}{043E}% CYRILLIC SMALL LETTER O
+\SE@MapDeclare{mac-cyrillic}{EF}{043F}% CYRILLIC SMALL LETTER PE
+\SE@MapDeclare{mac-cyrillic}{F0}{0440}% CYRILLIC SMALL LETTER ER
+\SE@MapDeclare{mac-cyrillic}{F1}{0441}% CYRILLIC SMALL LETTER ES
+\SE@MapDeclare{mac-cyrillic}{F2}{0442}% CYRILLIC SMALL LETTER TE
+\SE@MapDeclare{mac-cyrillic}{F3}{0443}% CYRILLIC SMALL LETTER U
+\SE@MapDeclare{mac-cyrillic}{F4}{0444}% CYRILLIC SMALL LETTER EF
+\SE@MapDeclare{mac-cyrillic}{F5}{0445}% CYRILLIC SMALL LETTER HA
+\SE@MapDeclare{mac-cyrillic}{F6}{0446}% CYRILLIC SMALL LETTER TSE
+\SE@MapDeclare{mac-cyrillic}{F7}{0447}% CYRILLIC SMALL LETTER CHE
+\SE@MapDeclare{mac-cyrillic}{F8}{0448}% CYRILLIC SMALL LETTER SHA
+\SE@MapDeclare{mac-cyrillic}{F9}{0449}% CYRILLIC SMALL LETTER SHCHA
+\SE@MapDeclare{mac-cyrillic}{FA}{044A}% CYRILLIC SMALL LETTER HARD SIGN
+\SE@MapDeclare{mac-cyrillic}{FB}{044B}% CYRILLIC SMALL LETTER YERU
+\SE@MapDeclare{mac-cyrillic}{FC}{044C}% CYRILLIC SMALL LETTER SOFT SIGN
+\SE@MapDeclare{mac-cyrillic}{FD}{044D}% CYRILLIC SMALL LETTER E
+\SE@MapDeclare{mac-cyrillic}{FE}{044E}% CYRILLIC SMALL LETTER YU
+\SE@MapDeclare{mac-cyrillic}{FF}{20AC}% EURO SIGN
+%</mac-cyrillic>
+% \end{macrocode}
+% \paragraph{mac-roman}
+% \begin{macrocode}
+%<*mac-roman>
+\SE@MapDeclare{mac-roman}{80}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{81}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{mac-roman}{82}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{mac-roman}{83}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{mac-roman}{84}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{mac-roman}{85}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{86}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{87}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{mac-roman}{88}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{mac-roman}{89}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{8A}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{8B}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{mac-roman}{8C}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{mac-roman}{8D}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{mac-roman}{8E}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{mac-roman}{8F}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{mac-roman}{90}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{91}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{92}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{mac-roman}{93}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{mac-roman}{94}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{95}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{96}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{mac-roman}{97}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{mac-roman}{98}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{mac-roman}{99}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{9A}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{9B}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{mac-roman}{9C}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{mac-roman}{9D}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{mac-roman}{9E}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{9F}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{A0}{2020}% DAGGER
+\SE@MapDeclare{mac-roman}{A1}{00B0}% DEGREE SIGN
+\SE@MapDeclare{mac-roman}{A2}{00A2}% CENT SIGN
+\SE@MapDeclare{mac-roman}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{mac-roman}{A4}{00A7}% SECTION SIGN
+\SE@MapDeclare{mac-roman}{A5}{2022}% BULLET
+\SE@MapDeclare{mac-roman}{A6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{mac-roman}{A7}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{mac-roman}{A8}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{mac-roman}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{mac-roman}{AA}{2122}% TRADE MARK SIGN
+\SE@MapDeclare{mac-roman}{AB}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{mac-roman}{AC}{00A8}% DIAERESIS
+\SE@MapDeclare{mac-roman}{AD}{2260}% NOT EQUAL TO
+\SE@MapDeclare{mac-roman}{AE}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{mac-roman}{AF}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{mac-roman}{B0}{221E}% INFINITY
+\SE@MapDeclare{mac-roman}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{mac-roman}{B2}{2264}% LESS-THAN OR EQUAL TO
+\SE@MapDeclare{mac-roman}{B3}{2265}% GREATER-THAN OR EQUAL TO
+\SE@MapDeclare{mac-roman}{B4}{00A5}% YEN SIGN
+\SE@MapDeclare{mac-roman}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{mac-roman}{B6}{2202}% PARTIAL DIFFERENTIAL
+\SE@MapDeclare{mac-roman}{B7}{2211}% N-ARY SUMMATION
+\SE@MapDeclare{mac-roman}{B8}{220F}% N-ARY PRODUCT
+\SE@MapDeclare{mac-roman}{B9}{03C0}% GREEK SMALL LETTER PI
+\SE@MapDeclare{mac-roman}{BA}{222B}% INTEGRAL
+\SE@MapDeclare{mac-roman}{BB}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{mac-roman}{BC}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{mac-roman}{BD}{03A9}% GREEK CAPITAL LETTER OMEGA
+\SE@MapDeclare{mac-roman}{BE}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{mac-roman}{BF}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{mac-roman}{C0}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{mac-roman}{C1}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{mac-roman}{C2}{00AC}% NOT SIGN
+\SE@MapDeclare{mac-roman}{C3}{221A}% SQUARE ROOT
+\SE@MapDeclare{mac-roman}{C4}{0192}% LATIN SMALL LETTER F WITH HOOK
+\SE@MapDeclare{mac-roman}{C5}{2248}% ALMOST EQUAL TO
+\SE@MapDeclare{mac-roman}{C6}{2206}% INCREMENT
+\SE@MapDeclare{mac-roman}{C7}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-roman}{C8}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-roman}{C9}{2026}% HORIZONTAL ELLIPSIS
+\SE@MapDeclare{mac-roman}{CA}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{mac-roman}{CB}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{mac-roman}{CC}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{mac-roman}{CD}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{mac-roman}{CE}{0152}% LATIN CAPITAL LIGATURE OE
+\SE@MapDeclare{mac-roman}{CF}{0153}% LATIN SMALL LIGATURE OE
+\SE@MapDeclare{mac-roman}{D0}{2013}% EN DASH
+\SE@MapDeclare{mac-roman}{D1}{2014}% EM DASH
+\SE@MapDeclare{mac-roman}{D2}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{mac-roman}{D3}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{mac-roman}{D4}{2018}% LEFT SINGLE QUOTATION MARK
+\SE@MapDeclare{mac-roman}{D5}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{mac-roman}{D6}{00F7}% DIVISION SIGN
+\SE@MapDeclare{mac-roman}{D7}{25CA}% LOZENGE
+\SE@MapDeclare{mac-roman}{D8}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{D9}{0178}% LATIN CAPITAL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{DA}{2044}% FRACTION SLASH
+\SE@MapDeclare{mac-roman}{DB}{20AC}% EURO SIGN
+\SE@MapDeclare{mac-roman}{DC}{2039}% SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-roman}{DD}{203A}% SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{mac-roman}{DE}{FB01}% LATIN SMALL LIGATURE FI
+\SE@MapDeclare{mac-roman}{DF}{FB02}% LATIN SMALL LIGATURE FL
+\SE@MapDeclare{mac-roman}{E0}{2021}% DOUBLE DAGGER
+\SE@MapDeclare{mac-roman}{E1}{00B7}% MIDDLE DOT
+\SE@MapDeclare{mac-roman}{E2}{201A}% SINGLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{mac-roman}{E3}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{mac-roman}{E4}{2030}% PER MILLE SIGN
+\SE@MapDeclare{mac-roman}{E5}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{E6}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{E7}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{mac-roman}{E8}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{E9}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{mac-roman}{EA}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{mac-roman}{EB}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{EC}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{mac-roman}{ED}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{mac-roman}{EE}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{mac-roman}{EF}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{F0}{F8FF}% Apple logo
+\SE@MapDeclare{mac-roman}{F1}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{mac-roman}{F2}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{mac-roman}{F3}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{mac-roman}{F4}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{mac-roman}{F5}{0131}% LATIN SMALL LETTER DOTLESS I
+\SE@MapDeclare{mac-roman}{F6}{02C6}% MODIFIER LETTER CIRCUMFLEX ACCENT
+\SE@MapDeclare{mac-roman}{F7}{02DC}% SMALL TILDE
+\SE@MapDeclare{mac-roman}{F8}{00AF}% MACRON
+\SE@MapDeclare{mac-roman}{F9}{02D8}% BREVE
+\SE@MapDeclare{mac-roman}{FA}{02D9}% DOT ABOVE
+\SE@MapDeclare{mac-roman}{FB}{02DA}% RING ABOVE
+\SE@MapDeclare{mac-roman}{FC}{00B8}% CEDILLA
+\SE@MapDeclare{mac-roman}{FD}{02DD}% DOUBLE ACUTE ACCENT
+\SE@MapDeclare{mac-roman}{FE}{02DB}% OGONEK
+\SE@MapDeclare{mac-roman}{FF}{02C7}% CARON
+%</mac-roman>
+% \end{macrocode}
+% \paragraph{dec-mcs}
+% \begin{macrocode}
+%<*dec-mcs>
+\SE@MapDeclare{dec-mcs}{A1}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{dec-mcs}{A2}{00A2}% CENT SIGN
+\SE@MapDeclare{dec-mcs}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{dec-mcs}{A5}{00A5}% YEN SIGN
+\SE@MapDeclare{dec-mcs}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{dec-mcs}{A8}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{dec-mcs}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{dec-mcs}{AA}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{dec-mcs}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{dec-mcs}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{dec-mcs}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{dec-mcs}{B2}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{dec-mcs}{B3}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{dec-mcs}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{dec-mcs}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{dec-mcs}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{dec-mcs}{B9}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{dec-mcs}{BA}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{dec-mcs}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{dec-mcs}{BC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{dec-mcs}{BD}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{dec-mcs}{BF}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{dec-mcs}{C0}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{dec-mcs}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{dec-mcs}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{C3}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{dec-mcs}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{C5}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{dec-mcs}{C6}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{dec-mcs}{C7}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{dec-mcs}{C8}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{dec-mcs}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{dec-mcs}{CA}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{CC}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{dec-mcs}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{dec-mcs}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{CF}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{D1}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{dec-mcs}{D2}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{dec-mcs}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{dec-mcs}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{D5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{dec-mcs}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{D7}{0152}% LATIN CAPITAL LIGATURE OE
+\SE@MapDeclare{dec-mcs}{D8}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{dec-mcs}{D9}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{dec-mcs}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{dec-mcs}{DB}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{DD}{0178}% LATIN CAPITAL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{dec-mcs}{E0}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{dec-mcs}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{dec-mcs}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{E3}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{dec-mcs}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{E5}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{dec-mcs}{E6}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{dec-mcs}{E7}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{dec-mcs}{E8}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{dec-mcs}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{dec-mcs}{EA}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{EC}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{dec-mcs}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{dec-mcs}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{EF}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{F1}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{dec-mcs}{F2}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{dec-mcs}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{dec-mcs}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{F5}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{dec-mcs}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{F7}{0153}% LATIN SMALL LIGATURE OE
+\SE@MapDeclare{dec-mcs}{F8}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{dec-mcs}{F9}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{dec-mcs}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{dec-mcs}{FB}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{dec-mcs}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{dec-mcs}{FD}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+%</dec-mcs>
+% \end{macrocode}
+% \paragraph{cp437}
+% \begin{macrocode}
+%<*cp437>
+\SE@MapDeclare{cp437}{80}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp437}{81}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp437}{82}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{cp437}{83}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp437}{84}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp437}{85}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{cp437}{86}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp437}{87}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp437}{88}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{cp437}{89}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp437}{8A}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{cp437}{8B}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{cp437}{8C}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp437}{8D}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{cp437}{8E}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp437}{8F}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp437}{90}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{cp437}{91}{00E6}% LATIN SMALL LIGATURE AE
+\SE@MapDeclare{cp437}{92}{00C6}% LATIN CAPITAL LIGATURE AE
+\SE@MapDeclare{cp437}{93}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp437}{94}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp437}{95}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{cp437}{96}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{cp437}{97}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{cp437}{98}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{cp437}{99}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp437}{9A}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp437}{9B}{00A2}% CENT SIGN
+\SE@MapDeclare{cp437}{9C}{00A3}% POUND SIGN
+\SE@MapDeclare{cp437}{9D}{00A5}% YEN SIGN
+\SE@MapDeclare{cp437}{9E}{20A7}% PESETA SIGN
+\SE@MapDeclare{cp437}{9F}{0192}% LATIN SMALL LETTER F WITH HOOK
+\SE@MapDeclare{cp437}{A0}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{cp437}{A1}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{cp437}{A2}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{cp437}{A3}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{cp437}{A4}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{cp437}{A5}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{cp437}{A6}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{cp437}{A7}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{cp437}{A8}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{cp437}{A9}{2310}% REVERSED NOT SIGN
+\SE@MapDeclare{cp437}{AA}{00AC}% NOT SIGN
+\SE@MapDeclare{cp437}{AB}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{cp437}{AC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{cp437}{AD}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{cp437}{AE}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp437}{AF}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp437}{B0}{2591}% LIGHT SHADE
+\SE@MapDeclare{cp437}{B1}{2592}% MEDIUM SHADE
+\SE@MapDeclare{cp437}{B2}{2593}% DARK SHADE
+\SE@MapDeclare{cp437}{B3}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\SE@MapDeclare{cp437}{B4}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\SE@MapDeclare{cp437}{B5}{2561}% BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp437}{B6}{2562}% BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp437}{B7}{2556}% BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp437}{B8}{2555}% BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp437}{B9}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\SE@MapDeclare{cp437}{BA}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\SE@MapDeclare{cp437}{BB}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\SE@MapDeclare{cp437}{BC}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\SE@MapDeclare{cp437}{BD}{255C}% BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp437}{BE}{255B}% BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp437}{BF}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\SE@MapDeclare{cp437}{C0}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\SE@MapDeclare{cp437}{C1}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\SE@MapDeclare{cp437}{C2}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\SE@MapDeclare{cp437}{C3}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\SE@MapDeclare{cp437}{C4}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\SE@MapDeclare{cp437}{C5}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp437}{C6}{255E}% BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp437}{C7}{255F}% BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp437}{C8}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\SE@MapDeclare{cp437}{C9}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\SE@MapDeclare{cp437}{CA}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\SE@MapDeclare{cp437}{CB}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\SE@MapDeclare{cp437}{CC}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\SE@MapDeclare{cp437}{CD}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\SE@MapDeclare{cp437}{CE}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp437}{CF}{2567}% BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp437}{D0}{2568}% BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp437}{D1}{2564}% BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp437}{D2}{2565}% BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp437}{D3}{2559}% BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp437}{D4}{2558}% BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp437}{D5}{2552}% BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp437}{D6}{2553}% BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp437}{D7}{256B}% BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp437}{D8}{256A}% BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp437}{D9}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\SE@MapDeclare{cp437}{DA}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\SE@MapDeclare{cp437}{DB}{2588}% FULL BLOCK
+\SE@MapDeclare{cp437}{DC}{2584}% LOWER HALF BLOCK
+\SE@MapDeclare{cp437}{DD}{258C}% LEFT HALF BLOCK
+\SE@MapDeclare{cp437}{DE}{2590}% RIGHT HALF BLOCK
+\SE@MapDeclare{cp437}{DF}{2580}% UPPER HALF BLOCK
+\SE@MapDeclare{cp437}{E0}{03B1}% GREEK SMALL LETTER ALPHA
+\SE@MapDeclare{cp437}{E1}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{cp437}{E2}{0393}% GREEK CAPITAL LETTER GAMMA
+\SE@MapDeclare{cp437}{E3}{03C0}% GREEK SMALL LETTER PI
+\SE@MapDeclare{cp437}{E4}{03A3}% GREEK CAPITAL LETTER SIGMA
+\SE@MapDeclare{cp437}{E5}{03C3}% GREEK SMALL LETTER SIGMA
+\SE@MapDeclare{cp437}{E6}{00B5}% MICRO SIGN
+\SE@MapDeclare{cp437}{E7}{03C4}% GREEK SMALL LETTER TAU
+\SE@MapDeclare{cp437}{E8}{03A6}% GREEK CAPITAL LETTER PHI
+\SE@MapDeclare{cp437}{E9}{0398}% GREEK CAPITAL LETTER THETA
+\SE@MapDeclare{cp437}{EA}{03A9}% GREEK CAPITAL LETTER OMEGA
+\SE@MapDeclare{cp437}{EB}{03B4}% GREEK SMALL LETTER DELTA
+\SE@MapDeclare{cp437}{EC}{221E}% INFINITY
+\SE@MapDeclare{cp437}{ED}{03C6}% GREEK SMALL LETTER PHI
+\SE@MapDeclare{cp437}{EE}{03B5}% GREEK SMALL LETTER EPSILON
+\SE@MapDeclare{cp437}{EF}{2229}% INTERSECTION
+\SE@MapDeclare{cp437}{F0}{2261}% IDENTICAL TO
+\SE@MapDeclare{cp437}{F1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{cp437}{F2}{2265}% GREATER-THAN OR EQUAL TO
+\SE@MapDeclare{cp437}{F3}{2264}% LESS-THAN OR EQUAL TO
+\SE@MapDeclare{cp437}{F4}{2320}% TOP HALF INTEGRAL
+\SE@MapDeclare{cp437}{F5}{2321}% BOTTOM HALF INTEGRAL
+\SE@MapDeclare{cp437}{F6}{00F7}% DIVISION SIGN
+\SE@MapDeclare{cp437}{F7}{2248}% ALMOST EQUAL TO
+\SE@MapDeclare{cp437}{F8}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp437}{F9}{2219}% BULLET OPERATOR
+\SE@MapDeclare{cp437}{FA}{00B7}% MIDDLE DOT
+\SE@MapDeclare{cp437}{FB}{221A}% SQUARE ROOT
+\SE@MapDeclare{cp437}{FC}{207F}% SUPERSCRIPT LATIN SMALL LETTER N
+\SE@MapDeclare{cp437}{FD}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{cp437}{FE}{25A0}% BLACK SQUARE
+\SE@MapDeclare{cp437}{FF}{00A0}% NO-BREAK SPACE
+%</cp437>
+% \end{macrocode}
+% \paragraph{cp850}
+% \begin{macrocode}
+%<*cp850>
+\SE@MapDeclare{cp850}{80}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp850}{81}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp850}{82}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{cp850}{83}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{84}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp850}{85}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{cp850}{86}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp850}{87}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp850}{88}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{89}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp850}{8A}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{cp850}{8B}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{cp850}{8C}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{8D}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{cp850}{8E}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp850}{8F}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp850}{90}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{cp850}{91}{00E6}% LATIN SMALL LIGATURE AE
+\SE@MapDeclare{cp850}{92}{00C6}% LATIN CAPITAL LIGATURE AE
+\SE@MapDeclare{cp850}{93}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{94}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp850}{95}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{cp850}{96}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{97}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{cp850}{98}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{cp850}{99}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp850}{9A}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp850}{9B}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{cp850}{9C}{00A3}% POUND SIGN
+\SE@MapDeclare{cp850}{9D}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{cp850}{9E}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{cp850}{9F}{0192}% LATIN SMALL LETTER F WITH HOOK
+\SE@MapDeclare{cp850}{A0}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{cp850}{A1}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{cp850}{A2}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{cp850}{A3}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{cp850}{A4}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{cp850}{A5}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{cp850}{A6}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{cp850}{A7}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{cp850}{A8}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{cp850}{A9}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{cp850}{AA}{00AC}% NOT SIGN
+\SE@MapDeclare{cp850}{AB}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{cp850}{AC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{cp850}{AD}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{cp850}{AE}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp850}{AF}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp850}{B0}{2591}% LIGHT SHADE
+\SE@MapDeclare{cp850}{B1}{2592}% MEDIUM SHADE
+\SE@MapDeclare{cp850}{B2}{2593}% DARK SHADE
+\SE@MapDeclare{cp850}{B3}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\SE@MapDeclare{cp850}{B4}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\SE@MapDeclare{cp850}{B5}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{cp850}{B6}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{B7}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{cp850}{B8}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{cp850}{B9}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\SE@MapDeclare{cp850}{BA}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\SE@MapDeclare{cp850}{BB}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\SE@MapDeclare{cp850}{BC}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\SE@MapDeclare{cp850}{BD}{00A2}% CENT SIGN
+\SE@MapDeclare{cp850}{BE}{00A5}% YEN SIGN
+\SE@MapDeclare{cp850}{BF}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\SE@MapDeclare{cp850}{C0}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\SE@MapDeclare{cp850}{C1}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\SE@MapDeclare{cp850}{C2}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\SE@MapDeclare{cp850}{C3}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\SE@MapDeclare{cp850}{C4}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\SE@MapDeclare{cp850}{C5}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp850}{C6}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{cp850}{C7}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{cp850}{C8}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\SE@MapDeclare{cp850}{C9}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\SE@MapDeclare{cp850}{CA}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\SE@MapDeclare{cp850}{CB}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\SE@MapDeclare{cp850}{CC}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\SE@MapDeclare{cp850}{CD}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\SE@MapDeclare{cp850}{CE}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp850}{CF}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp850}{D0}{00F0}% LATIN SMALL LETTER ETH
+\SE@MapDeclare{cp850}{D1}{00D0}% LATIN CAPITAL LETTER ETH
+\SE@MapDeclare{cp850}{D2}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{D3}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp850}{D4}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{cp850}{D5}{0131}% LATIN SMALL LETTER DOTLESS I
+\SE@MapDeclare{cp850}{D6}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{cp850}{D7}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{D8}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{cp850}{D9}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\SE@MapDeclare{cp850}{DA}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\SE@MapDeclare{cp850}{DB}{2588}% FULL BLOCK
+\SE@MapDeclare{cp850}{DC}{2584}% LOWER HALF BLOCK
+\SE@MapDeclare{cp850}{DD}{00A6}% BROKEN BAR
+\SE@MapDeclare{cp850}{DE}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{cp850}{DF}{2580}% UPPER HALF BLOCK
+\SE@MapDeclare{cp850}{E0}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{cp850}{E1}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{cp850}{E2}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{E3}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{cp850}{E4}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{cp850}{E5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{cp850}{E6}{00B5}% MICRO SIGN
+\SE@MapDeclare{cp850}{E7}{00FE}% LATIN SMALL LETTER THORN
+\SE@MapDeclare{cp850}{E8}{00DE}% LATIN CAPITAL LETTER THORN
+\SE@MapDeclare{cp850}{E9}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{cp850}{EA}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{cp850}{EB}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{cp850}{EC}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{cp850}{ED}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{cp850}{EE}{00AF}% MACRON
+\SE@MapDeclare{cp850}{EF}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{cp850}{F0}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{cp850}{F1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{cp850}{F2}{2017}% DOUBLE LOW LINE
+\SE@MapDeclare{cp850}{F3}{00BE}% VULGAR FRACTION THREE QUARTERS
+\SE@MapDeclare{cp850}{F4}{00B6}% PILCROW SIGN
+\SE@MapDeclare{cp850}{F5}{00A7}% SECTION SIGN
+\SE@MapDeclare{cp850}{F6}{00F7}% DIVISION SIGN
+\SE@MapDeclare{cp850}{F7}{00B8}% CEDILLA
+\SE@MapDeclare{cp850}{F8}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp850}{F9}{00A8}% DIAERESIS
+\SE@MapDeclare{cp850}{FA}{00B7}% MIDDLE DOT
+\SE@MapDeclare{cp850}{FB}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{cp850}{FC}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{cp850}{FD}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{cp850}{FE}{25A0}% BLACK SQUARE
+\SE@MapDeclare{cp850}{FF}{00A0}% NO-BREAK SPACE
+%</cp850>
+% \end{macrocode}
+% \paragraph{cp852}
+% \begin{macrocode}
+%<*cp852>
+\SE@MapDeclare{cp852}{80}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp852}{81}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp852}{82}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{cp852}{83}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp852}{84}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp852}{85}{016F}% LATIN SMALL LETTER U WITH RING ABOVE
+\SE@MapDeclare{cp852}{86}{0107}% LATIN SMALL LETTER C WITH ACUTE
+\SE@MapDeclare{cp852}{87}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp852}{88}{0142}% LATIN SMALL LETTER L WITH STROKE
+\SE@MapDeclare{cp852}{89}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp852}{8A}{0150}% LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{cp852}{8B}{0151}% LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{cp852}{8C}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp852}{8D}{0179}% LATIN CAPITAL LETTER Z WITH ACUTE
+\SE@MapDeclare{cp852}{8E}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp852}{8F}{0106}% LATIN CAPITAL LETTER C WITH ACUTE
+\SE@MapDeclare{cp852}{90}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{cp852}{91}{0139}% LATIN CAPITAL LETTER L WITH ACUTE
+\SE@MapDeclare{cp852}{92}{013A}% LATIN SMALL LETTER L WITH ACUTE
+\SE@MapDeclare{cp852}{93}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp852}{94}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp852}{95}{013D}% LATIN CAPITAL LETTER L WITH CARON
+\SE@MapDeclare{cp852}{96}{013E}% LATIN SMALL LETTER L WITH CARON
+\SE@MapDeclare{cp852}{97}{015A}% LATIN CAPITAL LETTER S WITH ACUTE
+\SE@MapDeclare{cp852}{98}{015B}% LATIN SMALL LETTER S WITH ACUTE
+\SE@MapDeclare{cp852}{99}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp852}{9A}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp852}{9B}{0164}% LATIN CAPITAL LETTER T WITH CARON
+\SE@MapDeclare{cp852}{9C}{0165}% LATIN SMALL LETTER T WITH CARON
+\SE@MapDeclare{cp852}{9D}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\SE@MapDeclare{cp852}{9E}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{cp852}{9F}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{cp852}{A0}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{cp852}{A1}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{cp852}{A2}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{cp852}{A3}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{cp852}{A4}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{cp852}{A5}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{cp852}{A6}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{cp852}{A7}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{cp852}{A8}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{cp852}{A9}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{cp852}{AA}{00AC}% NOT SIGN
+\SE@MapDeclare{cp852}{AB}{017A}% LATIN SMALL LETTER Z WITH ACUTE
+\SE@MapDeclare{cp852}{AC}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{cp852}{AD}{015F}% LATIN SMALL LETTER S WITH CEDILLA
+\SE@MapDeclare{cp852}{AE}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp852}{AF}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp852}{B0}{2591}% LIGHT SHADE
+\SE@MapDeclare{cp852}{B1}{2592}% MEDIUM SHADE
+\SE@MapDeclare{cp852}{B2}{2593}% DARK SHADE
+\SE@MapDeclare{cp852}{B3}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\SE@MapDeclare{cp852}{B4}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\SE@MapDeclare{cp852}{B5}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{cp852}{B6}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp852}{B7}{011A}% LATIN CAPITAL LETTER E WITH CARON
+\SE@MapDeclare{cp852}{B8}{015E}% LATIN CAPITAL LETTER S WITH CEDILLA
+\SE@MapDeclare{cp852}{B9}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\SE@MapDeclare{cp852}{BA}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\SE@MapDeclare{cp852}{BB}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\SE@MapDeclare{cp852}{BC}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\SE@MapDeclare{cp852}{BD}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{cp852}{BE}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{cp852}{BF}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\SE@MapDeclare{cp852}{C0}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\SE@MapDeclare{cp852}{C1}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\SE@MapDeclare{cp852}{C2}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\SE@MapDeclare{cp852}{C3}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\SE@MapDeclare{cp852}{C4}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\SE@MapDeclare{cp852}{C5}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp852}{C6}{0102}% LATIN CAPITAL LETTER A WITH BREVE
+\SE@MapDeclare{cp852}{C7}{0103}% LATIN SMALL LETTER A WITH BREVE
+\SE@MapDeclare{cp852}{C8}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\SE@MapDeclare{cp852}{C9}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\SE@MapDeclare{cp852}{CA}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\SE@MapDeclare{cp852}{CB}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\SE@MapDeclare{cp852}{CC}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\SE@MapDeclare{cp852}{CD}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\SE@MapDeclare{cp852}{CE}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp852}{CF}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp852}{D0}{0111}% LATIN SMALL LETTER D WITH STROKE
+\SE@MapDeclare{cp852}{D1}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\SE@MapDeclare{cp852}{D2}{010E}% LATIN CAPITAL LETTER D WITH CARON
+\SE@MapDeclare{cp852}{D3}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp852}{D4}{010F}% LATIN SMALL LETTER D WITH CARON
+\SE@MapDeclare{cp852}{D5}{0147}% LATIN CAPITAL LETTER N WITH CARON
+\SE@MapDeclare{cp852}{D6}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{cp852}{D7}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp852}{D8}{011B}% LATIN SMALL LETTER E WITH CARON
+\SE@MapDeclare{cp852}{D9}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\SE@MapDeclare{cp852}{DA}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\SE@MapDeclare{cp852}{DB}{2588}% FULL BLOCK
+\SE@MapDeclare{cp852}{DC}{2584}% LOWER HALF BLOCK
+\SE@MapDeclare{cp852}{DD}{0162}% LATIN CAPITAL LETTER T WITH CEDILLA
+\SE@MapDeclare{cp852}{DE}{016E}% LATIN CAPITAL LETTER U WITH RING ABOVE
+\SE@MapDeclare{cp852}{DF}{2580}% UPPER HALF BLOCK
+\SE@MapDeclare{cp852}{E0}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{cp852}{E1}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{cp852}{E2}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp852}{E3}{0143}% LATIN CAPITAL LETTER N WITH ACUTE
+\SE@MapDeclare{cp852}{E4}{0144}% LATIN SMALL LETTER N WITH ACUTE
+\SE@MapDeclare{cp852}{E5}{0148}% LATIN SMALL LETTER N WITH CARON
+\SE@MapDeclare{cp852}{E6}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{cp852}{E7}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{cp852}{E8}{0154}% LATIN CAPITAL LETTER R WITH ACUTE
+\SE@MapDeclare{cp852}{E9}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{cp852}{EA}{0155}% LATIN SMALL LETTER R WITH ACUTE
+\SE@MapDeclare{cp852}{EB}{0170}% LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{cp852}{EC}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{cp852}{ED}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{cp852}{EE}{0163}% LATIN SMALL LETTER T WITH CEDILLA
+\SE@MapDeclare{cp852}{EF}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{cp852}{F0}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{cp852}{F1}{02DD}% DOUBLE ACUTE ACCENT
+\SE@MapDeclare{cp852}{F2}{02DB}% OGONEK
+\SE@MapDeclare{cp852}{F3}{02C7}% CARON
+\SE@MapDeclare{cp852}{F4}{02D8}% BREVE
+\SE@MapDeclare{cp852}{F5}{00A7}% SECTION SIGN
+\SE@MapDeclare{cp852}{F6}{00F7}% DIVISION SIGN
+\SE@MapDeclare{cp852}{F7}{00B8}% CEDILLA
+\SE@MapDeclare{cp852}{F8}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp852}{F9}{00A8}% DIAERESIS
+\SE@MapDeclare{cp852}{FA}{02D9}% DOT ABOVE
+\SE@MapDeclare{cp852}{FB}{0171}% LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{cp852}{FC}{0158}% LATIN CAPITAL LETTER R WITH CARON
+\SE@MapDeclare{cp852}{FD}{0159}% LATIN SMALL LETTER R WITH CARON
+\SE@MapDeclare{cp852}{FE}{25A0}% BLACK SQUARE
+\SE@MapDeclare{cp852}{FF}{00A0}% NO-BREAK SPACE
+%</cp852>
+% \end{macrocode}
+% \paragraph{cp855}
+% \begin{macrocode}
+%<*cp855>
+\SE@MapDeclare{cp855}{80}{0452}% CYRILLIC SMALL LETTER DJE
+\SE@MapDeclare{cp855}{81}{0402}% CYRILLIC CAPITAL LETTER DJE
+\SE@MapDeclare{cp855}{82}{0453}% CYRILLIC SMALL LETTER GJE
+\SE@MapDeclare{cp855}{83}{0403}% CYRILLIC CAPITAL LETTER GJE
+\SE@MapDeclare{cp855}{84}{0451}% CYRILLIC SMALL LETTER IO
+\SE@MapDeclare{cp855}{85}{0401}% CYRILLIC CAPITAL LETTER IO
+\SE@MapDeclare{cp855}{86}{0454}% CYRILLIC SMALL LETTER UKRAINIAN IE
+\SE@MapDeclare{cp855}{87}{0404}% CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\SE@MapDeclare{cp855}{88}{0455}% CYRILLIC SMALL LETTER DZE
+\SE@MapDeclare{cp855}{89}{0405}% CYRILLIC CAPITAL LETTER DZE
+\SE@MapDeclare{cp855}{8A}{0456}% CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+\SE@MapDeclare{cp855}{8B}{0406}% CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+\SE@MapDeclare{cp855}{8C}{0457}% CYRILLIC SMALL LETTER YI
+\SE@MapDeclare{cp855}{8D}{0407}% CYRILLIC CAPITAL LETTER YI
+\SE@MapDeclare{cp855}{8E}{0458}% CYRILLIC SMALL LETTER JE
+\SE@MapDeclare{cp855}{8F}{0408}% CYRILLIC CAPITAL LETTER JE
+\SE@MapDeclare{cp855}{90}{0459}% CYRILLIC SMALL LETTER LJE
+\SE@MapDeclare{cp855}{91}{0409}% CYRILLIC CAPITAL LETTER LJE
+\SE@MapDeclare{cp855}{92}{045A}% CYRILLIC SMALL LETTER NJE
+\SE@MapDeclare{cp855}{93}{040A}% CYRILLIC CAPITAL LETTER NJE
+\SE@MapDeclare{cp855}{94}{045B}% CYRILLIC SMALL LETTER TSHE
+\SE@MapDeclare{cp855}{95}{040B}% CYRILLIC CAPITAL LETTER TSHE
+\SE@MapDeclare{cp855}{96}{045C}% CYRILLIC SMALL LETTER KJE
+\SE@MapDeclare{cp855}{97}{040C}% CYRILLIC CAPITAL LETTER KJE
+\SE@MapDeclare{cp855}{98}{045E}% CYRILLIC SMALL LETTER SHORT U
+\SE@MapDeclare{cp855}{99}{040E}% CYRILLIC CAPITAL LETTER SHORT U
+\SE@MapDeclare{cp855}{9A}{045F}% CYRILLIC SMALL LETTER DZHE
+\SE@MapDeclare{cp855}{9B}{040F}% CYRILLIC CAPITAL LETTER DZHE
+\SE@MapDeclare{cp855}{9C}{044E}% CYRILLIC SMALL LETTER YU
+\SE@MapDeclare{cp855}{9D}{042E}% CYRILLIC CAPITAL LETTER YU
+\SE@MapDeclare{cp855}{9E}{044A}% CYRILLIC SMALL LETTER HARD SIGN
+\SE@MapDeclare{cp855}{9F}{042A}% CYRILLIC CAPITAL LETTER HARD SIGN
+\SE@MapDeclare{cp855}{A0}{0430}% CYRILLIC SMALL LETTER A
+\SE@MapDeclare{cp855}{A1}{0410}% CYRILLIC CAPITAL LETTER A
+\SE@MapDeclare{cp855}{A2}{0431}% CYRILLIC SMALL LETTER BE
+\SE@MapDeclare{cp855}{A3}{0411}% CYRILLIC CAPITAL LETTER BE
+\SE@MapDeclare{cp855}{A4}{0446}% CYRILLIC SMALL LETTER TSE
+\SE@MapDeclare{cp855}{A5}{0426}% CYRILLIC CAPITAL LETTER TSE
+\SE@MapDeclare{cp855}{A6}{0434}% CYRILLIC SMALL LETTER DE
+\SE@MapDeclare{cp855}{A7}{0414}% CYRILLIC CAPITAL LETTER DE
+\SE@MapDeclare{cp855}{A8}{0435}% CYRILLIC SMALL LETTER IE
+\SE@MapDeclare{cp855}{A9}{0415}% CYRILLIC CAPITAL LETTER IE
+\SE@MapDeclare{cp855}{AA}{0444}% CYRILLIC SMALL LETTER EF
+\SE@MapDeclare{cp855}{AB}{0424}% CYRILLIC CAPITAL LETTER EF
+\SE@MapDeclare{cp855}{AC}{0433}% CYRILLIC SMALL LETTER GHE
+\SE@MapDeclare{cp855}{AD}{0413}% CYRILLIC CAPITAL LETTER GHE
+\SE@MapDeclare{cp855}{AE}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp855}{AF}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp855}{B0}{2591}% LIGHT SHADE
+\SE@MapDeclare{cp855}{B1}{2592}% MEDIUM SHADE
+\SE@MapDeclare{cp855}{B2}{2593}% DARK SHADE
+\SE@MapDeclare{cp855}{B3}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\SE@MapDeclare{cp855}{B4}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\SE@MapDeclare{cp855}{B5}{0445}% CYRILLIC SMALL LETTER HA
+\SE@MapDeclare{cp855}{B6}{0425}% CYRILLIC CAPITAL LETTER HA
+\SE@MapDeclare{cp855}{B7}{0438}% CYRILLIC SMALL LETTER I
+\SE@MapDeclare{cp855}{B8}{0418}% CYRILLIC CAPITAL LETTER I
+\SE@MapDeclare{cp855}{B9}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\SE@MapDeclare{cp855}{BA}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\SE@MapDeclare{cp855}{BB}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\SE@MapDeclare{cp855}{BC}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\SE@MapDeclare{cp855}{BD}{0439}% CYRILLIC SMALL LETTER SHORT I
+\SE@MapDeclare{cp855}{BE}{0419}% CYRILLIC CAPITAL LETTER SHORT I
+\SE@MapDeclare{cp855}{BF}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\SE@MapDeclare{cp855}{C0}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\SE@MapDeclare{cp855}{C1}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\SE@MapDeclare{cp855}{C2}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\SE@MapDeclare{cp855}{C3}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\SE@MapDeclare{cp855}{C4}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\SE@MapDeclare{cp855}{C5}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp855}{C6}{043A}% CYRILLIC SMALL LETTER KA
+\SE@MapDeclare{cp855}{C7}{041A}% CYRILLIC CAPITAL LETTER KA
+\SE@MapDeclare{cp855}{C8}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\SE@MapDeclare{cp855}{C9}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\SE@MapDeclare{cp855}{CA}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\SE@MapDeclare{cp855}{CB}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\SE@MapDeclare{cp855}{CC}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\SE@MapDeclare{cp855}{CD}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\SE@MapDeclare{cp855}{CE}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp855}{CF}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp855}{D0}{043B}% CYRILLIC SMALL LETTER EL
+\SE@MapDeclare{cp855}{D1}{041B}% CYRILLIC CAPITAL LETTER EL
+\SE@MapDeclare{cp855}{D2}{043C}% CYRILLIC SMALL LETTER EM
+\SE@MapDeclare{cp855}{D3}{041C}% CYRILLIC CAPITAL LETTER EM
+\SE@MapDeclare{cp855}{D4}{043D}% CYRILLIC SMALL LETTER EN
+\SE@MapDeclare{cp855}{D5}{041D}% CYRILLIC CAPITAL LETTER EN
+\SE@MapDeclare{cp855}{D6}{043E}% CYRILLIC SMALL LETTER O
+\SE@MapDeclare{cp855}{D7}{041E}% CYRILLIC CAPITAL LETTER O
+\SE@MapDeclare{cp855}{D8}{043F}% CYRILLIC SMALL LETTER PE
+\SE@MapDeclare{cp855}{D9}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\SE@MapDeclare{cp855}{DA}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\SE@MapDeclare{cp855}{DB}{2588}% FULL BLOCK
+\SE@MapDeclare{cp855}{DC}{2584}% LOWER HALF BLOCK
+\SE@MapDeclare{cp855}{DD}{041F}% CYRILLIC CAPITAL LETTER PE
+\SE@MapDeclare{cp855}{DE}{044F}% CYRILLIC SMALL LETTER YA
+\SE@MapDeclare{cp855}{DF}{2580}% UPPER HALF BLOCK
+\SE@MapDeclare{cp855}{E0}{042F}% CYRILLIC CAPITAL LETTER YA
+\SE@MapDeclare{cp855}{E1}{0440}% CYRILLIC SMALL LETTER ER
+\SE@MapDeclare{cp855}{E2}{0420}% CYRILLIC CAPITAL LETTER ER
+\SE@MapDeclare{cp855}{E3}{0441}% CYRILLIC SMALL LETTER ES
+\SE@MapDeclare{cp855}{E4}{0421}% CYRILLIC CAPITAL LETTER ES
+\SE@MapDeclare{cp855}{E5}{0442}% CYRILLIC SMALL LETTER TE
+\SE@MapDeclare{cp855}{E6}{0422}% CYRILLIC CAPITAL LETTER TE
+\SE@MapDeclare{cp855}{E7}{0443}% CYRILLIC SMALL LETTER U
+\SE@MapDeclare{cp855}{E8}{0423}% CYRILLIC CAPITAL LETTER U
+\SE@MapDeclare{cp855}{E9}{0436}% CYRILLIC SMALL LETTER ZHE
+\SE@MapDeclare{cp855}{EA}{0416}% CYRILLIC CAPITAL LETTER ZHE
+\SE@MapDeclare{cp855}{EB}{0432}% CYRILLIC SMALL LETTER VE
+\SE@MapDeclare{cp855}{EC}{0412}% CYRILLIC CAPITAL LETTER VE
+\SE@MapDeclare{cp855}{ED}{044C}% CYRILLIC SMALL LETTER SOFT SIGN
+\SE@MapDeclare{cp855}{EE}{042C}% CYRILLIC CAPITAL LETTER SOFT SIGN
+\SE@MapDeclare{cp855}{EF}{2116}% NUMERO SIGN
+\SE@MapDeclare{cp855}{F0}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{cp855}{F1}{044B}% CYRILLIC SMALL LETTER YERU
+\SE@MapDeclare{cp855}{F2}{042B}% CYRILLIC CAPITAL LETTER YERU
+\SE@MapDeclare{cp855}{F3}{0437}% CYRILLIC SMALL LETTER ZE
+\SE@MapDeclare{cp855}{F4}{0417}% CYRILLIC CAPITAL LETTER ZE
+\SE@MapDeclare{cp855}{F5}{0448}% CYRILLIC SMALL LETTER SHA
+\SE@MapDeclare{cp855}{F6}{0428}% CYRILLIC CAPITAL LETTER SHA
+\SE@MapDeclare{cp855}{F7}{044D}% CYRILLIC SMALL LETTER E
+\SE@MapDeclare{cp855}{F8}{042D}% CYRILLIC CAPITAL LETTER E
+\SE@MapDeclare{cp855}{F9}{0449}% CYRILLIC SMALL LETTER SHCHA
+\SE@MapDeclare{cp855}{FA}{0429}% CYRILLIC CAPITAL LETTER SHCHA
+\SE@MapDeclare{cp855}{FB}{0447}% CYRILLIC SMALL LETTER CHE
+\SE@MapDeclare{cp855}{FC}{0427}% CYRILLIC CAPITAL LETTER CHE
+\SE@MapDeclare{cp855}{FD}{00A7}% SECTION SIGN
+\SE@MapDeclare{cp855}{FE}{25A0}% BLACK SQUARE
+\SE@MapDeclare{cp855}{FF}{00A0}% NO-BREAK SPACE
+%</cp855>
+% \end{macrocode}
+% \paragraph{cp858}
+% \begin{macrocode}
+%<*cp858>
+\SE@MapDeclare{cp858}{80}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp858}{81}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp858}{82}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{cp858}{83}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{84}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp858}{85}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{cp858}{86}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp858}{87}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp858}{88}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{89}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp858}{8A}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{cp858}{8B}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{cp858}{8C}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{8D}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{cp858}{8E}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp858}{8F}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp858}{90}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{cp858}{91}{00E6}% LATIN SMALL LIGATURE AE
+\SE@MapDeclare{cp858}{92}{00C6}% LATIN CAPITAL LIGATURE AE
+\SE@MapDeclare{cp858}{93}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{94}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp858}{95}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{cp858}{96}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{97}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{cp858}{98}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{cp858}{99}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp858}{9A}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp858}{9B}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{cp858}{9C}{00A3}% POUND SIGN
+\SE@MapDeclare{cp858}{9D}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{cp858}{9E}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{cp858}{9F}{0192}% LATIN SMALL LETTER F WITH HOOK
+\SE@MapDeclare{cp858}{A0}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{cp858}{A1}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{cp858}{A2}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{cp858}{A3}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{cp858}{A4}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{cp858}{A5}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{cp858}{A6}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{cp858}{A7}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{cp858}{A8}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{cp858}{A9}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{cp858}{AA}{00AC}% NOT SIGN
+\SE@MapDeclare{cp858}{AB}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{cp858}{AC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{cp858}{AD}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{cp858}{AE}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp858}{AF}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp858}{B0}{2591}% LIGHT SHADE
+\SE@MapDeclare{cp858}{B1}{2592}% MEDIUM SHADE
+\SE@MapDeclare{cp858}{B2}{2593}% DARK SHADE
+\SE@MapDeclare{cp858}{B3}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\SE@MapDeclare{cp858}{B4}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\SE@MapDeclare{cp858}{B5}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{cp858}{B6}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{B7}{00C0}% LATIN CAPITAL LETTER A WITH GRAVE
+\SE@MapDeclare{cp858}{B8}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{cp858}{B9}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\SE@MapDeclare{cp858}{BA}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\SE@MapDeclare{cp858}{BB}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\SE@MapDeclare{cp858}{BC}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\SE@MapDeclare{cp858}{BD}{00A2}% CENT SIGN
+\SE@MapDeclare{cp858}{BE}{00A5}% YEN SIGN
+\SE@MapDeclare{cp858}{BF}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\SE@MapDeclare{cp858}{C0}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\SE@MapDeclare{cp858}{C1}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\SE@MapDeclare{cp858}{C2}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\SE@MapDeclare{cp858}{C3}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\SE@MapDeclare{cp858}{C4}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\SE@MapDeclare{cp858}{C5}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp858}{C6}{00E3}% LATIN SMALL LETTER A WITH TILDE
+\SE@MapDeclare{cp858}{C7}{00C3}% LATIN CAPITAL LETTER A WITH TILDE
+\SE@MapDeclare{cp858}{C8}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\SE@MapDeclare{cp858}{C9}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\SE@MapDeclare{cp858}{CA}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\SE@MapDeclare{cp858}{CB}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\SE@MapDeclare{cp858}{CC}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\SE@MapDeclare{cp858}{CD}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\SE@MapDeclare{cp858}{CE}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp858}{CF}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp858}{D0}{00F0}% LATIN SMALL LETTER ETH
+\SE@MapDeclare{cp858}{D1}{00D0}% LATIN CAPITAL LETTER ETH
+\SE@MapDeclare{cp858}{D2}{00CA}% LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{D3}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp858}{D4}{00C8}% LATIN CAPITAL LETTER E WITH GRAVE
+\SE@MapDeclare{cp858}{D5}{20AC}% EURO SIGN
+\SE@MapDeclare{cp858}{D6}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{cp858}{D7}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{D8}{00CF}% LATIN CAPITAL LETTER I WITH DIAERESIS
+\SE@MapDeclare{cp858}{D9}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\SE@MapDeclare{cp858}{DA}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\SE@MapDeclare{cp858}{DB}{2588}% FULL BLOCK
+\SE@MapDeclare{cp858}{DC}{2584}% LOWER HALF BLOCK
+\SE@MapDeclare{cp858}{DD}{00A6}% BROKEN BAR
+\SE@MapDeclare{cp858}{DE}{00CC}% LATIN CAPITAL LETTER I WITH GRAVE
+\SE@MapDeclare{cp858}{DF}{2580}% UPPER HALF BLOCK
+\SE@MapDeclare{cp858}{E0}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{cp858}{E1}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{cp858}{E2}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{E3}{00D2}% LATIN CAPITAL LETTER O WITH GRAVE
+\SE@MapDeclare{cp858}{E4}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{cp858}{E5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{cp858}{E6}{00B5}% MICRO SIGN
+\SE@MapDeclare{cp858}{E7}{00FE}% LATIN SMALL LETTER THORN
+\SE@MapDeclare{cp858}{E8}{00DE}% LATIN CAPITAL LETTER THORN
+\SE@MapDeclare{cp858}{E9}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{cp858}{EA}{00DB}% LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{cp858}{EB}{00D9}% LATIN CAPITAL LETTER U WITH GRAVE
+\SE@MapDeclare{cp858}{EC}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{cp858}{ED}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{cp858}{EE}{00AF}% MACRON
+\SE@MapDeclare{cp858}{EF}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{cp858}{F0}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{cp858}{F1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{cp858}{F2}{2017}% DOUBLE LOW LINE
+\SE@MapDeclare{cp858}{F3}{00BE}% VULGAR FRACTION THREE QUARTERS
+\SE@MapDeclare{cp858}{F4}{00B6}% PILCROW SIGN
+\SE@MapDeclare{cp858}{F5}{00A7}% SECTION SIGN
+\SE@MapDeclare{cp858}{F6}{00F7}% DIVISION SIGN
+\SE@MapDeclare{cp858}{F7}{00B8}% CEDILLA
+\SE@MapDeclare{cp858}{F8}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp858}{F9}{00A8}% DIAERESIS
+\SE@MapDeclare{cp858}{FA}{00B7}% MIDDLE DOT
+\SE@MapDeclare{cp858}{FB}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{cp858}{FC}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{cp858}{FD}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{cp858}{FE}{25A0}% BLACK SQUARE
+\SE@MapDeclare{cp858}{FF}{00A0}% NO-BREAK SPACE
+%</cp858>
+% \end{macrocode}
+% \paragraph{cp865}
+% \begin{macrocode}
+%<*cp865>
+\SE@MapDeclare{cp865}{80}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp865}{81}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp865}{82}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{cp865}{83}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp865}{84}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp865}{85}{00E0}% LATIN SMALL LETTER A WITH GRAVE
+\SE@MapDeclare{cp865}{86}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp865}{87}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp865}{88}{00EA}% LATIN SMALL LETTER E WITH CIRCUMFLEX
+\SE@MapDeclare{cp865}{89}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp865}{8A}{00E8}% LATIN SMALL LETTER E WITH GRAVE
+\SE@MapDeclare{cp865}{8B}{00EF}% LATIN SMALL LETTER I WITH DIAERESIS
+\SE@MapDeclare{cp865}{8C}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp865}{8D}{00EC}% LATIN SMALL LETTER I WITH GRAVE
+\SE@MapDeclare{cp865}{8E}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp865}{8F}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp865}{90}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{cp865}{91}{00E6}% LATIN SMALL LIGATURE AE
+\SE@MapDeclare{cp865}{92}{00C6}% LATIN CAPITAL LIGATURE AE
+\SE@MapDeclare{cp865}{93}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp865}{94}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp865}{95}{00F2}% LATIN SMALL LETTER O WITH GRAVE
+\SE@MapDeclare{cp865}{96}{00FB}% LATIN SMALL LETTER U WITH CIRCUMFLEX
+\SE@MapDeclare{cp865}{97}{00F9}% LATIN SMALL LETTER U WITH GRAVE
+\SE@MapDeclare{cp865}{98}{00FF}% LATIN SMALL LETTER Y WITH DIAERESIS
+\SE@MapDeclare{cp865}{99}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp865}{9A}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp865}{9B}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{cp865}{9C}{00A3}% POUND SIGN
+\SE@MapDeclare{cp865}{9D}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{cp865}{9E}{20A7}% PESETA SIGN
+\SE@MapDeclare{cp865}{9F}{0192}% LATIN SMALL LETTER F WITH HOOK
+\SE@MapDeclare{cp865}{A0}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{cp865}{A1}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{cp865}{A2}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{cp865}{A3}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{cp865}{A4}{00F1}% LATIN SMALL LETTER N WITH TILDE
+\SE@MapDeclare{cp865}{A5}{00D1}% LATIN CAPITAL LETTER N WITH TILDE
+\SE@MapDeclare{cp865}{A6}{00AA}% FEMININE ORDINAL INDICATOR
+\SE@MapDeclare{cp865}{A7}{00BA}% MASCULINE ORDINAL INDICATOR
+\SE@MapDeclare{cp865}{A8}{00BF}% INVERTED QUESTION MARK
+\SE@MapDeclare{cp865}{A9}{2310}% REVERSED NOT SIGN
+\SE@MapDeclare{cp865}{AA}{00AC}% NOT SIGN
+\SE@MapDeclare{cp865}{AB}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{cp865}{AC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{cp865}{AD}{00A1}% INVERTED EXCLAMATION MARK
+\SE@MapDeclare{cp865}{AE}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp865}{AF}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp865}{B0}{2591}% LIGHT SHADE
+\SE@MapDeclare{cp865}{B1}{2592}% MEDIUM SHADE
+\SE@MapDeclare{cp865}{B2}{2593}% DARK SHADE
+\SE@MapDeclare{cp865}{B3}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\SE@MapDeclare{cp865}{B4}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\SE@MapDeclare{cp865}{B5}{2561}% BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp865}{B6}{2562}% BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp865}{B7}{2556}% BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp865}{B8}{2555}% BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp865}{B9}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\SE@MapDeclare{cp865}{BA}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\SE@MapDeclare{cp865}{BB}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\SE@MapDeclare{cp865}{BC}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\SE@MapDeclare{cp865}{BD}{255C}% BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp865}{BE}{255B}% BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp865}{BF}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\SE@MapDeclare{cp865}{C0}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\SE@MapDeclare{cp865}{C1}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\SE@MapDeclare{cp865}{C2}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\SE@MapDeclare{cp865}{C3}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\SE@MapDeclare{cp865}{C4}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\SE@MapDeclare{cp865}{C5}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp865}{C6}{255E}% BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp865}{C7}{255F}% BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp865}{C8}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\SE@MapDeclare{cp865}{C9}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\SE@MapDeclare{cp865}{CA}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\SE@MapDeclare{cp865}{CB}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\SE@MapDeclare{cp865}{CC}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\SE@MapDeclare{cp865}{CD}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\SE@MapDeclare{cp865}{CE}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp865}{CF}{2567}% BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp865}{D0}{2568}% BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp865}{D1}{2564}% BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp865}{D2}{2565}% BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp865}{D3}{2559}% BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp865}{D4}{2558}% BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp865}{D5}{2552}% BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp865}{D6}{2553}% BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp865}{D7}{256B}% BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp865}{D8}{256A}% BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp865}{D9}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\SE@MapDeclare{cp865}{DA}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\SE@MapDeclare{cp865}{DB}{2588}% FULL BLOCK
+\SE@MapDeclare{cp865}{DC}{2584}% LOWER HALF BLOCK
+\SE@MapDeclare{cp865}{DD}{258C}% LEFT HALF BLOCK
+\SE@MapDeclare{cp865}{DE}{2590}% RIGHT HALF BLOCK
+\SE@MapDeclare{cp865}{DF}{2580}% UPPER HALF BLOCK
+\SE@MapDeclare{cp865}{E0}{03B1}% GREEK SMALL LETTER ALPHA
+\SE@MapDeclare{cp865}{E1}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{cp865}{E2}{0393}% GREEK CAPITAL LETTER GAMMA
+\SE@MapDeclare{cp865}{E3}{03C0}% GREEK SMALL LETTER PI
+\SE@MapDeclare{cp865}{E4}{03A3}% GREEK CAPITAL LETTER SIGMA
+\SE@MapDeclare{cp865}{E5}{03C3}% GREEK SMALL LETTER SIGMA
+\SE@MapDeclare{cp865}{E6}{00B5}% MICRO SIGN
+\SE@MapDeclare{cp865}{E7}{03C4}% GREEK SMALL LETTER TAU
+\SE@MapDeclare{cp865}{E8}{03A6}% GREEK CAPITAL LETTER PHI
+\SE@MapDeclare{cp865}{E9}{0398}% GREEK CAPITAL LETTER THETA
+\SE@MapDeclare{cp865}{EA}{03A9}% GREEK CAPITAL LETTER OMEGA
+\SE@MapDeclare{cp865}{EB}{03B4}% GREEK SMALL LETTER DELTA
+\SE@MapDeclare{cp865}{EC}{221E}% INFINITY
+\SE@MapDeclare{cp865}{ED}{03C6}% GREEK SMALL LETTER PHI
+\SE@MapDeclare{cp865}{EE}{03B5}% GREEK SMALL LETTER EPSILON
+\SE@MapDeclare{cp865}{EF}{2229}% INTERSECTION
+\SE@MapDeclare{cp865}{F0}{2261}% IDENTICAL TO
+\SE@MapDeclare{cp865}{F1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{cp865}{F2}{2265}% GREATER-THAN OR EQUAL TO
+\SE@MapDeclare{cp865}{F3}{2264}% LESS-THAN OR EQUAL TO
+\SE@MapDeclare{cp865}{F4}{2320}% TOP HALF INTEGRAL
+\SE@MapDeclare{cp865}{F5}{2321}% BOTTOM HALF INTEGRAL
+\SE@MapDeclare{cp865}{F6}{00F7}% DIVISION SIGN
+\SE@MapDeclare{cp865}{F7}{2248}% ALMOST EQUAL TO
+\SE@MapDeclare{cp865}{F8}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp865}{F9}{2219}% BULLET OPERATOR
+\SE@MapDeclare{cp865}{FA}{00B7}% MIDDLE DOT
+\SE@MapDeclare{cp865}{FB}{221A}% SQUARE ROOT
+\SE@MapDeclare{cp865}{FC}{207F}% SUPERSCRIPT LATIN SMALL LETTER N
+\SE@MapDeclare{cp865}{FD}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{cp865}{FE}{25A0}% BLACK SQUARE
+\SE@MapDeclare{cp865}{FF}{00A0}% NO-BREAK SPACE
+%</cp865>
+% \end{macrocode}
+% \paragraph{cp866}
+% \begin{macrocode}
+%<*cp866>
+\SE@MapDeclare{cp866}{80}{0410}% CYRILLIC CAPITAL LETTER A
+\SE@MapDeclare{cp866}{81}{0411}% CYRILLIC CAPITAL LETTER BE
+\SE@MapDeclare{cp866}{82}{0412}% CYRILLIC CAPITAL LETTER VE
+\SE@MapDeclare{cp866}{83}{0413}% CYRILLIC CAPITAL LETTER GHE
+\SE@MapDeclare{cp866}{84}{0414}% CYRILLIC CAPITAL LETTER DE
+\SE@MapDeclare{cp866}{85}{0415}% CYRILLIC CAPITAL LETTER IE
+\SE@MapDeclare{cp866}{86}{0416}% CYRILLIC CAPITAL LETTER ZHE
+\SE@MapDeclare{cp866}{87}{0417}% CYRILLIC CAPITAL LETTER ZE
+\SE@MapDeclare{cp866}{88}{0418}% CYRILLIC CAPITAL LETTER I
+\SE@MapDeclare{cp866}{89}{0419}% CYRILLIC CAPITAL LETTER SHORT I
+\SE@MapDeclare{cp866}{8A}{041A}% CYRILLIC CAPITAL LETTER KA
+\SE@MapDeclare{cp866}{8B}{041B}% CYRILLIC CAPITAL LETTER EL
+\SE@MapDeclare{cp866}{8C}{041C}% CYRILLIC CAPITAL LETTER EM
+\SE@MapDeclare{cp866}{8D}{041D}% CYRILLIC CAPITAL LETTER EN
+\SE@MapDeclare{cp866}{8E}{041E}% CYRILLIC CAPITAL LETTER O
+\SE@MapDeclare{cp866}{8F}{041F}% CYRILLIC CAPITAL LETTER PE
+\SE@MapDeclare{cp866}{90}{0420}% CYRILLIC CAPITAL LETTER ER
+\SE@MapDeclare{cp866}{91}{0421}% CYRILLIC CAPITAL LETTER ES
+\SE@MapDeclare{cp866}{92}{0422}% CYRILLIC CAPITAL LETTER TE
+\SE@MapDeclare{cp866}{93}{0423}% CYRILLIC CAPITAL LETTER U
+\SE@MapDeclare{cp866}{94}{0424}% CYRILLIC CAPITAL LETTER EF
+\SE@MapDeclare{cp866}{95}{0425}% CYRILLIC CAPITAL LETTER HA
+\SE@MapDeclare{cp866}{96}{0426}% CYRILLIC CAPITAL LETTER TSE
+\SE@MapDeclare{cp866}{97}{0427}% CYRILLIC CAPITAL LETTER CHE
+\SE@MapDeclare{cp866}{98}{0428}% CYRILLIC CAPITAL LETTER SHA
+\SE@MapDeclare{cp866}{99}{0429}% CYRILLIC CAPITAL LETTER SHCHA
+\SE@MapDeclare{cp866}{9A}{042A}% CYRILLIC CAPITAL LETTER HARD SIGN
+\SE@MapDeclare{cp866}{9B}{042B}% CYRILLIC CAPITAL LETTER YERU
+\SE@MapDeclare{cp866}{9C}{042C}% CYRILLIC CAPITAL LETTER SOFT SIGN
+\SE@MapDeclare{cp866}{9D}{042D}% CYRILLIC CAPITAL LETTER E
+\SE@MapDeclare{cp866}{9E}{042E}% CYRILLIC CAPITAL LETTER YU
+\SE@MapDeclare{cp866}{9F}{042F}% CYRILLIC CAPITAL LETTER YA
+\SE@MapDeclare{cp866}{A0}{0430}% CYRILLIC SMALL LETTER A
+\SE@MapDeclare{cp866}{A1}{0431}% CYRILLIC SMALL LETTER BE
+\SE@MapDeclare{cp866}{A2}{0432}% CYRILLIC SMALL LETTER VE
+\SE@MapDeclare{cp866}{A3}{0433}% CYRILLIC SMALL LETTER GHE
+\SE@MapDeclare{cp866}{A4}{0434}% CYRILLIC SMALL LETTER DE
+\SE@MapDeclare{cp866}{A5}{0435}% CYRILLIC SMALL LETTER IE
+\SE@MapDeclare{cp866}{A6}{0436}% CYRILLIC SMALL LETTER ZHE
+\SE@MapDeclare{cp866}{A7}{0437}% CYRILLIC SMALL LETTER ZE
+\SE@MapDeclare{cp866}{A8}{0438}% CYRILLIC SMALL LETTER I
+\SE@MapDeclare{cp866}{A9}{0439}% CYRILLIC SMALL LETTER SHORT I
+\SE@MapDeclare{cp866}{AA}{043A}% CYRILLIC SMALL LETTER KA
+\SE@MapDeclare{cp866}{AB}{043B}% CYRILLIC SMALL LETTER EL
+\SE@MapDeclare{cp866}{AC}{043C}% CYRILLIC SMALL LETTER EM
+\SE@MapDeclare{cp866}{AD}{043D}% CYRILLIC SMALL LETTER EN
+\SE@MapDeclare{cp866}{AE}{043E}% CYRILLIC SMALL LETTER O
+\SE@MapDeclare{cp866}{AF}{043F}% CYRILLIC SMALL LETTER PE
+\SE@MapDeclare{cp866}{B0}{2591}% LIGHT SHADE
+\SE@MapDeclare{cp866}{B1}{2592}% MEDIUM SHADE
+\SE@MapDeclare{cp866}{B2}{2593}% DARK SHADE
+\SE@MapDeclare{cp866}{B3}{2502}% BOX DRAWINGS LIGHT VERTICAL
+\SE@MapDeclare{cp866}{B4}{2524}% BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\SE@MapDeclare{cp866}{B5}{2561}% BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp866}{B6}{2562}% BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp866}{B7}{2556}% BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp866}{B8}{2555}% BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp866}{B9}{2563}% BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\SE@MapDeclare{cp866}{BA}{2551}% BOX DRAWINGS DOUBLE VERTICAL
+\SE@MapDeclare{cp866}{BB}{2557}% BOX DRAWINGS DOUBLE DOWN AND LEFT
+\SE@MapDeclare{cp866}{BC}{255D}% BOX DRAWINGS DOUBLE UP AND LEFT
+\SE@MapDeclare{cp866}{BD}{255C}% BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+\SE@MapDeclare{cp866}{BE}{255B}% BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+\SE@MapDeclare{cp866}{BF}{2510}% BOX DRAWINGS LIGHT DOWN AND LEFT
+\SE@MapDeclare{cp866}{C0}{2514}% BOX DRAWINGS LIGHT UP AND RIGHT
+\SE@MapDeclare{cp866}{C1}{2534}% BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\SE@MapDeclare{cp866}{C2}{252C}% BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\SE@MapDeclare{cp866}{C3}{251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\SE@MapDeclare{cp866}{C4}{2500}% BOX DRAWINGS LIGHT HORIZONTAL
+\SE@MapDeclare{cp866}{C5}{253C}% BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp866}{C6}{255E}% BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp866}{C7}{255F}% BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp866}{C8}{255A}% BOX DRAWINGS DOUBLE UP AND RIGHT
+\SE@MapDeclare{cp866}{C9}{2554}% BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\SE@MapDeclare{cp866}{CA}{2569}% BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\SE@MapDeclare{cp866}{CB}{2566}% BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\SE@MapDeclare{cp866}{CC}{2560}% BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\SE@MapDeclare{cp866}{CD}{2550}% BOX DRAWINGS DOUBLE HORIZONTAL
+\SE@MapDeclare{cp866}{CE}{256C}% BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\SE@MapDeclare{cp866}{CF}{2567}% BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp866}{D0}{2568}% BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp866}{D1}{2564}% BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp866}{D2}{2565}% BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp866}{D3}{2559}% BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp866}{D4}{2558}% BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp866}{D5}{2552}% BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+\SE@MapDeclare{cp866}{D6}{2553}% BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+\SE@MapDeclare{cp866}{D7}{256B}% BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+\SE@MapDeclare{cp866}{D8}{256A}% BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+\SE@MapDeclare{cp866}{D9}{2518}% BOX DRAWINGS LIGHT UP AND LEFT
+\SE@MapDeclare{cp866}{DA}{250C}% BOX DRAWINGS LIGHT DOWN AND RIGHT
+\SE@MapDeclare{cp866}{DB}{2588}% FULL BLOCK
+\SE@MapDeclare{cp866}{DC}{2584}% LOWER HALF BLOCK
+\SE@MapDeclare{cp866}{DD}{258C}% LEFT HALF BLOCK
+\SE@MapDeclare{cp866}{DE}{2590}% RIGHT HALF BLOCK
+\SE@MapDeclare{cp866}{DF}{2580}% UPPER HALF BLOCK
+\SE@MapDeclare{cp866}{E0}{0440}% CYRILLIC SMALL LETTER ER
+\SE@MapDeclare{cp866}{E1}{0441}% CYRILLIC SMALL LETTER ES
+\SE@MapDeclare{cp866}{E2}{0442}% CYRILLIC SMALL LETTER TE
+\SE@MapDeclare{cp866}{E3}{0443}% CYRILLIC SMALL LETTER U
+\SE@MapDeclare{cp866}{E4}{0444}% CYRILLIC SMALL LETTER EF
+\SE@MapDeclare{cp866}{E5}{0445}% CYRILLIC SMALL LETTER HA
+\SE@MapDeclare{cp866}{E6}{0446}% CYRILLIC SMALL LETTER TSE
+\SE@MapDeclare{cp866}{E7}{0447}% CYRILLIC SMALL LETTER CHE
+\SE@MapDeclare{cp866}{E8}{0448}% CYRILLIC SMALL LETTER SHA
+\SE@MapDeclare{cp866}{E9}{0449}% CYRILLIC SMALL LETTER SHCHA
+\SE@MapDeclare{cp866}{EA}{044A}% CYRILLIC SMALL LETTER HARD SIGN
+\SE@MapDeclare{cp866}{EB}{044B}% CYRILLIC SMALL LETTER YERU
+\SE@MapDeclare{cp866}{EC}{044C}% CYRILLIC SMALL LETTER SOFT SIGN
+\SE@MapDeclare{cp866}{ED}{044D}% CYRILLIC SMALL LETTER E
+\SE@MapDeclare{cp866}{EE}{044E}% CYRILLIC SMALL LETTER YU
+\SE@MapDeclare{cp866}{EF}{044F}% CYRILLIC SMALL LETTER YA
+\SE@MapDeclare{cp866}{F0}{0401}% CYRILLIC CAPITAL LETTER IO
+\SE@MapDeclare{cp866}{F1}{0451}% CYRILLIC SMALL LETTER IO
+\SE@MapDeclare{cp866}{F2}{0404}% CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\SE@MapDeclare{cp866}{F3}{0454}% CYRILLIC SMALL LETTER UKRAINIAN IE
+\SE@MapDeclare{cp866}{F4}{0407}% CYRILLIC CAPITAL LETTER YI
+\SE@MapDeclare{cp866}{F5}{0457}% CYRILLIC SMALL LETTER YI
+\SE@MapDeclare{cp866}{F6}{040E}% CYRILLIC CAPITAL LETTER SHORT U
+\SE@MapDeclare{cp866}{F7}{045E}% CYRILLIC SMALL LETTER SHORT U
+\SE@MapDeclare{cp866}{F8}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp866}{F9}{2219}% BULLET OPERATOR
+\SE@MapDeclare{cp866}{FA}{00B7}% MIDDLE DOT
+\SE@MapDeclare{cp866}{FB}{221A}% SQUARE ROOT
+\SE@MapDeclare{cp866}{FC}{2116}% NUMERO SIGN
+\SE@MapDeclare{cp866}{FD}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp866}{FE}{25A0}% BLACK SQUARE
+\SE@MapDeclare{cp866}{FF}{00A0}% NO-BREAK SPACE
+%</cp866>
+% \end{macrocode}
+% \paragraph{cp1250}
+% \begin{macrocode}
+%<*cp1250>
+\SE@MapDeclare{cp1250}{80}{20AC}% EURO SIGN
+\SE@MapDeclare{cp1250}{82}{201A}% SINGLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{cp1250}{84}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{cp1250}{85}{2026}% HORIZONTAL ELLIPSIS
+\SE@MapDeclare{cp1250}{86}{2020}% DAGGER
+\SE@MapDeclare{cp1250}{87}{2021}% DOUBLE DAGGER
+\SE@MapDeclare{cp1250}{89}{2030}% PER MILLE SIGN
+\SE@MapDeclare{cp1250}{8A}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{cp1250}{8B}{2039}% SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1250}{8C}{015A}% LATIN CAPITAL LETTER S WITH ACUTE
+\SE@MapDeclare{cp1250}{8D}{0164}% LATIN CAPITAL LETTER T WITH CARON
+\SE@MapDeclare{cp1250}{8E}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{cp1250}{8F}{0179}% LATIN CAPITAL LETTER Z WITH ACUTE
+\SE@MapDeclare{cp1250}{91}{2018}% LEFT SINGLE QUOTATION MARK
+\SE@MapDeclare{cp1250}{92}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{cp1250}{93}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{cp1250}{94}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{cp1250}{95}{2022}% BULLET
+\SE@MapDeclare{cp1250}{96}{2013}% EN DASH
+\SE@MapDeclare{cp1250}{97}{2014}% EM DASH
+\SE@MapDeclare{cp1250}{99}{2122}% TRADE MARK SIGN
+\SE@MapDeclare{cp1250}{9A}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{cp1250}{9B}{203A}% SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1250}{9C}{015B}% LATIN SMALL LETTER S WITH ACUTE
+\SE@MapDeclare{cp1250}{9D}{0165}% LATIN SMALL LETTER T WITH CARON
+\SE@MapDeclare{cp1250}{9E}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{cp1250}{9F}{017A}% LATIN SMALL LETTER Z WITH ACUTE
+\SE@MapDeclare{cp1250}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{cp1250}{A1}{02C7}% CARON
+\SE@MapDeclare{cp1250}{A2}{02D8}% BREVE
+\SE@MapDeclare{cp1250}{A3}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\SE@MapDeclare{cp1250}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp1250}{A5}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{cp1250}{A6}{00A6}% BROKEN BAR
+\SE@MapDeclare{cp1250}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{cp1250}{A8}{00A8}% DIAERESIS
+\SE@MapDeclare{cp1250}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{cp1250}{AA}{015E}% LATIN CAPITAL LETTER S WITH CEDILLA
+\SE@MapDeclare{cp1250}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1250}{AC}{00AC}% NOT SIGN
+\SE@MapDeclare{cp1250}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{cp1250}{AE}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{cp1250}{AF}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{cp1250}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp1250}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{cp1250}{B2}{02DB}% OGONEK
+\SE@MapDeclare{cp1250}{B3}{0142}% LATIN SMALL LETTER L WITH STROKE
+\SE@MapDeclare{cp1250}{B4}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{cp1250}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{cp1250}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{cp1250}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{cp1250}{B8}{00B8}% CEDILLA
+\SE@MapDeclare{cp1250}{B9}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{cp1250}{BA}{015F}% LATIN SMALL LETTER S WITH CEDILLA
+\SE@MapDeclare{cp1250}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1250}{BC}{013D}% LATIN CAPITAL LETTER L WITH CARON
+\SE@MapDeclare{cp1250}{BD}{02DD}% DOUBLE ACUTE ACCENT
+\SE@MapDeclare{cp1250}{BE}{013E}% LATIN SMALL LETTER L WITH CARON
+\SE@MapDeclare{cp1250}{BF}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{cp1250}{C0}{0154}% LATIN CAPITAL LETTER R WITH ACUTE
+\SE@MapDeclare{cp1250}{C1}{00C1}% LATIN CAPITAL LETTER A WITH ACUTE
+\SE@MapDeclare{cp1250}{C2}{00C2}% LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp1250}{C3}{0102}% LATIN CAPITAL LETTER A WITH BREVE
+\SE@MapDeclare{cp1250}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp1250}{C5}{0139}% LATIN CAPITAL LETTER L WITH ACUTE
+\SE@MapDeclare{cp1250}{C6}{0106}% LATIN CAPITAL LETTER C WITH ACUTE
+\SE@MapDeclare{cp1250}{C7}{00C7}% LATIN CAPITAL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp1250}{C8}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{cp1250}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{cp1250}{CA}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{cp1250}{CB}{00CB}% LATIN CAPITAL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp1250}{CC}{011A}% LATIN CAPITAL LETTER E WITH CARON
+\SE@MapDeclare{cp1250}{CD}{00CD}% LATIN CAPITAL LETTER I WITH ACUTE
+\SE@MapDeclare{cp1250}{CE}{00CE}% LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp1250}{CF}{010E}% LATIN CAPITAL LETTER D WITH CARON
+\SE@MapDeclare{cp1250}{D0}{0110}% LATIN CAPITAL LETTER D WITH STROKE
+\SE@MapDeclare{cp1250}{D1}{0143}% LATIN CAPITAL LETTER N WITH ACUTE
+\SE@MapDeclare{cp1250}{D2}{0147}% LATIN CAPITAL LETTER N WITH CARON
+\SE@MapDeclare{cp1250}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{cp1250}{D4}{00D4}% LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp1250}{D5}{0150}% LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{cp1250}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp1250}{D7}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{cp1250}{D8}{0158}% LATIN CAPITAL LETTER R WITH CARON
+\SE@MapDeclare{cp1250}{D9}{016E}% LATIN CAPITAL LETTER U WITH RING ABOVE
+\SE@MapDeclare{cp1250}{DA}{00DA}% LATIN CAPITAL LETTER U WITH ACUTE
+\SE@MapDeclare{cp1250}{DB}{0170}% LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{cp1250}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp1250}{DD}{00DD}% LATIN CAPITAL LETTER Y WITH ACUTE
+\SE@MapDeclare{cp1250}{DE}{0162}% LATIN CAPITAL LETTER T WITH CEDILLA
+\SE@MapDeclare{cp1250}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{cp1250}{E0}{0155}% LATIN SMALL LETTER R WITH ACUTE
+\SE@MapDeclare{cp1250}{E1}{00E1}% LATIN SMALL LETTER A WITH ACUTE
+\SE@MapDeclare{cp1250}{E2}{00E2}% LATIN SMALL LETTER A WITH CIRCUMFLEX
+\SE@MapDeclare{cp1250}{E3}{0103}% LATIN SMALL LETTER A WITH BREVE
+\SE@MapDeclare{cp1250}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp1250}{E5}{013A}% LATIN SMALL LETTER L WITH ACUTE
+\SE@MapDeclare{cp1250}{E6}{0107}% LATIN SMALL LETTER C WITH ACUTE
+\SE@MapDeclare{cp1250}{E7}{00E7}% LATIN SMALL LETTER C WITH CEDILLA
+\SE@MapDeclare{cp1250}{E8}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{cp1250}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{cp1250}{EA}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{cp1250}{EB}{00EB}% LATIN SMALL LETTER E WITH DIAERESIS
+\SE@MapDeclare{cp1250}{EC}{011B}% LATIN SMALL LETTER E WITH CARON
+\SE@MapDeclare{cp1250}{ED}{00ED}% LATIN SMALL LETTER I WITH ACUTE
+\SE@MapDeclare{cp1250}{EE}{00EE}% LATIN SMALL LETTER I WITH CIRCUMFLEX
+\SE@MapDeclare{cp1250}{EF}{010F}% LATIN SMALL LETTER D WITH CARON
+\SE@MapDeclare{cp1250}{F0}{0111}% LATIN SMALL LETTER D WITH STROKE
+\SE@MapDeclare{cp1250}{F1}{0144}% LATIN SMALL LETTER N WITH ACUTE
+\SE@MapDeclare{cp1250}{F2}{0148}% LATIN SMALL LETTER N WITH CARON
+\SE@MapDeclare{cp1250}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{cp1250}{F4}{00F4}% LATIN SMALL LETTER O WITH CIRCUMFLEX
+\SE@MapDeclare{cp1250}{F5}{0151}% LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\SE@MapDeclare{cp1250}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp1250}{F7}{00F7}% DIVISION SIGN
+\SE@MapDeclare{cp1250}{F8}{0159}% LATIN SMALL LETTER R WITH CARON
+\SE@MapDeclare{cp1250}{F9}{016F}% LATIN SMALL LETTER U WITH RING ABOVE
+\SE@MapDeclare{cp1250}{FA}{00FA}% LATIN SMALL LETTER U WITH ACUTE
+\SE@MapDeclare{cp1250}{FB}{0171}% LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\SE@MapDeclare{cp1250}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp1250}{FD}{00FD}% LATIN SMALL LETTER Y WITH ACUTE
+\SE@MapDeclare{cp1250}{FE}{0163}% LATIN SMALL LETTER T WITH CEDILLA
+\SE@MapDeclare{cp1250}{FF}{02D9}% DOT ABOVE
+%</cp1250>
+% \end{macrocode}
+% \paragraph{cp1251}
+% \begin{macrocode}
+%<*cp1251>
+\SE@MapDeclare{cp1251}{80}{0402}% CYRILLIC CAPITAL LETTER DJE
+\SE@MapDeclare{cp1251}{81}{0403}% CYRILLIC CAPITAL LETTER GJE
+\SE@MapDeclare{cp1251}{82}{201A}% SINGLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{cp1251}{83}{0453}% CYRILLIC SMALL LETTER GJE
+\SE@MapDeclare{cp1251}{84}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{cp1251}{85}{2026}% HORIZONTAL ELLIPSIS
+\SE@MapDeclare{cp1251}{86}{2020}% DAGGER
+\SE@MapDeclare{cp1251}{87}{2021}% DOUBLE DAGGER
+\SE@MapDeclare{cp1251}{88}{20AC}% EURO SIGN
+\SE@MapDeclare{cp1251}{89}{2030}% PER MILLE SIGN
+\SE@MapDeclare{cp1251}{8A}{0409}% CYRILLIC CAPITAL LETTER LJE
+\SE@MapDeclare{cp1251}{8B}{2039}% SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1251}{8C}{040A}% CYRILLIC CAPITAL LETTER NJE
+\SE@MapDeclare{cp1251}{8D}{040C}% CYRILLIC CAPITAL LETTER KJE
+\SE@MapDeclare{cp1251}{8E}{040B}% CYRILLIC CAPITAL LETTER TSHE
+\SE@MapDeclare{cp1251}{8F}{040F}% CYRILLIC CAPITAL LETTER DZHE
+\SE@MapDeclare{cp1251}{90}{0452}% CYRILLIC SMALL LETTER DJE
+\SE@MapDeclare{cp1251}{91}{2018}% LEFT SINGLE QUOTATION MARK
+\SE@MapDeclare{cp1251}{92}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{cp1251}{93}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{cp1251}{94}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{cp1251}{95}{2022}% BULLET
+\SE@MapDeclare{cp1251}{96}{2013}% EN DASH
+\SE@MapDeclare{cp1251}{97}{2014}% EM DASH
+\SE@MapDeclare{cp1251}{99}{2122}% TRADE MARK SIGN
+\SE@MapDeclare{cp1251}{9A}{0459}% CYRILLIC SMALL LETTER LJE
+\SE@MapDeclare{cp1251}{9B}{203A}% SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1251}{9C}{045A}% CYRILLIC SMALL LETTER NJE
+\SE@MapDeclare{cp1251}{9D}{045C}% CYRILLIC SMALL LETTER KJE
+\SE@MapDeclare{cp1251}{9E}{045B}% CYRILLIC SMALL LETTER TSHE
+\SE@MapDeclare{cp1251}{9F}{045F}% CYRILLIC SMALL LETTER DZHE
+\SE@MapDeclare{cp1251}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{cp1251}{A1}{040E}% CYRILLIC CAPITAL LETTER SHORT U
+\SE@MapDeclare{cp1251}{A2}{045E}% CYRILLIC SMALL LETTER SHORT U
+\SE@MapDeclare{cp1251}{A3}{0408}% CYRILLIC CAPITAL LETTER JE
+\SE@MapDeclare{cp1251}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp1251}{A5}{0490}% CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+\SE@MapDeclare{cp1251}{A6}{00A6}% BROKEN BAR
+\SE@MapDeclare{cp1251}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{cp1251}{A8}{0401}% CYRILLIC CAPITAL LETTER IO
+\SE@MapDeclare{cp1251}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{cp1251}{AA}{0404}% CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\SE@MapDeclare{cp1251}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1251}{AC}{00AC}% NOT SIGN
+\SE@MapDeclare{cp1251}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{cp1251}{AE}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{cp1251}{AF}{0407}% CYRILLIC CAPITAL LETTER YI
+\SE@MapDeclare{cp1251}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp1251}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{cp1251}{B2}{0406}% CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+\SE@MapDeclare{cp1251}{B3}{0456}% CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+\SE@MapDeclare{cp1251}{B4}{0491}% CYRILLIC SMALL LETTER GHE WITH UPTURN
+\SE@MapDeclare{cp1251}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{cp1251}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{cp1251}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{cp1251}{B8}{0451}% CYRILLIC SMALL LETTER IO
+\SE@MapDeclare{cp1251}{B9}{2116}% NUMERO SIGN
+\SE@MapDeclare{cp1251}{BA}{0454}% CYRILLIC SMALL LETTER UKRAINIAN IE
+\SE@MapDeclare{cp1251}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1251}{BC}{0458}% CYRILLIC SMALL LETTER JE
+\SE@MapDeclare{cp1251}{BD}{0405}% CYRILLIC CAPITAL LETTER DZE
+\SE@MapDeclare{cp1251}{BE}{0455}% CYRILLIC SMALL LETTER DZE
+\SE@MapDeclare{cp1251}{BF}{0457}% CYRILLIC SMALL LETTER YI
+\SE@MapDeclare{cp1251}{C0}{0410}% CYRILLIC CAPITAL LETTER A
+\SE@MapDeclare{cp1251}{C1}{0411}% CYRILLIC CAPITAL LETTER BE
+\SE@MapDeclare{cp1251}{C2}{0412}% CYRILLIC CAPITAL LETTER VE
+\SE@MapDeclare{cp1251}{C3}{0413}% CYRILLIC CAPITAL LETTER GHE
+\SE@MapDeclare{cp1251}{C4}{0414}% CYRILLIC CAPITAL LETTER DE
+\SE@MapDeclare{cp1251}{C5}{0415}% CYRILLIC CAPITAL LETTER IE
+\SE@MapDeclare{cp1251}{C6}{0416}% CYRILLIC CAPITAL LETTER ZHE
+\SE@MapDeclare{cp1251}{C7}{0417}% CYRILLIC CAPITAL LETTER ZE
+\SE@MapDeclare{cp1251}{C8}{0418}% CYRILLIC CAPITAL LETTER I
+\SE@MapDeclare{cp1251}{C9}{0419}% CYRILLIC CAPITAL LETTER SHORT I
+\SE@MapDeclare{cp1251}{CA}{041A}% CYRILLIC CAPITAL LETTER KA
+\SE@MapDeclare{cp1251}{CB}{041B}% CYRILLIC CAPITAL LETTER EL
+\SE@MapDeclare{cp1251}{CC}{041C}% CYRILLIC CAPITAL LETTER EM
+\SE@MapDeclare{cp1251}{CD}{041D}% CYRILLIC CAPITAL LETTER EN
+\SE@MapDeclare{cp1251}{CE}{041E}% CYRILLIC CAPITAL LETTER O
+\SE@MapDeclare{cp1251}{CF}{041F}% CYRILLIC CAPITAL LETTER PE
+\SE@MapDeclare{cp1251}{D0}{0420}% CYRILLIC CAPITAL LETTER ER
+\SE@MapDeclare{cp1251}{D1}{0421}% CYRILLIC CAPITAL LETTER ES
+\SE@MapDeclare{cp1251}{D2}{0422}% CYRILLIC CAPITAL LETTER TE
+\SE@MapDeclare{cp1251}{D3}{0423}% CYRILLIC CAPITAL LETTER U
+\SE@MapDeclare{cp1251}{D4}{0424}% CYRILLIC CAPITAL LETTER EF
+\SE@MapDeclare{cp1251}{D5}{0425}% CYRILLIC CAPITAL LETTER HA
+\SE@MapDeclare{cp1251}{D6}{0426}% CYRILLIC CAPITAL LETTER TSE
+\SE@MapDeclare{cp1251}{D7}{0427}% CYRILLIC CAPITAL LETTER CHE
+\SE@MapDeclare{cp1251}{D8}{0428}% CYRILLIC CAPITAL LETTER SHA
+\SE@MapDeclare{cp1251}{D9}{0429}% CYRILLIC CAPITAL LETTER SHCHA
+\SE@MapDeclare{cp1251}{DA}{042A}% CYRILLIC CAPITAL LETTER HARD SIGN
+\SE@MapDeclare{cp1251}{DB}{042B}% CYRILLIC CAPITAL LETTER YERU
+\SE@MapDeclare{cp1251}{DC}{042C}% CYRILLIC CAPITAL LETTER SOFT SIGN
+\SE@MapDeclare{cp1251}{DD}{042D}% CYRILLIC CAPITAL LETTER E
+\SE@MapDeclare{cp1251}{DE}{042E}% CYRILLIC CAPITAL LETTER YU
+\SE@MapDeclare{cp1251}{DF}{042F}% CYRILLIC CAPITAL LETTER YA
+\SE@MapDeclare{cp1251}{E0}{0430}% CYRILLIC SMALL LETTER A
+\SE@MapDeclare{cp1251}{E1}{0431}% CYRILLIC SMALL LETTER BE
+\SE@MapDeclare{cp1251}{E2}{0432}% CYRILLIC SMALL LETTER VE
+\SE@MapDeclare{cp1251}{E3}{0433}% CYRILLIC SMALL LETTER GHE
+\SE@MapDeclare{cp1251}{E4}{0434}% CYRILLIC SMALL LETTER DE
+\SE@MapDeclare{cp1251}{E5}{0435}% CYRILLIC SMALL LETTER IE
+\SE@MapDeclare{cp1251}{E6}{0436}% CYRILLIC SMALL LETTER ZHE
+\SE@MapDeclare{cp1251}{E7}{0437}% CYRILLIC SMALL LETTER ZE
+\SE@MapDeclare{cp1251}{E8}{0438}% CYRILLIC SMALL LETTER I
+\SE@MapDeclare{cp1251}{E9}{0439}% CYRILLIC SMALL LETTER SHORT I
+\SE@MapDeclare{cp1251}{EA}{043A}% CYRILLIC SMALL LETTER KA
+\SE@MapDeclare{cp1251}{EB}{043B}% CYRILLIC SMALL LETTER EL
+\SE@MapDeclare{cp1251}{EC}{043C}% CYRILLIC SMALL LETTER EM
+\SE@MapDeclare{cp1251}{ED}{043D}% CYRILLIC SMALL LETTER EN
+\SE@MapDeclare{cp1251}{EE}{043E}% CYRILLIC SMALL LETTER O
+\SE@MapDeclare{cp1251}{EF}{043F}% CYRILLIC SMALL LETTER PE
+\SE@MapDeclare{cp1251}{F0}{0440}% CYRILLIC SMALL LETTER ER
+\SE@MapDeclare{cp1251}{F1}{0441}% CYRILLIC SMALL LETTER ES
+\SE@MapDeclare{cp1251}{F2}{0442}% CYRILLIC SMALL LETTER TE
+\SE@MapDeclare{cp1251}{F3}{0443}% CYRILLIC SMALL LETTER U
+\SE@MapDeclare{cp1251}{F4}{0444}% CYRILLIC SMALL LETTER EF
+\SE@MapDeclare{cp1251}{F5}{0445}% CYRILLIC SMALL LETTER HA
+\SE@MapDeclare{cp1251}{F6}{0446}% CYRILLIC SMALL LETTER TSE
+\SE@MapDeclare{cp1251}{F7}{0447}% CYRILLIC SMALL LETTER CHE
+\SE@MapDeclare{cp1251}{F8}{0448}% CYRILLIC SMALL LETTER SHA
+\SE@MapDeclare{cp1251}{F9}{0449}% CYRILLIC SMALL LETTER SHCHA
+\SE@MapDeclare{cp1251}{FA}{044A}% CYRILLIC SMALL LETTER HARD SIGN
+\SE@MapDeclare{cp1251}{FB}{044B}% CYRILLIC SMALL LETTER YERU
+\SE@MapDeclare{cp1251}{FC}{044C}% CYRILLIC SMALL LETTER SOFT SIGN
+\SE@MapDeclare{cp1251}{FD}{044D}% CYRILLIC SMALL LETTER E
+\SE@MapDeclare{cp1251}{FE}{044E}% CYRILLIC SMALL LETTER YU
+\SE@MapDeclare{cp1251}{FF}{044F}% CYRILLIC SMALL LETTER YA
+%</cp1251>
+% \end{macrocode}
+% \paragraph{cp1257}
+% \begin{macrocode}
+%<*cp1257>
+\SE@MapDeclare{cp1257}{80}{20AC}% EURO SIGN
+\SE@MapDeclare{cp1257}{82}{201A}% SINGLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{cp1257}{84}{201E}% DOUBLE LOW-9 QUOTATION MARK
+\SE@MapDeclare{cp1257}{85}{2026}% HORIZONTAL ELLIPSIS
+\SE@MapDeclare{cp1257}{86}{2020}% DAGGER
+\SE@MapDeclare{cp1257}{87}{2021}% DOUBLE DAGGER
+\SE@MapDeclare{cp1257}{89}{2030}% PER MILLE SIGN
+\SE@MapDeclare{cp1257}{8B}{2039}% SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1257}{8D}{00A8}% DIAERESIS
+\SE@MapDeclare{cp1257}{8E}{02C7}% CARON
+\SE@MapDeclare{cp1257}{8F}{00B8}% CEDILLA
+\SE@MapDeclare{cp1257}{91}{2018}% LEFT SINGLE QUOTATION MARK
+\SE@MapDeclare{cp1257}{92}{2019}% RIGHT SINGLE QUOTATION MARK
+\SE@MapDeclare{cp1257}{93}{201C}% LEFT DOUBLE QUOTATION MARK
+\SE@MapDeclare{cp1257}{94}{201D}% RIGHT DOUBLE QUOTATION MARK
+\SE@MapDeclare{cp1257}{95}{2022}% BULLET
+\SE@MapDeclare{cp1257}{96}{2013}% EN DASH
+\SE@MapDeclare{cp1257}{97}{2014}% EM DASH
+\SE@MapDeclare{cp1257}{99}{2122}% TRADE MARK SIGN
+\SE@MapDeclare{cp1257}{9B}{203A}% SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1257}{9D}{00AF}% MACRON
+\SE@MapDeclare{cp1257}{9E}{02DB}% OGONEK
+\SE@MapDeclare{cp1257}{A0}{00A0}% NO-BREAK SPACE
+\SE@MapDeclare{cp1257}{A2}{00A2}% CENT SIGN
+\SE@MapDeclare{cp1257}{A3}{00A3}% POUND SIGN
+\SE@MapDeclare{cp1257}{A4}{00A4}% CURRENCY SIGN
+\SE@MapDeclare{cp1257}{A6}{00A6}% BROKEN BAR
+\SE@MapDeclare{cp1257}{A7}{00A7}% SECTION SIGN
+\SE@MapDeclare{cp1257}{A8}{00D8}% LATIN CAPITAL LETTER O WITH STROKE
+\SE@MapDeclare{cp1257}{A9}{00A9}% COPYRIGHT SIGN
+\SE@MapDeclare{cp1257}{AA}{0156}% LATIN CAPITAL LETTER R WITH CEDILLA
+\SE@MapDeclare{cp1257}{AB}{00AB}% LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1257}{AC}{00AC}% NOT SIGN
+\SE@MapDeclare{cp1257}{AD}{00AD}% SOFT HYPHEN
+\SE@MapDeclare{cp1257}{AE}{00AE}% REGISTERED SIGN
+\SE@MapDeclare{cp1257}{AF}{00C6}% LATIN CAPITAL LETTER AE
+\SE@MapDeclare{cp1257}{B0}{00B0}% DEGREE SIGN
+\SE@MapDeclare{cp1257}{B1}{00B1}% PLUS-MINUS SIGN
+\SE@MapDeclare{cp1257}{B2}{00B2}% SUPERSCRIPT TWO
+\SE@MapDeclare{cp1257}{B3}{00B3}% SUPERSCRIPT THREE
+\SE@MapDeclare{cp1257}{B4}{00B4}% ACUTE ACCENT
+\SE@MapDeclare{cp1257}{B5}{00B5}% MICRO SIGN
+\SE@MapDeclare{cp1257}{B6}{00B6}% PILCROW SIGN
+\SE@MapDeclare{cp1257}{B7}{00B7}% MIDDLE DOT
+\SE@MapDeclare{cp1257}{B8}{00F8}% LATIN SMALL LETTER O WITH STROKE
+\SE@MapDeclare{cp1257}{B9}{00B9}% SUPERSCRIPT ONE
+\SE@MapDeclare{cp1257}{BA}{0157}% LATIN SMALL LETTER R WITH CEDILLA
+\SE@MapDeclare{cp1257}{BB}{00BB}% RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\SE@MapDeclare{cp1257}{BC}{00BC}% VULGAR FRACTION ONE QUARTER
+\SE@MapDeclare{cp1257}{BD}{00BD}% VULGAR FRACTION ONE HALF
+\SE@MapDeclare{cp1257}{BE}{00BE}% VULGAR FRACTION THREE QUARTERS
+\SE@MapDeclare{cp1257}{BF}{00E6}% LATIN SMALL LETTER AE
+\SE@MapDeclare{cp1257}{C0}{0104}% LATIN CAPITAL LETTER A WITH OGONEK
+\SE@MapDeclare{cp1257}{C1}{012E}% LATIN CAPITAL LETTER I WITH OGONEK
+\SE@MapDeclare{cp1257}{C2}{0100}% LATIN CAPITAL LETTER A WITH MACRON
+\SE@MapDeclare{cp1257}{C3}{0106}% LATIN CAPITAL LETTER C WITH ACUTE
+\SE@MapDeclare{cp1257}{C4}{00C4}% LATIN CAPITAL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp1257}{C5}{00C5}% LATIN CAPITAL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp1257}{C6}{0118}% LATIN CAPITAL LETTER E WITH OGONEK
+\SE@MapDeclare{cp1257}{C7}{0112}% LATIN CAPITAL LETTER E WITH MACRON
+\SE@MapDeclare{cp1257}{C8}{010C}% LATIN CAPITAL LETTER C WITH CARON
+\SE@MapDeclare{cp1257}{C9}{00C9}% LATIN CAPITAL LETTER E WITH ACUTE
+\SE@MapDeclare{cp1257}{CA}{0179}% LATIN CAPITAL LETTER Z WITH ACUTE
+\SE@MapDeclare{cp1257}{CB}{0116}% LATIN CAPITAL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{cp1257}{CC}{0122}% LATIN CAPITAL LETTER G WITH CEDILLA
+\SE@MapDeclare{cp1257}{CD}{0136}% LATIN CAPITAL LETTER K WITH CEDILLA
+\SE@MapDeclare{cp1257}{CE}{012A}% LATIN CAPITAL LETTER I WITH MACRON
+\SE@MapDeclare{cp1257}{CF}{013B}% LATIN CAPITAL LETTER L WITH CEDILLA
+\SE@MapDeclare{cp1257}{D0}{0160}% LATIN CAPITAL LETTER S WITH CARON
+\SE@MapDeclare{cp1257}{D1}{0143}% LATIN CAPITAL LETTER N WITH ACUTE
+\SE@MapDeclare{cp1257}{D2}{0145}% LATIN CAPITAL LETTER N WITH CEDILLA
+\SE@MapDeclare{cp1257}{D3}{00D3}% LATIN CAPITAL LETTER O WITH ACUTE
+\SE@MapDeclare{cp1257}{D4}{014C}% LATIN CAPITAL LETTER O WITH MACRON
+\SE@MapDeclare{cp1257}{D5}{00D5}% LATIN CAPITAL LETTER O WITH TILDE
+\SE@MapDeclare{cp1257}{D6}{00D6}% LATIN CAPITAL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp1257}{D7}{00D7}% MULTIPLICATION SIGN
+\SE@MapDeclare{cp1257}{D8}{0172}% LATIN CAPITAL LETTER U WITH OGONEK
+\SE@MapDeclare{cp1257}{D9}{0141}% LATIN CAPITAL LETTER L WITH STROKE
+\SE@MapDeclare{cp1257}{DA}{015A}% LATIN CAPITAL LETTER S WITH ACUTE
+\SE@MapDeclare{cp1257}{DB}{016A}% LATIN CAPITAL LETTER U WITH MACRON
+\SE@MapDeclare{cp1257}{DC}{00DC}% LATIN CAPITAL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp1257}{DD}{017B}% LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{cp1257}{DE}{017D}% LATIN CAPITAL LETTER Z WITH CARON
+\SE@MapDeclare{cp1257}{DF}{00DF}% LATIN SMALL LETTER SHARP S
+\SE@MapDeclare{cp1257}{E0}{0105}% LATIN SMALL LETTER A WITH OGONEK
+\SE@MapDeclare{cp1257}{E1}{012F}% LATIN SMALL LETTER I WITH OGONEK
+\SE@MapDeclare{cp1257}{E2}{0101}% LATIN SMALL LETTER A WITH MACRON
+\SE@MapDeclare{cp1257}{E3}{0107}% LATIN SMALL LETTER C WITH ACUTE
+\SE@MapDeclare{cp1257}{E4}{00E4}% LATIN SMALL LETTER A WITH DIAERESIS
+\SE@MapDeclare{cp1257}{E5}{00E5}% LATIN SMALL LETTER A WITH RING ABOVE
+\SE@MapDeclare{cp1257}{E6}{0119}% LATIN SMALL LETTER E WITH OGONEK
+\SE@MapDeclare{cp1257}{E7}{0113}% LATIN SMALL LETTER E WITH MACRON
+\SE@MapDeclare{cp1257}{E8}{010D}% LATIN SMALL LETTER C WITH CARON
+\SE@MapDeclare{cp1257}{E9}{00E9}% LATIN SMALL LETTER E WITH ACUTE
+\SE@MapDeclare{cp1257}{EA}{017A}% LATIN SMALL LETTER Z WITH ACUTE
+\SE@MapDeclare{cp1257}{EB}{0117}% LATIN SMALL LETTER E WITH DOT ABOVE
+\SE@MapDeclare{cp1257}{EC}{0123}% LATIN SMALL LETTER G WITH CEDILLA
+\SE@MapDeclare{cp1257}{ED}{0137}% LATIN SMALL LETTER K WITH CEDILLA
+\SE@MapDeclare{cp1257}{EE}{012B}% LATIN SMALL LETTER I WITH MACRON
+\SE@MapDeclare{cp1257}{EF}{013C}% LATIN SMALL LETTER L WITH CEDILLA
+\SE@MapDeclare{cp1257}{F0}{0161}% LATIN SMALL LETTER S WITH CARON
+\SE@MapDeclare{cp1257}{F1}{0144}% LATIN SMALL LETTER N WITH ACUTE
+\SE@MapDeclare{cp1257}{F2}{0146}% LATIN SMALL LETTER N WITH CEDILLA
+\SE@MapDeclare{cp1257}{F3}{00F3}% LATIN SMALL LETTER O WITH ACUTE
+\SE@MapDeclare{cp1257}{F4}{014D}% LATIN SMALL LETTER O WITH MACRON
+\SE@MapDeclare{cp1257}{F5}{00F5}% LATIN SMALL LETTER O WITH TILDE
+\SE@MapDeclare{cp1257}{F6}{00F6}% LATIN SMALL LETTER O WITH DIAERESIS
+\SE@MapDeclare{cp1257}{F7}{00F7}% DIVISION SIGN
+\SE@MapDeclare{cp1257}{F8}{0173}% LATIN SMALL LETTER U WITH OGONEK
+\SE@MapDeclare{cp1257}{F9}{0142}% LATIN SMALL LETTER L WITH STROKE
+\SE@MapDeclare{cp1257}{FA}{015B}% LATIN SMALL LETTER S WITH ACUTE
+\SE@MapDeclare{cp1257}{FB}{016B}% LATIN SMALL LETTER U WITH MACRON
+\SE@MapDeclare{cp1257}{FC}{00FC}% LATIN SMALL LETTER U WITH DIAERESIS
+\SE@MapDeclare{cp1257}{FD}{017C}% LATIN SMALL LETTER Z WITH DOT ABOVE
+\SE@MapDeclare{cp1257}{FE}{017E}% LATIN SMALL LETTER Z WITH CARON
+\SE@MapDeclare{cp1257}{FF}{02D9}% DOT ABOVE
+%</cp1257>
+% \end{macrocode}
+% \endgroup
+%
+% \section{Test}
+%
+% \subsection{Catcode checks for loading}
+%
+% \begin{macrocode}
+%<*test1>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{minimal}
+\makeatletter
+
+\newcommand*{\RestoreCatcodes}{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@\@ne
+\repeat
+
+\newcommand*{\RangeCatcodeInvalid}[2]{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@\@ne
+ \repeat
+}
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\[=12 %
+ \catcode`\]=12 %
+ \catcode`\%=14 %
+ \catcode`\ =10 %
+ \catcode13=5 %
+ \usepackage{stringenc}[2016/05/16]%
+ \RestoreCatcodes
+}
+\Test
+
+\ifx\numexpr\relax
+ \expandafter\@@end
+\fi
+
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\def\Test#1{%
+ \begin{qstest}{loading}{loading}%
+% \RangeCatcodeInvalid{0}{47}%
+% % 0-9
+% \RangeCatcodeInvalid{58}{64}%
+% % A-Z
+% \RangeCatcodeInvalid{91}{96}%
+% % a-z
+% \RangeCatcodeInvalid{123}{255}%
+ \setbox0=\hbox{%
+ \def\par{p}%
+ \RangeCatcodeInvalid{0}{255}%
+ \StringEncodingLoad{#1}%
+ }%
+ \Expect*{\the\wd0}{0.0pt}%
+ \end{qstest}%
+}
+\@for\x:=\StringEncodingList\do{%
+ \Test\x
+}
+\@@end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+% \subsection{Conversion tests}
+%
+% \begin{macrocode}
+%<*test2>
+% \end{macrocode}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{minimal}
+
+\ifx\plainmode Y
+ \let\SavedNumexpr\numexpr
+ \let\numexpr\relax
+\fi
+\usepackage{stringenc}[2016/05/16]
+\ifx\plainmode Y
+ \let\numexpr\SavedNumexpr
+\fi
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\def\Test#1#2#3#4#5{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\TestTest{#1}{#2}{#3}{#4}#5||\noexpand\NIL
+ }%
+ \x
+}
+\def\TestTest#1#2#3#4#5|#6|#7\NIL{%
+ \begin{qstest}{encodings}{encodings, conversion}%
+ \setbox0=\hbox{%
+ \def\par{p}%
+ \EdefUnescapeHex\IN{#4}%
+ \StringEncodingConvert\RESULT\IN{#1}{#2}%
+ \EdefEscapeHex\RESULT\RESULT
+ \Expect*{\RESULT}*{#5#6}%
+ \Expect*{\StringEncodingSuccessFailure{true}{false}}{#3}%
+ \StringEncodingSuccessFailure{}{%
+ \StringEncodingConvertTest\RESULT\IN{#1}{#2}{%
+ }{%
+ \EdefEscapeHex\RESULT\RESULT
+ \Expect*{\RESULT}{#5}%
+ }%
+ }%
+ }%
+ \Expect*{\the\wd0}{0.0pt}%
+ \end{qstest}%
+}
+
+\def\AllBytesLow{%
+ 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F%
+ 202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F%
+ 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F%
+ 606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F%
+}
+\def\AllBytesHigh{%
+ 808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F%
+ A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
+ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
+ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
+}
+\def\AllBytes{%
+ \AllBytesLow
+ \AllBytesHigh
+}
+\def\AllUnicodesLow{%
+ 0000000100020003000400050006000700080009000A000B000C000D000E000F%
+ 0010001100120013001400150016001700180019001A001B001C001D001E001F%
+ 0020002100220023002400250026002700280029002A002B002C002D002E002F%
+ 0030003100320033003400350036003700380039003A003B003C003D003E003F%
+ 0040004100420043004400450046004700480049004A004B004C004D004E004F%
+ 0050005100520053005400550056005700580059005A005B005C005D005E005F%
+ 0060006100620063006400650066006700680069006A006B006C006D006E006F%
+ 0070007100720073007400750076007700780079007A007B007C007D007E007F%
+}
+% \end{macrocode}
+%
+% \subsubsection{UTF8/16/32 encodings}
+%
+% \begin{macrocode}
+\Test{utf16be}{utf16be}{true}%
+ {004D04304E8CD800DF02}%
+ {004D04304E8CD800DF02}%
+\Test{utf16}{utf16be}{true}%
+ {004D04304E8CD800DF02}%
+ {004D04304E8CD800DF02}%
+\Test{utf16be}{utf16}{true}%
+ {004D04304E8CD800DF02}%
+ {004D04304E8CD800DF02}%
+\Test{utf16}{utf16}{true}%
+ {004D04304E8CD800DF02}%
+ {004D04304E8CD800DF02}%
+\Test{utf16}{utf16}{true}%
+ {FEFF004D04304E8CD800DF02}%
+ {004D04304E8CD800DF02}%
+\Test{utf16}{utf16}{true}%
+ {FFFE4D0030048C4E00D802DF}%
+ {004D04304E8CD800DF02}%
+\Test{utf16be}{utf32be}{true}%
+ {004D04304E8CD800DF02}%
+ {0000004D0000043000004E8C00010302}%
+\Test{utf16be}{utf32le}{true}%
+ {004D04304E8CD800DF02}%
+ {4D000000300400008C4E000002030100}%
+\Test{utf32be}{utf16}{true}%
+ {0000004D0000043000004E8C00010302}%
+ {004D04304E8CD800DF02}%
+\Test{utf32le}{utf16}{true}%
+ {4D000000300400008C4E000002030100}%
+ {004D04304E8CD800DF02}%
+\Test{utf32}{utf16}{true}%
+ {0000004D0000043000004E8C00010302}%
+ {004D04304E8CD800DF02}%
+\Test{utf32}{utf16}{true}%
+ {0000FEFF0000004D0000043000004E8C00010302}%
+ {004D04304E8CD800DF02}%
+\Test{utf32}{utf16}{true}%
+ {FFFE00004D000000300400008C4E000002030100}%
+ {004D04304E8CD800DF02}%
+\Test{utf32be}{utf16be}{false}{FFFFFFFF}{}
+\Test{utf32be}{utf16be}{false}{0000004DFFFFFFFF}{004D}
+\Test{utf32be}{utf16be}{false}{FFFFFFFF0000004D}{|004D}
+\Test{utf32be}{utf16be}{false}{0000004DFFFFFFFF00000430}{004D|0430}
+\Test{utf32be}{utf16be}{false}{FFFFFFFF0000004DFFFFFFFF}{|004D}
+\Test{utf32be}{utf16be}{false}{FFFFFF}{}
+\Test{utf32be}{utf16be}{false}{0000004DFFFFFF}{004D}
+\Test{utf32be}{utf16be}{false}{FFFFFF0000004D}{}
+\Test{utf32be}{utf16be}{false}{0000004DFFFFFF00000430}{004D}
+\Test{utf32be}{utf16be}{false}{FFFFFF0000004DFFFFFF}{|4DFF}
+\Test{utf32be}{utf16be}{false}{FFFF}{}
+\Test{utf32be}{utf16be}{false}{0000004DFFFF}{004D}
+\Test{utf32be}{utf16be}{false}{FFFF0000004D}{}
+\Test{utf32be}{utf16be}{false}{0000004DFFFF00000430}{004D}
+\Test{utf32be}{utf16be}{false}{FF}{}
+\Test{utf32be}{utf16be}{false}{0000004DFF}{004D}
+\Test{utf32be}{utf16be}{false}{FF0000004D}{}
+\Test{utf32be}{utf16be}{false}{0000004DFF00000430}{004D}
+\Test{utf16be}{utf32be}{true}{DBBFDFFF}{000FFFFF}
+\Test{utf16be}{utf8}{true}%
+ {004D04304E8CD800DF02}%
+ {4DD0B0E4BA8CF0908C82}%
+\Test{utf32}{utf8}{true}%
+ {000000000000007F000000800000FFFF000100000010FFFF}%
+ {007FC280EFBFBFF0908080F48FBFBF}%
+\Test{utf8}{utf16}{true}%
+ {007FC280EFBFBFF0908080F48FBFBF}%
+ {0000007F0080FFFFD800DC00DBFFDFFF}%
+\Test{utf16}{utf32}{true}%
+ {0000007F0080FFFFD800DC00DBFFDFFF}%
+ {000000000000007F000000800000FFFF000100000010FFFF}%
+\Test{utf8}{utf32}{true}%
+ {007FC280EFBFBFF0908080F48FBFBF}%
+ {000000000000007F000000800000FFFF000100000010FFFF}%
+\Test{utf8}{utf16}{false}{64F57F}{|0064007F}
+\Test{utf8}{utf16}{false}{64FE7F}{|0064007F}
+\Test{utf8}{utf16}{false}{64FF7F}{|0064007F}
+\Test{utf8}{utf16}{false}{80}{}
+\Test{utf8}{utf16}{false}{7F807F}{007F|007F}
+\Test{utf8}{utf16}{false}{C0}{}
+\Test{utf8}{utf16}{false}{7FC07F}{|007F007F}
+\Test{utf8}{utf16}{false}{C1}{}
+\Test{utf8}{utf16}{false}{7FC17F}{|007F007F}
+\Test{utf8}{utf16}{false}{C080}{}
+\Test{utf8}{utf16}{false}{C2}{}
+\Test{utf8}{utf16}{false}{C2CF}{}
+\Test{utf8}{utf16}{false}{12C27F}{0012|007F}
+\Test{utf8}{utf16}{true}{C280}{0080}
+\Test{utf8}{utf16}{true}{DFBF}{07FF}
+\Test{utf8}{utf16}{false}{E0}{}
+\Test{utf8}{utf16}{false}{E07F}{|007F}
+\Test{utf8}{utf16}{false}{E0A0}{}
+\Test{utf8}{utf16}{false}{E0A07F}{|007F}
+\Test{utf8}{utf16}{false}{E08080}{}
+\Test{utf8}{utf16}{false}{E080807F}{|007F}
+\Test{utf8}{utf16}{true}{ED8080}{D000}
+\Test{utf8}{utf16}{true}{ED9FBF}{D7FF}
+\Test{utf8}{utf16}{true}{EE8080}{E000}
+\Test{utf8}{utf16}{true}{EFBFBF}{FFFF}
+\Test{utf8}{utf32}{false}{F0}{}
+\Test{utf8}{utf32}{false}{F07F}{|0000007F}
+\Test{utf8}{utf32}{false}{F090}{}
+\Test{utf8}{utf32}{false}{F0907F}{|0000007F}
+\Test{utf8}{utf32}{false}{F09080}{}
+\Test{utf8}{utf32}{false}{F090807F}{|0000007F}
+\Test{utf8}{utf32}{true}{F0908080}{00010000}
+\Test{utf8}{utf32}{false}{F0808080}{}
+\Test{utf8}{utf32}{false}{F08080807F}{|0000007F}
+\Test{utf8}{utf32}{true}{F1808080}{00040000}
+\Test{utf8}{utf32}{true}{F3BFBFBF}{000FFFFF}
+\Test{utf8}{utf32}{true}{F4808080}{00100000}
+\Test{utf8}{utf32}{true}{F48FBFBF}{0010FFFF}
+\Test{utf8}{utf32}{false}{F4BFBFBF}{}
+\Test{utf8}{utf32}{false}{F4BFBFBF7F}{|0000007F}
+\Test{utf16be}{utf8}{true}{0000}{00}
+\Test{utf16be}{utf8}{true}{007F}{7F}
+\Test{utf16be}{utf8}{true}{0080}{C280}
+\Test{utf16be}{utf8}{true}{07FF}{DFBF}
+\Test{utf16be}{utf8}{true}{0800}{E0A080}
+\Test{utf16be}{utf8}{true}{0FFF}{E0BFBF}
+\Test{utf16be}{utf8}{true}{1000}{E18080}
+\Test{utf16be}{utf8}{true}{CFFF}{ECBFBF}
+\Test{utf16be}{utf8}{true}{D000}{ED8080}
+\Test{utf16be}{utf8}{true}{D7FF}{ED9FBF}
+\Test{utf16be}{utf8}{false}{D800}{}
+\Test{utf16be}{utf8}{false}{DFFF}{}
+\Test{utf16be}{utf8}{true}{E000}{EE8080}
+\Test{utf16be}{utf8}{true}{FFFF}{EFBFBF}
+\Test{utf32be}{utf8}{true}{00010000}{F0908080}
+\Test{utf32be}{utf8}{true}{0003FFFF}{F0BFBFBF}
+\Test{utf32be}{utf8}{true}{00040000}{F1808080}
+\Test{utf32be}{utf8}{true}{000FFFFF}{F3BFBFBF}
+\Test{utf32be}{utf8}{true}{00100000}{F4808080}
+\Test{utf32be}{utf8}{true}{0010FFFF}{F48FBFBF}
+\Test{utf32be}{utf8}{false}{00110000}{}
+\Test{utf32be}{utf8}{false}{001100000000007F}{|7F}
+% \end{macrocode}
+%
+% \subsubsection{ASCII}
+%
+% \begin{macrocode}
+\Test{ascii}{utf8}{true}{007F}{007F}
+\Test{ascii}{utf8}{false}{80}{}
+\Test{ascii}{utf8}{false}{80}{}
+\Test{ascii}{utf8}{false}{807F}{|7F}
+\Test{utf16be}{ascii}{true}{0000007F}{007F}
+\Test{utf16be}{ascii}{false}{0080}{}
+\Test{utf16be}{ascii}{false}{0430}{}
+\Test{utf16be}{ascii}{false}{D800DF02}{}
+\Test{utf16be}{ascii}{false}{D800DF02007F}{|7F}
+\Test{ascii}{utf16be}{true}\AllBytesLow\AllUnicodesLow
+\Test{utf16be}{ascii}{true}\AllUnicodesLow\AllBytesLow
+% \end{macrocode}
+%
+% \subsubsection{PDFDocEncoding}
+%
+% \begin{macrocode}
+\def\pdfdocSlots{%
+ 090A0D18191A1B1C1D1E1F%
+ 202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F%
+ 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F%
+ 606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E%
+ 808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E%
+ A0A1A2A3A4A5A6A7A8A9AAABACAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
+ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
+ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
+}
+\def\pdfdocUnicodes{%
+ 0009000A000D02D802C702C602D902DD02DB02DA02DC%
+ 0020002100220023002400250026002700280029002A002B002C002D002E002F%
+ 0030003100320033003400350036003700380039003A003B003C003D003E003F%
+ 0040004100420043004400450046004700480049004A004B004C004D004E004F%
+ 0050005100520053005400550056005700580059005A005B005C005D005E005F%
+ 0060006100620063006400650066006700680069006A006B006C006D006E006F%
+ 0070007100720073007400750076007700780079007A007B007C007D007E%
+ 202220202021202620142013019220442039203A22122030201E201C201D2018%
+ 2019201A2122FB01FB020141015201600178017D0131014201530161017E%
+ 20AC00A100A200A300A400A500A600A700A800A900AA00AB00AC00AE00AF%
+ 00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF%
+ 00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF%
+ 00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF%
+ 00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF%
+ 00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF%
+}
+\Test{pdfdoc}{utf16be}{false}%
+ {0001020304050607080B0C0E0F10111213141516177F9FAD}%
+ {}%
+\Test{pdfdoc}{utf16be}{true}\pdfdocSlots\pdfdocUnicodes
+\Test{pdfdoc}{utf16be}{false}\AllBytes{|\pdfdocUnicodes}%
+\Test{utf16be}{pdfdoc}{true}\pdfdocUnicodes\pdfdocSlots
+\Test{utf16be}{pdfdoc}{true}{FEFF0054006500730074}{54657374}
+% \end{macrocode}
+%
+% \subsubsection{ISO-8859-1}
+%
+% \begin{macrocode}
+\Test{iso-8859-1}{utf16be}{true}{007FA0FF}{0000007F00A000FF}
+\Test{iso-8859-1}{utf16be}{false}{80}{}
+\Test{iso-8859-1}{utf16be}{false}{807F}{|007F}
+\Test{iso-8859-1}{utf16be}{false}{9F}{}
+\Test{iso-8859-1}{utf16be}{false}{9F7F}{|007F}
+% \end{macrocode}
+%
+% \subsubsection{CP1252}
+%
+% \begin{macrocode}
+\def\Slots{%
+ \AllBytesLow
+ 8082838485868788898A8B8C8E9192939495969798999A9B9C9E9F%
+ A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
+ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
+ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
+}
+\def\Unicodes{%
+ \AllUnicodesLow
+ 20AC201A0192201E20262020202102C62030016020390152017D%
+ 20182019201C201D20222013201402DC21220161203A0153017E0178%
+ 00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF%
+ 00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF%
+ 00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF%
+ 00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF%
+ 00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF%
+ 00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF%
+}
+\Test{cp1252}{utf16be}{false}{818D8F909D}{}
+\Test{cp1252}{utf16be}{true}\Slots\Unicodes
+\Test{utf16be}{cp1252}{true}\Unicodes\Slots
+% \end{macrocode}
+%
+% \subsubsection{KOI8-R}
+%
+% \begin{macrocode}
+\def\Slots{%
+ \AllBytesLow
+ 808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F%
+ A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
+ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
+ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
+}
+\def\Unicodes{%
+ \AllUnicodesLow
+ 25002502250C251025142518251C2524252C2534253C258025842588258C2590%
+ 259125922593232025A02219221A22482264226500A0232100B000B200B700F7%
+ 25502551255204512553255425552556255725582559255A255B255C255D255E%
+ 255F25602561040125622563256425652566256725682569256A256B256C00A9%
+ 044E0430043104460434043504440433044504380439043A043B043C043D043E%
+ 043F044F044004410442044304360432044C044B04370448044D04490447044A%
+ 042E0410041104260414041504240413042504180419041A041B041C041D041E%
+ 041F042F042004210422042304160412042C042B04170428042D04290427042A%
+}
+\Test{koi8-r}{utf16be}{true}\Slots\Unicodes
+\Test{utf16be}{koi8-r}{true}\Unicodes\Slots
+% \end{macrocode}
+%
+% \subsubsection{DEC-MCS}
+%
+% \begin{macrocode}
+\def\Slots{%
+ \AllBytesLow
+ A1A2A3A5A7A8A9AAABB0B1B2B3B5B6B7B9BABBBCBDBF%
+ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD1D2D3D4D5D6D7D8D9DADBDCDDDF%
+ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF1F2F3F4F5F6F7F8F9FAFBFCFD%
+}
+\def\Unicodes{%
+ \AllUnicodesLow
+ 00A100A200A300A500A700A400A900AA00AB%
+ 00B000B100B200B300B500B600B700B900BA00BB00BC00BD00BF%
+ 00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF%
+ 00D100D200D300D400D500D6015200D800D900DA00DB00DC017800DF%
+ 00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF%
+ 00F100F200F300F400F500F6015300F800F900FA00FB00FC00FF%
+}
+\Test{dec-mcs}{utf16be}{true}\Slots\Unicodes
+\Test{dec-mcs}{utf16be}{false}{C0BEC2}{00C0|00C2}
+\Test{utf16be}{dec-mcs}{true}\Unicodes\Slots
+% \end{macrocode}
+%
+% \subsection{Removal of byte order marks}
+%
+% \begin{macrocode}
+\Test{utf16be}{utf16be}{true}{FEFF}{}
+\Test{utf16be}{utf16be}{true}{FFFE}{FFFE}
+\Test{utf16le}{utf16le}{true}{FFFE}{}
+\Test{utf16le}{utf16le}{true}{FEFF}{FEFF}
+\Test{utf32be}{utf32be}{true}{0000FEFF}{}
+\Test{utf32be}{utf32be}{true}{0000FFFE}{0000FFFE}
+\Test{utf32le}{utf32le}{true}{FFFE0000}{}
+\Test{utf32le}{utf32le}{true}{FEFF0000}{FEFF0000}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\csname @@end\endcsname
+% \end{macrocode}
+% \begin{macrocode}
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/stringenc}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/stringenc.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/stringenc.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[\CTAN{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 stringenc.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@{}}
+% stringenc.sty & tex/generic/oberdiek/stringenc.sty\\
+% se-utf32be.def & tex/generic/oberdiek/se-utf32be.def\\
+% se-utf32le.def & tex/generic/oberdiek/se-utf32le.def\\
+% se-utf8.def & tex/generic/oberdiek/se-utf8.def\\
+% se-utf16le.def & tex/generic/oberdiek/se-utf16le.def\\
+% se-pdfdoc.def & tex/generic/oberdiek/se-pdfdoc.def\\
+% se-iso-8859-1.def & tex/generic/oberdiek/se-iso-8859-1.def\\
+% se-cp1252.def & tex/generic/oberdiek/se-cp1252.def\\
+% se-ascii.def & tex/generic/oberdiek/se-ascii.def\\
+% se-ascii-print.def & tex/generic/oberdiek/se-ascii-print.def\\
+% se-clean7bit.def & tex/generic/oberdiek/se-clean7bit.def\\
+% se-iso-8859-2.def & tex/generic/oberdiek/se-iso-8859-2.def\\
+% se-iso-8859-3.def & tex/generic/oberdiek/se-iso-8859-3.def\\
+% se-iso-8859-4.def & tex/generic/oberdiek/se-iso-8859-4.def\\
+% se-iso-8859-5.def & tex/generic/oberdiek/se-iso-8859-5.def\\
+% se-iso-8859-6.def & tex/generic/oberdiek/se-iso-8859-6.def\\
+% se-iso-8859-7.def & tex/generic/oberdiek/se-iso-8859-7.def\\
+% se-iso-8859-8.def & tex/generic/oberdiek/se-iso-8859-8.def\\
+% se-iso-8859-9.def & tex/generic/oberdiek/se-iso-8859-9.def\\
+% se-iso-8859-10.def & tex/generic/oberdiek/se-iso-8859-10.def\\
+% se-iso-8859-11.def & tex/generic/oberdiek/se-iso-8859-11.def\\
+% se-iso-8859-13.def & tex/generic/oberdiek/se-iso-8859-13.def\\
+% se-iso-8859-14.def & tex/generic/oberdiek/se-iso-8859-14.def\\
+% se-iso-8859-15.def & tex/generic/oberdiek/se-iso-8859-15.def\\
+% se-iso-8859-16.def & tex/generic/oberdiek/se-iso-8859-16.def\\
+% se-koi8-r.def & tex/generic/oberdiek/se-koi8-r.def\\
+% se-nextstep.def & tex/generic/oberdiek/se-nextstep.def\\
+% se-mac-centeuro.def & tex/generic/oberdiek/se-mac-centeuro.def\\
+% se-mac-cyrillic.def & tex/generic/oberdiek/se-mac-cyrillic.def\\
+% se-mac-roman.def & tex/generic/oberdiek/se-mac-roman.def\\
+% se-dec-mcs.def & tex/generic/oberdiek/se-dec-mcs.def\\
+% se-cp437.def & tex/generic/oberdiek/se-cp437.def\\
+% se-cp850.def & tex/generic/oberdiek/se-cp850.def\\
+% se-cp852.def & tex/generic/oberdiek/se-cp852.def\\
+% se-cp855.def & tex/generic/oberdiek/se-cp855.def\\
+% se-cp858.def & tex/generic/oberdiek/se-cp858.def\\
+% se-cp865.def & tex/generic/oberdiek/se-cp865.def\\
+% se-cp866.def & tex/generic/oberdiek/se-cp866.def\\
+% se-cp1250.def & tex/generic/oberdiek/se-cp1250.def\\
+% se-cp1251.def & tex/generic/oberdiek/se-cp1251.def\\
+% se-cp1257.def & tex/generic/oberdiek/se-cp1257.def\\
+% stringenc.pdf & doc/latex/oberdiek/stringenc.pdf\\
+% test/stringenc-test1.tex & doc/latex/oberdiek/test/stringenc-test1.tex\\
+% test/stringenc-test2.tex & doc/latex/oberdiek/test/stringenc-test2.tex\\
+% stringenc.dtx & source/latex/oberdiek/stringenc.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk stringenc.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{stringenc.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 stringenc.dtx
+%makeindex -s gind.ist stringenc.idx
+%pdflatex stringenc.dtx
+%makeindex -s gind.ist stringenc.idx
+%pdflatex stringenc.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{stringenc.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='stringenc'>
+ <name>stringenc</name>
+ <caption>Converting a string between different encodings.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.11'/>
+ <description>
+ This package provides <tt>\StringEncodingConvert</tt> for converting
+ a string between different encodings.
+ Both <xref refid='latex'>LaTeX</xref> and
+ <xref refid='plain'>plain-TeX</xref> are supported.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/stringenc.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/stringenc.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/06/14 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2007/06/16 v1.1}
+% \item
+% \cs{StringEncodingConvertTest} added.
+% \item
+% Fixes for cp850, cp852, nextstep.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.2}
+% \item
+% Uses \cs{EdefSanitize} instead of \cs{PE@sanitize}
+% from package \xpackage{pdfescape} (2007/08/27 v1.5).
+% \end{Version}
+% \begin{Version}{2007/10/22 v1.3}
+% \item
+% \cs{StringEncodingList} added.
+% \item
+% Safer encoding file loading by ensuring all used catcodes.
+% \end{Version}
+% \begin{Version}{2007/11/11 v1.4}
+% \item
+% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+% \end{Version}
+% \begin{Version}{2007/11/25 v1.5}
+% \item
+% Bug in use of \cs{pdf@filesize} fixed, bug introduced in previous version.
+% \end{Version}
+% \begin{Version}{2008/10/27 v1.6}
+% \item
+% Supported encoding list in documentation fixed.
+% \end{Version}
+% \begin{Version}{2009/12/15 v1.7}
+% \item
+% Encoding \xoption{clean7bit} added.
+% \item
+% Encoding \xoption{ascii-print} added.
+% \end{Version}
+% \begin{Version}{2010/03/01 v1.8}
+% \item
+% Compatibility with \iniTeX.
+% \item
+% Use of package \xpackage{ltxcmds}.
+% \end{Version}
+% \begin{Version}{2011/07/26 v1.9}
+% \item
+% Documentation: \xoption{pdfdoc} added in encoding list.
+% \end{Version}
+% \begin{Version}{2011/12/02 v1.10}
+% \item
+% Small improvement for \cs{SE@Nibble@NumToBin} and
+% \cs{SE@Nibble@NumToHex} if \hologo{eTeX} is not available
+% (thanks Bruno Le Floch).
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.11}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/stringenc.pdf b/macros/latex/contrib/oberdiek/stringenc.pdf
new file mode 100644
index 0000000000..fe3a514a3a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/stringenc.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/tabularht.dtx b/macros/latex/contrib/oberdiek/tabularht.dtx
new file mode 100644
index 0000000000..3ea8cc4933
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/tabularht.dtx
@@ -0,0 +1,1267 @@
+% \iffalse meta-comment
+%
+% File: tabularht.dtx
+% Version: 2016/05/16 v2.6
+% Info: Tabular with height specified
+%
+% Copyright (C) 2005-2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file tabularht.dtx
+% and the derived files
+% tabularht.sty, tabularht.pdf, tabularht.ins, tabularht.drv,
+% tabularht-example1.tex, tabularht-example2.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/tabularht.dtx
+% CTAN:macros/latex/contrib/oberdiek/tabularht.pdf
+%
+% Unpacking:
+% (a) If tabularht.ins is present:
+% tex tabularht.ins
+% (b) Without tabularht.ins:
+% tex tabularht.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{tabularht.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If tabularht.drv is present:
+% latex tabularht.drv
+% (b) Without tabularht.drv:
+% latex tabularht.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 tabularht.dtx
+% makeindex -s gind.ist tabularht.idx
+% pdflatex tabularht.dtx
+% makeindex -s gind.ist tabularht.idx
+% pdflatex tabularht.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/tabularht.sty
+% TDS:doc/latex/oberdiek/tabularht.pdf
+% TDS:doc/latex/oberdiek/tabularht-example1.tex
+% TDS:doc/latex/oberdiek/tabularht-example2.tex
+% TDS:source/latex/oberdiek/tabularht.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: tabularht 2016/05/16 v2.6 Tabular with height specified (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: tabularht
+Version: 2016/05/16 v2.6
+
+Copyright (C) 2005-2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file tabularht.dtx
+and the derived files
+ tabularht.sty, tabularht.pdf, tabularht.ins, tabularht.drv,
+ tabularht-example1.tex, tabularht-example2.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{tabularht.ins}{\from{tabularht.dtx}{install}}%
+ \file{tabularht.drv}{\from{tabularht.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{tabularht.sty}{\from{tabularht.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{tabularht-example1.tex}{\from{tabularht.dtx}{example1}}%
+ \file{tabularht-example2.tex}{\from{tabularht.dtx}{example2}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{tabularht.xml}{\from{tabularht.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{* tabularht.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `tabularht.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{tabularht.drv}%
+ [2016/05/16 v2.6 Tabular with height specified (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{tabularht.dtx}%
+\end{document}
+%</driver>
+% \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{tabularht.drv}
+%
+% \title{The \xpackage{tabularht} package}
+% \date{2016/05/16 v2.6}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package defines some environments that adds
+% a height specification to tabular and array.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \begin{quote}
+% |\usepackage{tabularht}|
+% \end{quote}
+% The package provides the following environments
+% that extend the tabular/array environment by
+% a height specification as first argument:
+% \begin{itemize}
+% \item |tabularht|, |tabularht*|
+% \item |arrayht|
+% \item |tabularhtx|
+% (if package \xpackage{tabularx} is loaded)
+% \end{itemize}
+% The height argument allows a length specification,
+% package \xpackage{calc} is supported if used. This means,
+% the tabular will have the specified height.
+% You can also use the prefixes |to=| and |spread=|.
+% |to=| is the default, |spread=| means, the natural
+% height of the tabular box is changed by the length
+% after |spread=|.
+%
+% Examples:
+% \begin{quote}
+% \begin{tabular}{@{}l@{ $\rightarrow$ }l@{}}
+% |\begin{tabularht}{1in}|
+% & height is 1in\\
+% |\begin{tabularht}{to=1in}|
+% & height is 1in\\
+% |\begin{tabularht}{spread=0pt}|
+% & natural height, same as |\begin{tabular}|\\
+% |\begin{tabularht}{spread=1in}|
+% & natural height increased by 1in
+% \end{tabular}
+% \end{quote}
+%
+% Hint: See also package \xpackage{tabularkv}, it provides an interface,
+% where most parameters for the environments can be given
+% by key-value pairs.
+%
+% \begin{declcs}{interrowspace}\,|{|\dots|}|
+% \end{declcs}
+% Adds space between table rows. It is essentially
+% the same as |\noalign{\vspace{...}}|.
+% \begin{declcs}{interrowfill}
+% \end{declcs}
+% Short for |\interrowspace{\fill}|
+% \begin{declcs}{interrowstart}\,\dots\,\cs{interrowstop}
+% \end{declcs}
+% Marker commands, useful for option \xoption{vlines}.
+%
+% \subsection{Option \xoption{vlines}}
+%
+% Warning: This stuff is experimental.
+%
+% \vspace{2ex}
+% \noindent
+% Vertical lines are interrupted, if space is inserted
+% in \cs{noalign}, \cs{interrowspace}, \cs{addlinespace}
+% (\xpackage{booktabs}),
+% between double \cs{hline}s. This option tries to detect
+% and add the vertical lines. The lines in a tabular
+% with \xpackage{tabularht} support (environments of this package)
+% are numbered from left to right. The gap that is
+% controlled by \cs{interrowspace} or inbetween \cs{interrowstart}
+% and \cs{interrowstop} is then filled with the detected
+% vertical lines.
+%
+% If only a limited selection of the lines should be
+% drawn, the commands know an optional argument with a
+% list of line numbers, e.g.
+% \begin{quote}
+%\begin{verbatim}
+%\begin{tabularht}{50mm}{|l|l|}
+% Hello & World\\
+% \interrowfill[1,3]
+% Foo & Bar
+%\end{tabularht}
+%\end{verbatim}
+% \end{quote}
+% There are three lines, but the middle line is not drawn
+% in the gap between the first and second row.
+% Zero can be used to suppress all lines:
+% \begin{quote}
+% |\interrowspace[0]{10mm}|
+% \end{quote}
+% The syntax of the commands with the optional argument
+% with the line number list \meta{list}. \meta{list} is a comma
+% separated list of numbers, \meta{height} means the
+% height specification described above with the optional
+% prefixes |to=| or |spread=|.
+% \begin{quote}
+% \cs{interrowspace}\,|[|\meta{list}|]|\,|{|\meta{height}|}|\\
+% \cs{interrowfill}\,|[|\meta{list}|]|\\
+% \cs{interrowstart}\,|[|\meta{list}|]|\,\dots\,\cs{interrowstop}
+% \end{quote}
+%
+% Option \xoption{vlines} is driver dependent and uses \eTeX\ features.
+% \begin{description}
+% \item[\xoption{pdftex}:] \pdfTeX\ in PDF mode.
+% Here the positions of the lines are written with the
+% help of the \cs{pdfsavepos} feature into the \xfile{.aux} file(s).
+% Therefore you need two LaTeX runs to get the lines.
+% \item[\xoption{dvips}:]
+% Here, PostScript's currentpoint it used to get
+% the line positions. The lines are then drawn at the end
+% of the page. Thus one \LaTeX/dvips run is sufficient
+% for this option.
+% \item[Other drivers:]\mbox{}
+% \begin{description}
+% \item[PostScript drivers:] probably possible, an end of page
+% hook would be nice.
+% \item[\VTeX:] with GeX (PostScript interpreter) probably possible.
+% \item[dvipdfm:] no idea. The big problem is, how to get the
+% current position?
+% \end{description}
+% \end{description}
+%
+% \subsection{Limitations}
+%
+% \begin{itemize}
+% \item
+% Vertical lines are interrupted by |\noalign{\vfill}|.
+% \end{itemize}
+%
+% \subsection{Compatibility}
+%
+% \begin{itemize}
+% \item
+% \xpackage{array}, \xpackage{delarray}, \xpackage{tabularx}
+% are supported.
+% \item There can be problems with packages that
+% redefine \cs{@array} (or \cs{@@array}, \cs{@tabarray}) and
+% \cs{@arrayrule} (for option \xoption{vlines}).
+% \item \xpackage{colortbl}: it should at least work, but there isn't
+% support for filling the gaps with color, neither
+% the rules nor the backgrounds.
+% \end{itemize}
+%
+% \subsection{Examples}
+%
+% \subsubsection{Example 1}
+%
+% \begin{macrocode}
+%<*example1>
+\documentclass{article}
+\usepackage{tabularht}
+
+\begin{document}
+\fbox{%
+ \begin{tabularht*}{1in}{4in}{@{}l@{\extracolsep{\fill}}r@{}}%
+ upper left corner & upper right corner\\%
+ \noalign{\vfill}%
+ \multicolumn{2}{@{}c@{}}{bounding box}\\%
+ \noalign{\vfill}%
+ lower left corner & lower right corner\\%
+ \end{tabularht*}%
+}
+\end{document}
+%</example1>
+% \end{macrocode}
+%
+% \subsubsection{Example 2}
+%
+% \begin{macrocode}
+%<*example2>
+\documentclass{article}
+\usepackage{booktabs}
+\usepackage[dvips,vlines]{tabularht}
+
+\begin{document}
+
+\begin{tabularht}{spread=0pt}{|l|l|}
+ \hline
+ First&Line\\%
+ \hline
+\interrowstart
+ \addlinespace[10mm]%
+\interrowstop
+ \hline
+ Second&Line\\%
+\interrowstart
+ \hline
+ \hline
+\interrowstop
+ Third&Line\\%
+ \hline
+\interrowspace{10mm}
+ \hline
+ Fourth&Line\\%
+ \hline
+\end{tabularht}
+
+\end{document}
+%</example2>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tabularht}%
+ [2016/05/16 v2.6 Tabular with height specified (HO)]
+% \end{macrocode}
+%
+% \subsection{Environments}
+%
+% \begin{macrocode}
+\let\@toarrayheight\@empty
+\let\tabH@array@init\@empty
+
+\toks@={%
+ \begingroup
+ \long\def\x#1\vcenter\fi\fi\bgroup#2\@sharp#3#4\@nil{%
+ \endgroup
+ \gdef\@array[##1]##2{%
+ \tabH@array@init
+ #1%
+ \vcenter\fi\fi
+ \@toarrayheight
+ \bgroup
+ \let\@toarrayheight\@empty
+ #2\@sharp###3#4%
+ }%
+ }%
+ \expandafter\x\@array[#1]{#2}\@nil % hash-ok
+}
+\edef\tabH@patch@array{\the\toks@}
+\def\tabH@patch@@array{%
+ \ifx\@array\@@array
+ \def\reserved@a{\let\@@array\@array}%
+ \else
+ \let\reserved@a\relax
+ \fi
+ \tabH@patch@array
+ \reserved@a
+}
+\tabH@patch@@array
+
+\@ifpackageloaded{array}{}{%
+ \AtBeginDocument{%
+ \@ifpackageloaded{array}{%
+ \tabH@patch@@array
+ }{}%
+ }%
+}
+
+\def\tabH@setheight#1{%
+ \tabH@@setheight#1==\@nil
+}
+\def\tabH@@setheight#1=#2=#3\@nil{%
+ \ifx\\#2#3\\%
+ \setlength{\dimen@}{#1}%
+ \edef\@toarrayheight{to\the\dimen@}%
+ \else
+ \edef\tabH@temp{\zap@space#1 \@empty}%
+ \ifx\tabH@temp\tabH@to
+ \else
+ \ifx\tabH@temp\tabH@spread
+ \else
+ \PackageError{tabularht}{%
+ Unknown height specifier %
+ `\expandafter\strip@prefix\meaning\tabH@temp'%
+ }{%
+ The height dimension for tabular height can be prefixed%
+ \MessageBreak
+ with `to=' or `spread=', default is `to='.%
+ }%
+ \let\tabH@temp\tabH@to
+ \fi
+ \fi
+ \setlength{\dimen@}{#2}%
+ \edef\@toarrayheight{\tabH@temp\the\dimen@}%
+ \fi
+}
+\def\tabH@to{to}
+\def\tabH@spread{spread}
+% \end{macrocode}
+% First argument is the height of the table,
+% then the orignal arguments for tabular follow.
+% \begin{macrocode}
+\newenvironment{tabularht}[1]{%
+ \tabH@setheight{#1}%
+ \tabular
+}{%
+ \endtabular
+}
+
+\newenvironment{tabularht*}[1]{%
+ \tabH@setheight{#1}%
+ \@nameuse{tabular*}%
+}{%
+ \@nameuse{endtabular*}%
+}
+
+\newenvironment{tabularhtx}[1]{%
+ \tabH@setheight{#1}%
+ \tabularx
+}{%
+ \endtabularx
+}
+
+\newenvironment{arrayht}[1]{%
+ \tabH@setheight{#1}%
+ \array
+}{%
+ \endarray
+}
+
+\def\interrowspace{%
+ \noalign\bgroup
+ \tabH@interrowspace
+}
+\newcommand*{\tabH@interrowspace}[2][]{%
+ \tabH@vspace{#1}{#2}%
+ \egroup
+}
+\def\interrowfill{%
+ \noalign\bgroup
+ \tabH@interrowfill
+}
+\newcommand*{\tabH@interrowfill}[1][]{%
+ \tabH@vspace{#1}{\fill}%
+ \egroup
+}
+\def\tabH@vspace#1#2{%
+ \tabH@vspace@start{#1}%
+ \vspace{#2}%
+ \tabH@vspace@stop
+}
+\let\tabH@vspace@start\@gobble
+\let\tabH@vspace@stop\@empty
+
+\newcommand*{\interrowstart}{%
+ \noalign\bgroup
+ \tabH@interrowstart
+}
+\newcommand*{\tabH@interrowstart}[1][]{%
+ \tabH@vspace@start{#1}%
+ \egroup
+}
+\newcommand*{\interrowstop}{%
+ \noalign{\tabH@vspace@stop}%
+}
+% \end{macrocode}
+%
+% \subsection{Options}
+%
+% \begin{macrocode}
+\providecommand*{\tabH@driver}{}
+
+\DeclareOption{vlines}{%
+ \let\tabH@temp\relax
+}
+\DeclareOption{pdftex}{}
+\DeclareOption{dvips}{%
+ \def\tabH@driver{dvips}%
+}
+\ProcessOptions*\relax
+
+\ifx\tabH@temp\relax
+\else
+ \expandafter\endinput
+\fi
+
+\begingroup
+ \@ifundefined{eTeXversion}{%
+ \PackageError{tabularht}{%
+ Option `vlines' requires eTeX%
+ }{%
+ Use of eTeX is recommended for LaTeX, see ltnews16.%
+ }%
+ \endgroup
+ \endinput
+ }{}%
+\endgroup
+% \end{macrocode}
+%
+% \subsection{Option vlines, driver independent stuff}
+%
+% \begin{macrocode}
+\begingroup
+ \let\@addtoreset\@gobbletwo
+ \newcounter{tabH@unique}%
+\endgroup
+\let\tabH@currenttab\@empty
+
+\def\tabH@array@init{%
+ \ifx\@toarrayheight\@empty
+ % ignore vertical lines of nested tabular environments
+ \let\tabH@currenttab\@empty
+ \else
+ \stepcounter{tabH@unique}%
+ \edef\tabH@currenttab{\the\c@tabH@unique}%
+ \fi
+}
+
+\renewcommand*{\@arrayrule}{%
+ \@addtopreamble{%
+ \hskip -.5\arrayrulewidth
+ \ifx\tabH@currenttab\@empty
+ \else
+ \tabH@vrule{\tabH@currenttab}%
+ \fi
+ \begingroup
+ \expandafter\ifx\csname CT@arc@\endcsname\relax
+ \else
+ \expandafter\CT@arc@
+ \fi
+ \vline
+ \endgroup
+ \hskip -.5\arrayrulewidth
+ }%
+}
+\let\tabH@arrayrule\@arrayrule
+\AtBeginDocument{%
+ \@ifpackageloaded{colortbl}{%
+ \let\@arrayrule\tabH@arrayrule
+ }{}%
+}
+
+\let\tabH@vrule\@gobble
+% \end{macrocode}
+%
+% \subsection{Driver pdftex}
+%
+% \begin{macrocode}
+\RequirePackage{ifpdf}
+\ifpdf
+ \begingroup
+ \@ifundefined{pdfsavepos}{%
+ \PackageError{tabularht}{%
+ Your pdfTeX is too old%
+ }{%
+ \string\pdfsavepos\space is missing.%
+ }%
+ \endgroup
+ \csname fi\endcsname
+ \endinput
+ }{}%
+
+ \let\on@line\@empty
+ \PackageInfo{tabularht}{%
+ Using driver `pdftex' because of pdfTeX in PDF mode%
+ }%
+ \endgroup
+
+ \protected\def\tabH@vrule#1{%
+ \if@filesw
+ \pdfsavepos
+ \protected@write\@auxout{%
+ \let\tabH@lastxpos\relax
+ }{%
+ \tabH@aux@vrule{#1}{\tabH@lastxpos}%
+ }%
+ \fi
+ }%
+
+ \def\tabH@lastxpos{\the\pdflastxpos}%
+ \def\tabH@lastypos{\the\pdflastypos}%
+
+ % The .aux file contains three commands:
+ % \tabH@aux@vrule{tabular id}{x position}
+ % \tabH@aux@vstart{tabular id}{row id}{x position}{y position}
+ % \tabH@aux@vstop{y position}
+ %
+ \AtBeginDocument{%
+ % The .aux files are read the first time before
+ % \AtBeginDocument and later at \end{document}.
+ % \tabH@aux@done is a marker to distinguish
+ % between these two readings. Only in the first
+ % case we need the \tabH@aux@... commands.
+ \let\tabH@aux@done\@empty
+ \if@filesw
+ \immediate\write\@mainaux{%
+ \@percentchar\@percentchar BeginProlog: tabularht%
+ }%
+ % items in the aux file are executed,
+ % if tabularht is loaded
+ % and during the aux file read at \begin{document} only
+ \immediate\write\@mainaux{%
+ \detokenize{%
+ % the \tabH@aux@... commands are needed only if
+ % tabularht is loaded with driver pdftex.
+ \@ifundefined{tabH@aux@vrule}\@secondoftwo\@firstofone
+ {%
+ % disable commands except for the first .aux files reading
+ \@ifundefined{tabH@aux@done}\@gobble\@firstofone
+ }%
+ {%
+ \let\tabH@aux@vrule\@gobbletwo
+ \let\tabH@aux@vstart\@gobblefour
+ \let\tabH@aux@vstop\@gobble
+ }%
+ }%
+ }%
+ \immediate\write\@mainaux{%
+ \@percentchar\@percentchar EndProlog: tabularht%
+ }%
+ \fi
+ }%
+
+ % the x positions of vrules are stored in
+ % \tabH@<tabcount>list with distinct values
+ \protected\def\tabH@aux@vrule#1#2{%
+ \@ifundefined{tabH@#1list}{%
+ \expandafter\xdef\csname tabH@#1list\endcsname{%
+ \noexpand\do{#2}%
+ }%
+ }{%
+ \begingroup
+ \def\x{#2}%
+ \let\y\@undefined
+ \let\do\tabH@do@add
+ \expandafter\xdef\csname tabH@#1list\endcsname{%
+ \csname tabH@#1list\endcsname\@empty
+ \ifx\y\@undefined
+ \noexpand\do{\x}%
+ \fi
+ }%
+ \endgroup
+ }%
+ }%
+ \def\tabH@do@add#1{%
+ \ifx\y\@undefined
+ \ifnum#1<\x\space
+ \else
+ \expandafter\ifx\csname y\endcsname\relax\fi
+ \ifnum#1>\x\space
+ \noexpand\do{\x}%
+ \fi
+ \fi
+ \fi
+ \noexpand\do{#1}%
+ }%
+
+ \def\tabH@vspace@start#1{%
+ \if@filesw
+ \stepcounter{tabH@unique}%
+ \edef\tabH@currentrow{\the\c@tabH@unique}%
+ \pdfsavepos
+ \protected@write\@auxout{%
+ \let\tabH@lastxpos\relax
+ \let\tabH@lastypos\relax
+ }{%
+ \tabH@aux@vstart{\tabH@currenttab}{\tabH@currentrow}%
+ {\tabH@lastxpos}{\tabH@lastypos}%
+ }%
+ \fi
+ \begingroup
+ \edef\a{tabH@\tabH@currenttab row\tabH@currentrow}%
+ \expandafter\let\expandafter\x\csname\a x\endcsname
+ \ifx\x\relax
+ \else
+ \expandafter\let\expandafter\y\csname\a y\endcsname
+ \expandafter\let\expandafter\l
+ \csname tabH@\tabH@currenttab list\endcsname
+ \ifx\l\relax
+ \else
+ \def\f{#1}%
+ \ifx\f\@empty
+ \let\do\tabH@do@set
+ \else
+ \count@=\z@
+ \let\do\tabH@do@filter
+ \fi
+ \setbox\z@=\hbox{\l}%
+ \wd\z@=\z@
+ \dp\z@=\z@
+ \copy\z@
+ \fi
+ \fi
+ \endgroup
+ }%
+ \def\tabH@vspace@stop{%
+ \if@filesw
+ \pdfsavepos
+ \protected@write\@auxout{%
+ \let\tabH@lastypos\relax
+ }{%
+ \tabH@aux@vstop{\tabH@lastypos}%
+ }%
+ \fi
+ }%
+ \def\tabH@do@set#1{%
+ \hbox to \z@{%
+ \hskip \dimexpr #1sp - \x sp\relax
+ \vrule \@width\arrayrulewidth
+ \@depth\dimexpr \y sp\relax
+ \hss
+ }%
+ }%
+ \def\tabH@do@filter{%
+ \@tempswafalse
+ \advance\count@\@ne
+ \@for\e:=\f\do{%
+ \ifnum\e=\count@
+ \@tempswatrue
+ \fi
+ }%
+ \if@tempswa
+ \expandafter\tabH@do@set
+ \else
+ \expandafter\@gobble
+ \fi
+ }%
+
+ \protected\def\tabH@aux@vstart#1#2#3#4{%
+ \def\tabH@current@vstart{{#1}{#2}{#3}{#4}}%
+ }%
+ \protected\def\tabH@aux@vstop{%
+ \expandafter\tabH@aux@v\tabH@current@vstart
+ }%
+ \def\tabH@aux@v#1#2#3#4#5{%
+ \expandafter\gdef\csname tabH@#1row#2x\endcsname{#3}%
+ \expandafter\xdef\csname tabH@#1row#2y\endcsname{%
+ \the\numexpr #4 - #5\relax
+ }%
+ }%
+
+ \csname fi\endcsname
+ \endinput
+
+\fi
+% \end{macrocode}
+%
+% \subsection{DVI drivers}
+%
+% \begin{macrocode}
+\ifx\tabH@driver\@empty
+ \PackageError{tabularht}{%
+ Missing DVI driver, option `vlines' disabled%
+ }{%
+ Supported DVI drivers: dvips.%
+ }%
+ \expandafter\endinput
+\fi
+
+\def\tabH@driver@dvips{%
+ \def\tabH@literalps##1{\special{ps:SDict begin ##1 end}}%
+ \def\tabH@headerps##1{\special{! ##1}}%
+}
+
+\@onelevel@sanitize\tabH@driver
+\@ifundefined{tabH@driver@\tabH@driver}{%
+ \PackageError{tabularht}{%
+ Unsupported driver `\tabH@driver'%
+ }{%
+ Supported DVI drivers: dvips.%
+ }%
+ \endinput
+}{}
+
+\begingroup
+ \let\on@line\@empty
+ \PackageInfo{tabularht}{%
+ Using driver `\tabH@driver'%
+ }%
+\endgroup
+\csname tabH@driver@\tabH@driver\endcsname
+
+\protected\def\tabH@vrule#1#2\vrule#3\arrayrulewidth{%
+ #2% \fi or empty
+ % hack to get rid of maxdrift rounding of dvips,
+ % thus simulate a large motion
+ \kern1in\relax
+ \tabH@literalps{%
+ #1 tabH.vrule %
+ Resolution neg 0 translate%
+ }%
+ \vrule#3\arrayrulewidth
+ \tabH@literalps{Resolution 0 translate}%
+ \kern-1in\relax
+}
+
+\def\tabH@vspace@start#1{%
+ \begingroup
+ \let\y\@empty
+ \@for\x:=#1\do{%
+ \ifx\y\@empty
+ \edef\y{\x}%
+ \else
+ \edef\y{\y\space\x}%
+ \fi
+ }%
+ \tabH@literalps{\tabH@currenttab[\y]currentpoint exch pop}%
+ \endgroup
+}
+\def\tabH@vspace@stop{%
+ \tabH@literalps{%
+ currentpoint exch pop %
+ \number\dimexpr\arrayrulewidth\relax\space
+ tabH.vspace%
+ }%
+}
+
+\tabH@headerps{%
+ userdict begin%
+ /tabH.list 10 dict def%
+ /tabH.job [] def %
+ end%
+ /tabH.vrule{%
+ 10 string cvs cvn dup tabH.list exch known{%
+ tabH.list exch dup [ exch tabH.list exch get %
+ currentpoint pop round exch true exch{%
+ % tabH.list key [ ... x true i
+ % tabH.list key [ ... false i
+ exch{%
+ % ... [ ... x i
+ 2 copy lt{false}{%
+ 2 copy eq{pop false}{exch true}ifelse%
+ }ifelse%
+ }{false}ifelse%
+ }forall %
+ pop%
+ ]put%
+ }{%
+ tabH.list exch[currentpoint pop round]put%
+ }ifelse%
+ }bind def%
+ % <tab num> <cols array> <ytop> <ybottom> <rulewidth[sp]>
+ /tabH.vspace{%
+ userdict begin %
+ 10 dict dup begin %
+ exch 65536 div Resolution mul 72.27 div %
+ % dvips uses a poor man's ceil function
+ % see dopage.c before "drawrule": (int)(... + 0.9999999)
+ 0.9999999 add truncate%
+ /rulewidth exch def %
+ exch/ybottom exch def %
+ exch/ytop exch def %
+ exch/cols exch def %
+ exch/tabkey exch 10 string cvs cvn def %
+ end%
+ /tabH.job exch[exch userdict/tabH.job get aload pop]def %
+ end%
+ }bind def %
+ % Now we do the work at the end of the page.
+ % Unhappily "eop-hook" cannot be used, because "eop"
+ % executes "restore" before, so that all data are lost.
+ TeXDict begin%
+ /eop%
+ [%
+ {%
+ tabH.job{%
+ begin%
+ /colarray %
+ tabH.list tabkey known{tabH.list tabkey get}{[]}ifelse %
+ def %
+ cols length 0 eq not{%
+ /colarray[%
+ cols{1 sub %
+ dup 0 lt{pop}{%
+ dup colarray length ge{pop}{%
+ colarray exch get%
+ }ifelse%
+ }ifelse%
+ }forall%
+ ]def%
+ }if %
+ colarray{%
+ % (rulewidth) == rulewidth == % debug
+ Resolution sub %
+ ytop rulewidth ytop ybottom sub v%
+ }forall %
+ end%
+ }forall%
+ % tabH.list{== ==}forall % debug
+ }bind aload pop %
+ TeXDict /eop get aload pop%
+ ]cvx def %
+ end%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/tabularht}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/tabularht.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/tabularht.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[\CTAN{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 tabularht.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@{}}
+% tabularht.sty & tex/latex/oberdiek/tabularht.sty\\
+% tabularht.pdf & doc/latex/oberdiek/tabularht.pdf\\
+% tabularht-example1.tex & doc/latex/oberdiek/tabularht-example1.tex\\
+% tabularht-example2.tex & doc/latex/oberdiek/tabularht-example2.tex\\
+% tabularht.dtx & source/latex/oberdiek/tabularht.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk tabularht.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{tabularht.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 tabularht.dtx
+%makeindex -s gind.ist tabularht.idx
+%pdflatex tabularht.dtx
+%makeindex -s gind.ist tabularht.idx
+%pdflatex tabularht.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{tabularht.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='tabularht'>
+ <name>tabularht</name>
+ <caption>Tabular environments with height specified.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2005-2007'/>
+ <license type='lppl1.3'/>
+ <version number='2.6'/>
+ <description>
+ The tabularht package defines some environments that add a height
+ specification to tabular and array environments. The default set
+ of new environments take a value for their height in the first
+ argument: defined environments are: <tt>tabularht</tt>,
+ <tt>tabularht*</tt> and <tt>arrayht</tt>. If package
+ <xref refid='tabularx'>tabularx</xref> is also loaded,
+ the package also defines environments <tt>tabularxht</tt> and
+ <tt>tabularxht*</tt>.
+ <p/>
+ The places where stretching is to happen are signalled by<br/>
+ <tt>\noalign{\vfill}</tt><br/>
+ immediately after the <tt>\\</tt> that ends a row of the table or
+ array.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/tabularht.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/tabularht.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2005/09/22 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2005/10/16 v2.0}
+% \item
+% Height specification allows
+% |to=...| or |spread=...|, default is |to=|.
+% \item
+% Option \xoption{vlines} added,
+% drivers \xoption{pdftex} and \xoption{dvips}.
+% \item
+% \cs{interrowspace}, \cs{interrowfil}, and
+% \cs{interrowstart}\dots\cs{interrowstop} added.
+% \end{Version}
+% \begin{Version}{2005/10/18 v2.1}
+% \item
+% Fix for package \xpackage{colortbl}, but the colors
+% of \xpackage{colortbl} remain unsupported.
+% \end{Version}
+% \begin{Version}{2006/02/20 v2.2}
+% \item
+% Code is not changed.
+% \item
+% DTX framework.
+% \end{Version}
+% \begin{Version}{2006/12/22 v2.3}
+% \item
+% Documentation fix.
+% \item
+% Fix in code of option vlines.
+% \end{Version}
+% \begin{Version}{2007/03/21 v2.4}
+% \item
+% Fix: Counter |tabh@unique| must not be changed by \cs{include}.
+% \end{Version}
+% \begin{Version}{2007/04/11 v2.5}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2016/05/16 v2.6}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/tabularht.pdf b/macros/latex/contrib/oberdiek/tabularht.pdf
new file mode 100644
index 0000000000..735e232943
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/tabularht.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/tabularkv.dtx b/macros/latex/contrib/oberdiek/tabularkv.dtx
new file mode 100644
index 0000000000..6cb6f979a1
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/tabularkv.dtx
@@ -0,0 +1,547 @@
+% \iffalse meta-comment
+%
+% File: tabularkv.dtx
+% Version: 2016/05/16 v1.2
+% Info: Tabular with key value interface
+%
+% Copyright (C) 2005, 2006 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file tabularkv.dtx
+% and the derived files
+% tabularkv.sty, tabularkv.pdf, tabularkv.ins, tabularkv.drv,
+% tabularkv-example.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/tabularkv.dtx
+% CTAN:macros/latex/contrib/oberdiek/tabularkv.pdf
+%
+% Unpacking:
+% (a) If tabularkv.ins is present:
+% tex tabularkv.ins
+% (b) Without tabularkv.ins:
+% tex tabularkv.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{tabularkv.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If tabularkv.drv is present:
+% latex tabularkv.drv
+% (b) Without tabularkv.drv:
+% latex tabularkv.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 tabularkv.dtx
+% makeindex -s gind.ist tabularkv.idx
+% pdflatex tabularkv.dtx
+% makeindex -s gind.ist tabularkv.idx
+% pdflatex tabularkv.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/tabularkv.sty
+% TDS:doc/latex/oberdiek/tabularkv.pdf
+% TDS:doc/latex/oberdiek/tabularkv-example.tex
+% TDS:source/latex/oberdiek/tabularkv.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: tabularkv 2016/05/16 v1.2 Tabular with key value interface (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: tabularkv
+Version: 2016/05/16 v1.2
+
+Copyright (C) 2005, 2006 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file tabularkv.dtx
+and the derived files
+ tabularkv.sty, tabularkv.pdf, tabularkv.ins, tabularkv.drv,
+ tabularkv-example.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{tabularkv.ins}{\from{tabularkv.dtx}{install}}%
+ \file{tabularkv.drv}{\from{tabularkv.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{tabularkv.sty}{\from{tabularkv.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{tabularkv-example.tex}{\from{tabularkv.dtx}{example}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{tabularkv.xml}{\from{tabularkv.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{* tabularkv.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `tabularkv.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{tabularkv.drv}%
+ [2016/05/16 v1.2 Tabular with key value interface (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{tabularkv.dtx}%
+\end{document}
+%</driver>
+% \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{tabularkv.drv}
+%
+% \title{The \xpackage{tabularkv} package}
+% \date{2016/05/16 v1.2}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package adds a key value interface for tabular
+% by the new environment \texttt{tabularkv}. Thus the
+% \TeX\ source code looks better by named parameters,
+% especially if package \xpackage{tabularht} is used.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+% \begin{quote}
+% |\usepackage{tabularkv}|
+% \end{quote}
+% The package provides the environment |tabularkv|
+% that takes an optional argument with tabular
+% parameters:
+% \begin{description}
+% \item[\texttt{width}:] width specification, "tabular*" is used.
+% \item[\texttt{x}:]
+% width specification, |tabularx| is used,
+% package \xpackage{tabularx} must be loaded.
+% \item[\texttt{height}:]
+% height specification, see package \xpackage{tabularht}.
+% \item[\texttt{valign}:] vertical positioning, this option is optional;\\
+% values: top, bottom, center.
+% \end{description}
+% Parameter \xoption{valign} optional, the following are
+% equivalent:
+% \begin{quote}
+% |\begin{tabularkv}[|\dots|, valign=top]{l}|\dots|\end{tabularkv}|\\
+% |\begin{tabularkv}[|\dots|][t]{l}|\dots|\end{tabularkv}|
+% \end{quote}
+%
+% \subsection{Example}
+%
+% \begin{macrocode}
+%<*example>
+\documentclass{article}
+\usepackage{tabularkv}
+
+\begin{document}
+\fbox{%
+ \begin{tabularkv}[
+ width=4in,
+ height=1in,
+ valign=center
+ ]{@{}l@{\extracolsep{\fill}}r@{}}
+ upper left corner & upper right corner\\
+ \noalign{\vfill}%
+ \multicolumn{2}{@{}c@{}}{bounding box}\\
+ \noalign{\vfill}%
+ lower left corner & lower right corner\\
+ \end{tabularkv}%
+}
+\end{document}
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Package identification.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tabularkv}%
+ [2016/05/16 v1.2 Tabular with key value interface (HO)]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{keyval}
+\RequirePackage{tabularht}
+
+\let\tabKV@star@x\@empty
+\let\tabKV@width\@empty
+\let\tabKV@valign\@empty
+
+\define@key{tabKV}{height}{%
+ \setlength{\dimen@}{#1}%
+ \edef\@toarrayheight{to\the\dimen@}%
+}
+\define@key{tabKV}{width}{%
+ \def\tabKV@width{{#1}}%
+ \def\tabKV@star@x{*}%
+}
+\define@key{tabKV}{x}{%
+ \def\tabKV@width{{#1}}%
+ \def\tabKV@star@x{x}%
+}
+\define@key{tabKV}{valign}{%
+ \edef\tabKV@valign{[\@car #1c\@nil]}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newenvironment{tabularkv}[1][]{%
+ \setkeys{tabKV}{#1}%
+ \@nameuse{%
+ tabular\tabKV@star@x\expandafter\expandafter\expandafter
+ }%
+ \expandafter\tabKV@width\tabKV@valign
+}{%
+ \@nameuse{endtabular\tabKV@star@x}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/tabularkv}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/tabularkv.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/tabularkv.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[\CTAN{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 tabularkv.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@{}}
+% tabularkv.sty & tex/latex/oberdiek/tabularkv.sty\\
+% tabularkv.pdf & doc/latex/oberdiek/tabularkv.pdf\\
+% tabularkv-example.tex & doc/latex/oberdiek/tabularkv-example.tex\\
+% tabularkv.dtx & source/latex/oberdiek/tabularkv.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk tabularkv.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{tabularkv.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 tabularkv.dtx
+%makeindex -s gind.ist tabularkv.idx
+%pdflatex tabularkv.dtx
+%makeindex -s gind.ist tabularkv.idx
+%pdflatex tabularkv.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{tabularkv.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='tabularkv'>
+ <name>tabularkv</name>
+ <caption>Tabular environments with key-value interface.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2005,2006'/>
+ <license type='lppl1.3'/>
+ <version number='1.2'/>
+ <description>
+ The tabularkv package creates an environment <tt>tabularkv</tt>, whose
+ arguments are specified in key-value form. The arguments chosen
+ determine which other type of tabular is to be used (whether
+ standard LaTeX ones, or environments from the
+ <xref refid='tabularx'>tabularx</xref> or the
+ <xref refid='tabularht'>tabularx</xref> package).
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref> bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/tabularkv.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/tabularkv.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2005/09/22 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.1}
+% \item
+% DTX framework.
+% \item
+% Code is not changed.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.2}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/tabularkv.pdf b/macros/latex/contrib/oberdiek/tabularkv.pdf
new file mode 100644
index 0000000000..ddeccda367
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/tabularkv.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/telprint.dtx b/macros/latex/contrib/oberdiek/telprint.dtx
new file mode 100644
index 0000000000..eafd86c48a
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/telprint.dtx
@@ -0,0 +1,1028 @@
+% \iffalse meta-comment
+%
+% File: telprint.dtx
+% Version: 2016/05/16 v1.11
+% Info: Format German phone numbers
+%
+% Copyright (C) 1996, 1997, 2004-2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 telprint.dtx
+% and the derived files
+% telprint.sty, telprint.pdf, telprint.ins, telprint.drv,
+% telprint-test1.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/telprint.dtx
+% CTAN:macros/latex/contrib/oberdiek/telprint.pdf
+%
+% Unpacking:
+% (a) If telprint.ins is present:
+% tex telprint.ins
+% (b) Without telprint.ins:
+% tex telprint.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{telprint.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If telprint.drv is present:
+% latex telprint.drv
+% (b) Without telprint.drv:
+% latex telprint.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 telprint.dtx
+% makeindex -s gind.ist telprint.idx
+% pdflatex telprint.dtx
+% makeindex -s gind.ist telprint.idx
+% pdflatex telprint.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/telprint.sty
+% TDS:doc/latex/oberdiek/telprint.pdf
+% TDS:doc/latex/oberdiek/test/telprint-test1.tex
+% TDS:source/latex/oberdiek/telprint.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: telprint 2016/05/16 v1.11 Format German phone numbers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: telprint
+Version: 2016/05/16 v1.11
+
+Copyright (C) 1996, 1997, 2004-2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 telprint.dtx
+and the derived files
+ telprint.sty, telprint.pdf, telprint.ins, telprint.drv,
+ telprint-test1.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{telprint.ins}{\from{telprint.dtx}{install}}%
+ \file{telprint.drv}{\from{telprint.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{telprint.sty}{\from{telprint.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{telprint-test1.tex}{\from{telprint.dtx}{test1}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{telprint.xml}{\from{telprint.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{* telprint.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `telprint.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{telprint.drv}%
+ [2016/05/16 v1.11 Format German phone numbers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage[ngerman,english]{babel}
+\begin{document}
+ \DocInput{telprint.dtx}%
+\end{document}
+%</driver>
+% \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{telprint.drv}
+%
+% \title{The \xpackage{telprint} package}
+% \date{2016/05/16 v1.11}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{telprint} provides \cs{telprint} for formatting
+% German phone numbers.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% This is a very old package that I have written
+% to format phone numbers. It follows German
+% conventions and the documentation is mainly in German.
+%
+% \subsection{Short overview in English}
+%
+% \LaTeX:
+% \begin{quote}
+% |\usepackage{telprint}|\\
+% |\telprint{123/456-789}|\\
+% \end{quote}
+% \plainTeX:
+% \begin{quote}
+% |\input telprint.sty|\\
+% |\telprint{123/456-789}|
+% \end{quote}
+%
+% \DescribeMacro\telprint
+% |\telprint{...}| formats the explicitly given number.
+% Digits, spaces and some special characters
+% ('+', '/', '-', '(', ')', '\textasciitilde', ' ') are supported.
+% Numbers are divided into groups of two digits from the right.
+% Examples:
+% \begin{quote}
+% |\telprint{0761/12345} ==> 07\,61/1\,23\,45|\\
+% |\telprint{01234/567-89} ==> 0\,12\,34/5\,67\leavevmode\hbox{-}89|\\
+% |\telprint{+49 (6221) 297} ==> +49~(62\,21)~2\,97|
+% \end{quote}
+%
+% \subsubsection{Configuration}
+%
+% The output of the symbols can be configured by
+% \cs{telhyphen}, \cs{telslash}, \cs{telleftparen}, \cs{telrightparen},
+% \cs{telplus}, \cs{teltilde}.
+% Example:
+% \begin{quote}
+% |\telslash{\,/\,}\\|
+% |\telprint{12/34} ==> 12\,/\,34|
+% \end{quote}
+%
+% \DescribeMacro\telspace
+% \cs{telspace} configures the space between digit groups.
+%
+% \DescribeMacro\telnumber
+% \cs{telnumber} only formats a number in digit groups; special
+% characters are not recognized.
+%
+% \subsection{Documentation in German}
+%
+% \begin{otherlanguage*}{ngerman}
+% \hyphenation{To-ken-ma-kros}
+% \begin{itemize}
+% \item \DescribeMacro\telprint |telprint#1|\\
+% Der eigentliche Anwenderbefehl zur formatierten Ausgabe von
+% Telefonnummern. Diese d\"urfen dabei nur als Zahlen angegeben
+% werden(, da sie tokenweise analysiert werden).
+% Als Trenn- oder Sonderzeichen werden unterst\"utzt:
+% '+', '/', '-', '(', ')', '\textasciitilde', ' '
+% Einfache Leerzeichen werden erkannt und durch Tilden ersetzt, um
+% Trennungen in der Telefonnummer zu verhindern. (Man beachte aus
+% gleichem Grunde die \cs{hbox} bei '-'.)
+% Beispiele:
+% \begin{quote}
+% |\telprint{0761/12345} ==> 07\,61/1\,23\,45|\\
+% |\telprint{01234/567-89} ==> 0\,12\,34/5\,67\leavevmode\hbox{-}89|\\
+% |\telprint{+49 (6221) 297} ==> +49~(62\,21)~2\,97|
+% \end{quote}
+% \end{itemize}
+% Der Rest enth\"alt eher Technisches:
+% \begin{itemize}
+% \item \DescribeMacro\telspace |\telspace#1|\\
+% Mit diesem Befehl wird der Abstand zwischen den Zifferngruppen
+% angegeben (Default: |\,|).
+% (Durch |\telspace{}| kann dieser zusaetzliche Abstand abgestellt
+% werden.)
+% \item \DescribeMacro\telhyphen |\telhyphen#1|\\
+% Dieser Befehl gibt die Art des Bindestriches, wie er ausgegeben
+% werden soll. In der Eingabe darf jedoch nur der einfache
+% Bindestrich stehen:
+% |\telprint{123-45}|, jedoch NIE |\telprint{123--45}|!
+% Kopka-Bindestrich-Fans geben an:
+% |\telhyphen{\leavevmode\hbox{--}}|
+% \item
+% \DescribeMacro{\telslash}
+% \DescribeMacro{\telleftparen}
+% \DescribeMacro{\telrightparen}
+% \DescribeMacro{\telplus}
+% \DescribeMacro{\teltilde}
+% |\telslash#1|, |\telleftparen#1|, |\telrightparen#1|, |\telplus#1|,
+% |\teltilde|\\
+% Diese Befehle konfigurieren die Zeichen '/', '(', ')', '+'
+% und '\textasciitilde'. Sie funktionieren analog zu \cs{telhyphen}.
+% \item \DescribeMacro\telnumber |\telnumber#1|\\
+% Richtung interner Befehl: Er dient dazu, eine Zifferngruppe
+% in Zweiergruppen auszugeben.
+% Die einzelnen Zahlen werden im Tokenregister \cs{TELtoks}
+% gespeichert. Abwechselnd werden dabei zwischen zwei Token
+% (Zahlen) \cs{TELx} bzw. \cs{TELy} eingefuegt, abh\"angig von dem
+% wechselnden Wert von \cs{TELswitch}. Zum Schluss kann dann einfach
+% festgestellt werden ob die Nummer nun eine geradzahlige oder
+% ungeradzahlige Zahl von Ziffern aufwies. Dem entsprechend wird
+% \cs{TELx} mit dem Zusatzabstand belegt und \cs{TELy} leer definiert
+% oder umgekehrt. )
+% \item |\TEL...| interne Befehle, Technisches:\\
+% \cs{TELsplit} dient zur Aufteilung einer zusammengesetzten
+% Telefonnummer (Vorwahl, Hauptnummer, Nebenstelle). In dieser
+% Implementation werden als Trennzeichen nur '/' und '-' erkannt.
+% Die einzelnen Bestandteile wie Vorwahl werden dann dem Befehl
+% \cs{telnumber} zur Formatierung uebergeben.
+% \item Die Erkennung von einfachen Leerzeichen ist um einiges
+% schwieriger: Die Tokentrennung ueber Parameter |#1#2| funktioniert
+% nicht f\"ur einfache Leerzeichen, da TeX sie \emph{niemals} als
+% eigenst\"andige Argumente behandelt! (The TeXbook, Chapter 20,
+% p. 201)
+%
+% (Anmerkung am Rande: Deshalb funktionieren die entsprechenden
+% Tokenmakros auf S. 149 des Buches "`Einf\"uhrung in TeX"' von
+% N. Schwarz (3. Aufl.) nicht, wenn im Tokenregister als erstes
+% ein einfaches Leerzeichen steht!)
+% \end{itemize}
+% \end{otherlanguage*}
+%
+% \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@telprint.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{telprint}{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@telprint.sty\endcsname
+\ProvidesPackage{telprint}%
+ [2016/05/16 v1.11 Format German phone numbers (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 TELAtEnd\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\TELAtEnd{%
+ \TELAtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{36}{3}% $
+\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{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{126}{13}% ~ (active)
+\edef\TELAtEnd{\TELAtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Package macros}
+% \begin{macrocode}
+\ifx\DeclareRobustCommand\UnDeFiNeD
+ \def\DeclareRobustCommand*#1[1]{\def#1##1}%
+ \def\TELreset{\let\DeclareRobustCommand=\UnDeFiNeD}%
+ \input infwarerr.sty\relax
+ \@PackageInfo{telprint}{%
+ Macros are not robust!%
+ }%
+\else
+ \let\TELreset=\relax
+\fi
+% \end{macrocode}
+% \begin{macro}{\telspace}
+% \begin{macrocode}
+\DeclareRobustCommand*{\telspace}[1]{\def\TELspace{#1}}
+\telspace{{}$\,${}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\telhyphen}
+% \begin{macrocode}
+\DeclareRobustCommand*{\telhyphen}[1]{\def\TELhyphen{#1}}
+\telhyphen{\leavevmode\hbox{-}}% \hbox zur Verhinderung der Trennung
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\telslash}
+% \begin{macrocode}
+\DeclareRobustCommand*{\telslash}[1]{\def\TELslash{#1}}
+\telslash{/}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\telleftparen}
+% \begin{macrocode}
+\DeclareRobustCommand*{\telleftparen}[1]{\def\TELleftparen{#1}}
+\telleftparen{(}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\telrightparen}
+% \begin{macrocode}
+\DeclareRobustCommand*{\telrightparen}[1]{\def\TELrightparen{#1}}
+\telrightparen{)}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\telplus}
+% \begin{macrocode}
+\DeclareRobustCommand*{\telplus}[1]{\def\TELplus{#1}}
+\telplus{+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\teltilde}
+% \begin{macrocode}
+\DeclareRobustCommand*{\teltilde}[1]{\def\TELtilde{#1}}
+\teltilde{~}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TELtoks}
+% \begin{macrocode}
+\newtoks\TELtoks
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TELnumber}
+% \begin{macrocode}
+\def\TELnumber#1#2\TELnumberEND{%
+ \begingroup
+ \def\0{#2}%
+ \expandafter\endgroup
+ \ifx\0\empty
+ \TELtoks=\expandafter{\the\TELtoks#1}%
+ \ifnum\TELswitch=0 %
+ \def\TELx{\TELspace}\def\TELy{}%
+ \else
+ \def\TELx{}\def\TELy{\TELspace}%
+ \fi
+ \the\TELtoks
+ \else
+ \ifnum\TELswitch=0 %
+ \TELtoks=\expandafter{\the\TELtoks#1\TELx}%
+ \def\TELswitch{1}%
+ \else
+ \TELtoks=\expandafter{\the\TELtoks#1\TELy}%
+ \def\TELswitch{0}%
+ \fi
+ \TELnumber#2\TELnumberEND
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\telnumber}
+% \begin{macrocode}
+\DeclareRobustCommand*{\telnumber}[1]{%
+ \TELtoks={}%
+ \def\TELswitch{0}%
+ \TELnumber#1{}\TELnumberEND
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TELsplit}
+% \begin{macrocode}
+\def\TELsplit{\futurelet\TELfuture\TELdosplit}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TELdosplit}
+% \begin{macrocode}
+\def\TELdosplit#1#2\TELsplitEND
+{%
+ \def\TELsp{ }%
+ \expandafter\ifx\TELsp\TELfuture
+ \let\TELfuture=\relax
+ \expandafter\telnumber\expandafter{\the\TELtoks}~%
+ \telprint{#1#2}% Das Leerzeichen kann nicht #1 sein!
+ \else
+ \def\TELfirst{#1}%
+ \ifx\TELfirst\empty
+ \expandafter\telnumber\expandafter{\the\TELtoks}%
+ \TELtoks={}%
+ \else\if-\TELfirst
+ \expandafter\telnumber\expandafter{\the\TELtoks}\TELhyphen
+ \telprint{#2}%
+ \else\if/\TELfirst
+ \expandafter\telnumber\expandafter{\the\TELtoks}\TELslash
+ \telprint{#2}%
+ \else\if(\TELfirst
+ \expandafter\telnumber\expandafter{\the\TELtoks}\TELleftparen
+ \telprint{#2}%
+ \else\if)\TELfirst
+ \expandafter\telnumber\expandafter{\the\TELtoks}\TELrightparen
+ \telprint{#2}%
+ \else\if+\TELfirst
+ \expandafter\telnumber\expandafter{\the\TELtoks}\TELplus
+ \telprint{#2}%
+ \else\def\TELtemp{~}\ifx\TELtemp\TELfirst
+ \expandafter\telnumber\expandafter{\the\TELtoks}\TELtilde
+ \telprint{#2}%
+ \else
+ \TELtoks=\expandafter{\the\TELtoks#1}%
+ \TELsplit#2{}\TELsplitEND
+ \fi\fi\fi\fi\fi\fi\fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\telprint}
+% \begin{macrocode}
+\DeclareRobustCommand*{\telprint}[1]{%
+ \TELtoks={}%
+ \TELsplit#1{}\TELsplitEND
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\TELreset\let\TELreset=\UnDeFiNeD
+% \end{macrocode}
+%
+% \begin{macrocode}
+\TELAtEnd%
+%</package>
+% \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 telprint.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/telprint}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/telprint.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/telprint.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[\CTAN{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 telprint.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@{}}
+% telprint.sty & tex/generic/oberdiek/telprint.sty\\
+% telprint.pdf & doc/latex/oberdiek/telprint.pdf\\
+% test/telprint-test1.tex & doc/latex/oberdiek/test/telprint-test1.tex\\
+% telprint.dtx & source/latex/oberdiek/telprint.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk telprint.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{telprint.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 telprint.dtx
+%makeindex -s gind.ist telprint.idx
+%pdflatex telprint.dtx
+%makeindex -s gind.ist telprint.idx
+%pdflatex telprint.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{telprint.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='telprint'>
+ <name>telprint</name>
+ <caption>Format German phone numbers.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1996,1997,2004-2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.11'/>
+ <description>
+ The package provides a command <tt>\telprint</tt> for formatting
+ German telephone numbers.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/telprint.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/telprint.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1996/11/28 v1.0}
+% \item
+% Erste lauff\"ahige Version.
+% \item
+% Nur '-' und '/' als zul\"assige Sonderzeichen.
+% \end{Version}
+% \begin{Version}{1997/09/16 v1.1}
+% \item
+% Dokumentation und Kommentare (Posting in de.comp.text.tex).
+% \item
+% Erweiterung um Sonderzeichen '(', ')', '+', '\textasciitilde' und ' '.
+% \item
+% Trennungsverhinderung am 'hyphen'.
+% \end{Version}
+% \begin{Version}{1997/10/16 v1.2}
+% \item
+% Schutz vor wiederholtem Einlesen.
+% \item
+% Unter \LaTeXe\ Nutzung des \cs{DeclareRobustCommand}-Features.
+% \end{Version}
+% \begin{Version}{1997/12/09 v1.3}
+% \item
+% Tempor\"are Variable eingespart.
+% \item
+% Posted in newsgroup \xnewsgroup{de.comp.text.tex}:\\
+% \URL{``\link{Re: Generisches Markup f\"ur Telefonnummern?}''}^^A
+% {http://groups.google.com/group/de.comp.text.tex/msg/86b3a86140007309}
+% \end{Version}
+% \begin{Version}{2004/11/02 v1.4}
+% \item
+% Fehler in der Dokumentation korrigiert.
+% \end{Version}
+% \begin{Version}{2005/09/30 v1.5}
+% \item
+% Konfigurierbare Symbole: '/', '(', ')', '+' und '\textasciitilde'.
+% \end{Version}
+% \begin{Version}{2006/02/12 v1.6}
+% \item
+% LPPL 1.3.
+% \item
+% Kurze \"Ubersicht in Englisch.
+% \item
+% CTAN.
+% \end{Version}
+% \begin{Version}{2006/08/26 v1.7}
+% \item
+% New DTX framework.
+% \end{Version}
+% \begin{Version}{2007/04/11 v1.8}
+% \item
+% Line ends sanitized.
+% \end{Version}
+% \begin{Version}{2007/09/09 v1.9}
+% \item
+% Catcode section added.
+% \item
+% Missing docstrip tag added.
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.10}
+% \item
+% Code is not changed.
+% \item
+% URLs updated.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.11}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/telprint.pdf b/macros/latex/contrib/oberdiek/telprint.pdf
new file mode 100644
index 0000000000..ef672a83da
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/telprint.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/thepdfnumber.dtx b/macros/latex/contrib/oberdiek/thepdfnumber.dtx
new file mode 100644
index 0000000000..5567c51711
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/thepdfnumber.dtx
@@ -0,0 +1,1598 @@
+% \iffalse meta-comment
+%
+% File: thepdfnumber.dtx
+% Version: 2016/05/16 v1.1
+% Info: Print PDF numbers with minimal digits
+%
+% Copyright (C) 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 thepdfnumber.dtx
+% and the derived files
+% thepdfnumber.sty, thepdfnumber.pdf, thepdfnumber.ins, thepdfnumber.drv,
+% thepdfnumber-test1.tex, thepdfnumber-test2.tex,
+% thepdfnumber-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/thepdfnumber.dtx
+% CTAN:macros/latex/contrib/oberdiek/thepdfnumber.pdf
+%
+% Unpacking:
+% (a) If thepdfnumber.ins is present:
+% tex thepdfnumber.ins
+% (b) Without thepdfnumber.ins:
+% tex thepdfnumber.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{thepdfnumber.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If thepdfnumber.drv is present:
+% latex thepdfnumber.drv
+% (b) Without thepdfnumber.drv:
+% latex thepdfnumber.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 thepdfnumber.dtx
+% makeindex -s gind.ist thepdfnumber.idx
+% pdflatex thepdfnumber.dtx
+% makeindex -s gind.ist thepdfnumber.idx
+% pdflatex thepdfnumber.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/thepdfnumber.sty
+% TDS:doc/latex/oberdiek/thepdfnumber.pdf
+% TDS:doc/latex/oberdiek/test/thepdfnumber-test1.tex
+% TDS:doc/latex/oberdiek/test/thepdfnumber-test2.tex
+% TDS:doc/latex/oberdiek/test/thepdfnumber-test3.tex
+% TDS:source/latex/oberdiek/thepdfnumber.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: thepdfnumber 2016/05/16 v1.1 Print PDF numbers with minimal digits (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: thepdfnumber
+Version: 2016/05/16 v1.1
+
+Copyright (C) 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 thepdfnumber.dtx
+and the derived files
+ thepdfnumber.sty, thepdfnumber.pdf, thepdfnumber.ins, thepdfnumber.drv,
+ thepdfnumber-test1.tex, thepdfnumber-test2.tex,
+ thepdfnumber-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{thepdfnumber.ins}{\from{thepdfnumber.dtx}{install}}%
+ \file{thepdfnumber.drv}{\from{thepdfnumber.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{thepdfnumber.sty}{\from{thepdfnumber.dtx}{package}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{thepdfnumber-test1.tex}{\from{thepdfnumber.dtx}{test1}}%
+% \file{thepdfnumber-test2.tex}{\from{thepdfnumber.dtx}{test2}}%
+% \file{thepdfnumber-test3.tex}{\from{thepdfnumber.dtx}{test2,active}}%
+}
+
+\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{* thepdfnumber.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `thepdfnumber.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{thepdfnumber.drv}%
+ [2016/05/16 v1.1 Print PDF numbers with minimal digits (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\usepackage{csquotes}
+\usepackage[
+ backend=bibtex,
+ bibencoding=ascii,
+ alldates=iso8601,
+]{biblatex}[2011/11/13]
+\bibliography{oberdiek-source}
+\begin{document}
+ \DocInput{thepdfnumber.dtx}%
+\end{document}
+%</driver>
+% \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{thepdfnumber.drv}
+%
+% \title{The \xpackage{thepdfnumber} package}
+% \date{2016/05/16 v1.1}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package converts real numbers to a minimal representation
+% that is stripped from leading or trailing zeros,
+% plus signs and decimal point if not necessary.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% Dealing with the PDF format, there is sometimes the need to write
+% some low level PDF stuff. In case of numbers, the numbers can
+% arise from user input (e.g. color or transparency specifications)
+% or can be calculated. For example, \hologo{LaTeX}'s \cs{strip@pt}
+% makes a good job to output a real number. It automatically suppresses
+% the decimal part if the number is an integer. However it leaves
+% a leading zero for numbers greater zero and smaller one.
+% Thus the package provides macros that can be used with different
+% formats, even with \hologo{iniTeX} and generates numbers that
+% are valid numbers of the PDF format and whose length is minimal.
+%
+% \subsection{Usage}
+%
+% The package \xpackage{thepdfnumber} can be used with \hologo{LaTeX},
+% \hologo{plainTeX} or even with \hologo{iniTeX}:
+% \begin{quote}
+% |\RequirePackage{thepdfnumber}| \textit{\% \hologo{LaTeX}}\\
+% |\input thepdfnumber.sty| \textit{\% \hologo{plainTeX}/\hologo{iniTeX}}
+% \end{quote}
+% The package does not need and have package options.
+%
+% \subsection{User macros}
+%
+% All user macros are expandable in exact two expansion steps.
+%
+% \begin{declcs}{thepdfnumber} \M{number}
+% \end{declcs}
+% Macro \cs{thepdfnumber} takes a number
+% as argument and expands to a minimal representation of that number.
+% Some examples:
+% \begin{quote}
+% \begin{tabular}{r@{.: }>{\ttfamily}l@{ $\rightarrow$\ }>{\ttfamily}l@{}}
+% 1& +123 & 123\\
+% 2& --123 & 123\\
+% 3& -01 & -1\\
+% 4& 0045 & 45\\
+% 5& 1.0 & 1\\
+% 6& 1.20 & 1.2\\
+% 7& 0.0 & 0\\
+% 8& 0.78 & .78\\
+% 9& +012.340 & 12.34\\
+% \end{tabular}
+% \end{quote}
+% It reduces the length of the number representation:
+% \begin{itemize}
+% \item The signs are collapsed and only one minus sign
+% is output if the number is negative (see examples 1, 2, 3, 9).
+% \item Leading zeros are removed (4, 8, 9) unless the number is zero (7).
+% \item The decimal part is omitted, if the number is an integer (5, 7).
+% \item Trailing zeros from the decimal part are stripped (5, 6, 7, 9).
+% \end{itemize}
+% The resulting number representation can be catched with one of the
+% following Perl regular expressions:
+% \begin{itemize}
+% \item |^0$| (zero)
+% \item |^-?[1-9][0-9]*$| (integer)
+% \item |^-?[0-9]*\.[0-9]*[1-9]$| (real)
+% \end{itemize}
+% This is a valid numeric object of the PDF specification \cite[``7.3.3~Numeric Objects'']{pdfspec-iso32000-1}.
+%
+% \begin{declcs}{thepdfnumberNormZeroOne}
+% \end{declcs}
+% There are various places in the PDF specification where the
+% number is in the domain 0.0 upto 1.0. Macro thepdfnumberNormZeroOne
+% automatically adjusts the number to fit into that range. Negative
+% numbers are mapped to |0| and numbers greater than one are
+% replaced by |1|. Thus the result fits one of the following regular
+% expressions:
+% \begin{itemize}
+% \item |^0$|
+% \item |^\.[0-9]*[1-9]$|
+% \item |^1$|
+% \end{itemize}
+% Examples:
+% \begin{quote}
+% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$\ }>{\ttfamily}l@{}}
+% -456 & 0\\
+% -0.001 & 0\\
+% 0.0 & 0\\
+% 0.010 & .01\\
+% 0.456 & .456\\
+% 1.0 & 1\\
+% 01.001 & 1\\
+% 4 & 1\\
+% \end{tabular}
+% \end{quote}
+%
+% \subsection{Input number}
+%
+% The user macros expect a number as argument. The number can either
+% be given explicitely or as macro that expands in one step
+% to an explicite number, because the first token of the argument
+% is expanded once.
+%
+% The explicite number consists of
+% \begin{itemize}
+% \item optional signs `\texttt{+}' and `\texttt{-}',
+% \item digits `\texttt{0}' upto `\texttt{9}' and
+% \item an optional dot `\texttt{.}'.
+% \end{itemize}
+% All tokens must have catcode 12 (other), the default catcodes
+% for these characters in \hologo{LaTeX}, \hologo{plainTeX} or
+% \hologo{iniTeX}. As Perl regular expression the number is expected
+% in one of the following forms:
+% \begin{itemize}
+% \item |^[+-]*[0-9]+$|
+% \item |^[+-]*[0-9]*\.[0-9]*$|
+% \end{itemize}
+% At least one digit or the dot must be present.
+%
+% \subsection{Error handling}
+%
+% The package is not intended for validating numbers or to
+% decide if an argument is a number. Therefore it is an usage
+% error to use the user macros with arguments that are not
+% explicite numbers as specified in the previous sections.
+% Nevertheless some error conditions are sometimes recognized.
+% Errors are given in form of an undefined command sequence.
+% It is the only way to notify \hologo{TeX} in expandable context.
+% Expanding to some error text would invalidate the output.
+% Currently the following errors are thrown:
+% \begin{description}
+% \item[\cs{thepdfnumber@ErrorEndMarker}:]
+% Internally the argument parsing uses an end marker that
+% is never called directly. If it is called with valid
+% user input, then this is a bug. Otherwise it means the user input
+% contains nasty stuff.
+% \item[\cs{thepdfnumber@ErrorUnexpectedEnd}:] The macros expect at least one digit
+% or the dot, otherwise if the argument is empty or only contains
+% signs, then this error is called.
+% \item[\cs{thepdfnumber@ErrorInvalidToken}:] It is called if the number
+% contains other tokens than signs, digits or the dot or the
+% token at the wrong place (e.g. a sign after a digit).
+% In case of \cs{thepdfnumberNormZeroOne} this error condition might
+% not always be detected, because the number parsing might stop
+% at an early point, when the result is already clear (e.g.
+% if the number is negative or will be greater than one).
+% \item[Improper alphabetic constant:] This error might be
+% thrown by \hologo{TeX}, if the number contains
+% command tokens instead of characters.
+% \end{description}
+%
+% \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@thepdfnumber.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{thepdfnumber}{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@thepdfnumber.sty\endcsname
+\ProvidesPackage{thepdfnumber}%
+ [2016/05/16 v1.1 Print PDF numbers with minimal digits (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 ThPdNu@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\ThPdNu@AtEnd{%
+ \ThPdNu@AtEnd
+ \catcode#1=\the\catcode#1\relax
+ }%
+ \catcode#1=#2\relax
+}
+\TMP@EnsureCode{33}{12}% !
+\TMP@EnsureCode{36}{3}% $
+\TMP@EnsureCode{38}{4}% &
+\TMP@EnsureCode{42}{12}% *
+\TMP@EnsureCode{43}{12}% +
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{60}{12}% <
+\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{96}{12}% `
+\edef\ThPdNu@AtEnd{\ThPdNu@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \subsection{Helper macros}
+%
+% \begin{macro}{\ThPdNu@FIN}
+% \begin{macrocode}
+\def\ThPdNu@FIN{\thepdfnumber@ErrorEndMarker}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@space}
+% \begin{macrocode}
+\def\ThPdNu@space{ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@zero}
+% \begin{macrocode}
+\chardef\ThPdNu@zero=0 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@one}
+% \begin{macrocode}
+\chardef\ThPdNu@one=1 %
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@firstoftwo}
+% \begin{macrocode}
+\long\def\ThPdNu@firstoftwo#1#2{#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@secondoftwo}
+% \begin{macrocode}
+\long\def\ThPdNu@secondoftwo#1#2{#2}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Detect \hologo{eTeX}}
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname detokenize\endcsname\relax
+ \catcode`\&=14 %
+ \catcode`\$=9 %
+\else
+ \catcode`\&=9 %
+ \catcode`\$=14 %
+\fi
+% \end{macrocode}
+%
+% \subsection{User macro \cs{thepdfnumber}}
+%
+% \begin{macro}{\thepdfnumber}
+% \begin{macrocode}
+\def\thepdfnumber#1{%
+ \romannumeral
+& \iftrue\expandafter\ThPdNu@State@Plus\expandafter\fi
+& \detokenize\expandafter{#1}%
+& \ThPdNu@FIN
+$ \ifx\ThPdNu@FIN#1\ThPdNu@FIN
+$ \expandafter\ThPdNu@firstoftwo
+$ \else
+$ \expandafter\ThPdNu@secondoftwo
+$ \fi
+$ {%
+$ \ThPdNu@zero
+$ 0\thepdfnumber@ErrorUnexpectedEnd
+$ }{%
+$ \iftrue\expandafter\ThPdNu@State@Plus\expandafter\fi#1\ThPdNu@FIN
+$ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{State definitions for sign}
+%
+% \begin{macro}{\ThPdNu@State@Plus}
+% \begin{macrocode}
+\def\ThPdNu@State@Plus#1\fi#2{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#2%
+ 0%
+& \else\ifx-#2%
+$ \else\ifnum`#2=45 % -
+ 1%
+ \else\ifx0#2%
+ 2%
+ \else\ifnum`#2>48 %
+ \ifnum`#2<58 %
+ 3%
+ \else
+ 9%
+ \fi
+& \else\ifx.#2%
+$ \else\ifnum`#2=46 % .
+ 4%
+& \else\ifx+#2%
+$ \else\ifnum`#2=43 % +
+ 5%
+ \else
+ 9%
+ \fi\fi\fi\fi\fi\fi\ThPdNu@space
+ \expandafter\ThPdNu@zero
+ \expandafter0%
+ \expandafter\thepdfnumber@ErrorUnexpectedEnd
+ \or
+ \ThPdNu@State@Minus
+ \or
+ \ThPdNu@State@SkipZeros!%
+ \or
+ \ThPdNu@State@Int!#2!%
+ \or
+ \ThPdNu@State@Dot!\ThPdNu@zero*\ThPdNu@zero!!%
+ \or
+ \ThPdNu@State@Plus
+ \else
+ \ThPdNu@ReturnError{0}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@State@Minus}
+% \begin{macrocode}
+\def\ThPdNu@State@Minus#1\fi#2{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#2%
+ 0%
+ \else\ifx0#2%
+ 1%
+ \else\ifnum`#2>48 %
+ \ifnum`#2<58 %
+ 2%
+ \else
+ 9%
+ \fi
+& \else\ifx.#2%
+$ \else\ifnum`#2=46 % .
+ 3%
+& \else\ifx-#2%
+$ \else\ifnum`#2=45 % -
+ 4%
+& \else\ifx+#2%
+$ \else\ifnum`#2=43 % +
+ 5%
+ \else
+ 9%
+ \fi\fi\fi\fi\fi\fi\ThPdNu@space
+ \expandafter\ThPdNu@zero
+ \expandafter0%
+ \expandafter\thepdfnumber@ErrorUnexpectedEnd
+ \or
+ \ThPdNu@State@SkipZeros-!%
+ \or
+ \ThPdNu@State@Int-!#2!%
+ \or
+ \ThPdNu@State@Dot-!\ThPdNu@zero*\ThPdNu@zero!!%
+ \or
+ \ThPdNu@State@Plus
+ \or
+ \ThPdNu@State@Minus
+ \else
+ \ThPdNu@ReturnError{0}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@ReturnError}
+% \begin{macrocode}
+\def\ThPdNu@ReturnError#1#2\fi#3\ThPdNu@FIN{%
+ \fi
+ \ThPdNu@zero
+ #1%
+ \thepdfnumber@ErrorInvalidToken
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{State definitions for integer part}
+%
+% \begin{macro}{\ThPdNu@State@SkipZeros}
+% \begin{macrocode}
+\def\ThPdNu@State@SkipZeros#1!#2\fi#3{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#3%
+ 0%
+ \else\ifx0#3%
+ 1%
+ \else\ifnum`#3>48 %
+ \ifnum`#3<58 %
+ 2%
+ \else
+ 9%
+ \fi
+& \else\ifx.#3%
+$ \else\ifnum`#3=46 % .
+ 3%
+ \else
+ 9%
+ \fi\fi\fi\fi\ThPdNu@space
+ \expandafter\ThPdNu@zero
+ \expandafter0%
+ \or
+ \ThPdNu@State@SkipZeros#1!%
+ \or
+ \ThPdNu@State@Int#1!#3!%
+ \or
+ \ThPdNu@State@Dot#1!\ThPdNu@zero*\ThPdNu@zero!!%
+ \else
+ \ThPdNu@ReturnError{0}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@State@Int}
+% \begin{macrocode}
+\def\ThPdNu@State@Int#1!#2!#3\fi#4{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#4%
+ 0%
+ \else\ifnum`#4>47 %
+ \ifnum`#4<58 %
+ 1%
+ \else
+ 9%
+ \fi
+& \else\ifx.#4%
+$ \else\ifnum`#4=46 % .
+ 2%
+ \else
+ 9%
+ \fi\fi\fi\ThPdNu@space
+ \ThPdNu@ReturnInt{#1#2}%
+ \or
+ \ThPdNu@State@Int#1!#2#4!%
+ \or
+ \ThPdNu@State@Dot#1!\ThPdNu@one#2*\ThPdNu@zero!!%
+ \else
+ \ThPdNu@ReturnError{#1#2}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@ReturnInt}
+% \begin{macrocode}
+\def\ThPdNu@ReturnInt#1#2\fi{%
+ \fi
+ \ThPdNu@zero
+ #1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{State definitions for decimal digits}
+%
+% \begin{macro}{\ThPdNu@State@Dot}
+% \begin{macrocode}
+\def\ThPdNu@State@Dot#1*#2#3!#4!#5\fi#6{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#6%
+ 0%
+ \else\ifnum`#6>48 %
+ \ifnum`#6<58 %
+ 1%
+ \else
+ 9%
+ \fi
+ \else\ifx0#6%
+ 2%
+ \else
+ 9%
+ \fi\fi\fi\ThPdNu@space
+ \ThPdNu@ReturnNumber#1*#2#3!%
+ \or
+ \ThPdNu@State@Dot#1*\ThPdNu@one#3#4#6!!%
+ \or
+ \ThPdNu@State@DotZero#1*#2#3!#4#6!%
+ \else
+ \ThPdNu@ReturnNumberInvalid#1*#2#3!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@State@DotZero}
+% \begin{macrocode}
+\def\ThPdNu@State@DotZero#1*#2#3!#4!#5\fi#6{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#6%
+ 0%
+ \else\ifnum`#6>48 %
+ \ifnum`#6<58 %
+ 1%
+ \else
+ 9%
+ \fi
+ \else\ifx0#6%
+ 2%
+ \else
+ 9%
+ \fi\fi\fi\ThPdNu@space
+ \ThPdNu@ReturnNumber#1*#2#3!%
+ \or
+ \ThPdNu@State@Dot#1*\ThPdNu@one#3#4#6!!%
+ \or
+ \ThPdNu@State@DotZero#1*#2#3!#4#6!%
+ \else
+ \ThPdNu@ReturnNumber#1*#2#3!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@ReturnNumber}
+% \begin{macrocode}
+\def\ThPdNu@ReturnNumber#1!#2#3*#4#5!#6\fi{%
+ \fi
+ \ifcase#2%
+ \expandafter\ThPdNu@firstoftwo
+ \else
+ \expandafter\ThPdNu@secondoftwo
+ \fi
+ {%
+ \ifcase#4%
+ \expandafter\ThPdNu@firstoftwo
+ \else
+ \expandafter\ThPdNu@secondoftwo
+ \fi
+ {\ThPdNu@zero 0}%
+ {\ThPdNu@zero #1.#5}%
+ }{%
+ \ifcase#4%
+ \expandafter\ThPdNu@firstoftwo
+ \else
+ \expandafter\ThPdNu@secondoftwo
+ \fi
+ {\ThPdNu@zero #1#3}%
+ {\ThPdNu@zero #1#3.#5}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@ReturnNumberInvalid}
+% \begin{macrocode}
+\def\ThPdNu@ReturnNumberInvalid#1*#2!#3\fi#4\ThPdNu@FIN{%
+ \fi
+ \iftrue\ThPdNu@ReturnNumber#1*#2!\fi
+ \thepdfnumber@ErrorInvalidToken
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Norm macro}
+%
+% \begin{macro}{\thepdfnumberNormZeroOne}
+% \begin{macrocode}
+\def\thepdfnumberNormZeroOne#1{%
+ \romannumeral
+& \iftrue\expandafter\ThPbNu@StateN@Plus\expandafter\fi
+& \detokenize\expandafter{#1}%
+& \ThPdNu@FIN
+$ \ifx\ThPdNu@FIN#1\ThPdNu@FIN
+$ \expandafter\ThPdNu@firstoftwo
+$ \else
+$ \expandafter\ThPdNu@secondoftwo
+$ \fi
+$ {%
+$ \ThPdNu@zero
+$ 0\thepdfnumber@ErrorUnexpectedEnd
+$ }{%
+$ \iftrue\expandafter\ThPbNu@StateN@Plus\expandafter\fi#1\ThPdNu@FIN
+$ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{State definitions for sign}
+%
+% \begin{macro}{\ThPbNu@StateN@Plus}
+% \begin{macrocode}
+\def\ThPbNu@StateN@Plus#1\fi#2{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#2%
+ 0%
+& \else\ifx-#2%
+$ \else\ifnum`#2=45 % -
+ 1%
+ \else\ifx0#2%
+ 2%
+ \else\ifnum`#2>48 %
+ \ifnum`#2<58 %
+ 3%
+ \else
+ 9%
+ \fi
+& \else\ifx.#2%
+$ \else\ifnum`#2=46 % .
+ 4%
+& \else\ifx+#2%
+$ \else\ifnum`#2=43 % +
+ 5%
+ \else
+ 9%
+ \fi\fi\fi\fi\fi\fi\ThPdNu@space
+ \expandafter\ThPdNu@zero
+ \expandafter0%
+ \expandafter\thepdfnumber@ErrorUnexpectedEnd
+ \or
+ \ThPbNu@StateN@Minus
+ \or
+ \ThPbNu@StateN@SkipZeros
+ \or
+ \ThPdNu@ReturnAndSkip{1}%
+ \or
+ \ThPbNu@StateN@Dot\ThPdNu@zero!!%
+ \or
+ \ThPbNu@StateN@Plus
+ \else
+ \ThPdNu@ReturnError{0}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPbNu@StateN@Minus}
+% \begin{macrocode}
+\def\ThPbNu@StateN@Minus#1\fi#2{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#2%
+ 0%
+ \else\ifnum`#2>47 %
+ \ifnum`#2<58 %
+ 1%
+ \else
+ 9%
+ \fi
+& \else\ifx.#2%
+$ \else\ifnum`#2=46 % .
+ 1%
+& \else\ifx-#2%
+$ \else\ifnum`#2=45 % -
+ 2%
+& \else\ifx+#2%
+$ \else\ifnum`#2=43 % +
+ 3%
+ \else
+ 9%
+ \fi\fi\fi\fi\fi\ThPdNu@space
+ \expandafter\ThPdNu@zero
+ \expandafter0%
+ \expandafter\thepdfnumber@ErrorUnexpectedEnd
+ \or
+ \ThPdNu@ReturnAndSkip{0}%
+ \or
+ \ThPbNu@StateN@Plus
+ \or
+ \ThPbNu@StateN@Minus
+ \else
+ \ThPdNu@ReturnError{0}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@ReturnAndSkip}
+% \begin{macrocode}
+\def\ThPdNu@ReturnAndSkip#1#2\fi#3\ThPdNu@FIN{%
+ \fi
+ \ThPdNu@zero
+ #1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{State definitions for integer part}
+%
+% \begin{macro}{\ThPbNu@StateN@SkipZeros}
+% \begin{macrocode}
+\def\ThPbNu@StateN@SkipZeros#1\fi#2{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#2%
+ 0%
+ \else\ifx0#2%
+ 1%
+ \else\ifnum`#2>48 %
+ \ifnum`#2<58 %
+ 2%
+ \else
+ 9%
+ \fi
+& \else\ifx.#2%
+$ \else\ifnum`#2=46 % .
+ 3%
+ \else
+ 9%
+ \fi\fi\fi\fi\ThPdNu@space
+ \expandafter\ThPdNu@zero
+ \expandafter0%
+ \or
+ \ThPbNu@StateN@SkipZeros%
+ \or
+ \ThPdNu@ReturnAndSkip{1}%
+ \or
+ \ThPbNu@StateN@Dot\ThPdNu@zero!!%
+ \else
+ \ThPdNu@ReturnError{0}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{State definitions for decimal digits}
+%
+% \begin{macro}{\ThPbNu@StateN@Dot}
+% \begin{macrocode}
+\def\ThPbNu@StateN@Dot#1#2!#3!#4\fi#5{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#5%
+ 0%
+ \else\ifnum`#5>48 %
+ \ifnum`#5<58 %
+ 1%
+ \else
+ 9%
+ \fi
+ \else\ifx0#5%
+ 2%
+ \else
+ 9%
+ \fi\fi\fi\ThPdNu@space
+ \ThPdNu@ReturnFracNumber#1#2!%
+ \or
+ \ThPbNu@StateN@Dot\ThPdNu@one#2#3#5!!%
+ \or
+ \ThPbNu@StateN@DotZero#1#2!#3#5!%
+ \else
+ \ThPdNu@ReturnFracNumberInvalid#1#2!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPbNu@StateN@DotZero}
+% \begin{macrocode}
+\def\ThPbNu@StateN@DotZero#1#2!#3!#4\fi#5{%
+ \fi
+ \ifcase\ifx\ThPdNu@FIN#5%
+ 0%
+ \else\ifnum`#5>48 %
+ \ifnum`#5<58 %
+ 1%
+ \else
+ 9%
+ \fi
+ \else\ifx0#5%
+ 2%
+ \else
+ 9%
+ \fi\fi\fi\ThPdNu@space
+ \ThPdNu@ReturnFracNumber#1#2!%
+ \or
+ \ThPbNu@StateN@Dot\ThPdNu@one#2#3#5!!%
+ \or
+ \ThPbNu@StateN@DotZero#1#2!#3#5!%
+ \else
+ \ThPdNu@ReturnFracNumberInvalid#1#2!%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@ReturnFracNumber}
+% \begin{macrocode}
+\def\ThPdNu@ReturnFracNumber#1#2!#3\fi{%
+ \fi
+ \ifcase#1%
+ \expandafter\ThPdNu@firstoftwo
+ \else
+ \expandafter\ThPdNu@secondoftwo
+ \fi
+ {\ThPdNu@zero 0}%
+ {\ThPdNu@zero .#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ThPdNu@ReturnFracNumberInvalid}
+% \begin{macrocode}
+\def\ThPdNu@ReturnFracNumberInvalid#1!#2\fi#3\ThPdNu@FIN{%
+ \fi
+ \iftrue\ThPdNu@ReturnFracNumber#1!\fi
+ \thepdfnumber@ErrorInvalidToken
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ThPdNu@AtEnd%
+%</package>
+% \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 thepdfnumber.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \subsubsection{Preamble}
+%
+% \begin{macrocode}
+%<*test2>
+\catcode`\{=1
+\catcode`\}=2
+\catcode`\#=6
+\catcode`\@=11
+\errorcontextlines=10000 %
+\def\msg#{\immediate\write16}
+\def\space{ }
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input thepdfnumber.sty\relax
+\else
+ \RequirePackage{thepdfnumber}[2016/05/16]%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\Test}
+% \begin{macrocode}
+\def\Test#1#2{%
+ \def\TestExpected{#2}%
+%<*active>
+ \edef\TestExpected{\TestExpected}%
+%</active>
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestResult
+ \expandafter\expandafter\expandafter{%
+ \TestCommand{#1}%
+ }%
+ \begingroup
+ \toks0\expandafter{\TestResult}%
+ \toks2\expandafter{\TestExpected}%
+ \ifx\TestResult\TestExpected
+ \msg{* OK: #1 => \the\toks0}%
+ \else
+ \errmessage{FAILED: #1 => \the\toks0\space(\the\toks2)}%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\let\thepdfnumber@ErrorUnexpectedEnd\relax
+\let\thepdfnumber@ErrorInvalidToken\relax
+% \end{macrocode}
+%
+% \subsubsection{Test with active catcodes}
+%
+% \begin{macrocode}
+%<*active>
+\catcode`\~=13 %
+\def\ThPdNu@Temp#1{%
+ \begingroup
+ \lccode`\~=`#1 %
+ \lowercase{\endgroup
+ \edef~%
+ }{\string#1}%
+ \catcode`#1=13 %
+}
+\ThPdNu@Temp{.}
+\ThPdNu@Temp{-}
+\ThPdNu@Temp{+}
+%</active>
+% \end{macrocode}
+%
+% \subsubsection{Test cases for \cs{thepdfnumber}}
+%
+% \begin{macro}{\TestCommand}
+% \begin{macrocode}
+\let\TestCommand\thepdfnumber
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\Test{0}{0}
+\Test{1}{1}
+\Test{23}{23}
+\Test{0045}{45}
+\Test{4500}{4500}
+\Test{-0}{0}
+\Test{-1}{-1}
+\Test{-00002}{-2}
+\Test{-010203}{-10203}
+\Test{+0}{0}
+\Test{+123}{123}
+
+\Test{+-4}{-4}
+\Test{+-+-4}{4}
+\Test{++--++--++4}{4}
+\Test{+++---+++---+++---4}{-4}
+
+\Test{.}{0}
+\Test{0.}{0}
+\Test{.0}{0}
+\Test{0.}{0}
+\Test{-.}{0}
+\Test{-0.}{0}
+\Test{-.0}{0}
+\Test{-0.}{0}
+\Test{010.020}{10.02}
+\Test{123.456}{123.456}
+\Test{12.}{12}
+\Test{.123}{.123}
+\Test{.0001}{.0001}
+\Test{.00100}{.001}
+\Test{.12003400560078009}{.12003400560078009}
+\Test{-.12003400560078009}{-.12003400560078009}
+\Test{04.0500000}{4.05}
+
+\Test{}{0\thepdfnumber@ErrorUnexpectedEnd}
+\Test{+}{0\thepdfnumber@ErrorUnexpectedEnd}
+\Test{-}{0\thepdfnumber@ErrorUnexpectedEnd}
+\Test{a}{0\thepdfnumber@ErrorInvalidToken}
+\Test{0x1}{0\thepdfnumber@ErrorInvalidToken}
+\Test{4x56}{4\thepdfnumber@ErrorInvalidToken}
+\Test{012,34}{12\thepdfnumber@ErrorInvalidToken}
+\Test{0.12x4}{.12\thepdfnumber@ErrorInvalidToken}
+% \end{macrocode}
+%
+% \subsubsection{Test cases for \cs{thepdfnumberNormZeroOne}}
+%
+% \begin{macro}{\TestCommand}
+% \begin{macrocode}
+\let\TestCommand\thepdfnumberNormZeroOne
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\Test{0}{0}
+\Test{1}{1}
+\Test{23}{1}
+\Test{12}{1}
+\Test{10}{1}
+\Test{0045}{1}
+\Test{001}{1}
+\Test{-0}{0}
+\Test{-1}{0}
+\Test{-01}{0}
+\Test{-4}{0}
+
+\Test{+-0}{0}
+\Test{+-+-1}{1}
+\Test{++--++--++1}{1}
+\Test{+++---+++---+++---1}{0}
+
+\Test{.}{0}
+\Test{0.}{0}
+\Test{.0}{0}
+\Test{0.}{0}
+\Test{-.}{0}
+\Test{-0.}{0}
+\Test{-.0}{0}
+\Test{-0.}{0}
+\Test{010.020}{1}
+\Test{123.456}{1}
+\Test{12.}{1}
+\Test{.123}{.123}
+\Test{.0001}{.0001}
+\Test{.00100}{.001}
+\Test{.12003400560078009}{.12003400560078009}
+\Test{-.12003400560078009}{0}
+\Test{04.0500000}{1}
+\Test{0.1200340056}{.1200340056}
+\Test{1.05}{1}
+
+\Test{}{0\thepdfnumber@ErrorUnexpectedEnd}
+\Test{+}{0\thepdfnumber@ErrorUnexpectedEnd}
+\Test{-}{0\thepdfnumber@ErrorUnexpectedEnd}
+\Test{a}{0\thepdfnumber@ErrorInvalidToken}
+\Test{0x1}{0\thepdfnumber@ErrorInvalidToken}
+\Test{4x56}{1}
+\Test{012,34}{1}
+\Test{.012x4}{.012\thepdfnumber@ErrorInvalidToken}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\csname @@end\endcsname\end
+%</test2>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/thepdfnumber}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/thepdfnumber.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/thepdfnumber.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[\CTAN{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 thepdfnumber.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@{}}
+% thepdfnumber.sty & tex/generic/oberdiek/thepdfnumber.sty\\
+% thepdfnumber.pdf & doc/latex/oberdiek/thepdfnumber.pdf\\
+% test/thepdfnumber-test1.tex & doc/latex/oberdiek/test/thepdfnumber-test1.tex\\
+% test/thepdfnumber-test2.tex & doc/latex/oberdiek/test/thepdfnumber-test2.tex\\
+% test/thepdfnumber-test3.tex & doc/latex/oberdiek/test/thepdfnumber-test3.tex\\
+% thepdfnumber.dtx & source/latex/oberdiek/thepdfnumber.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk thepdfnumber.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{thepdfnumber.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 thepdfnumber.dtx
+%makeindex -s gind.ist thepdfnumber.idx
+%pdflatex thepdfnumber.dtx
+%makeindex -s gind.ist thepdfnumber.idx
+%pdflatex thepdfnumber.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \printbibliography[
+% heading=bibnumbered,
+% ]
+%
+% \begin{History}
+% \begin{Version}{2011/11/24 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/thepdfnumber.pdf b/macros/latex/contrib/oberdiek/thepdfnumber.pdf
new file mode 100644
index 0000000000..2c470d72d7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/thepdfnumber.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/transparent.dtx b/macros/latex/contrib/oberdiek/transparent.dtx
new file mode 100644
index 0000000000..4b964788cc
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/transparent.dtx
@@ -0,0 +1,659 @@
+% \iffalse meta-comment
+%
+% File: transparent.dtx
+% Version: 2018/11/18 v1.3
+% Info: Transparency via pdfTeX's color stack
+%
+% Copyright (C) 2007 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 2016 2018
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file transparent.dtx
+% and the derived files
+% transparent.sty, transparent.pdf, transparent.ins, transparent.drv,
+% transparent-example.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/transparent.dtx
+% CTAN:macros/latex/contrib/oberdiek/transparent.pdf
+%
+% Unpacking:
+% (a) If transparent.ins is present:
+% tex transparent.ins
+% (b) Without transparent.ins:
+% tex transparent.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{transparent.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If transparent.drv is present:
+% latex transparent.drv
+% (b) Without transparent.drv:
+% latex transparent.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 transparent.dtx
+% makeindex -s gind.ist transparent.idx
+% pdflatex transparent.dtx
+% makeindex -s gind.ist transparent.idx
+% pdflatex transparent.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/transparent.sty
+% TDS:doc/latex/oberdiek/transparent.pdf
+% TDS:doc/latex/oberdiek/transparent-example.tex
+% TDS:source/latex/oberdiek/transparent.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: transparent 2018/11/18 v1.3 Transparency via pdfTeX's color stack (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: transparent
+Version: 2018/11/18 v1.3
+
+Copyright (C) 2007 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file transparent.dtx
+and the derived files
+ transparent.sty, transparent.pdf, transparent.ins, transparent.drv,
+ transparent-example.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{transparent.ins}{\from{transparent.dtx}{install}}%
+ \file{transparent.drv}{\from{transparent.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{transparent.sty}{\from{transparent.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{transparent-example.tex}{\from{transparent.dtx}{example}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{transparent.xml}{\from{transparent.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{* transparent.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `transparent.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{transparent.drv}%
+ [2018/11/18 v1.3 Transparency via pdfTeX's color stack (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{transparent.dtx}%
+\end{document}
+%</driver>
+% \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{transparent.drv}
+%
+% \title{The \xpackage{transparent} package}
+% \date{2018/11/18 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Since version 1.40 \pdfTeX\ supports several color stacks. This
+% package shows, how a separate color stack can be used for transparency,
+% a property besides color.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{User interface}
+%
+% The package \xpackage{transparent} defines \cs{transparent} and
+% \cs{texttransparent}. They are used like \cs{color} and \cs{textcolor}.
+% The first argument is the transparency value between 0 and 1.
+%
+% Because of the poor interface for page resources, there can be problems
+% with packages that also use \cs{pdfpageresources}.
+%
+% Example for usage:
+% \begin{macrocode}
+%<*example>
+\documentclass[12pt]{article}
+
+\usepackage{color}
+\usepackage{transparent}
+
+\begin{document}
+\colorbox{yellow}{%
+ \bfseries
+ \color{blue}%
+ Blue and %
+ \transparent{0.6}%
+ transparent blue%
+}
+
+\bigskip
+Hello World
+\texttransparent{0.5}{Hello\newpage World}
+Hello World
+\end{document}
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{transparent}%
+ [2018/11/18 v1.3 Transparency via pdfTeX's color stack (HO)]%
+% \end{macrocode}
+%
+% \subsection{Initial checks}
+%
+% \subsubsection{Check for \pdfTeX\ in PDF mode}
+% \begin{macrocode}
+\RequirePackage{ifpdf}
+\ifpdf
+\else
+ \PackageWarningNoLine{transparent}{%
+ Loading aborted, because pdfTeX is not running in PDF mode%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Check \pdfTeX\ or Lua\TeX\ version}
+% \begin{macrocode}
+\ifx\pdfextension\@undefined
+ \let\TRP@pdfcolorstackinit\pdfcolorstackinit
+ \let\TRP@pdfpageresources\pdfpageresources
+ \let\TRP@pdfcolorstack\pdfcolorstack
+\else
+ \def\TRP@pdfcolorstackinit {\pdffeedback colorstackinit}
+ \protected\edef\TRP@pdfpageresources {\pdfvariable pageresources}
+ \protected\def\TRP@pdfcolorstack {\pdfextension colorstack}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifcsname TRP@pdfcolorstackinit\endcsname\else
+ \PackageWarningNoLine{transparent}{%
+ Your pdfTeX version does not support color stacks%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \subsection{Compatibility with pgf}
+% https://github.com/ho-tex/oberdiek/issues/19
+% \begin{macrocode}
+\AtBeginDocument
+ {%
+ \ifcsname pgfutil@addpdfresource@extgs\endcsname
+ \let\TRP@addresource\relax
+ \pgfutil@addpdfresource@extgs{\TRP@list}%
+ \fi
+ }
+% \end{macrocode}
+% \subsection{Transparency}
+%
+% The setting for the different transparency values must
+% be added to the page resources. In the first run the values
+% are recorded in the \xfile{.aux} file. In the second run
+% the values are set and transparency is available.
+% \begin{macrocode}
+\RequirePackage{auxhook}
+\AddLineBeginAux{%
+ \string\providecommand{\string\transparent@use}[1]{}%
+}
+\gdef\TRP@list{/TRP1<</ca 1/CA 1>>}
+\def\transparent@use#1{%
+ \@ifundefined{TRP#1}{%
+ \g@addto@macro\TRP@list{%
+ /TRP#1<</ca #1/CA #1>>%
+ }%
+ \expandafter\gdef\csname TRP#1\endcsname{/TRP#1 gs}%
+ }{%
+ % #1 is already known, nothing to do
+ }%
+}
+\AtBeginDocument{%
+ \TRP@addresource
+ \let\transparent@use\@gobble
+}
+% \end{macrocode}
+% Unhappily the interface setting page resources is very
+% poor, only a token register \cs{pdfpageresources}.
+% Thus this package tries to be cooperative in the way that
+% it embeds the previous contents of \cs{pdfpageresources}.
+% However it does not solve the problem, if several packages
+% want to set |/ExtGState|.
+% \begin{macrocode}
+\def\TRP@addresource{%
+ \begingroup
+ \edef\x{\endgroup
+ \TRP@pdfpageresources{%
+ \the\TRP@pdfpageresources
+ /ExtGState<<\TRP@list>>%
+ }%
+ }%
+ \x
+}
+\newif\ifTRP@rerun
+\xdef\TRP@colorstack{%
+ \TRP@pdfcolorstackinit page direct{/TRP1 gs}%
+}
+% \end{macrocode}
+% \begin{macro}{\transparent}
+% \begin{macrocode}
+\newcommand*{\transparent}[1]{%
+ \begingroup
+ \dimen@=#1\p@\relax
+ \ifdim\dimen@>\p@
+ \dimen@=\p@
+ \fi
+ \ifdim\dimen@<\z@
+ \dimen@=\z@
+ \fi
+ \ifdim\dimen@=\p@
+ \def\x{1}%
+ \else
+ \ifdim\dimen@=\z@
+ \def\x{0}%
+ \else
+ \edef\x{\strip@pt\dimen@}%
+ \edef\x{\expandafter\@gobble\x}%
+ \fi
+ \fi
+ \if@filesw
+ \immediate\write\@auxout{%
+ \string\transparent@use{\x}%
+ }%
+ \fi
+ \edef\x{\endgroup
+ \def\noexpand\transparent@current{\x}%
+ }%
+ \x
+ \transparent@set
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AtEndDocument{%
+ \ifTRP@rerun
+ \PackageWarningNoLine{transparent}{%
+ Rerun to get transparencies right%
+ }%
+ \fi
+}
+\def\transparent@current{/TRP1 gs}
+\def\transparent@set{%
+ \@ifundefined{TRP\transparent@current}{%
+ \global\TRP@reruntrue
+ }{%
+ \TRP@pdfcolorstack\TRP@colorstack push{%
+ \csname TRP\transparent@current\endcsname
+ }%
+ \aftergroup\transparent@reset
+ }%
+}
+\def\transparent@reset{%
+ \TRP@pdfcolorstack\TRP@colorstack pop\relax
+}
+% \end{macrocode}
+% \begin{macro}{\texttransparent}
+% \begin{macrocode}
+\newcommand*{\texttransparent}[2]{%
+ \protect\leavevmode
+ \begingroup
+ \transparent{#1}%
+ #2%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/transparent}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/transparent.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/transparent.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[\CTAN{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 transparent.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@{}}
+% transparent.sty & tex/latex/oberdiek/transparent.sty\\
+% transparent.pdf & doc/latex/oberdiek/transparent.pdf\\
+% transparent-example.tex & doc/latex/oberdiek/transparent-example.tex\\
+% transparent.dtx & source/latex/oberdiek/transparent.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk transparent.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{transparent.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 transparent.dtx
+%makeindex -s gind.ist transparent.idx
+%pdflatex transparent.dtx
+%makeindex -s gind.ist transparent.idx
+%pdflatex transparent.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{transparent.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='transparent'>
+ <name>transparent</name>
+ <caption>Using a color stack for transparency with pdfTeX.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2007'/>
+ <license type='lppl1.3'/>
+ <version number='1.2'/>
+ <description>
+ Since version 1.40 <xref refid='pdftex'>pdfTeX</xref> supports
+ several color stacks. This package shows how a separate colour stack
+ can be used for transparency, a property other than colour.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/transparent.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/transparent.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2007/01/08 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.1}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2018/09/10 v1.2}
+% \item
+% Update for LuaTeX, remove dependency on Pdf\TeX\ command names.
+% \end{Version}
+% \begin{Version}{2018/11/18 v1.3}
+% \item
+% Added code for pgf compatibility, see https://github.com/ho-tex/oberdiek/issues/19
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/transparent.pdf b/macros/latex/contrib/oberdiek/transparent.pdf
new file mode 100644
index 0000000000..cb0c1cc1aa
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/transparent.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/twoopt.dtx b/macros/latex/contrib/oberdiek/twoopt.dtx
new file mode 100644
index 0000000000..9d3d94e2e0
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/twoopt.dtx
@@ -0,0 +1,658 @@
+% \iffalse meta-comment
+%
+% File: twoopt.dtx
+% Version: 2016/05/16 v1.6
+% Info: Definitions with two optional arguments
+%
+% Copyright (C) 1999, 2006, 2008 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file twoopt.dtx
+% and the derived files
+% twoopt.sty, twoopt.pdf, twoopt.ins, twoopt.drv.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/twoopt.dtx
+% CTAN:macros/latex/contrib/oberdiek/twoopt.pdf
+%
+% Unpacking:
+% (a) If twoopt.ins is present:
+% tex twoopt.ins
+% (b) Without twoopt.ins:
+% tex twoopt.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{twoopt.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If twoopt.drv is present:
+% latex twoopt.drv
+% (b) Without twoopt.drv:
+% latex twoopt.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 twoopt.dtx
+% makeindex -s gind.ist twoopt.idx
+% pdflatex twoopt.dtx
+% makeindex -s gind.ist twoopt.idx
+% pdflatex twoopt.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/twoopt.sty
+% TDS:doc/latex/oberdiek/twoopt.pdf
+% TDS:source/latex/oberdiek/twoopt.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: twoopt 2016/05/16 v1.6 Definitions with two optional arguments (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: twoopt
+Version: 2016/05/16 v1.6
+
+Copyright (C) 1999, 2006, 2008 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file twoopt.dtx
+and the derived files
+ twoopt.sty, twoopt.pdf, twoopt.ins, twoopt.drv.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{twoopt.ins}{\from{twoopt.dtx}{install}}%
+ \file{twoopt.drv}{\from{twoopt.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{twoopt.sty}{\from{twoopt.dtx}{package}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{twoopt.xml}{\from{twoopt.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{* twoopt.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `twoopt.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{twoopt.drv}%
+ [2016/05/16 v1.6 Definitions with two optional arguments (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{twoopt.dtx}%
+\end{document}
+%</driver>
+% \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{twoopt.drv}
+%
+% \title{The \xpackage{twoopt} package}
+% \date{2016/05/16 v1.6}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides commands to define macros with two
+% optional arguments.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newenvironment{param}{^^A
+% \newcommand{\entry}[1]{\meta{\###1}:&}^^A
+% \begin{tabular}[t]{@{}l@{ }l@{}}^^A
+% }{^^A
+% \end{tabular}^^A
+% }
+%
+% \section{Usage}
+% \DescribeMacro{\newcommandtwoopt}
+% \DescribeMacro{\renewcommandtwoopt}
+% \DescribeMacro{\providecommandtwoopt}
+% Similar to \cmd{\newcommand}, \cmd{\renewcommand}
+% and \cmd{\providecommand} this package provides commands
+% to define macros with two optional arguments.
+% The names of the commands are built by appending the
+% package name to the \LaTeX-pendants:
+% \begingroup
+% \def\x{\marg{cmd} \oarg{num} \oarg{default1}^^A
+% \oarg{default2} \marg{def.}}^^A
+% \begin{tabbing}
+% \cmd{\providecommandtwoopt} \=\kill
+% \cmd{\newcommandtwoopt}\>\x\\
+% \cmd{\renewcommandtwoopt}\>\x\\
+% \cmd{\providecommandtwoopt}\>\x\\
+% \end{tabbing}
+% \endgroup
+%
+% Also the |*|-forms are supported. Indeed it is better to
+% use this ones, unless it is intended to hold
+% whole paragraphs in some of the arguments. If the macro
+% is defined with the |*|-form, missing braces
+% can be detected earlier.
+%
+% Example:
+% \begin{quote}
+% |\newcommandtwoopt{\bsp}[3][AA][BB]{%|\\
+% | \typeout{\string\bsp: #1,#2,#3}%|\\
+% |}|\\
+% \begin{tabular}{@{}l@{\quad$\rightarrow$\quad}l@{}}
+% |\bsp[aa][bb]{cc}|&|\bsp: aa,bb,cc|\\
+% |\bsp[aa]{cc}|&|\bsp: aa,BB,cc|\\
+% |\bsp{cc}|&|\bsp: AA,BB,cc|\\
+% \end{tabular}
+% \end{quote}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{twoopt}
+ [2016/05/16 v1.6 Definitions with two optional arguments (HO)]%
+% \end{macrocode}
+% \begin{macro}{\newcommandtwoopt}
+% \begin{macrocode}
+\newcommand{\newcommandtwoopt}{%
+ \@ifstar{\@newcommandtwoopt*}{\@newcommandtwoopt{}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@newcommandtwoopt}
+% \begin{param}
+% \entry1 star\\
+% \entry2 macro name to be defined
+% \end{param}
+% \begin{macrocode}
+\newcommand{\@newcommandtwoopt}{}
+\long\def\@newcommandtwoopt#1#2{%
+ \expandafter\@@newcommandtwoopt
+ \csname2\string#2\endcsname{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@newcommandtwoopt}
+% \begin{param}
+% \entry1 help command to be defined
+% (\expandafter\cmd\csname 2\bslash<name>\endcsname)\\
+% \entry2 star\\
+% \entry3 macro name to be defined\\
+% \entry4 number of total arguments\\
+% \entry5 default for optional argument one\\
+% \entry6 default for optional argument two
+% \end{param}
+% \begin{macrocode}
+\newcommand{\@@newcommandtwoopt}{}
+\long\def\@@newcommandtwoopt#1#2#3[#4][#5][#6]{%
+ \newcommand#2#3[1][{#5}]{%
+ \to@ScanSecondOptArg#1{##1}{#6}%
+ }%
+ \newcommand#2#1[{#4}]%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\renewcommandtwoopt}
+% \begin{macrocode}
+\newcommand{\renewcommandtwoopt}{%
+ \@ifstar{\@renewcommandtwoopt*}{\@renewcommandtwoopt{}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@renewcommandtwoopt}
+% \begin{param}
+% \entry1 star\\
+% \entry2 command name to be defined
+% \end{param}
+% \begin{macrocode}
+\newcommand{\@renewcommandtwoopt}{}
+\long\def\@renewcommandtwoopt#1#2{%
+ \begingroup
+ \escapechar\m@ne
+ \xdef\@gtempa{{\string#2}}%
+ \endgroup
+ \expandafter\@ifundefined\@gtempa{%
+ \@latex@error{\noexpand#2undefined}\@ehc
+ }{}%
+ \let#2\@undefined
+ \expandafter\let\csname2\string#2\endcsname\@undefined
+ \expandafter\@@newcommandtwoopt
+ \csname2\string#2\endcsname{#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\providecommandtwoopt}
+% \begin{macrocode}
+\newcommand{\providecommandtwoopt}{%
+ \@ifstar{\@providecommandtwoopt*}{\@providecommandtwoopt{}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@providecommandtwoopt}
+% \begin{param}
+% \entry1 star\\
+% \entry2 command name to be defined
+% \end{param}
+% \begin{macrocode}
+\newcommand{\@providecommandtwoopt}{}
+\long\def\@providecommandtwoopt#1#2{%
+ \begingroup
+ \escapechar\m@ne
+ \xdef\@gtempa{{\string#2}}%
+ \endgroup
+ \expandafter\@ifundefined\@gtempa{%
+ \expandafter\@@newcommandtwoopt
+ \csname2\string#2\endcsname{#1}{#2}%
+ }{%
+ \let\to@dummyA\@undefined
+ \let\to@dummyB\@undefined
+ \@@newcommandtwoopt\to@dummyA{#1}\to@dummyB
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\to@ScanSecondOptArg}
+% \begin{param}
+% \entry1 help command to be defined
+% (\expandafter\cmd\csname 2\bslash<name>\endcsname)\\
+% \entry2 first arg of command to be defined\\
+% \entry3 default for second opt. arg.
+% \end{param}
+% \begin{macrocode}
+\newcommand{\to@ScanSecondOptArg}[3]{%
+ \@ifnextchar[{%
+ \expandafter#1\to@ArgOptToArgArg{#2}%
+ }{%
+ #1{#2}{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\to@ArgOptToArgArg}
+% \begin{macrocode}
+\newcommand{\to@ArgOptToArgArg}{}
+\long\def\to@ArgOptToArgArg#1[#2]{{#1}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/twoopt}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/twoopt.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/twoopt.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[\CTAN{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 twoopt.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@{}}
+% twoopt.sty & tex/latex/oberdiek/twoopt.sty\\
+% twoopt.pdf & doc/latex/oberdiek/twoopt.pdf\\
+% twoopt.dtx & source/latex/oberdiek/twoopt.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk twoopt.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{twoopt.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 twoopt.dtx
+%makeindex -s gind.ist twoopt.idx
+%pdflatex twoopt.dtx
+%makeindex -s gind.ist twoopt.idx
+%pdflatex twoopt.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{twoopt.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='twoopt'>
+ <name>twoopt</name>
+ <caption>Definitions with two optional arguments.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='1999,2006,2008'/>
+ <license type='lppl1.3'/>
+ <version number='1.6'/>
+ <description>
+ Variants of <tt>\newcommand</tt>, <tt>\renewcommand</tt> and
+ <tt>\providecommand</tt> are provided.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/twoopt.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/twoopt.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{1998/10/30 v1.0}
+% \item
+% The first version was built as a response to a question
+% of \NameEmail{Rebecca and Rowland}{rebecca@astrid.u-net.com},
+% published in the newsgroup
+% \href{news:comp.text.tex}{comp.text.tex}:\\
+% \URL{``Re: [Q] LaTeX command with two optional arguments?''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/0ab1afde7b172d37}
+% \end{Version}
+% \begin{Version}{1998/10/30 v1.1}
+% \item
+% Improvements added in response to
+% \NameEmail{Stefan Ulrich}{ulrich@cis.uni-muenchen.de}
+% in the same thread:\\
+% \URL{``Re: [Q] LaTeX command with two optional arguments?''}^^A
+% {http://groups.google.com/group/comp.text.tex/msg/b8d84d4336f302c4}
+% \end{Version}
+% \begin{Version}{1998/11/04 v1.2}
+% \item
+% Fixes for LaTeX bugs 2896, 2901, 2902 added.
+% \end{Version}
+% \begin{Version}{1999/04/12 v1.3}
+% \item
+% Fixes removed because of LaTeX [1998/12/01].
+% \item
+% Documentation in dtx format.
+% \item
+% Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt})
+% \item
+% First CTAN release.
+% \end{Version}
+% \begin{Version}{2006/02/20 v1.4}
+% \item
+% Code is not changed.
+% \item
+% New DTX framework.
+% \item
+% LPPL 1.3
+% \end{Version}
+% \begin{Version}{2008/08/11 v1.5}
+% \item
+% Code is not changed.
+% \item
+% URLs updated from \texttt{www.dejanews.com}
+% to \texttt{groups.google.com}.
+% \end{Version}
+% \begin{Version}{2016/05/16 v1.6}
+% \item
+% Documentation updates.
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/twoopt.pdf b/macros/latex/contrib/oberdiek/twoopt.pdf
new file mode 100644
index 0000000000..11c8cc9ae2
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/twoopt.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/uniquecounter.dtx b/macros/latex/contrib/oberdiek/uniquecounter.dtx
new file mode 100644
index 0000000000..7ff2950d25
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/uniquecounter.dtx
@@ -0,0 +1,1056 @@
+% \iffalse meta-comment
+%
+% File: uniquecounter.dtx
+% Version: 2016/05/16 v1.3
+% Info: Provide unlimited unique counter
+%
+% Copyright (C) 2009, 2011 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% 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 uniquecounter.dtx
+% and the derived files
+% uniquecounter.sty, uniquecounter.pdf, uniquecounter.ins,
+% uniquecounter.drv, uniquecounter-example.tex,
+% uniquecounter-test1.tex, uniquecounter-test2.tex,
+% uniquecounter-test3.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/uniquecounter.dtx
+% CTAN:macros/latex/contrib/oberdiek/uniquecounter.pdf
+%
+% Unpacking:
+% (a) If uniquecounter.ins is present:
+% tex uniquecounter.ins
+% (b) Without uniquecounter.ins:
+% tex uniquecounter.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{uniquecounter.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If uniquecounter.drv is present:
+% latex uniquecounter.drv
+% (b) Without uniquecounter.drv:
+% latex uniquecounter.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 uniquecounter.dtx
+% makeindex -s gind.ist uniquecounter.idx
+% pdflatex uniquecounter.dtx
+% makeindex -s gind.ist uniquecounter.idx
+% pdflatex uniquecounter.dtx
+%
+% Installation:
+% TDS:tex/generic/oberdiek/uniquecounter.sty
+% TDS:doc/latex/oberdiek/uniquecounter.pdf
+% TDS:doc/latex/oberdiek/uniquecounter-example.tex
+% TDS:doc/latex/oberdiek/test/uniquecounter-test1.tex
+% TDS:doc/latex/oberdiek/test/uniquecounter-test2.tex
+% TDS:doc/latex/oberdiek/test/uniquecounter-test3.tex
+% TDS:source/latex/oberdiek/uniquecounter.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: uniquecounter 2016/05/16 v1.3 Provide unlimited unique counter (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: uniquecounter
+Version: 2016/05/16 v1.3
+
+Copyright (C) 2009, 2011 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+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 uniquecounter.dtx
+and the derived files
+ uniquecounter.sty, uniquecounter.pdf, uniquecounter.ins,
+ uniquecounter.drv, uniquecounter-example.tex,
+ uniquecounter-test1.tex, uniquecounter-test2.tex,
+ uniquecounter-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{uniquecounter.ins}{\from{uniquecounter.dtx}{install}}%
+ \file{uniquecounter.drv}{\from{uniquecounter.dtx}{driver}}%
+ \usedir{tex/generic/oberdiek}%
+ \file{uniquecounter.sty}{\from{uniquecounter.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{uniquecounter-example.tex}{\from{uniquecounter.dtx}{example}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{uniquecounter-test1.tex}{\from{uniquecounter.dtx}{test1}}%
+% \file{uniquecounter-test2.tex}{\from{uniquecounter.dtx}{test2}}%
+% \file{uniquecounter-test3.tex}{\from{uniquecounter.dtx}{test3}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{uniquecounter.xml}{\from{uniquecounter.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{* uniquecounter.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `uniquecounter.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{uniquecounter.drv}%
+ [2016/05/16 v1.3 Provide unlimited unique counter (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+ \DocInput{uniquecounter.dtx}%
+\end{document}
+%</driver>
+% \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{uniquecounter.drv}
+%
+% \title{The \xpackage{uniquecounter} package}
+% \date{2016/05/16 v1.3}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides a kind of counter that provides unique
+% number values. Several counters can be created by different names.
+% The numeric values are not limited.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \begin{declcs}{UniqueCounterNew} \M{name}
+% \end{declcs}
+% Macro \cs{UniqueCounterNew} creates a new unique counter \meta{name}.
+% An error is thrown, if the counter already exists.
+%
+% \begin{declcs}{UniqueCounterCall} \M{name} \M{code}
+% \end{declcs}
+% Macro \cs{UniqueCounterCall} calls the given \meta{code} with a new
+% value of counter \meta{name} as argument.
+%
+% \begin{declcs}{UniqueCounterIncrement} \M{name}
+% \end{declcs}
+% Macro \cs{UniqueCounterIncrement} generates a new value for the counter
+% \meta{name}
+% by incrementing by one (globally).
+%
+% \begin{declcs}{UniqueCounterGet} \M{name}
+% \end{declcs}
+% Expandable macro \cs{UniqueCounterGet} returns the current value
+% of counter \meta{name}
+%
+% \subsection{Example}
+%
+% \begin{macrocode}
+%<*example>
+\documentclass{minimal}
+\usepackage{uniquecounter}
+\UniqueCounterNew{anchor}
+\makeatletter
+\newcommand*{\DefNewAnchorName}[2]{%
+ % #1 is unique counter value
+ % #2 is name of anchor
+ \@namedef{anchor@#2}{a#1}%
+}
+\newcommand*{\NewAnchorName}[1]{%
+ \UniqueCounterCall{anchor}\DefNewAnchorName{#1}%
+}
+\newcommand*{\PrintAnchorName}[1]{%
+ \@nameuse{anchor@#1}%
+}
+\begin{document}
+ \NewAnchorName{Top}%
+ \NewAnchorName{Left}%
+ \noindent
+ Top: \PrintAnchorName{Top}\\%
+ Left: \PrintAnchorName{Left}%
+\end{document}
+%</example>
+% \end{macrocode}
+%
+% \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@uniquecounter.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{uniquecounter}{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@uniquecounter.sty\endcsname
+\ProvidesPackage{uniquecounter}%
+ [2016/05/16 v1.3 Provide unlimited unique counter (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 uqc@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\uqc@AtEnd{%
+ \uqc@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{43}{12}% +
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
+\TMP@EnsureCode{96}{12}% `
+\edef\uqc@AtEnd{\uqc@AtEnd\noexpand\endinput}
+% \end{macrocode}
+%
+% \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{bigintcalc}[2007/11/11]%
+ \TMP@RequirePackage{infwarerr}[2007/09/09]%
+\else
+ \RequirePackage{bigintcalc}[2007/11/11]%
+ \RequirePackage{infwarerr}[2007/09/09]%
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\uqc@IncNum}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+ \def\uqc@IncNum#1{%
+ \begingroup
+ \count@=\csname uqc@cnt@#1\endcsname\relax
+ \advance\count@\@ne
+ \expandafter\xdef\csname uqc@cnt@#1\endcsname{%
+ \number\count@
+ }%
+ \ifnum\count@=2147483647 %
+ \global\expandafter\let\csname uqc@inc@#1\endcsname
+ \uqc@IncBig
+ \fi
+ \endgroup
+ }%
+\else
+ \def\uqc@IncNum#1{%
+ \expandafter\xdef\csname uqc@cnt@#1\endcsname{%
+ \number\numexpr\csname uqc@cnt@#1\endcsname+1%
+ }%
+ \ifnum\csname uqc@cnt@#1\endcsname=2147483647 %
+ \global\expandafter\let\csname uqc@inc@#1\endcsname
+ \uqc@IncBig
+ \fi
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\uqc@IncBig}
+% \begin{macrocode}
+\def\uqc@IncBig#1{%
+ \expandafter\xdef\csname uqc@cnt@#1\endcsname{%
+ \expandafter\expandafter\expandafter
+ \BigIntCalcInc\csname uqc@cnt@#1\endcsname!%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\uqc@Def}
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname newcommand\endcsname\relax
+ \def\uqc@Def#1{\def#1##1}%
+\else
+ \def\uqc@Def#1{\newcommand*{#1}[1]}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\UniqueCounterNew}
+% \begin{macrocode}
+\uqc@Def\UniqueCounterNew{%
+ \expandafter\ifx\csname uqc@cnt@#1\endcsname\relax
+ \expandafter\xdef\csname uqc@cnt@#1\endcsname{0}%
+ \global\expandafter\let\csname uqc@inc@#1\endcsname\uqc@IncNum
+ \@PackageInfo{uniquecounter}{New unique counter `#1'}%
+ \else
+ \@PackageError{uniquecounter}{Unique counter `#1' is already defined}\@ehc
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\UniqueCounterIncrement}
+% \begin{macrocode}
+\uqc@Def\UniqueCounterIncrement{%
+ \expandafter\ifx\csname uqc@cnt@#1\endcsname\relax
+ \@PackageError{uniquecounter}{Unique counter `#1' is undefined}\@ehc
+ \else
+ \csname uqc@inc@#1\endcsname{#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\UniqueCounterGet}
+% \begin{macrocode}
+\uqc@Def\UniqueCounterGet{%
+ \csname uqc@cnt@#1\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\UniqueCounterCall}
+% \begin{macrocode}
+\uqc@Def\UniqueCounterCall{%
+ \expandafter\ifx\csname uqc@cnt@#1\endcsname\relax
+ \@PackageError{uniquecounter}{Unique counter `#1' is undefined}\@ehc
+ \expandafter\uqc@Call\expandafter0%
+ \else
+ \UniqueCounterIncrement{#1}%
+ \expandafter\expandafter\expandafter\uqc@Call
+ \expandafter\expandafter\expandafter{%
+ \csname uqc@cnt@#1\expandafter\endcsname\expandafter
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\uqc@Call}
+% \begin{macrocode}
+\long\def\uqc@Call#1#2{#2{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\uqc@AtEnd%
+% \end{macrocode}
+% \begin{macrocode}
+%</package>
+% \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 uniquecounter.sty\relax}%
+\fi
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\%=14 %
+ \LoadCommand
+ \RangeCatcodeCheck{0}{36}{15}%
+ \RangeCatcodeCheck{37}{37}{14}%
+ \RangeCatcodeCheck{38}{47}{15}%
+ \RangeCatcodeCheck{48}{57}{12}%
+ \RangeCatcodeCheck{58}{63}{15}%
+ \RangeCatcodeCheck{64}{64}{12}%
+ \RangeCatcodeCheck{65}{90}{11}%
+ \RangeCatcodeCheck{91}{91}{15}%
+ \RangeCatcodeCheck{92}{92}{0}%
+ \RangeCatcodeCheck{93}{96}{15}%
+ \RangeCatcodeCheck{97}{122}{11}%
+ \RangeCatcodeCheck{123}{255}{15}%
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \subsubsection{Test with \LaTeX}
+%
+% \begin{macrocode}
+%<*test2>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{minimal}
+\usepackage{uniquecounter}[2016/05/16]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\newcommand*{\CheckValue}[2]{%
+ \Expect*{#2}*{\UniqueCounterGet{#1}}%
+}
+\newcommand*{\CheckSpace}[1]{%
+ \sbox0{#1}%
+ \Expect{0.0pt}*{\the\wd0}%
+}
+
+\begin{qstest}{creation}{creation}
+ \CheckSpace{%
+ \UniqueCounterNew{test}%
+ }%
+ \CheckValue{test}{0}%
+\end{qstest}
+
+\begin{qstest}{increment}{increment}
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \CheckValue{test}{1}%
+ \makeatletter
+ \def\uqc@cnt@test{2147483645}%
+ \CheckValue{test}{2147483645}%
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \CheckValue{test}{2147483646}%
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \Expect{true}*{\ifx\uqc@inc\uqc@NumInc true\else false\fi}%
+ \CheckValue{test}{2147483647}%
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \CheckValue{test}{2147483648}%
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \CheckValue{test}{2147483649}%
+\end{qstest}
+
+\begin{qstest}{call}{call}
+ \def\CheckCall#1#2{%
+ \Expect{#1}{#2}%
+ }%
+ \CheckSpace{%
+ \UniqueCounterNew{foo}%
+ }%
+ \CheckValue{foo}{0}%
+ \def\Check#1{%
+ \CheckSpace{%
+ \UniqueCounterCall{foo}{\CheckCall}{#1}%
+ }%
+ \CheckValue{foo}{#1}%
+ }%
+ \Check{1}%
+ \Check{2}%
+ \Check{3}%
+ \Check{4}%
+ \Check{5}%
+ \Check{6}%
+ \Check{7}%
+ \Check{8}%
+ \Check{9}%
+ \Check{10}%
+ \Check{11}%
+ \Check{12}%
+\end{qstest}
+
+\csname @@end\endcsname
+%</test2>
+% \end{macrocode}
+% \subsubsection{Test with plain-\TeX}
+%
+% \begin{macrocode}
+%<*test3>
+\input uniquecounter.sty\relax
+\catcode`\@=11 %
+\def\CheckValue#1#2{%
+ \begingroup
+ \edef\A{#2}%
+ \edef\B{\UniqueCounterGet{#1}}%
+ \ifx\A\B
+ \else
+ \@PackageError{TEST}{Failed: \A\space<> \B}\@ehc
+ \fi
+ \endgroup
+}
+\def\CheckSpace#1{%
+ \setbox0=\hbox{#1}%
+ \ifdim\wd0=\z@
+ \else
+ \@PackageError{TEST}{Failed: 0.0pt <> \the\wd0}\@ehc
+ \fi
+}
+
+\begingroup
+ \CheckSpace{%
+ \UniqueCounterNew{test}%
+ }%
+ \CheckValue{test}{0}%
+\endgroup
+
+\begingroup
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \CheckValue{test}{1}%
+ \def\uqc@cnt@test{2147483645}%
+ \CheckValue{test}{2147483645}%
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \CheckValue{test}{2147483646}%
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \ifx\uqc@inc\uqc@NumInc
+ \else
+ \@PackageError{TEST}{Failed: wrong inc function}\@ehc
+ \fi
+ \CheckValue{test}{2147483647}%
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \CheckValue{test}{2147483648}%
+ \CheckSpace{%
+ \UniqueCounterIncrement{test}%
+ }%
+ \CheckValue{test}{2147483649}%
+\endgroup
+\begingroup
+ \def\CheckCall#1#2{%
+ \begingroup
+ \def\A{#1}%
+ \def\B{#2}%
+ \ifx\A\B
+ \else
+ \@PackageError{TEST}{Failed: \A\space <> \B}\@ehc
+ \fi
+ \endgroup
+ }%
+ \CheckSpace{%
+ \UniqueCounterNew{foo}%
+ }%
+ \CheckValue{foo}{0}%
+ \CheckSpace{%
+ \UniqueCounterCall{foo}{\CheckCall}{1}%
+ }%
+ \CheckSpace{%
+ \UniqueCounterCall{foo}{\CheckCall}{2}%
+ }%
+ \CheckValue{foo}{2}%
+\endgroup
+\csname @@end\endcsname\end
+%</test3>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/uniquecounter}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/uniquecounter.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/uniquecounter.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[\CTAN{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 uniquecounter.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@{}}
+% uniquecounter.sty & tex/generic/oberdiek/uniquecounter.sty\\
+% uniquecounter.pdf & doc/latex/oberdiek/uniquecounter.pdf\\
+% uniquecounter-example.tex & doc/latex/oberdiek/uniquecounter-example.tex\\
+% test/uniquecounter-test1.tex & doc/latex/oberdiek/test/uniquecounter-test1.tex\\
+% test/uniquecounter-test2.tex & doc/latex/oberdiek/test/uniquecounter-test2.tex\\
+% test/uniquecounter-test3.tex & doc/latex/oberdiek/test/uniquecounter-test3.tex\\
+% uniquecounter.dtx & source/latex/oberdiek/uniquecounter.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk uniquecounter.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{uniquecounter.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 uniquecounter.dtx
+%makeindex -s gind.ist uniquecounter.idx
+%pdflatex uniquecounter.dtx
+%makeindex -s gind.ist uniquecounter.idx
+%pdflatex uniquecounter.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{uniquecounter.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='uniquecounter'>
+ <name>uniquecounter</name>
+ <caption>Provides unlimited unique counter.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2009,2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.3'/>
+ <description>
+ This package provides a kind of counter that provides unique
+ number values. Several counters can be created with different names.
+ The numeric values are not limited.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/uniquecounter.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/uniquecounter.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \begin{History}
+% \begin{Version}{2009/09/11 v1.0}
+% \item
+% First public version.
+% \end{Version}
+% \begin{Version}{2009/12/18 v1.1}
+% \item
+% Bug fix in \cs{UniqueCounterCall} for values \textgreater\ 9
+% (bug report of Lev Bishop).
+% \end{Version}
+% \begin{Version}{2011/01/30 v1.2}
+% \item
+% Already loaded package files are not input in \hologo{plainTeX}.
+% \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/uniquecounter.pdf b/macros/latex/contrib/oberdiek/uniquecounter.pdf
new file mode 100644
index 0000000000..560ffbbdeb
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/uniquecounter.pdf
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/zref.dtx b/macros/latex/contrib/oberdiek/zref.dtx
new file mode 100644
index 0000000000..890b09c285
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/zref.dtx
@@ -0,0 +1,6928 @@
+% \iffalse meta-comment
+%
+% File: zref.dtx
+% Version: 2018/11/21 v2.27
+% Info: A new reference scheme for LaTeX
+%
+% Copyright (C) 2006-2012 by
+% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+% 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
+% http://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work is Heiko Oberdiek.
+%
+% This work consists of the main source file zref.dtx
+% and the derived files
+% zref.sty, zref.pdf, zref.ins, zref.drv, zref-base.sty,
+% zref-abspage.sty, zref-abspos.sty, zref-counter.sty,
+% zref-dotfill.sty, zref-env.sty, zref-hyperref.sty,
+% zref-lastpage.sty, zref-marks.sty, zref-nextpage.sty,
+% zref-pageattr.sty, zref-pagelayout.sty, zref-perpage.sty,
+% zref-runs.sty, zref-savepos.sty, zref-thepage.sty,
+% zref-titleref.sty, zref-totpages.sty, zref-user.sty,
+% zref-xr.sty, zref-example.tex, zref-example-lastpage.tex,
+% zref-example-nextpage.tex, zref-test1.tex,
+% zref-test-base.tex, zref-test-runs.tex,
+% zref-test-titleref-memoir.tex.
+%
+% Distribution:
+% CTAN:macros/latex/contrib/oberdiek/zref.dtx
+% CTAN:macros/latex/contrib/oberdiek/zref.pdf
+%
+% Unpacking:
+% (a) If zref.ins is present:
+% tex zref.ins
+% (b) Without zref.ins:
+% tex zref.dtx
+% (c) If you insist on using LaTeX
+% latex \let\install=y\input{zref.dtx}
+% (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+% (a) If zref.drv is present:
+% latex zref.drv
+% (b) Without zref.drv:
+% latex zref.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 zref.dtx
+% makeindex -s gind.ist zref.idx
+% pdflatex zref.dtx
+% makeindex -s gind.ist zref.idx
+% pdflatex zref.dtx
+%
+% Installation:
+% TDS:tex/latex/oberdiek/zref.sty
+% TDS:tex/latex/oberdiek/zref-base.sty
+% TDS:tex/latex/oberdiek/zref-abspage.sty
+% TDS:tex/latex/oberdiek/zref-abspos.sty
+% TDS:tex/latex/oberdiek/zref-counter.sty
+% TDS:tex/latex/oberdiek/zref-dotfill.sty
+% TDS:tex/latex/oberdiek/zref-env.sty
+% TDS:tex/latex/oberdiek/zref-hyperref.sty
+% TDS:tex/latex/oberdiek/zref-lastpage.sty
+% TDS:tex/latex/oberdiek/zref-marks.sty
+% TDS:tex/latex/oberdiek/zref-nextpage.sty
+% TDS:tex/latex/oberdiek/zref-pageattr.sty
+% TDS:tex/latex/oberdiek/zref-pagelayout.sty
+% TDS:tex/latex/oberdiek/zref-perpage.sty
+% TDS:tex/latex/oberdiek/zref-runs.sty
+% TDS:tex/latex/oberdiek/zref-savepos.sty
+% TDS:tex/latex/oberdiek/zref-thepage.sty
+% TDS:tex/latex/oberdiek/zref-titleref.sty
+% TDS:tex/latex/oberdiek/zref-totpages.sty
+% TDS:tex/latex/oberdiek/zref-user.sty
+% TDS:tex/latex/oberdiek/zref-xr.sty
+% TDS:doc/latex/oberdiek/zref.pdf
+% TDS:doc/latex/oberdiek/zref-example.tex
+% TDS:doc/latex/oberdiek/zref-example-lastpage.tex
+% TDS:doc/latex/oberdiek/zref-example-nextpage.tex
+% TDS:doc/latex/oberdiek/test/zref-test1.tex
+% TDS:doc/latex/oberdiek/test/zref-test-base.tex
+% TDS:doc/latex/oberdiek/test/zref-test-runs.tex
+% TDS:doc/latex/oberdiek/test/zref-test-titleref-memoir.tex
+% TDS:source/latex/oberdiek/zref.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
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: zref 2018/11/21 v2.27 A new reference scheme for LaTeX (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: zref
+Version: 2018/11/21 v2.27
+
+Copyright (C) 2006-2012 by
+ Heiko Oberdiek <heiko.oberdiek at googlemail.com>
+
+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
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+This Current Maintainer of this work is Heiko Oberdiek.
+
+This work consists of the main source file zref.dtx
+and the derived files
+ zref.sty, zref.pdf, zref.ins, zref.drv, zref-base.sty,
+ zref-abspage.sty, zref-abspos.sty, zref-counter.sty,
+ zref-dotfill.sty, zref-env.sty, zref-hyperref.sty,
+ zref-lastpage.sty, zref-marks.sty, zref-nextpage.sty,
+ zref-pageattr.sty, zref-pagelayout.sty, zref-perpage.sty,
+ zref-runs.sty, zref-savepos.sty, zref-thepage.sty,
+ zref-titleref.sty, zref-totpages.sty, zref-user.sty,
+ zref-xr.sty, zref-example.tex, zref-example-lastpage.tex,
+ zref-example-nextpage.tex, zref-test1.tex,
+ zref-test-base.tex, zref-test-runs.tex,
+ zref-test-titleref-memoir.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+ \file{zref.ins}{\from{zref.dtx}{install}}%
+ \file{zref.drv}{\from{zref.dtx}{driver}}%
+ \usedir{tex/latex/oberdiek}%
+ \file{zref.sty}{\from{zref.dtx}{package}}%
+ \file{zref-base.sty}{\from{zref.dtx}{base}}%
+ \file{zref-abspage.sty}{\from{zref.dtx}{abspage}}%
+ \file{zref-abspos.sty}{\from{zref.dtx}{abspos}}%
+ \file{zref-counter.sty}{\from{zref.dtx}{counter}}%
+ \file{zref-dotfill.sty}{\from{zref.dtx}{dotfill}}%
+ \file{zref-env.sty}{\from{zref.dtx}{env}}%
+ \file{zref-hyperref.sty}{\from{zref.dtx}{hyperref}}%
+ \file{zref-lastpage.sty}{\from{zref.dtx}{lastpage}}%
+ \file{zref-marks.sty}{\from{zref.dtx}{marks}}%
+ \file{zref-nextpage.sty}{\from{zref.dtx}{nextpage}}%
+ \file{zref-pageattr.sty}{\from{zref.dtx}{pageattr}}%
+ \file{zref-pagelayout.sty}{\from{zref.dtx}{pagelayout}}%
+ \file{zref-perpage.sty}{\from{zref.dtx}{perpage}}%
+ \file{zref-runs.sty}{\from{zref.dtx}{runs}}%
+ \file{zref-savepos.sty}{\from{zref.dtx}{savepos}}%
+ \file{zref-thepage.sty}{\from{zref.dtx}{thepage}}%
+ \file{zref-titleref.sty}{\from{zref.dtx}{titleref}}%
+ \file{zref-totpages.sty}{\from{zref.dtx}{totpages}}%
+ \file{zref-user.sty}{\from{zref.dtx}{user}}%
+ \file{zref-xr.sty}{\from{zref.dtx}{xr}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{zref-example.tex}{\from{zref.dtx}{example}}%
+ \file{zref-example-lastpage.tex}{\from{zref.dtx}{example-lastpage}}%
+ \file{zref-example-nextpage.tex}{\from{zref.dtx}{example-nextpage}}%
+% \usedir{doc/latex/oberdiek/test}%
+% \file{zref-test1.tex}{\from{zref.dtx}{test1}}%
+% \file{zref-test-base.tex}{\from{zref.dtx}{test-base}}%
+% \file{zref-test-runs.tex}{\from{zref.dtx}{test-runs}}%
+% \file{zref-test-titleref-memoir.tex}{\from{zref.dtx}{test-titleref-memoir}}%
+ \nopreamble
+ \nopostamble
+% \usedir{source/latex/oberdiek/catalogue}%
+% \file{zref.xml}{\from{zref.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{* zref.sty, zref-base.sty, zref-abspage.sty, zref-abspos.sty,}
+\Msg{* zref-counter.sty, zref-dotfill.sty, zref-env.sty,}
+\Msg{* zref-hyperref.sty, zref-lastpage.sty, zref-marks.sty,}
+\Msg{* zref-nextpage.sty, zref-pageattr.sty, zref-pagelayout.sty,}
+\Msg{* zref-perpage.sty, zref-runs.sty, zref-savepos.sty,}
+\Msg{* zref-thepage.sty, zref-titleref.sty, zref-totpages.sty,}
+\Msg{* zref-user.sty, zref-xr.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `zref.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{zref.drv}%
+ [2018/11/21 v2.27 A new reference scheme for LaTeX (HO)]%
+\documentclass{ltxdoc}
+\usepackage{holtxdoc}[2011/11/22]
+\setlength{\emergencystretch}{1em}
+\begin{document}
+ \DocInput{zref.dtx}%
+\end{document}
+%</driver>
+% \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{zref.drv}
+%
+% \title{The \xpackage{zref} package}
+% \date{2018/11/21 v2.27}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at https://github.com/ho-tex/oberdiek/issues}\\
+% \xemail{heiko.oberdiek at googlemail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% Package \xpackage{zref} tries to get rid of the restriction
+% in \hologo{LaTeX}'s reference system that only two properties are
+% supported. The package implements an extensible referencing
+% system, where properties are handled in a more flexible way.
+% It offers an interface for macro programmers for the access
+% to the system and some applications that uses the new
+% reference scheme.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newcommand*{\metacs}[1]{\texttt{\itshape #1}}
+%
+% \newcommand{\markexp}{^^A
+% \textsuperscript{exp}^^A
+% \space
+% }
+% \newcommand{\markexptwo}{^^A
+% \textsuperscript{exp2}^^A
+% \space
+% }
+% \newcommand{\markrobust}{^^A
+% \textsuperscript{robust}^^A
+% \space
+% }
+% \newcommand{\marknowarn}{^^A
+% \textsuperscript{nowarn}^^A
+% \space
+% }
+% \newcommand{\markbabel}{^^A
+% \textsuperscript{babel}^^A
+% \space
+% }
+%
+% \section{Introduction}
+%
+% Standard \hologo{LaTeX}'s reference system with \cs{label}, \cs{ref},
+% and \cs{pageref} supports two properties, the apperance of
+% the counter that is last incremented by \cs{refstepcounter} and
+% the page with the \cs{label} command.
+%
+% Unhappily \hologo{LaTeX} does not provide an interface for adding
+% another properties. Packages such as \xpackage{hyperref},
+% \xpackage{nameref}, or \xpackage{titleref} are forced to
+% use ugly hacks to extend the reference system.
+% These ugly hacks are one of the causes for \xpackage{hyperref}'s
+% difficulty regarding compatibility with other packages.
+%
+% \subsection{Standard \hologo{LaTeX} behaviour}
+%
+% References are created by the \cs{label} command:
+% \begin{quote}
+% |\chapter{Second chapter}|\\
+% |\section{First section on page 7} % section 2.1|\\
+% |\label{myref}|
+% \end{quote}
+% Now \hologo{LaTeX} records the section number |2.1| and the page |7|
+% in the reference. Internally the reference is a list with
+% two entries:
+% \begin{quote}
+% |\r@myref| $\rightarrow$ |{2.1}{7}|
+% \end{quote}
+% The length of the list if fixed in the \hologo{LaTeX} kernel,
+% An interface for adding new properties is missing.
+%
+% There are several tries to add new properties:
+% \begin{description}
+% \item[\xpackage{hyperref}] uses a list of five
+% properties instead of the standard list with two entries.
+% This causes many compatibility problems with \hologo{LaTeX} and
+% other packages.
+% \item[\xpackage{titleref}] stores its title data into the
+% first entry in the list. \hologo{LaTeX} is happy because it
+% does only see its list with two entries. The situation
+% becomes more difficult, if more properties are added
+% this way. Then the macros form a nested structure
+% inside the first reference argument for the label.
+% Expandable extractions will then become painful.
+% \end{description}
+%
+% \subsection{Basic idea}
+%
+% Some time ago Morten H\o gholm sent me an experimental
+% cross referencing mechanism as ``expl3'' code. His
+% idea is:
+% \begin{quote}
+% |\g_xref_mylabel_plist| $\rightarrow$\\
+% \mbox{}\qquad|\xref_dance_key{salsa}\xref_name_key{Morten}|\dots
+% \end{quote}
+% The entries have the following format:
+% \begin{quote}
+% |\xref_|\meta{your key}|_key{|\meta{some text}|}|
+% \end{quote}
+% This approach is much more flexible:
+% \begin{itemize}
+% \item New properties can easily be added, just use a new key.
+% \item The length of the list is not fixed. A reference
+% can use a subset of the keys.
+% \item The order of the entries does not matter.
+% \end{itemize}
+% Unhappily I am not familiar with the experimental code
+% for \hologo{LaTeX3} that will need some time before its first release.
+% Thus I have implemented it as \hologo{LaTeXe} package without disturbing
+% the existing \hologo{LaTeX} reference system.
+%
+% \subsection{Interfaces}
+%
+% The package provides a generic \emph{interface for programmers}.
+% Commands of this interface are prefixed by \cs{zref@}.
+%
+% Option \xoption{user} enabels the \emph{user interface}.
+% Here the commands are prefixed by \cs{z} to avoid name
+% clashes with existing macros.
+%
+% Then the packages provides some \emph{modules}. They
+% are applications for the reference system and can also be
+% considered as examples how to use the reference system.
+%
+% The modules can be loaded as packages. The package
+% name is prefixed with |zref-|, for example:
+%\begin{quote}
+%\begin{verbatim}
+%\RequirePackage{zref-abspage}
+%\end{verbatim}
+%\end{quote}
+% This is the preferred way if the package is loaded from
+% within other packages to avoid option clashes.
+%
+% As alternative package |zref| can be used and the modules
+% are given as options:
+%\begin{quote}
+%\begin{verbatim}
+%\usepackage[perpage,user]{zref}
+%\end{verbatim}
+%\end{quote}
+%
+% \section{Interface for programmers}
+%
+% The user interface is described in the next section \ref{sec:user}.
+%
+% \subsection{Entities}
+%
+% \paragraph{Reference.}
+% Internally a reference is a list of key value pairs:
+% \begin{quote}
+% |\Z@R@myref| $\rightarrow$
+% |\default{2.1}\page{7}|
+% \end{quote}
+% The generic format of a entry is:
+% \begin{quote}
+% |\Z@R@|\meta{refname} $\rightarrow$
+% |\|\meta{propname}|{|\meta{value}|}|
+% \end{quote}
+% \meta{refname} is the name that denoted references
+% (the name used in \cs{label} and \cs{ref}). \meta{propname}
+% is the name of the property or key. The property key macro
+% is never executed, it is used in parameter text matching only.
+%
+% \paragraph{Property.}
+% Because the name of a property is used in a macro name
+% that must survive the \xfile{.aux} file, the name is
+% restricted to letters and `@'.
+%
+% \paragraph{Property list.}
+% Often references are used for special purposes. Thus it
+% saves memory if just the properties are used in this
+% reference that are necessary for its purpose.
+%
+% Therefore this package uses the concept of \emph{property lists}.
+% A property list is a set of properties. The set of properties
+% that is used by the default \cs{label} command is the
+% \emph{main property list}.
+%
+% \subsection{Property list}
+%
+% \markexp means that the implementation of the
+% marked macro is expandable. \markexptwo goes a step further
+% and marks the macro expandable in exact two expansion steps.
+%
+% \begin{declcs}{zref@newlist}
+% \M{listname}
+% \end{declcs}
+% Declares a new empty property list.
+%
+% \begin{declcs}{zref@addprop}
+% \M{listname} \M{propname}\\
+% \cs{zref@localaddprop} \M{listname} \M{propname}
+% \end{declcs}
+% Adds the property \meta{propname}
+% to the property list \meta{listname}.
+% The property and list must exist.
+% The addition is global by \cs{zref@addprop} and limited to
+% local scope by \cs{zref@localaddprop}.
+% Between 2010/04/19 v2.13 and 2010/10/22 v2.19 a comma separated list
+% of properties could be used as argument \meta{propname}.
+% Since 2010/10/22 v2.19 the addition of several properties
+% at once is supported by \cs{zref@addprops}.
+%
+% \begin{declcs}{zref@addprops}
+% \M{listname} \M{propname list}\\
+% \cs{zref@localaddprops} \M{listname} \M{propname list}
+% \end{declcs}
+% These macros add a comma separated list of properties
+% \meta{propname list} to list \meta{listname}.
+% \cs{zref@addprops} works globally and \cs{zref@localaddprops}
+% locally. Since 2010/10/22 v2.19.
+%
+% \begin{declcs}{zref@listexists}
+% \M{listname} \M{then}
+% \end{declcs}
+% Executes \meta{then} if the property list \meta{listname} exists
+% or raise an error otherwise.
+%
+% \begin{declcs}{zref@iflistundefined}\markexp \M{listname}
+% \M{then} \M{else}
+% \end{declcs}
+% Executes \meta{then} if the list exists or \meta{else}
+% otherwise.
+%
+% \begin{declcs}{zref@iflistcontainsprop}
+% \M{listname} \M{propname} \M{then} \M{else}
+% \end{declcs}
+% Executes \meta{then} if the property \meta{propname} is part
+% of property list \meta{listname} or otherwise it
+% runs the \meta{else} part.
+%
+% \subsection{Property}
+%
+% \begin{declcs}{zref@newprop}
+% \* \M{propname} |[|\meta{default}|]| \M{value}
+% \end{declcs}
+% This command declares and configures a new property with
+% name \meta{propname}.
+%
+% In case of unknown references
+% or the property does not exist in the reference, the
+% \meta{default} is used as value. If it is not specified
+% here, a global default is used, see \cs{zref@setdefault}.
+%
+% The correct values of some properties are not known
+% immediately but at page shipout time. Prominent example
+% is the page number. These properties are declared with
+% the star form of the command.
+%
+% \begin{declcs}{zref@setcurrent}
+% \M{propname} \M{value}
+% \end{declcs}
+% This sets the current value of the property \meta{propname}.
+% It is a generalization of setting \hologo{LaTeX}'s \cs{currentlabel}.
+%
+% \begin{declcs}{zref@getcurrent}\markexptwo
+% \M{propname}
+% \end{declcs}
+% This returns the current value of the property \meta{propname}.
+% The value may not be correct, especially if the property
+% is bound to a page (start form of \cs{zref@newprop}) and the
+% right value is only known at shipout time (e.g. property `page').
+% In case of errors (e.g. unknown property) the empty string is
+% returned.
+%
+% Since version 2010/04/22 v2.14 \cs{zref@getcurrent} supports
+% \cs{zref@wrapper@unexpanded}.
+%
+% \begin{declcs}{zref@propexists}
+% \M{propname} \M{then}
+% \end{declcs}
+% Calls \meta{then} if the property \meta{propname} is available
+% or generates an error message otherwise.
+%
+% \begin{declcs}{zref@ifpropundefined}\markexp
+% \M{propname} \M{then} \M{else}
+% \end{declcs}
+% Calls \meta{then} or \meta{else} depending on the existence
+% of property \meta{propname}.
+%
+% \subsection{Reference generation}
+%
+% \begin{declcs}{zref@label}
+% \M{refname}
+% \end{declcs}
+% This works similar to \cs{label}. The reference \meta{refname} is
+% created and put into the \xfile{.aux} file with the
+% properties of the main property list.
+%
+% \begin{declcs}{zref@labelbylist}
+% \M{refname} \M{listname}
+% \end{declcs}
+% Same as \cs{zref@label} except that the properties are
+% taken from the specified property list \meta{listname}.
+%
+% \begin{declcs}{zref@labelbyprops}
+% \M{refname} |{|\meta{propnameA}|,|\meta{propnameB}|,|\dots|}|
+% \end{declcs}
+% Same as \cs{zref@label} except that these properties
+% are used that are given as comma separated list in the
+% second argument.
+%
+% \begin{declcs}{zref@newlabel}
+% \M{refname} |{|\dots|}|
+% \end{declcs}
+% This is the macro that is used in the \xfile{.aux} file.
+% It is basically the same as \cs{newlabel} apart from
+% the format of the data in the second argument.
+%
+% \subsection{Data extraction}
+%
+% \begin{declcs}{zref@extractdefault}\markexptwo
+% \M{refname} \M{propname} \M{default}
+% \end{declcs}
+% This is the basic command that refernces the value of a
+% property \meta{propname} for the reference \meta{refname}.
+% In case of errors such as undefined reference the \meta{default}
+% is used instead.
+%
+% \begin{declcs}{zref@extract}\markexptwo
+% \M{refname} \M{propname}
+% \end{declcs}
+% The command is an abbreviation for \cs{zref@extractdefault}.
+% As default the default of the property is taken, otherwise
+% the global default.
+%
+% Example for page references:
+% \begin{quote}
+% \begin{tabular}{@{}ll}
+% \hologo{LaTeX}:& |\pageref{foobar}|\\
+% \xpackage{zref}:& |\zref@extract{foobar}{page}|
+% \end{tabular}
+% \end{quote}
+% Both \cs{zref@extract} and \cs{zref@extractdefault} are
+% expandable. That means, these macros can directly
+% be used in expandable calculations, see the example file.
+% On the other side, babel's shorthands are not supported,
+% there are no warnings in case of undefined references.
+%
+% If an user interface doesn't need expandable macros
+% then it can use \cs{zref@refused} and \cs{zref@wrapper@babel}
+% for its user macros.
+%
+% \begin{declcs}{zref@refused}
+% \M{refname}
+% \end{declcs}
+% This command is not expandable. It causes the warnings if
+% the reference \meta{refname} is not defined. Use the
+% \cs{zref@extract} commands inside expandable contexts and
+% mark their use outside by \cs{zref@refused}, see the example
+% file.
+%
+% \begin{declcs}{zref@def@extract}%
+% \M{cmd} \M{refname} \M{propname}\\
+% \cs{zref@def@extractdefault}
+% \M{cmd} \M{refname} \M{propname} \M{default}
+% \end{declcs}
+% Both macros extract the property \meta{propname} from the reference
+% \meta{refname} the same way as macros \cs{zref@extract} and
+% \cs{zref@extractdefault}. The result is stored in macro \meta{cmd}.
+% Also \cs{zref@refused} is called to notify \hologo{LaTeX} that
+% the reference \meta{refname} is used. Added in 2011/10/04 v2.22.
+%
+% \begin{declcs}{zref@ifrefundefined}\markexp
+% \M{refname} \M{then} \M{else}
+% \end{declcs}
+% Macro \cs{zref@ifrefundefined} calls arguments \meta{then} or \meta{else}
+% dependent on the existence of the reference \meta{refname}.
+%
+% \begin{declcs}{zifrefundefined}
+% \M{refname} \M{then} \M{else}
+% \end{declcs}
+% Macro \cs{zifrefundefined} calls \cs{ref@refused} before
+% executing \cs{zref@ifrefundefined}. Babel shorthands are
+% supported in \meta{refname}.
+%
+% \begin{declcs}{zref@ifrefcontainsprop}\markexp
+% \M{refname} \M{propname} \M{then} \M{else}
+% \end{declcs}
+% Test whether a reference provides a property.
+%
+% \subsection{Setup}
+%
+% \begin{declcs}{zref@default}
+% \end{declcs}
+% Holds the global default for unknown values.
+%
+% \begin{declcs}{zref@setdefault}
+% |{|\meta{value}|}|
+% \end{declcs}
+% Sets the global default for unknown values.
+% The global default is used, if a property does not specify
+% an own default and the value for a property
+% cannot be extracted. This can happen if the reference is
+% unknown or the reference does not have the property.
+%
+% \begin{declcs}{zref@setmainlist}
+% |{|\meta{value}|}|
+% \end{declcs}
+% Sets the name of the main property list. The package
+% sets and uses |main|.
+%
+% \subsection{Declared properties}
+%
+% \begin{quote}
+% \renewcommand*{\arraystretch}{1.05}
+% \setlength{\tabcolsep}{2\tabcolsep}
+% \def\VV{\vphantom{\large \"Ag}}
+% \def\EMPTY{{\itshape\textless empty\textgreater}}
+% \def\pl#1{&#1&thepage&\cs{number}\cs{#1}}
+% \begin{tabular}{@{}>{\sffamily}l|>{\ttfamily}l|>{\ttfamily}l|>{\ttfamily}l@{}}
+% \rmfamily Module&
+% \rmfamily Property&
+% \rmfamily Property list&
+% \rmfamily Default\\
+% \hline
+% (base)
+% & default & main & \EMPTY\\
+% & page & main & \EMPTY\\
+% \hline
+% abspage
+% & abspage & main & 0\\
+% \hline
+% counter
+% & counter & main & \EMPTY\\
+% \hline
+% hyperref
+% & anchor & main & \EMPTY\\
+% & url & & \EMPTY\\
+% \hline
+% pageattr
+% & pdfpageattr & thepage & \dots\\
+% & pdfpagesattr & LastPage & \dots\\
+% \hline
+% pagelayout\footnotemark
+% \pl{mag}\\
+% \pl{paperwidth}\\
+% \pl{paperheight}\\
+% \pl{stockwidth}\\
+% \pl{stockheight}\\
+% \pl{pdfpageheight}\\
+% \pl{pdfpagewidth}\\
+% \pl{pdfhorigin}\\
+% \pl{pdfvorigin}\\
+% \pl{hoffset}\\
+% \pl{voffset}\\
+% \pl{topmargin}\\
+% \pl{oddsidemargin}\\
+% \pl{evensidemargin}\\
+% \pl{textwidth}\\
+% \pl{textheight}\\
+% \pl{headheight}\\
+% \pl{headsep}\\
+% \pl{footskip}\\
+% \pl{marginparwidth}\\
+% \pl{marginparsep}\\
+% \pl{columnwidth}\\
+% \pl{columnsep}\\
+% \hline
+% perpage
+% & pagevalue & perpage & 0\\
+% & page & perpage & \EMPTY\\
+% & abspage & perpage & 0\\
+% \hline
+% savepos
+% & posx & savepos & 0\\
+% & posy & savepos & 0\\
+% \hline
+% titleref
+% & title & main & \EMPTY\\
+% \hline
+% xr
+% & anchor & & \EMPTY\\
+% & externaldocument & & \EMPTY\\
+% & theotype & & \EMPTY\\
+% & title & & \EMPTY\\
+% & url & & \EMPTY\\
+% \end{tabular}
+% \footnotetext{Module \xmodule{pagelayout} only defines properties
+% if the parameter exists.}%
+% \end{quote}
+%
+% \subsection{Wrapper for advanced situations}
+%
+% \begin{declcs}{zref@wrapper@babel}
+% |{|\dots|}| \M{name}
+% \end{declcs}
+% This macro helps to add shorthand support. The second
+% argument is protected, then the code of the first argument
+% is called with the protected name appended. Examples
+% are in the sources.
+%
+% \begin{declcs}{zref@wrapper@immediate}
+% |{|\dots|}|
+% \end{declcs}
+% There are situations where a label must be written instantly
+% to the \xfile{.aux} file, for example after the last page.
+% If the \cs{zlabel} or \cs{label} command is put inside this wrapper,
+% immediate writing is enabled. See the implementation for
+% module \xmodule{lastpage} for an example of its use.
+%
+% \begin{declcs}{zref@wrapper@unexpanded}
+% |{|\dots|}|
+% \end{declcs}
+% Assuming someone wants to extract a value for property |bar|
+% and store the result in a macro |\foo| without traces of
+% the expanding macros and without expanding the value.
+% This (theoretical?) problem can be solved by this wrapper:
+% \begin{quote}
+%\begin{verbatim}
+%\zref@wrapper@unexpanded{%
+% \edef\foo{%
+% \zref@extract{someref}{bar}%
+% }%
+%}
+%\end{verbatim}
+% \end{quote}
+% The \cs{edef} forces the expansion of \cs{zref@extract},
+% but the extraction of the value is prevented by
+% the wrapper that uses \hologo{eTeX}'\ \cs{unexpanded} for this
+% purpose. Supported macros are \cs{zref@extract}, \cs{zref@extractdefault}
+% and since version 2010/04/22 v2.14 macro \cs{zref@getcurrent}.
+%
+% \subsection{Counter for unique names}
+%
+% Some modules (\xmodule{titleref} and \xmodule{dotfillmin})
+% need unique names for automatically generated label names.
+%
+% \begin{declcs}{zref@require@unique}
+% \end{declcs}
+% This command creates the unique counter |zref@unique| if the
+% counter does not already exist.
+%
+% \begin{declcs}{thezref@unique}
+% \end{declcs}
+% This command is used to generate unique label names.
+%
+% \section{User interface}\label{sec:user}
+%
+% \subsection{Module \xmodule{user}}
+%
+% The user interface for this package and its modules
+% is enabled by \xpackage{zref}'s package option \xmodule{user}
+% or package \xpackage{zref-user}.
+% The names of user commands are prefixed by |z| in order
+% to avoid name clashes with existing macros of the same
+% functionality. Thus the package does not disturb the
+% traditional reference scheme, both can be used together.
+%
+% The syntax descriptions contain the following markers
+% that are intended as hints for programmers:
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% \markbabel\unskip & Babel shorthands are allowed.\\
+% \markrobust\unskip & Robust macro.\\
+% \markexp\unskip & Expandable version:\\
+% & \textbullet\ robust,
+% unless the extracted values are fragile,\\
+% & \textbullet\ no babel shorthand suport.\\
+% \markexptwo\unskip & Expandable like \markexp and:\\
+% & \textbullet\ expandable in exact two steps.\\
+% \end{tabular}
+% \end{quote}
+%
+% The basic user interface of the package without modules
+% are commands that mimic the standard \hologo{LaTeX} behaviour
+% of \cs{label}, \cs{ref}, and \cs{pageref}:
+%
+% \begin{declcs}{zlabel}
+% \M{refname}\markbabel
+% \end{declcs}
+% Similar to \cs{label}. It generates a label with name
+% \meta{refname} in the new reference scheme.
+%
+% \begin{declcs}{zref}
+% |[|\meta{propname}|]| \M{refname}\markbabel
+% \end{declcs}
+% Without optional argument similar to \cs{ref}, it returns
+% the default reference property. This property is named
+% |default|:
+% \[
+% |\zref{|x|}| \equiv |\zref[default]{|x|}|
+% \]
+%
+% \begin{declcs}{zpageref}
+% \M{refname}\markbabel
+% \end{declcs}
+% Convenience macro, similar to \cs{pageref}.
+% \[
+% |\zpageref{|x|}| \equiv |\zref[page]{|x|}|
+% \]
+%
+% \begin{declcs}{zrefused}
+% \M{refname}\markbabel
+% \end{declcs}
+% Some of the user commands in the modules are expandable.
+% The use of such commands do not cause any undefined
+% reference warnings, because inside of expandable
+% contexts this is not possible. However, if there is
+% a place outside of expandable contexts, \cs{refused}
+% is strongly recommended. The reference \meta{refname}
+% is marked as used, undefined ones will generate
+% warnings.
+%
+% \subsection{Module \xmodule{abspage}}
+%
+% With the help of package \xpackage{atbegshi}
+% a new counter |abspage| with absolute page numbers is provided.
+% Also a new property |abspage| is defined and added to the
+% main property list. Thus you can reference the absolute
+% page number:
+% \begin{quote}
+% |Section \zref{foo} is on page \zpageref{foo}.|\\
+% |This is page \zref[abspage]{foo}|\\
+% |of \zref[abspage]{LastPage}.|
+% \end{quote}
+% The example also makes use of module \xmodule{lastpage}.
+%
+% \subsection{Module \xmodule{lastpage}}
+%
+% Provides the functionality of package \xpackage{lastpage}
+% \cite{lastpage} in the new reference scheme.
+% The label |LastPage| is put at the end of the document.
+% You can refer the last page number with:
+% \begin{quote}
+% |\zref@extract{LastPage}{page}| (+ |\zref@refused{LastPage}|)\\
+% \end{quote}
+% or
+% \begin{quote}
+% |\zpageref{LastPage}| (module \xmodule{user})
+% \end{quote}
+%
+% Since version 2008/10/01 v2.3 the module defines the list |LastPage|.
+% In addition to the properties of the main list label |LastPage| also
+% stores the properties of this list |LastPage|. The default of this
+% list is empty. The list can be used by the user to add additional
+% properties for label |LastPage|.
+%
+% \subsubsection{Tests for last page}
+%
+% Since version 2010/03/26 v2.8 the macros \cs{zref@iflastpage}
+% and \cs{ziflastpage} were added. They test the reference,
+% whether it is a reference of the last page.
+%
+% \begin{declcs}{zref@iflastpage}\markexp \M{refname} \M{then} \M{else}
+% \end{declcs}
+% Macro \cs{zref@iflastpage} compares the references \meta{refname}
+% with \meta{LastPage}. Basis of the comparison is the value of
+% property |abspage|, because the values are different for different
+% pages. This is not ensured by property |page|. Therefore module
+% \xmodule{abspage} is loaded by module \xmodule{lastpage}.
+% If both values of property |abspage| are present and match,
+% then \meta{then} is executed, otherwise code \meta{else} is called.
+% If one or both references are undefined or lack the property |abspage|,
+% then \meta{else} is executed.
+%
+% Macro \cs{zref@iflastpage} is expandable, therefore \cs{zref@refused}
+% should be called on \meta{refname} and \meta{LastPage}.
+%
+% \begin{declcs}{ziflastpage} \M{refname} \M{then} \M{else}
+% \end{declcs}
+% Macro \cs{ziflastpage} has the same function as \cs{zref@iflastpage},
+% but adds support for babel shorthands in \meta{refname} and
+% calls \cs{zref@refused}. However macro \cs{ziflastpage} is not
+% expandable.
+%
+% \subsubsection{Example}
+%
+% \begin{macrocode}
+%<*example-lastpage>
+%<<END_EXAMPLE
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{report}
+
+\newcounter{foo}
+\renewcommand*{\thefoo}{\Alph{foo}}
+
+\usepackage{zref-lastpage,zref-user}[2018/11/21]
+
+\makeatletter
+\zref@newprop{thefoo}{\thefoo}
+\zref@newprop{valuefoo}{\the\value{foo}}
+\zref@newprop{chapter}{\thechapter}
+\zref@addprops{LastPage}{thefoo,valuefoo,chapter}
+\makeatother
+
+\newcommand*{\foo}{%
+ \stepcounter{foo}%
+ [Current foo: \thefoo]%
+}
+
+\begin{document}
+ \chapter{First chapter}
+ Last page is \zref{LastPage}.\\
+ Last chapter is \zref[chapter]{LastPage}.\\
+ Last foo is \zref[thefoo]{LastPage}.\\
+ Last value of foo is \zref[valuefoo]{LastPage}.\\
+ \foo
+ \chapter{Second chapter}
+ \foo\foo\foo
+ \chapter{Last chapter}
+ \foo
+\end{document}
+%END_EXAMPLE
+%</example-lastpage>
+% \end{macrocode}
+%
+% \subsection{Module \xmodule{thepage}}
+%
+% This module \xmodule{thepage} loads module \xmodule{abspage},
+% constructs a reference name using the absolute page number
+% and remembers property |page|. Other properties can be added
+% by adding them to the property list |thepage|.
+%
+% \begin{declcs}{zthepage} \M{absolute page number}\\
+% \end{declcs}
+% Macro \cs{zthepage} is basically a \cs{zpageref}. The reference
+% name is yield by the \meta{absolute page number}. If the reference
+% is not defined, then the default for property |page| is used.
+%
+% \begin{declcs}{zref@thepage@name}\markexp \M{absolute page number}
+% \end{declcs}
+% Macro \cs{zref@thepage@name} returns the internal reference
+% name that is constructed using the \meta{absolute page number}.
+% The internal reference name should not be used directly, because
+% it might change in future versions.
+%
+% \begin{declcs}{zref@thepage}\markexp \M{absolute page number}\\
+% \cs{zref@thepage@refused} \M{absolute page number}
+% \end{declcs}
+% Macro \cs{zref@thepage} returns the page number (\cs{thepage})
+% of \meta{absolute page number}. Because this macro is expandable,
+% \cs{zref@thepage@refused} is used outside an expandable context
+% to mark the reference as used.
+%
+%
+% \subsection{Module \xmodule{nextpage}}
+%
+% \begin{declcs}{znextpage}
+% \end{declcs}
+% Macro \cs{znextpage} prints \cs{thepage} of the following page.
+% It gets the current absolute page number by using a label.
+% There are three cases for the next page:
+% \begin{enumerate}
+% \item The next page is not known yet because of undefined references.
+% Then \cs{zunknownnextpagename} is used instead. The default for
+% this macro is the default of property |page|.
+% \item This page is the last page. Then \cs{znonextpagename}
+% is used. Its default is empty.
+% \item The next page is known, then \cs{thepage} of the next
+% page is used (the value of property |page| of the next page).
+% \end{enumerate}
+%
+% \subsubsection{Configuration}
+%
+% The behaviour can be configured by the following macros.
+%
+% \begin{declcs}{zunknownnextpagename}\\
+% \cs{znonextpagename}
+% \end{declcs}
+% If the next page is not known or available, then
+% \cs{znextpage} uses these name macros as default.
+% \cs{zunknownnextpagename} is used in case of undefined
+% references. Default is the value of property |page| of the
+% next page (\cs{thepage}). Module \xmodule{thepage} is used.
+%
+% Macro \cs{znonextpagename} is used, if the next page does
+% not exists. That means that the current page is last page.
+% The default is empty.
+%
+% \begin{declcs}{znextpagesetup} \M{unknown} \M{no next}
+% \M{next}
+% \end{declcs}
+% Acording to the case (see \cs{znextpage}) macro \cs{znextpage}
+% calls an internal macro with an argument. The argument is
+% either \cs{thepage} of the next page or one of \cs{zunknownnextpagename}
+% or \cs{znonextpagename}. These internal macro can be changed by
+% \cs{znextpagesetup}. It expects the definition texts for these
+% three cases of a macro with one argument.
+% The default is
+% \begin{quote}
+% |\znextpagesetup{#1}{#1}{#1}|
+% \end{quote}
+%
+% \subsubsection{Example}
+%
+% \begin{macrocode}
+%<*example-nextpage>
+%<<END_EXAMPLE
+\documentclass{book}
+
+\usepackage{zref-nextpage}[2018/11/21]
+\znextpagesetup
+ {\thepage}% next page is unknown
+ {\thepage\ (#1)}% this page is last page
+ {\thepage\ $\rightarrow$ #1}% next page is known
+\renewcommand*{\znonextpagename}{last page}
+
+\usepackage{fancyhdr}
+\pagestyle{fancy}
+\fancyhf{}
+\fancyhead[LE,RO]{\znextpage}
+\fancypagestyle{plain}{%
+ \fancyhf{}%
+ \fancyhead[LE,RO]{\znextpage}%
+}
+
+\begin{document}
+\frontmatter
+ \tableofcontents
+\mainmatter
+ \chapter{Hello World}
+ \clearpage
+ \section{Last section}
+\end{document}
+%END_EXAMPLE
+%</example-nextpage>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{totpages}}
+%
+% For the total number of pages of a document you need to
+% know the absolute page number of the last page.
+% Both modules \xmodule{abspage} and \xmodule{lastpage}
+% are necessary and automatically enabled.
+%
+% \begin{declcs}{ztotpages}\markexp
+% \end{declcs}
+% Prints the total number of pages or |0| if this
+% number is not yet known. It expands to an explicit number
+% and can also used even in expandable calculations (\cs{numexpr})
+% or counter assignments.
+%
+% \subsection{Module \xmodule{pagelayout}}
+%
+% The module defines additional properties for each parameter
+% of the page layout that is effective during page shipout.
+% The value of length parameters is given in sp without the
+% unit as plain number.
+%
+% Some parameters are specific for a class (e.g.\@ \xoption{stockwidth}
+% and \xoption{stockheight} for class \xclass{memoir}) or the
+% \hologo{TeX} engine like \hologo{pdfTeX}. If the parameter is not
+% available, then the property will not be defined. The default value
+% of the property is the current setting of the parameter.
+%
+% The module \xmodule{thepage} is loaded that generates a label
+% for each page. The properties of module \xmodule{pagelayout}
+% are added to the property list |thepage| of module \xmodule{thepage}.
+%
+% List of properties:
+% \begin{quote}
+% \def\x#1{\cs{#1}&#1}%
+% \begin{tabular}{l>{\sffamily}ll}
+% \textrm{parameter} & \textrm{property} & remarks\\
+% \hline
+% \x{mag}\\
+% \x{paperwidth}\\
+% \x{paperheight}\\
+% \x{stockwidth}& class \xclass{memoir}\\
+% \x{stockheight}& class \xclass{memoir}\\
+% \x{pdfpagewidth}& \hologo{pdfTeX}, \hologo{LuaTeX}\\
+% \x{pdfpageheight}& \hologo{pdfTeX}, \hologo{LuaTeX}\\
+% \x{pdfhorigin}& \hologo{pdfTeX}, \hologo{LuaTeX}\\
+% \x{pdfvorigin}& \hologo{pdfTeX}, \hologo{LuaTeX}\\
+% \x{hoffset}\\
+% \x{voffset}\\
+% \x{topmargin}\\
+% \x{oddsidemargin}\\
+% \x{evensidemargin}\\
+% \x{textwidth}\\
+% \x{textheight}\\
+% \x{headheight}\\
+% \x{headsep}\\
+% \x{footskip}\\
+% \x{marginparwidth}\\
+% \x{marginparsep}\\
+% \x{columnwidth}\\
+% \x{columnsep}\\
+% \end{tabular}
+% \end{quote}
+%
+% \begin{declcs}{zlistpagelayout}
+% \end{declcs}
+% At the end of document the page layout parameter for each page are
+% printed into the \xext{log} file if macro \cs{zlistpagelayout}
+% is called before |\end{document}| (preamble is a good place).
+%
+% \subsection{Module \xmodule{marks}}
+%
+% ToDo.
+%
+% \subsection{Module \xmodule{runs}}
+%
+% Module \xmodule{runs} counts the \hologo{LaTeX} runs since last
+% \xext{aux} file creation and prints the number in the
+% \xext{log} file.
+%
+% \begin{declcs}{zruns}\markexp
+% \end{declcs}
+% Prints the the total number of \hologo{LaTeX} runs including
+% the current one. It expands to an explicit number.
+% Before |begin{document}| the value is zero meaning
+% the \xext{aux} file is not read yet. If a previous
+% \xext{aux} file exists, the value found there increased
+% by one is the new number. Otherwise \cs{zruns} is set to one.
+% \hologo{LaTeX}~runs where the \xext{aux} files are not rewritten
+% are not counted (see \cs{nofiles}).
+%
+% \subsection{Module \xmodule{perpage}}
+%
+% With \cs{@addtoreset} or \cs{numberwithin} a counter can be
+% reset if another counter is incremented. This do not work
+% well if the other counter is the page counter. The page counter is
+% incremented in the output routine that is often called asynchronous
+% somewhere on the next page. A reference mechanism costs at least
+% two \hologo{LaTeX} runs, but ensures correct page counter values.
+%
+% \begin{declcs}{zmakeperpage}
+% |[|\meta{reset}|]| \M{counter}
+% \end{declcs}
+% At the of a new page counter \meta{counter} starts
+% counting with value \meta{reset} (default is \texttt{1}).
+% The macro has the same
+% syntax and semantics as \cs{MakePerPage} of package
+% \xpackage{perpage} \cite{perpage}.
+% Also \xoption{perpage} of package \xpackage{footmisc} \cite{footmisc}
+% can easily be simulated by
+% \begin{quote}
+% |\zmakeperpage{footnote}| \itshape |% \usepackage[perpage]{footmisc}|
+%\end{quote}
+% If footnote symbols are used, some people dislike the
+% first symbol \ensuremath{\dagger}. It can easily be skipped:
+% \begin{quote}
+% |\zmakeperpage[2]{footnote}|
+% \end{quote}
+%
+% \begin{declcs}{thezpage}\\
+% counter |zpage|
+% \end{declcs}
+% If the formatted counter value of the counter that is reset at
+% a new page contains the page value, then you can use \cs{thezpage},
+% the page number of the current page. Or counter |zpage| can be
+% used, if the page number should be formatted differently from
+% the current page number. Example:
+%\begin{quote}
+%\begin{verbatim}
+%\newcounter{foobar}
+%\zmakeperpage{foobar}
+%\renewcommand*{\thefoobar}{\thezpage-\arabic{foobar}}
+% % or
+%\renewcommand*{\thefoobar}{\roman{zpage}-\arabic{foobar}}
+%\end{verbatim}
+%\end{quote}
+%
+% \begin{declcs}{zunmakeperpage}
+% \M{counter}
+% \end{declcs}
+% The reset mechanism for this counter is deactivated.
+%
+%
+% \subsection{Module \xmodule{counter}}
+%
+% This option just add the property |counter| to the main
+% property list. The property stores the counter name,
+% that was responsible for the reference. This is the
+% property \xpackage{hyperref}'s \cs{autoref} feature
+% uses. Thus this property |counter| may be useful
+% for a reimplementation of the autoref feature,
+% see the section \ref{sec:todo} with the todo list.
+%
+% \subsection{Module \xmodule{titleref}}
+%
+% This option makes section and caption titles available
+% to the reference system similar to packages \xpackage{titleref}
+% or \xpackage{nameref}.
+%
+% \begin{declcs}{ztitleref}
+% \M{refname}\markbabel
+% \end{declcs}
+% Print the section or caption title of reference \meta{refname},
+% similar to \cs{nameref} or \cs{titleref}.
+%
+% \begin{declcs}{ztitlerefsetup}
+% |{|\textit{key$_1$=value$_1$, key$_2$=value$_2$, \dots}|}|
+% \end{declcs}
+% This command allows to configure the behaviour of module
+% \xmodule{titleref}. The following keys are available:
+% \begin{description}
+% \let\bfseries\relax
+% \item[\texttt{title=}\meta{value}]\mbox{}\\*
+% Sets the current title.
+% \item[\texttt{stripperiod=true\string|false}]\mbox{}\\*
+% Follow package \xpackage{nameref} that
+% removes a last period. Default: |true|.
+% \item[\texttt{expand=true\string|false}]\mbox{}\\*
+% Package \cs{titleref} expands the title first. This way
+% garbage and dangerous commands can be removed, e.g.
+% \cs{label}, \cs{index}\dots. See implementation section
+% for more details. Default is |false|.
+% \item[\texttt{cleanup=\{}\textrm{\dots}\texttt{\}}]\mbox{}\\*
+% Hook to add own cleanup code, if method |expand| is used.
+% See implementation section for more details.
+% \end{description}
+%
+% \subsection{Module \xmodule{savepos}}
+%
+% This option supports a feature that \pdfTeX\ provides
+% (and \hologo{XeTeX}).
+% \pdfTeX\ is able to tell the current position on the
+% page. The page position is not instantly known. First the
+% page must be constructed by \hologo{TeX}'s asynchronous output
+% routine. Thus the time where the position is known is
+% the page shipout time. Thus a reference system where the
+% information is recorded in the first run and made available
+% for use in the second run comes in handy.
+%
+% \begin{declcs}{zsavepos}
+% \M{refname}
+% \end{declcs}
+% It generates a reference with name \meta{refname}.
+% The reference stores the location where \cs{zsavepos}
+% is executed in properties |posx| and |posy|.
+%
+% \begin{declcs}{zsaveposx}
+% \M{refname}\\
+% \cs{zsaveposy}
+% \M{refname}
+% \end{declcs}
+% Same as \cs{zsavepos} except that only the |x| or |y| component
+% of the position is stored. Since 2011/12/05 v2.23.
+%
+% \begin{declcs}{zposx}\markexp
+% \M{refname}\\
+% \SpecialUsageIndex{\zposy}\cs{zposy}\markexp \M{refname}
+% \end{declcs}
+% Get the position as number. Unit is sp. Horizontal
+% positions by \cs{zposx} increase from left to right.
+% Vertical positions by \cs{zposy} from bottom to top.
+%
+% Do not rely on absolute page numbers. Because of problems
+% with the origin the numbers may differ in DVI or PDF mode
+% of \pdfTeX. Therefore work with relative values by comparisons.
+%
+% Both \cs{zposx} and \cs{zposy} are expandable and can be
+% used inside calculations (\cs{setcounter}, \cs{addtocounter},
+% package \xpackage{calc}, \cs{numexpr}). However this property
+% prevents from notifying \hologo{LaTeX} that the reference is actually
+% used (the notifying is not expandable). Therefore you should
+% mark the reference as used by \cs{zrefused}.
+%
+% This module uses \pdfTeX's \cs{pdfsavepos}, \cs{pdflastxpos},
+% and \cs{pdflastypos}. They are available in PDF mode and
+% since version 1.40.0 also in DVI mode.
+%
+% \begin{declcs}{zref@savepos}
+% \end{declcs}
+% Macro \cs{zref@savepos} performs the first part of \cs{zsavepos}
+% by calling \cs{pdfsavepos} (if \xext{aux} files are writable).
+%
+% Thus \cs{zsavepos} is basically \cs{zref@savepos} followed
+% by |\zref@labelbylist{|\texttt{\meta{refname}}|}{savepos}|.
+% If \cs{TeXXeTstate} is detected and enabled, \cs{savepos}
+% also adds \cs{zref@savepos} at the end to support \cs{beginR}
+% where the whatits are processed in reverse order.
+% The property list |savepos| contains the properties |posx|
+% and |posy|.
+%
+% \subsection{Module \xmodule{dotfill}}
+%
+% \begin{declcs}{zdotfill}
+% \end{declcs}
+% This package provides the command \cs{zdotfill} that works
+% similar to \cs{dotfill}, but can be configured. Especially
+% it suppresses the dots if a minimum number of dots cannot be set.
+%
+% \begin{declcs}{zdotfillsetup}
+% |{|\textit{key$_1$=value$_1$, key$_2$=value$_2$, \dots}|}|
+% \end{declcs}
+% This command allows to configure the behaviour of \cs{zdotfill}.
+% The following keys are available:
+% \begin{description}
+% \let\bfseries\relax
+% \item[\texttt{min=}\meta{count value}]\mbox{}\\*
+% If the actual number of dots are smaller than \meta{count value},
+% then the dots are suppressed. Default: |2|.
+% \item[\texttt{unit=}\meta{dimen value}]\mbox{}\\*
+% The width of a dot unit is given by \meta{dimen value}.
+% Default: |0.44em| (same as the unit in \cs{dotfill}).
+% \item[\texttt{dot=}\meta{value}]\mbox{}\\*
+% The dot itself is given by \meta{value}. Default: |.| (dot, same as
+% the dot in \cs{dotfill}).
+% \end{description}
+%
+% \subsection{Module \xmodule{env}}
+%
+% This module defines two properties |envname| and |envline|. They
+% remember the name of the environment and the line number at
+% the start of the environment.
+%
+% \subsection{Module \xmodule{xr}}
+%
+% This package provides the functionality of package \xpackage{xr},
+% see \cite{xr}. It also supports the syntax of \xpackage{xr-hyper}.
+%
+% \begin{declcs}{zexternaldocument}
+% \* |[|\meta{prefix}|]|\markbabel \M{external document}
+% |[|\meta{url}|]|
+% \end{declcs}
+% See \cs{externaldocument} for a description of this option.
+% The found labels also get a property |externaldocument| that
+% remembers \meta{external document}.
+% The standard reference scheme and the scheme of this
+% package use different name spaces for reference names.
+% If the external document uses both systems. Then one
+% import statement would put the names in one namespace
+% and probably causing problems with multiple references
+% of the same name. Thus the star form only looks for
+% \cs{newlabel} in the \xfile{.aux} files, whereas without
+% star only \cs{zref@newlabel}s are used.
+%
+% In the star form it tries to detect labels from
+% \xpackage{hyperref}, \xpackage{titleref}, and \xpackage{ntheorem}.
+% If such an extended property from the packages before cannot
+% be found or are empty, they are not included in the
+% imported reference.
+%
+% Warnings are given if a reference name is already in use
+% and the item is ignored. Unknown properties will automatically
+% be declared.
+%
+% If the external references contain |anchor| properties,
+% then we need also a url to be able to address the external
+% file. As default the filename is taken with a default
+% extension.
+%
+% \begin{declcs}{zxrsetup}
+% |{|\textit{key$_1$=value$_1$, key$_2$=value$_2$, \dots}|}|
+% \end{declcs}
+% The following setup options are available:
+% \begin{description}
+% \item[\xoption{ext}:] It sets the default extension.
+% \item[\xoption{tozreflabel}:] Boolean option. The found references
+% are imported as zref labels. This is enabled by default.
+% \item[\xoption{toltxlabel}:] Boolean option. The found references
+% are imported as \hologo{LaTeX} labels. Packages \xpackage{nameref},
+% \xpackage{titleref} and class \xclass{memoir} are supported.
+% \item[\xoption{urluse}:] Boolean option. If enabled, then a URL
+% is stored in a macro and the macro is put in property `urluse'.
+% The URL is not put in property `url'.
+% The purpose is to save \hologo{TeX} memory.
+% \item[\xoption{verbose}:] Boolean option. List the imported labels in the
+% \xext{log} file. Default is |false|.
+% \end{description}
+%
+% \begin{declcs}{zref@xr@ext}
+% \end{declcs}
+% If the \meta{url} is not specified in \cs{zref@externaldocument},
+% then the url will be constructed with the file name and
+% this macro as extension. \cs{XR@ext} is used if
+% \xpackage{hyperref} is loaded, otherwise |pdf|.
+%
+% \section{ToDo}\label{sec:todo}
+%
+% Among other things the following issues are left for future work:
+% \begin{itemize}
+% \item Other applications: autoref, hyperref, \dots
+% \end{itemize}
+%
+% \section{Example}
+%
+% \begin{macrocode}
+%<*example>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\documentclass{book}
+
+\usepackage[ngerman]{babel}%
+
+\usepackage[savepos,totpages,titleref,dotfill,counter,user]{zref}
+
+% \end{macrocode}
+%
+% Chapters are wrapped inside \cs{ChapterStart} and
+% \cs{ChapterStop}. The first argument \verb|#1| of \cs{ChapterStart}
+% is used to form a label id \verb|chap:#1|. At the end of
+% the chapter another label is set by \cs{zref@wrapper@immediate}, because
+% otherwise at the end of document a deferred write would not
+% be written, because there is no page for shipout.
+%
+% Also this example shows how chapter titles can be recorded.
+% A new property \verb|chaptitle| is declared and added to the
+% main property list. In \cs{ChapterStart} the current value
+% of the property is updated.
+% \begin{macrocode}
+\makeatletter
+\zref@newprop{chaptitle}{}
+\zref@addprop{main}{chaptitle}
+
+\newcommand*{\ChapterStart}[2]{%
+ \cleardoublepage
+ \def\current@chapid{#1}%
+ \zref@setcurrent{chaptitle}{#2}%
+ \chapter{#2}%
+ \zlabel{chap:#1}%
+}
+\newcommand*{\ChapterStop}{%
+ \cleardoublepage
+ \zref@wrapper@immediate{%
+ \zref@labelbyprops{chapend:\current@chapid}{abspage}%
+ }%
+}
+% \end{macrocode}
+% \cs{ChapterPages} calculates and returns the number of pages of the
+% referenced chapter.
+% \begin{macrocode}
+\newcommand*{\ChapterPages}[1]{%
+ \zrefused{chap:#1}%
+ \zrefused{chapend:#1}%
+ \number\numexpr
+ \zref@extract{chapend:#1}{abspage}%
+ -\zref@extract{chap:#1}{abspage}%
+ +1\relax
+}
+\makeatother
+% \end{macrocode}
+% \begin{macrocode}
+\begin{document}
+% \end{macrocode}
+% As exception we use \cs{makeatletter} here, because
+% this is just an example file that also should show some of
+% programmer's interface.
+% \begin{macrocode}
+\makeatletter
+
+\frontmatter
+\zlabel{documentstart}
+
+\begin{itemize}
+\item
+ The frontmatter part has
+ \number\numexpr\zref@extract{chap:first}{abspage}-1\relax
+ ~pages.
+\item
+ Chapter \zref{chap:first} has \ChapterPages{first} page(s).
+\item
+ Section \zref{hello} is on the
+ \ifcase\numexpr
+ \zref@extractdefault{hello}{page}{0}%
+ -\zref@extractdefault{chap:first}{page}{0}%
+ +1\relax
+ ??\or first\or second\or third\or forth\fi
+ ~page inside its chapter.
+\item
+ The document has
+ \zref[abspage]{LastPage} pages.
+ This number is \ifodd\ztotpages odd\else even\fi.
+\item
+ The last page is labeled with \zpageref{LastPage}.
+\item
+ The title of chapter \zref{chap:next} %
+ is ``\zref[chaptitle]{chap:next}''.
+\end{itemize}
+
+\tableofcontents
+
+\mainmatter
+\ChapterStart{first}{First chapter}
+
+% \end{macrocode}
+% The user level commands should protect babel shorthands
+% where possible. On the other side, expandable extracting
+% macros are useful in calculations, see above the
+% examples with \cs{numexpr}.
+% \begin{macrocode}
+\section{Test}
+\zlabel{a"o}
+Section \zref{a"o} on page
+\zref@wrapper@babel\zref@extract{a"o}{page}.
+
+Text.
+\newpage
+
+\section{Hello World}
+\zlabel{hello}
+
+\ChapterStop
+
+\ChapterStart{next}{Next chapter with \emph{umlauts}: "a"o"u"s}
+
+% \end{macrocode}
+%
+% Here an example follows that makes use of \pdfTeX's ``savepos''
+% feature. The position on the page is not known before the
+% page is constructed and shipped out. Therefore the position
+% ist stored in references and are available for calculations
+% in the next \hologo{LaTeX} compile run.
+% \begin{macrocode}
+The width of the first column is
+ \the\dimexpr \zposx{secondcol}sp - \zposx{firstcol}sp\relax,\\
+the height difference of the two baselines is
+ \the\dimexpr \zposy{firstcol}sp - \zposy{secondline}sp\relax:\\
+\begin{tabular}{ll}
+ \zsavepos{firstcol}Hello&\zsavepos{secondcol}World\\
+ \zsavepos{secondline}Second line&foobar\\
+\end{tabular}
+
+% \end{macrocode}
+% With \cs{zrefused} \hologo{LaTeX} is notified, if the references
+% are not yet available and \hologo{LaTeX} can generate the rerun
+% hint.
+% \begin{macrocode}
+\zrefused{firstcol}
+\zrefused{secondcol}
+\zrefused{secondline}
+
+\ChapterStop
+% \end{macrocode}
+% Test for module \cs{dotfill}.
+% \begin{macrocode}
+\ChapterStart{dotfill}{Test for dotfill feature}
+\newcommand*{\dftest}[1]{%
+ #1&
+ [\makebox[{#1}]{\dotfill}]&
+ [\makebox[{#1}]{\zdotfill}]\\
+}
+\begin{tabular}{rll}
+& [\verb|\dotfill|] & [\verb|\zdotfill|]\\
+\dftest{0.43em}
+\dftest{0.44em}
+\dftest{0.45em}
+\dftest{0.87em}
+\dftest{0.88em}
+\dftest{0.89em}
+\dftest{1.31em}
+\dftest{1.32em}
+\dftest{1.33em}
+\end{tabular}
+\ChapterStop
+\end{document}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</example>
+% \end{macrocode}
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+% \subsection{Package \xpackage{zref}}
+%
+% \subsubsection{Identification}
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref}
+ [2018/11/21 v2.27 A new reference scheme for LaTeX (HO)]%
+% \end{macrocode}
+%
+% \subsubsection{Load basic module}
+%
+% \begin{macrocode}
+\RequirePackage{zref-base}[2018/11/21]
+% \end{macrocode}
+% Abort package loading if \xpackage{zref-base} could not be
+% loaded successfully.
+% \begin{macrocode}
+\@ifundefined{ZREF@base@ok}{\endinput}{}
+% \end{macrocode}
+%
+% \subsubsection{Process options}
+%
+% Known modules are loaded and the release date is checked.
+% \begin{macrocode}
+\def\ZREF@temp#1{%
+ \DeclareOption{#1}{%
+ \AtEndOfPackage{%
+ \RequirePackage{zref-#1}[2018/11/21]%
+ }%
+ }%
+}
+\ZREF@temp{abspage}
+\ZREF@temp{counter}
+\ZREF@temp{dotfill}
+\ZREF@temp{hyperref}
+\ZREF@temp{lastpage}
+\ZREF@temp{marks}
+\ZREF@temp{nextpage}
+\ZREF@temp{pageattr}
+\ZREF@temp{pagelayout}
+\ZREF@temp{perpage}
+\ZREF@temp{runs}
+\ZREF@temp{savepos}
+\ZREF@temp{thepage}
+\ZREF@temp{titleref}
+\ZREF@temp{totpages}
+\ZREF@temp{user}
+\ZREF@temp{xr}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessOptions\relax
+%</package>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{base}}
+%
+% \subsubsection{Prefixes}
+%
+% This package uses the following prefixes for macro names:
+% \begin{description}
+% \item[\cs{zref@}:] Macros of the programmer's interface.
+% \item[\cs{ZREF@}:] Internal macros.
+% \item[\cs{Z@L@}\metacs{listname}:]
+% The properties of the list \meta{listname}.
+% \item[\cs{Z@D@}\metacs{propname}:]
+% The default value for property \meta{propname}.
+% \item[\cs{Z@E@}\metacs{propname}:]
+% Extract function for property \meta{propname}.
+% \item[\cs{Z@X@}\metacs{propname}:]
+% Information whether a property value for property
+% \meta{propname} is expanded
+% immediately or at shipout time.
+% \item[\cs{Z@C@}\metacs{propname}:]
+% Current value of the property \meta{propname}.
+% \item[\cs{Z@R@}\metacs{labelname}:]
+% Data for reference \meta{labelname}.
+% \item[\cs{ZREF@org@}:] Original versions of patched commands.
+% \item[\cs{z}:] For macros in user land, defined if
+% module \xmodule{user} is set.
+% \end{description}
+% The following family names are used for keys defined
+% according to the \xpackage{keyval} package:
+% \begin{description}
+% \item[\texttt{ZREF@TR}:] Setup for module \xmodule{titleref}.
+% \end{description}
+%
+% \subsubsection{Identification}
+%
+% \begin{macrocode}
+%<*base>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-base}%
+ [2018/11/21 v2.27 Module base for zref (HO)]%
+% \end{macrocode}
+%
+% \subsubsection{Utilities}
+%
+% \begin{macrocode}
+\RequirePackage{ltxcmds}[2010/12/02]
+\RequirePackage{infwarerr}[2010/04/08]
+\RequirePackage{kvsetkeys}[2010/03/01]
+\RequirePackage{kvdefinekeys}[2010/03/01]
+\RequirePackage{pdftexcmds}[2010/04/01]
+% \end{macrocode}
+%
+% \begin{macro}{\ZREF@name}
+% Several times the package name is used, thus we store it
+% in \cmd{\ZREF@name}.
+% \begin{macrocode}
+\def\ZREF@name{zref}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ltx@IfUndefined{protected}{%
+ \RequirePackage{makerobust}[2006/03/18]%
+% \end{macrocode}
+% \begin{macro}{\ZREF@Robust}
+% \begin{macrocode}
+ \def\ZREF@Robust#1#2{%
+ \def\ZREF@temp{\MakeRobustcommand#2}%
+ \afterassignment\ZREF@temp
+ #1#2%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% \begin{macro}{\ZREF@Robust}
+% \begin{macrocode}
+ \def\ZREF@Robust#1{%
+ \protected#1%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \begin{macro}{\ZREF@IfDefinable}
+% \begin{macrocode}
+\def\ZREF@IfDefinable#1#2#3{%
+ \@ifdefinable{#1}{%
+ \ZREF@Robust{#2}#1#3%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@UpdatePdfTeX}
+% \cs{ZREF@UpdatePdfTeX} is used as help message text in
+% error messages.
+% \begin{macrocode}
+\def\ZREF@UpdatePdfTeX{Update pdfTeX.}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifZREF@found}
+% The following switch is usded in list processing.
+% \begin{macrocode}
+\newif\ifZREF@found
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@patch}
+% Macro \cs{ZREF@patch} first checks the existence of
+% the command and safes it.
+% \begin{macrocode}
+\def\ZREF@patch#1{%
+ \ltx@IfUndefined{#1}{%
+ \ltx@gobble
+ }{%
+ \expandafter\let\csname ZREF@org@#1\expandafter\endcsname
+ \csname #1\endcsname
+ \ltx@firstofone
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Check for \hologo{eTeX}}
+%
+% The use of \hologo{eTeX} should be standard nowadays for \hologo{LaTeX}.
+% We test for \hologo{eTeX} in order to use its features later.
+% \begin{macrocode}
+\ltx@IfUndefined{eTeXversion}{%
+ \PackageError\ZREF@name{%
+ Missing support for eTeX; package is abandoned%
+ }{%
+ Use a TeX compiler that support eTeX and enable eTeX %
+ in the format.%
+ }%
+ \endinput
+}{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{etexcmds}[2007/09/09]
+\ifetex@unexpanded
+\else
+ \PackageError\ZREF@name{%
+ Missing e-TeX's \string\unexpanded.\MessageBreak
+ Add \string\RequirePackage\string{etexcmds\string} before %
+ \string\documentclass%
+ }{%
+ Probably you are using some package (e.g. ConTeXt) that %
+ redefines \string\unexpanded%
+ }%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Auxiliary file stuff}
+%
+% We are using some commands in the \xfile{.aux} files.
+% However sometimes these auxiliary files are interpreted
+% by \hologo{LaTeX} processes that haven't loaded this package
+% (e.g. package \xpackage{xr}).
+% Therefore we provide dummy definitions.
+% \begin{macrocode}
+\RequirePackage{auxhook}
+\AddLineBeginAux{%
+ \string\providecommand\string\zref@newlabel[2]{}%
+}
+% \end{macrocode}
+% \begin{macro}{\ZREF@RefPrefix}
+% \begin{macrocode}
+\def\ZREF@RefPrefix{Z@R}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@newlabel}
+% For the implementation of \cs{zref@newlabel} we call
+% the same internal macro \cs{@newl@bel} that is used
+% in \cs{newlabel}. Thus we have for free:
+% \begin{itemize}
+% \item \cs{Z@R@}\metacs{labelname} is defined.
+% \item \hologo{LaTeX}'s check for multiple references.
+% \item \hologo{LaTeX}'s check for changed references.
+% \end{itemize}
+% \begin{macrocode}
+\ZREF@Robust\edef\zref@newlabel{%
+ \noexpand\@newl@bel{\ZREF@RefPrefix}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Property lists}
+%
+% \begin{macro}{\zref@newlist}
+% Property lists are stored as list of property names
+% enclosed in curly braces. \cs{zref@newlist}
+% creates a new list as empty list. Assignments to
+% property lists are global.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@newlist#1{%
+ \zref@iflistundefined{#1}{%
+ \@ifdefinable{Z@L@#1}{%
+ \global\expandafter\let\csname Z@L@#1\endcsname\ltx@empty
+ \PackageInfo\ZREF@name{New property list: #1}%
+ }%
+ }{%
+ \PackageError\ZREF@name{%
+ Property list `#1' already exists%
+ }\@ehc
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@iflistundefined}
+% \cs{zref@iflistundefined} checks the existence of the
+% property list \verb|#1|. If the property list is present,
+% then \verb|#2| is executed and \verb|#3| otherwise.
+% \begin{macrocode}
+\def\zref@iflistundefined#1{%
+ \ltx@ifundefined{Z@L@#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@listexists}
+% \cs{zref@listexists} only executes \verb|#2| if the
+% property list \verb|#1| exists and raises an error
+% message otherwise.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@listexists#1{%
+ \zref@iflistundefined{#1}{%
+ \PackageError\ZREF@name{%
+ Property list `#1' does not exist%
+ }\@ehc
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@iflistcontainsprop}
+% \cs{zref@iflistcontainsprop} checks, whether a property \verb|#2| is
+% already present in a property list \verb|#1|.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@iflistcontainsprop#1#2{%
+ \zref@iflistundefined{#1}{%
+ \ltx@secondoftwo
+ }{%
+ \begingroup\expandafter\endgroup
+ \expandafter\in@
+ \csname#2\expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter{\csname Z@L@#1\endcsname}%
+ \csname ltx@\ifin@ first\else second\fi oftwo\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@listforloop}
+% \begin{macrocode}
+\def\zref@listforloop#1#2{%
+ \zref@listexists{#1}{%
+ \expandafter\expandafter\expandafter\@tfor
+ \expandafter\expandafter\expandafter\zref@prop
+ \expandafter\expandafter\expandafter:%
+ \expandafter\expandafter\expandafter=%
+ \csname Z@L@#1\endcsname
+ \do{%
+ \begingroup
+ \escapechar=-1 %
+ \edef\x{\endgroup
+ \def\noexpand\zref@prop{%
+ \expandafter\string\zref@prop
+ }%
+ }%
+ \x
+ #2\zref@prop
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@addprops}
+% \cs{zref@addprop} adds the properties \verb|#2| to the property
+% list \verb|#1|, if the property is not already in the list.
+% Otherwise a warning is given.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@addprops#1#2{%
+ \zref@listexists{#1}{%
+ \comma@parse{#2}{%
+ \zref@propexists\comma@entry{%
+ \zref@iflistcontainsprop{#1}\comma@entry{%
+ \PackageWarning\ZREF@name{%
+ Property `\comma@entry' is already in list `#1'%
+ }%
+ }{%
+ \begingroup\expandafter\endgroup
+ \expandafter\g@addto@macro
+ \csname Z@L@#1\expandafter\endcsname
+ \expandafter{\csname\comma@entry\endcsname}%
+ }%
+ }%
+ \ltx@gobble
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@addprop}
+% \cs{zref@addprop} adds the property \verb|#2| to the property
+% list \verb|#1|, if the property is not already in the list.
+% Otherwise a warning is given.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@addprop#1#2{%
+ \zref@listexists{#1}{%
+ \zref@propexists{#2}{%
+ \zref@iflistcontainsprop{#1}{#2}{%
+ \PackageWarning\ZREF@name{%
+ Property `#2' is already in list `#1'%
+ }%
+ }{%
+ \begingroup\expandafter\endgroup
+ \expandafter\g@addto@macro
+ \csname Z@L@#1\expandafter\endcsname
+ \expandafter{\csname#2\endcsname}%
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@localaddprops}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@localaddprops#1#2{%
+ \zref@listexists{#1}{%
+ \comma@parse{#2}{%
+ \zref@propexists\comma@entry{%
+ \zref@iflistcontainsprop{#1}\comma@entry{%
+ \PackageWarning\ZREF@name{%
+ Property `\comma@entry' is already in list `#1'%
+ }%
+ }{%
+ \begingroup\expandafter\endgroup
+ \expandafter\ltx@LocalAppendToMacro
+ \csname Z@L@#1\expandafter\endcsname
+ \expandafter{\csname\comma@entry\endcsname}%
+ }%
+ }%
+ \ltx@gobble
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@localaddprop}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@localaddprop#1#2{%
+ \zref@listexists{#1}{%
+ \zref@propexists{#2}{%
+ \zref@iflistcontainsprop{#1}{#2}{%
+ \PackageWarning\ZREF@name{%
+ Property `#2' is already in list `#1'%
+ }%
+ }{%
+ \begingroup\expandafter\endgroup
+ \expandafter\ltx@LocalAppendToMacro
+ \csname Z@L@#1\expandafter\endcsname
+ \expandafter{\csname#2\endcsname}%
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ltx@IfUndefined{pdf@strcmp}{%
+% \end{macrocode}
+% \begin{macro}{\zref@delprop}
+% \begin{macrocode}
+ \ZREF@Robust\def\zref@delprop{%
+ \ZREF@delprop\gdef
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@localdelprop}
+% \begin{macrocode}
+ \ZREF@Robust\def\zref@localdelprop{%
+ \ZREF@delprop\def
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@delprop}
+% \begin{macrocode}
+ \def\ZREF@delprop#1#2#3{%
+ \zref@listexists{#2}{%
+ \begingroup
+ \escapechar=-1 %
+ \def\ZREF@param{#3}%
+ \@onelevel@sanitize\ZREF@param
+ \toks@{}%
+ \expandafter\expandafter\expandafter\ZREF@@delprop
+ \csname Z@L@#2\endcsname!%
+ \expandafter\endgroup
+ \expandafter#1\csname Z@L@#2\expandafter\endcsname
+ \expandafter{%
+ \the\toks@
+ }%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@@delprop}
+% \begin{macrocode}
+ \def\ZREF@@delprop#1{%
+ \expandafter\ZREF@@@delprop\expandafter{\string#1}#1%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@@@delprop}
+% \begin{macrocode}
+ \def\ZREF@@@delprop#1#2{%
+ \ifx#2!%
+ \else
+ \def\ZREF@temp{#1}%
+ \@onelevel@sanitize\ZREF@temp
+ \ifx\ZREF@param\ZREF@temp
+ \else
+ \toks@\expandafter{%
+ \the\expandafter\toks@\csname#1\endcsname
+ }%
+ \fi
+ \expandafter\ZREF@@delprop
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% \begin{macro}{\zref@delprop}
+% \begin{macrocode}
+ \ZREF@Robust\def\zref@delprop{%
+ \ZREF@delprop\xdef
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@localdelprop}
+% \begin{macrocode}
+ \ZREF@Robust\def\zref@localdelprop{%
+ \ZREF@delprop\edef
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@delprop}
+% \begin{macrocode}
+ \def\ZREF@delprop#1#2#3{%
+ \zref@listexists{#2}{%
+ \def\ZREF@param{#3}%
+ \edef\ZREF@SavedEscapechar{\the\escapechar}%
+ \escapechar=-1 %
+ \expandafter#1\csname Z@L@#2%
+ \expandafter\expandafter\expandafter\endcsname{%
+ \expandafter\expandafter\expandafter\ZREF@@delprop
+ \csname Z@L@#2\endcsname!%
+ }%
+ \escapechar=\ZREF@SavedEscapechar\relax
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@@delprop}
+% Caution: |#1| might be an \cs{if} or similar token.
+% \begin{macrocode}
+ \def\ZREF@@delprop#1{%
+ \expandafter\ZREF@@@delprop\expandafter{\string#1}#1%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@@@delprop}
+% \begin{macrocode}
+ \def\ZREF@@@delprop#1#2{%
+ \ifx#2!%
+ \else
+ \ifnum\pdf@strcmp{#1}{\ZREF@param}=\ltx@zero
+ \else
+ \expandafter\noexpand\csname#1\endcsname
+ \fi
+ \expandafter\ZREF@@delprop
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \subsubsection{Properties}
+%
+% \begin{macro}{\zref@ifpropundefined}
+% \cs{zref@ifpropundefined} checks the existence of the
+% property \verb|#1|. If the property is present,
+% then \verb|#2| is executed and \verb|#3| otherwise.
+% \begin{macrocode}
+\def\zref@ifpropundefined#1{%
+ \ltx@ifundefined{Z@E@#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@propexists}
+% Some macros rely on the existence of a property.
+% \cs{zref@propexists} only executes \verb|#2| if the
+% property \verb|#1| exists and raises an error
+% message otherwise.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@propexists#1{%
+ \zref@ifpropundefined{#1}{%
+ \PackageError\ZREF@name{%
+ Property `#1' does not exist%
+ }\@ehc
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@newprop}
+% A new property is declared by \cs{zref@newprop}, the
+% property name \meta{propname} is given in \verb|#1|. The
+% property is created and configured. If the star form
+% is given, then the expansion of the property value
+% is delayed to page shipout time, when the reference
+% is written to the \xfile{.aux} file.
+% \begin{description}
+% \item[\cs{Z@D@}\metacs{propname}:]
+% Stores the default value for this property.
+% \item[\cs{Z@E@}\metacs{propname}:]
+% Extract function.
+% \item[\cs{Z@X@}\metacs{propname}:]
+% Information whether the expansion of the property value
+% is delayed to shipout time.
+% \item[\cs{Z@C@}\metacs{propname}:]
+% Current value of the property.
+% \end{description}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@newprop{%
+ \@ifstar{%
+ \let\ZREF@X\noexpand
+ \ZREF@newprop
+ }{%
+ \let\ZREF@X\ltx@empty
+ \ZREF@newprop
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@newprop}
+% \begin{macrocode}
+\def\ZREF@newprop#1{%
+ \edef\ZREF@P{#1}%
+ \@onelevel@sanitize\ZREF@P
+ \begingroup
+ \ifx\ZREF@P\ZREF@par
+ \@PackageError\ZREF@name{%
+ Invalid property name `\ZREF@P'%
+ }{%
+ The property name `par' is not allowed %
+ because of internal reasons.%
+ \MessageBreak
+ \@ehc
+ }%
+ \def\ZREF@@newprop[##1]##2{\endgroup}%
+ \else
+ \zref@ifpropundefined\ZREF@P{%
+ \endgroup
+ \PackageInfo\ZREF@name{%
+ New property: \ZREF@P
+ }%
+ }{%
+ \@PackageError\ZREF@name{%
+ Property `\ZREF@P' already exists%
+ }\@ehc
+ \def\ZREF@@newprop[##1]##2{\endgroup}%
+ }%
+ \fi
+ \@ifnextchar[\ZREF@@newprop{\ZREF@@newprop[\zref@default]}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@par}
+% \begin{macrocode}
+\def\ZREF@par{par}
+\@onelevel@sanitize\ZREF@par
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@@newprop}
+% \begin{macrocode}
+\def\ZREF@@newprop[#1]{%
+ \global\@namedef{Z@D@\ZREF@P}{#1}%
+ \global\expandafter\let\csname Z@X@\ZREF@P\endcsname\ZREF@X
+ \begingroup\expandafter\endgroup
+ \expandafter\ZREF@@@newprop\csname\ZREF@P\endcsname
+ \expandafter\gdef\csname Z@C@\ZREF@P\endcsname{}%
+ \zref@setcurrent\ZREF@P
+}
+\def\ZREF@@@newprop#1{%
+ \expandafter
+ \gdef\csname Z@E@\ZREF@P\endcsname##1#1##2##3\ZREF@nil{##2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@showprop}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@showprop#1{%
+ \zref@ifpropundefined{#1}{%
+ \@PackageInfoNoLine{\ZREF@name}{%
+ Show property `#1': <undefined>%
+ }%
+ }{%
+ \begingroup
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname Z@C@#1\endcsname
+ }%
+ \edef\ZREF@value{\the\toks@}%
+ \ltx@onelevel@sanitize\ZREF@value
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname Z@D@#1\endcsname
+ }%
+ \edef\ZREF@default{\the\toks@}%
+ \ltx@onelevel@sanitize\ZREF@default
+ \@PackageInfoNoLine{\ZREF@name}{%
+ Show property `#1':\MessageBreak
+ \expandafter\ifx\csname Z@X@#1\endcsname\ltx@empty
+ Immediate %
+ \else
+ Delayed %
+ \fi
+ value: [\ZREF@value]\MessageBreak
+ Default: [\ZREF@default]%
+ }%
+ \endgroup
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@setcurrent}
+% \cs{zref@setcurrent} sets the current value for a property.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@setcurrent#1#2{%
+ \zref@propexists{#1}{%
+ \expandafter\def\csname Z@C@#1\endcsname{#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@getcurrent}
+% \cs{zref@getcurrent} gets the current value for a property.
+% \begin{macrocode}
+\def\ZREF@getcurrent#1{%
+ \romannumeral0%
+ \ltx@ifundefined{Z@C@#1}{%
+ \ltx@space
+ }{%
+ \expandafter\expandafter\expandafter\ltx@space
+ \csname Z@C@#1\endcsname
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@u@getcurrent}
+% \begin{macrocode}
+\def\ZREF@wu@getcurrent#1{%
+ \etex@unexpanded\expandafter\expandafter\expandafter{%
+ \ZREF@getcurrent{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@getcurrent}
+% \begin{macrocode}
+\let\zref@getcurrent\ZREF@getcurrent
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Reference generation}
+%
+% \begin{macro}{\zref@label}
+% Label macro that uses the main property list.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@label#1{%
+ \zref@labelbylist{#1}\ZREF@mainlist
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@labelbylist}
+% Label macro that stores the properties, specified in the
+% property list \verb|#2|.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@labelbylist#1#2{%
+ \@bsphack
+ \zref@listexists{#2}{%
+ \expandafter\expandafter\expandafter\ZREF@label
+ \expandafter\expandafter\expandafter{%
+ \csname Z@L@#2\endcsname
+ }{#1}%
+ }%
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@labelbyprops}
+% The properties are directly specified in a comma separated list.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@labelbyprops#1#2{%
+ \@bsphack
+ \begingroup
+ \toks@{}%
+ \comma@parse{#2}{%
+ \zref@ifpropundefined\comma@entry{%
+ \PackageWarning\ZREF@name{%
+ Property `\comma@entry' is not known%
+ }%
+ }{%
+ \toks@\expandafter{%
+ \the\expandafter\toks@\csname\comma@entry\endcsname
+ }%
+ }%
+ \ltx@gobble
+ }%
+ \expandafter\endgroup
+ \expandafter\ZREF@label\expandafter{\the\toks@}{#1}%
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@labelbykv}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@labelbykv#1#2{%
+ \@bsphack
+ \begingroup
+ \let\Z@L@ZREF@temp\ltx@empty
+ \kvsetkeys{ZREF@LABEL}{#1}%
+ \ifZREF@immediate
+ \expandafter\zref@wrapper@immediate\expandafter{%
+ \expandafter\ZREF@label\expandafter{\Z@L@ZREF@temp}{#2}%
+ }%
+ \else
+ \expandafter\ZREF@label\expandafter{\Z@L@ZREF@temp}{#2}%
+ \fi
+ \endgroup
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\kv@define@key{ZREF@LABEL}{prop}{%
+ \edef\ZREF@param{#1}%
+ \zref@propexists\ZREF@param{%
+ \zref@iflistcontainsprop{ZREF@temp}\ZREF@param{}{%
+ \begingroup\expandafter\endgroup
+ \expandafter\ltx@LocalAppendToMacro
+ \expandafter\Z@L@ZREF@temp
+ \expandafter{\csname\ZREF@param\endcsname}%
+ }%
+ }%
+}
+\kv@define@key{ZREF@LABEL}{list}{%
+ \zref@listforloop{#1}{%
+ \zref@iflistcontainsprop{ZREF@temp}\zref@prop{}{%
+ \begingroup\expandafter\endgroup
+ \expandafter\ltx@LocalAppendToMacro
+ \expandafter\Z@L@ZREF@temp
+ \expandafter{\csname\zref@prop\endcsname}%
+ }%
+ \ltx@gobble
+ }%
+}
+\kv@define@key{ZREF@LABEL}{delprop}{%
+ \zref@propexists{#1}{%
+ \zref@localdelprop{ZREF@temp}{#1}%
+ }%
+}
+\kv@define@key{ZREF@LABEL}{immediate}[true]{%
+ \edef\ZREF@param{#1}%
+ \ifx\ZREF@param\ZREF@true
+ \ZREF@immediatetrue
+ \else
+ \ifx\ZREF@param\ZREF@false
+ \ZREF@immediatefalse
+ \else
+ \PackageWarning\ZREF@name{%
+ Option `immediate' expects `true' or `false'.\MessageBreak
+ Ignoring invalid value `\ZREF@param'%
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\ZREF@false}
+% \begin{macrocode}
+\def\ZREF@false{false}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@true}
+% \begin{macrocode}
+\def\ZREF@true{true}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\kv@define@key{ZREF@LABEL}{values}[]{%
+ \kv@parse{#1}{%
+ \ifx\kv@value\relax
+ \@PackageWarning\ZREF@name{%
+ Missing value for property `\kv@key'%
+ }%
+ \expandafter\ltx@gobbletwo
+ \else
+ \expandafter\zref@setcurrent
+ \fi
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\ifZREF@immediate}
+% The switch \cs{ifZREF@immediate} tells us, whether the
+% label should be written immediately or at page shipout time.
+% \cs{ZREF@label} need to be notified about this, because
+% it must disable the deferred execution of property values,
+% if the label is written immediately.
+% \begin{macrocode}
+\newif\ifZREF@immediate
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@wrapper@immediate}
+% The argument of \cs{zref@wrapper@immediate} is executed inside
+% a group where \cs{write} is redefined by adding
+% \cs{immediate} before its execution. Also \cs{ZREF@label}
+% is notified via the switch \cs{ifZREF@immediate}.
+% \begin{macrocode}
+\ZREF@Robust{\long\def}\zref@wrapper@immediate#1{%
+ \begingroup
+ \ZREF@immediatetrue
+ \let\ZREF@org@write\write
+ \def\write{\immediate\ZREF@org@write}%
+ #1%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@label}
+% \cs{ZREF@label} writes the data in the \xfile{.aux} file.
+% \verb|#1| contains the list of valid properties,
+% \verb|#2| the name of the reference. In case of immediate
+% writing, the deferred execution of property values is
+% disabled. Also \thepage is made expandable in this case.
+% \begin{macrocode}
+\def\ZREF@label#1#2{%
+ \if@filesw
+ \begingroup
+ \ifZREF@immediate
+ \let\ZREF@org@thepage\thepage
+ \fi
+ \protected@write\@auxout{%
+ \ifZREF@immediate
+ \let\thepage\ZREF@org@thepage
+ \fi
+ \let\ZREF@temp\ltx@empty
+ \@tfor\ZREF@P:=#1\do{%
+ \begingroup
+ \escapechar=-1 %
+ \edef\x{\endgroup
+ \def\noexpand\ZREF@P{%
+ \expandafter\string\ZREF@P
+ }%
+ }%
+ \x
+ \expandafter\ifx
+ \csname
+ \ifZREF@immediate
+ relax%
+ \else
+ Z@X@\ZREF@P%
+ \fi
+ \endcsname
+ \noexpand
+ \expandafter\let\csname Z@C@\ZREF@P\endcsname\relax
+ \fi
+ \toks@\expandafter{\ZREF@temp}%
+ \edef\ZREF@temp{%
+ \the\toks@
+ \ltx@backslashchar\ZREF@P{%
+ \expandafter\noexpand\csname Z@C@\ZREF@P\endcsname
+ }%
+ }%
+ }%
+ }{%
+ \string\zref@newlabel{#2}{\ZREF@temp}%
+ }%
+ \endgroup
+ \fi
+}
+\def\ZREF@addtoks#1{%
+ \toks@\expandafter\expandafter\expandafter{%
+ \expandafter\the\expandafter\toks@#1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Reference querying and extracting}
+%
+% Design goal for the extracting macros is that the extraction
+% process is full expandable. Thus these macros can be used
+% in expandable contexts. But there are problems that cannot
+% be solved by full expandable macros:
+% \begin{itemize}
+% \item In standard \hologo{LaTeX} undefined references sets a flag
+% and generate a warning. Both actions are not expandable.
+% \item Babel's support for its shorthand uses commands that
+% use non-expandable assignments. However currently there
+% is hope, that primitives are added to \pdfTeX\ that
+% allows the detection of contexts. Then the shorthand
+% can detect, if they are executed inside \cs{csname}
+% and protect themselves automatically.
+% \end{itemize}
+% \begin{macro}{\zref@ifrefundefined}
+% If a reference \verb|#1| is undefined, then macro
+% \cs{zref@ifrefundefined} calls \verb|#2| and \verb|#3| otherwise.
+% \begin{macrocode}
+\def\zref@ifrefundefined#1{%
+ \ltx@ifundefined{Z@R@#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zifrefundefined}
+% If a reference \verb|#1| is undefined, then macro
+% \cs{zref@ifrefundefined} calls \verb|#2| and \verb|#3| otherwise.
+% Also the reference is marked used.
+% \begin{macrocode}
+\ZREF@IfDefinable\zifrefundefined\def{%
+ #1{%
+ \zref@wrapper@babel\ZREF@ifrefundefined{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@ifrefundefined}
+% \begin{macrocode}
+\def\ZREF@ifrefundefined#1{%
+ \zref@refused{#1}%
+ \zref@ifrefundefined{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@refused}
+% The problem with undefined references is addressed by
+% the macro \cs{zref@refused}. This can be used outside
+% the expandable context. In case of an undefined reference
+% the flag is set to notify \hologo{LaTeX} and a warning is given.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@refused#1{%
+ \zref@wrapper@babel\ZREF@refused{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@refused}
+% \begin{macrocode}
+\def\ZREF@refused#1{%
+ \zref@ifrefundefined{#1}{%
+ \protect\G@refundefinedtrue
+ \@latex@warning{%
+ Reference `#1' on page \thepage \space undefined%
+ }%
+ }{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@ifrefcontainsprop}
+% \cs{zref@ifrefcontainsprop} looks, if the reference \verb|#1|
+% has the property \verb|#2| and calls then \verb|#3| and
+% \verb|#4| otherwise.
+% \begin{macrocode}
+\def\zref@ifrefcontainsprop#1#2{%
+ \zref@ifrefundefined{#1}{%
+ \ltx@secondoftwo
+ }{%
+ \expandafter\ZREF@ifrefcontainsprop
+ \csname Z@E@#2\expandafter\endcsname
+ \csname#2\expandafter\expandafter\expandafter\endcsname
+ \expandafter\expandafter\expandafter{%
+ \csname Z@R@#1\endcsname
+ }%
+ }%
+}
+\def\ZREF@ifrefcontainsprop#1#2#3{%
+ \expandafter\ifx\expandafter\ZREF@novalue
+ #1#3#2\ZREF@novalue\ZREF@nil\ltx@empty
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+}
+\def\ZREF@novalue{\ZREF@NOVALUE}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@extract}
+% \cs{zref@extract} is an abbreviation for the case
+% that the default of the property is used as default
+% value.
+% \begin{macrocode}
+\def\ZREF@extract#1#2{%
+ \romannumeral0%
+ \ltx@ifundefined{Z@D@#2}{%
+ \expandafter\ltx@space\zref@default
+ }{%
+ \expandafter\expandafter\expandafter\ZREF@@extract
+ \expandafter\expandafter\expandafter{%
+ \csname Z@D@#2\endcsname
+ }{#1}{#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@@extract}
+% \begin{macrocode}
+\def\ZREF@@extract#1#2#3{%
+ \expandafter\expandafter\expandafter\ltx@space
+ \zref@extractdefault{#2}{#3}{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@wu@extract}
+% \begin{macrocode}
+\def\ZREF@wu@extract#1#2{%
+ \etex@unexpanded\expandafter\expandafter\expandafter{%
+ \ZREF@extract{#1}{#2}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@extract}
+% \begin{macrocode}
+\let\zref@extract\ZREF@extract
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@extractdefault}
+% The basic extracting macro is \cs{zref@extractdefault} with
+% the reference name in \verb|#1|, the property in \verb|#2| and
+% the default value in \verb|#3| in case for problems.
+% \begin{macrocode}
+\def\ZREF@extractdefault#1#2#3{%
+ \romannumeral0%
+ \zref@ifrefundefined{#1}\ltx@firstoftwo{%
+ \zref@ifpropundefined{#2}\ltx@firstoftwo\ltx@secondoftwo
+ }{%
+ \ltx@space
+ #3%
+ }{%
+ \expandafter\expandafter\expandafter\ltx@space
+ \csname Z@E@#2\expandafter\expandafter\expandafter\endcsname
+ \csname Z@R@#1\expandafter\endcsname
+ \csname#2\endcsname{#3}\ZREF@nil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@wu@extractdefault}
+% \begin{macrocode}
+\def\ZREF@wu@extractdefault#1#2#3{%
+ \etex@unexpanded\expandafter\expandafter\expandafter{%
+ \ZREF@extractdefault{#1}{#2}{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@extractdefault}
+% \begin{macrocode}
+\let\zref@extractdefault\ZREF@extractdefault
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@def@extract}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@def@extract#1{%
+ \zref@wrapper@babel{\ZREF@def@extract{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@def@extract}
+% \begin{macrocode}
+\def\ZREF@def@extract#1#2#3{%
+ \zref@refused{#2}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter{%
+ \zref@extract{#2}{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@def@extractdefault}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@def@extractdefault#1{%
+ \zref@wrapper@babel{\ZREF@def@extractdefault{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@def@extractdefault}
+% \begin{macrocode}
+\def\ZREF@def@extractdefault#1#2#3#4{%
+ \zref@refused{#2}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter{%
+ \zref@extractdefault{#2}{#3}{#4}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@wrapper@unexpanded}
+% \begin{macrocode}
+\ZREF@Robust{\long\def}\ZREF@wrapper@unexpanded#1{%
+ \let\zref@wrapper@unexpanded\ltx@firstofone
+ \let\zref@getcurrent\ZREF@wu@getcurrent
+ \let\zref@extractdefault\ZREF@wu@extractdefault
+ \let\zref@extract\ZREF@wu@extract
+ #1%
+ \let\zref@wrapper@unexpanded\ZREF@wrapper@unexpanded
+ \let\zref@getcurrent\ZREF@getcurrent
+ \let\zref@extractdefault\ZREF@extractdefault
+ \let\zref@extract\ZREF@extract
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@wrapper@unexpanded}
+% \begin{macrocode}
+\ltx@IfUndefined{etex@unexpanded}{%
+ \let\zref@wrapper@unexpanded\ltx@firstofone
+}{%
+ \let\zref@wrapper@unexpanded\ZREF@wrapper@unexpanded
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Compatibility with \xpackage{babel}}
+%
+% \begin{macro}{\zref@wrapper@babel}
+% \begin{macrocode}
+\ZREF@Robust{\long\def}\zref@wrapper@babel#1#2{%
+ \ifcsname if@safe@actives\endcsname
+ \expandafter\ltx@firstofone
+ \else
+ \expandafter\ltx@secondoftwo
+ \fi
+ {%
+ \if@safe@actives
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+ {%
+ \begingroup
+ \csname @safe@activestrue\endcsname
+ \edef\x{#2}%
+ \expandafter\endgroup
+ \expandafter\ZREF@wrapper@babel\expandafter{\x}{#1}%
+ }%
+ }{%
+ #1{#2}%
+ }%
+}
+\long\def\ZREF@wrapper@babel#1#2{%
+ #2{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Unique counter support}
+%
+% \begin{macro}{\zref@require@unique}
+% Generate the counter |zref@unique| if the counter does not
+% already exist.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@require@unique{%
+ \@ifundefined{c@zref@unique}{%
+ \begingroup
+ \let\@addtoreset\ltx@gobbletwo
+ \newcounter{zref@unique}%
+ \endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thezref@unique}
+% \cs{thezref@unique} is used for automatically generated unique
+% labelnames.
+% \begin{macrocode}
+ \renewcommand*{\thezref@unique}{%
+ zref@\number\c@zref@unique
+ }%
+ }{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Utilities}
+%
+% \begin{macro}{\ZREF@number}
+% \begin{macrocode}
+\ltx@IfUndefined{numexpr}{%
+ \def\ZREF@number#1{\number#1}%
+}{%
+ \def\ZREF@number#1{\the\numexpr(#1)\relax}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Setup}
+%
+% \begin{macro}{\zref@setdefault}
+% Standard \hologo{LaTeX} prints ``??'' in bold face if a reference
+% is not known. \cs{zref@default} holds the text that is
+% printed in case of unknown references and is used, if
+% the default was not specified during the definition
+% of the new property by \cs{ref@newprop}.
+% The global default value can be set by \cs{zref@setdefault}.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@setdefault#1{%
+ \def\zref@default{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@default}
+% Now we initialize \cs{zref@default} with the same value
+% that \hologo{LaTeX} uses for its undefined references.
+% \begin{macrocode}
+\zref@setdefault{%
+ \nfss@text{\reset@font\bfseries ??}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Main property list.}
+%
+% \begin{macro}{\zref@setmainlist}
+% The name of the default property list is stored in
+% \cs{ZREF@mainlist} and can be set by \cs{zref@setmainlist}.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@setmainlist#1{%
+ \def\ZREF@mainlist{#1}%
+}
+\zref@setmainlist{main}
+% \end{macrocode}
+% \end{macro}
+% Now we create the list.
+% \begin{macrocode}
+\zref@newlist\ZREF@mainlist
+% \end{macrocode}
+%
+% \paragraph{Main properties.}
+%
+% The two properties \texttt{default} and \texttt{page}
+% are created and added to the main property list.
+% They store the data that
+% standard \hologo{LaTeX} uses in its references created by
+% \cs{label}.
+% \begin{description}
+% \item[\texttt{default}] the apperance of the latest
+% counter that is incremented by \cs{refstepcounter}
+% \item[\texttt{page}] the apperance of the page counter
+% \end{description}
+% \begin{macrocode}
+\zref@newprop{default}{\@currentlabel}
+\zref@newprop*{page}{\thepage}
+\zref@addprops\ZREF@mainlist{default,page}
+% \end{macrocode}
+%
+% \paragraph{Properties}
+%
+% \begin{macro}{\ZREF@NewPropAnchor}
+% \begin{macrocode}
+\def\ZREF@NewPropAnchor{%
+ \zref@newprop{anchor}{%
+ \ltx@ifundefined{@currentHref}{}{\@currentHref}%
+ }%
+ \global\let\ZREF@NewPropAnchor\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@titleref@current}
+% Later we will redefine the section and caption macros
+% to catch the current title and remember the value in
+% \cs{zref@titleref@current}.
+% \begin{macro}{\ZREF@NewPropTitle}
+% \begin{macrocode}
+\def\ZREF@NewPropTitle{%
+ \gdef\zref@titleref@current{}%
+ \zref@newprop{title}{\zref@titleref@current}%
+ \global\let\ZREF@NewPropTitle\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ZREF@NewPropTheotype}
+% \begin{macrocode}
+\def\ZREF@NewPropTheotype{%
+ \zref@newprop{theotype}{}%
+ \global\let\ZREF@NewPropTheotype\relax
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@NewPropPageValue}
+% \begin{macrocode}
+\def\ZREF@NewPropPageValue{%
+ \zref@newprop*{pagevalue}[0]{\number\c@page}%
+ \global\let\ZREF@NewPropPageValue\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{Mark successful loading}
+%
+% \begin{macrocode}
+\let\ZREF@base@ok=Y
+%</base>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{user}}
+%
+% \begin{macrocode}
+%<*user>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-user}%
+ [2018/11/21 v2.27 Module user for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% Module \xmodule{user} enables a small user interface.
+% All macros are prefixed by \cs{z}.
+%
+% First we define the pendants to the standard \hologo{LaTeX} referencing
+% commands \cs{label}, \cs{ref}, and \cs{pageref}.
+%
+% \begin{macro}{\zlabel}
+% Similar to \cs{label} the macro \cs{zlabel} writes a reference
+% entry in the \xfile{.aux} file. The main property list is used.
+% Also we add the babel patch. The \cs{label} command can also be
+% used inside section titles, but it must not go into the
+% table of contents. Therefore we have to check this situation.
+% \begin{macrocode}
+\newcommand*\zlabel{%
+ \ifx\label\ltx@gobble
+ \expandafter\ltx@gobble
+ \else
+ \expandafter\zref@wrapper@babel\expandafter\zref@label
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zkvlabel}
+% \begin{macrocode}
+\newcommand*{\zkvlabel}[1]{%
+ \ifx\label\ltx@gobble
+ \expandafter\ltx@gobblethree
+ \fi
+ \zref@wrapper@babel{\zref@labelbykv{#1}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref}
+% Macro \cs{zref} is the corresponding macro for \cs{ref}.
+% Also it provides an optional argument in order to
+% select another property.
+% \begin{macrocode}
+\newcommand*{\zref}[2][default]{% robust because of optional argument
+ \zref@propexists{#1}{%
+ \zref@wrapper@babel\ZREF@zref{#2}{#1}%
+ }%
+}%
+\def\ZREF@zref#1{%
+ \zref@refused{#1}%
+ \zref@extract{#1}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zpageref}
+% For macro \cs{zpageref} we just call \cs{zref}
+% with property \verb|page|.
+% \begin{macrocode}
+\ZREF@IfDefinable\zpageref\def{%
+ {\zref[page]}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zrefused}
+% For the following expandible user macros \cs{zrefused}
+% should be used to notify \hologo{LaTeX} in case of undefined
+% references.
+% \begin{macrocode}
+\ZREF@IfDefinable\zrefused\def{%
+ {\zref@refused}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</user>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{abspage}}
+%
+% \begin{macrocode}
+%<*abspage>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-abspage}%
+ [2018/11/21 v2.27 Module abspage for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% Module \xmodule{abspage} adds a new property \verb|abspage|
+% to the \verb|main| property list for absolute page numbers.
+% These are recorded by the help of package \xpackage{atbegshi}.
+% \begin{macrocode}
+\RequirePackage{atbegshi}[2011/10/05]%
+% \end{macrocode}
+% The counter \verb|abspage| must not go in the clear list
+% of \verb|@ckpt| that is used to set counters in
+% \xfile{.aux} files of included \hologo{TeX} files.
+% \begin{macrocode}
+\begingroup
+ \let\@addtoreset\ltx@gobbletwo
+ \newcounter{abspage}%
+\endgroup
+\setcounter{abspage}{0}%
+\AtBeginShipout{%
+ \stepcounter{abspage}%
+}%
+\zref@newprop*{abspage}[0]{\the\c@abspage}%
+\zref@addprop\ZREF@mainlist{abspage}%
+% \end{macrocode}
+% Note that counter \verb|abspage| shows the
+% previous page during page processing. Before
+% shipout the counter is incremented.
+% Thus the property is correctly written with
+% deferred writing. If the counter is written
+% using \cs{zref@wrapper@immediate}, then the number
+% is too small by one.
+%
+% \begin{macrocode}
+%</abspage>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{counter}}
+%
+% \begin{macrocode}
+%<*counter>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-counter}%
+ [2018/11/21 v2.27 Module counter for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% For features such as \xpackage{hyperref}'s \cs{autoref}
+% we need the name of the counter. The property
+% \verb|counter| is defined and added to the main property
+% list.
+% \begin{macrocode}
+\zref@newprop{counter}{}
+\zref@addprop\ZREF@mainlist{counter}
+% \end{macrocode}
+%
+% \cs{refstepcounter} is the central macro where we know
+% which counter is responsible for the reference.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ZREF@patch{refstepcounter}{%
+ \def\refstepcounter#1{%
+ \zref@setcurrent{counter}{#1}%
+ \ZREF@org@refstepcounter{#1}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</counter>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{lastpage}}
+%
+% \begin{macrocode}
+%<*lastpage>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-lastpage}%
+ [2018/11/21 v2.27 Module lastpage for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\RequirePackage{zref-abspage}[2018/11/21]
+\RequirePackage{atveryend}[2009/12/07]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% The module \xmodule{lastpage} implements the service
+% of package \xpackage{lastpage} by setting a reference
+% \verb|LastPage| at the end of the document.
+% If module \xmodule{abspage} is given, also the absolute
+% page number is available, because the properties of
+% the main property list are used.
+% \begin{macrocode}
+\zref@newlist{LastPage}
+\AfterLastShipout{%
+ \if@filesw
+ \begingroup
+ \advance\c@page\m@ne
+ \toks@\expandafter\expandafter\expandafter{%
+ \expandafter\Z@L@main
+ \Z@L@LastPage
+ }%
+ \expandafter\zref@wrapper@immediate\expandafter{%
+ \expandafter\ZREF@label\expandafter{\the\toks@}{LastPage}%
+ }%
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\zref@iflastpage}
+% \begin{macrocode}
+\def\zref@iflastpage#1{%
+ \ifnum\zref@extractdefault{#1}{abspage}{-1}=%
+ \zref@extractdefault{LastPage}{abspage}{-2} %
+ \expandafter\ltx@firstoftwo
+ \else
+ \expandafter\ltx@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ziflastpage}
+% \begin{macrocode}
+\ZREF@IfDefinable\ziflastpage\def{%
+ {\zref@wrapper@babel\ZREF@iflastpage}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{ZREF@iflastpage}
+% \begin{macrocode}
+\def\ZREF@iflastpage#1{%
+ \zref@refused{LastPage}%
+ \zref@refused{#1}%
+ \zref@iflastpage{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</lastpage>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{thepage}}
+%
+% \begin{macrocode}
+%<*thepage>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-thepage}%
+ [2018/11/21 v2.27 Module thepage for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{atbegshi}[2011/10/05]
+\RequirePackage{zref-abspage}[2018/11/21]
+% \end{macrocode}
+% \begin{macrocode}
+\zref@newlist{thepage}
+\zref@addprop{thepage}{page}
+\ZREF@NewPropPageValue
+% \end{macrocode}
+% \begin{macro}{\zref@thepage@atbegshi@hook}
+% \begin{macrocode}
+\let\zref@thepage@atbegshi@hook\ltx@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\zref@addprop{thepage}{pagevalue}
+\AtBeginShipout{%
+ \AtBeginShipoutAddToBox{%
+ \zref@thepage@atbegshi@hook
+ \zref@labelbylist{thepage\the\value{abspage}}{thepage}%
+ }%
+}
+% \end{macrocode}
+% \begin{macro}{\zref@thepage@name}
+% \begin{macrocode}
+\ltx@IfUndefined{numexpr}{%
+ \def\zref@thepage@name#1{thepage\number#1}%
+}{%
+ \def\zref@thepage@name#1{thepage\the\numexpr#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@thepage}
+% \begin{macrocode}
+\def\zref@thepage#1{%
+ \zref@extract{\zref@thepage@name{#1}}{page}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@thepage@refused}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@thepage@refused#1{%
+ \zref@refused{\zref@thepage@name{#1}}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zthepage}
+% \begin{macrocode}
+\ZREF@IfDefinable\zthepage\def{%
+ #1{%
+ \zref@thepage@refused{#1}%
+ \zref@thepage{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</thepage>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{nextpage}}
+%
+% \begin{macrocode}
+%<*nextpage>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-nextpage}%
+ [2018/11/21 v2.27 Module nextpage for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{zref-abspage}[2018/11/21]
+\RequirePackage{zref-thepage}[2018/11/21]
+\RequirePackage{zref-lastpage}[2018/11/21]
+\RequirePackage{uniquecounter}[2009/12/18]
+% \end{macrocode}
+% \begin{macrocode}
+\UniqueCounterNew{znextpage}
+
+\newcommand*{\znextpagesetup}{%
+ \afterassignment\ZREF@np@setup@i
+ \def\ZREF@np@call@unknown##1%
+}
+\def\ZREF@np@setup@i{%
+ \afterassignment\ZREF@np@setup@ii
+ \def\ZREF@np@call@nonext##1%
+}
+\def\ZREF@np@setup@ii{%
+ \def\ZREF@np@call@next##1%
+}
+\def\ZREF@np@call@unknown#1{#1}
+\def\ZREF@np@call@nonext#1{#1}
+\def\ZREF@np@call@next#1{#1}
+\ZREF@IfDefinable\znextpage\def{%
+ {\UniqueCounterCall{znextpage}{\ZREF@nextpage}}%
+}%
+\newcommand*{\znonextpagename}{}
+\newcommand*{\zunknownnextpagename}{\Z@D@page}
+\def\ZREF@nextpage#1{%
+ \begingroup
+ \def\ZREF@refname@this{zref@np#1}%
+ \zref@labelbyprops\ZREF@refname@this{abspage}%
+ \chardef\ZREF@call=0 % unknown
+ \ZREF@ifrefundefined\ZREF@refname@this{%
+ }{%
+ \edef\ZREF@pagenum@this{%
+ \zref@extractdefault\ZREF@refname@this{abspage}{0}%
+ }%
+ \edef\ZREF@refname@next{%
+ \zref@thepage@name{%
+ \the\numexpr\ZREF@pagenum@this+1%
+ }%
+ }%
+ \ifnum\ZREF@pagenum@this>0 %
+ \ZREF@ifrefundefined{LastPage}{%
+ \zref@ifrefundefined\ZREF@refname@next{%
+ }{%
+ \chardef\ZREF@call=2 % next page
+ }%
+ }{%
+ \edef\ZREF@pagenum@last{%
+ \zref@extractdefault{LastPage}{abspage}{0}%
+ }%
+ \ifnum\ZREF@pagenum@this<\ZREF@pagenum@last\ltx@space
+ \ZREF@ifrefundefined\ZREF@refname@next{%
+ }{%
+ \chardef\ZREF@call=2 % next page
+ }%
+ \else
+ \ifnum\ZREF@pagenum@this=\ZREF@pagenum@this\ltx@space
+ \chardef\ZREF@call=1 % no next page
+ \fi
+ \fi
+ }%
+ \fi
+ }%
+ \edef\x{%
+ \endgroup
+ \ifcase\ZREF@call
+ \noexpand\ZREF@np@call@unknown{%
+ \noexpand\zunknownnextpagename
+ }%
+ \or
+ \noexpand\ZREF@np@call@nonext{%
+ \noexpand\znonextpagename
+ }%
+ \else
+ \noexpand\ZREF@np@call@next{%
+ \noexpand\zref@extract{\ZREF@refname@next}{page}%
+ }%
+ \fi
+ }%
+ \x
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</nextpage>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{totpages}}
+%
+% \begin{macrocode}
+%<*totpages>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-totpages}%
+ [2018/11/21 v2.27 Module totpages for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% The absolute page number of the last page is the total
+% page number.
+% \begin{macrocode}
+\RequirePackage{zref-abspage}[2018/11/21]
+\RequirePackage{zref-lastpage}[2018/11/21]
+% \end{macrocode}
+%
+% \begin{macro}{\ztotpages}
+% Macro \cs{ztotpages} contains the number of pages. It can be
+% used inside expandable calculations. It expands to zero if
+% the reference is not yet available.
+% \begin{macrocode}
+\newcommand*{\ztotpages}{%
+ \zref@extractdefault{LastPage}{abspage}{0}%
+}
+% \end{macrocode}
+% \end{macro}
+% Also we mark the reference |LastPage| as used:
+% \begin{macrocode}
+\AtBeginDocument{%
+ \zref@refused{LastPage}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</totpages>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{pagelayout}}
+%
+% \begin{macrocode}
+%<*pagelayout>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-pagelayout}%
+ [2018/11/21 v2.27 Module pagelayout for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{zref-thepage}[2018/11/21]
+\RequirePackage{ifluatex}[2010/03/01]
+\RequirePackage{atveryend}[2010/03/24]
+% \end{macrocode}
+%
+% \subsubsection{Support for \hologo{LuaTeX}}
+%
+% \begin{macrocode}
+\ifluatex
+ \ifnum\luatexversion<39 %
+ \else
+ \begingroup
+ \escapechar=-1 %
+ \def\ZREF@temp#1{%
+ \ltx@IfUndefined{\string#1}{%
+ \let#1\ltx@undefined
+ \directlua{%
+ if tex.enableprimitives then %
+ tex.enableprimitives('', {'\string#1'})%
+ end%
+ }%
+ \ltx@ifundefined{\string#1}{%
+ }{%
+ \global#1=#1%
+ \@PackageInfoNoLine{zref-pagelayout}{%
+ \string#1 enabled%
+ }%
+ }%
+ }{}%
+ }%
+ \ZREF@temp\pdfpagewidth
+ \ZREF@temp\pdfpageheight
+ \ZREF@temp\pdfhorigin
+ \ZREF@temp\pdfvorigin
+ \endgroup
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Define layout properties}
+%
+% \begin{macrocode}
+\def\ZREF@temp#1{%
+ \begingroup
+ \escapechar=-1 %
+ \ltx@ifundefined{\string#1}{\endgroup}{%
+ \edef\x{%
+ \endgroup
+ \noexpand\zref@newprop*{\string#1}%
+ [\noexpand\number\noexpand#1]% hash-ok
+ {\noexpand\number\noexpand#1}%
+ \noexpand\zref@addprop{thepage}{\string#1}%
+ }%
+ \x
+ }%
+}
+\ZREF@temp\mag
+\ZREF@temp\paperwidth
+\ZREF@temp\paperheight
+\ZREF@temp\stockwidth % memoir.cls, crop.sty
+\ZREF@temp\stockheight % memoir.cls, crop.sty
+\ZREF@temp\mediawidth % VTeX
+\ZREF@temp\mediaheight % VTeX
+\ZREF@temp\pdfpagewidth
+\ZREF@temp\pdfpageheight
+\ZREF@temp\pdfhorigin
+\ZREF@temp\pdfvorigin
+\ZREF@temp\hoffset
+\ZREF@temp\voffset
+\ZREF@temp\topmargin
+\ZREF@temp\oddsidemargin
+\ZREF@temp\evensidemargin
+\ZREF@temp\textwidth
+\ZREF@temp\textheight
+\ZREF@temp\headheight
+\ZREF@temp\headsep
+\ZREF@temp\footskip
+\ZREF@temp\marginparwidth
+\ZREF@temp\marginparsep
+\ZREF@temp\columnwidth
+\ZREF@temp\columnsep
+\ZREF@temp\trimedge % memoir.cls
+\ZREF@temp\spinemargin % memoir.cls
+\ZREF@temp\foremargin % memoir.cls
+\ZREF@temp\trimtop % memoir.cls
+\ZREF@temp\uppermargin % memoir.cls
+\ZREF@temp\headmargin % memoir.cls
+% \end{macrocode}
+%
+% \begin{macrocode}
+\zref@newprop*{outputboxwd}[0pt]{\AtBeginShipoutBoxWidth}
+% \end{macrocode}
+% \begin{macrocode}
+\zref@newprop*{outputboxht}[0pt]{\AtBeginShipoutBoxHeight}
+% \end{macrocode}
+% \begin{macrocode}
+\zref@newprop*{outputboxdp}[0pt]{\AtBeginShipoutBoxDepth}
+% \end{macrocode}
+% \begin{macrocode}
+\zref@addprops{thepage}{outputboxwd,outputboxht,outputboxdp}
+% \end{macrocode}
+%
+% \begin{macro}{\ifZREF@pl@list}
+% \begin{macrocode}
+\ltx@newif\ifZREF@pl@list
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@listpagelayout}
+% \begin{macrocode}
+\ZREF@IfDefinable\zlistpagelayout\def{%
+ {\global\ZREF@pl@listtrue}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@pl@AfterLastShipout}
+% \begin{macrocode}
+\def\ZREF@pl@AfterLastShipout{%
+ \ifZREF@pl@list
+ \edef\ZREF@page@max{\the\value{abspage}}%
+ \ltx@ifundefined{ZREF@org@testdef}{%
+ \let\ZREF@org@testdef\@testdef
+ \def\@testdef##1##2##3{%
+ \ZREF@org@testdef{##1}{##2}{##3}%
+ \def\ZREF@temp{##1}%
+ \ifx\ZREF@temp\ZREF@RefPrefix
+ \expandafter\gdef\csname##1@##2\endcsname{##3}%
+ \fi
+ }%
+ }{}%
+ \AtVeryEndDocument{\ZREF@pl@AtVeryEnd}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@pl@AtVeryEnd}
+% \begin{macrocode}
+\def\ZREF@pl@AtVeryEnd{%
+ \begingroup
+ \toks@{Page layout parameters:\MessageBreak}%
+ \count@=1 %
+ \ZREF@pl@ListPage
+ \edef\x{\endgroup
+ \noexpand\@PackageInfoNoLine{zref-pagelayout}{\the\toks@}%
+ }%
+ \x
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@pl@ListPage}
+% \begin{macrocode}
+\def\ZREF@pl@ListPage{%
+ \edef\x{%
+ \toks@={%
+ \the\toks@
+ Page \the\count@:\noexpand\MessageBreak
+ \zref@ifrefundefined{thepage\the\count@}{}{%
+ \ltx@space\ltx@space mag = %
+ \zref@extract{thepage\the\count@}{mag}%
+ \noexpand\MessageBreak
+ \ZREF@pl@ListEntry{paperwidth}%
+ \ZREF@pl@ListEntry{paperheight}%
+ \ZREF@pl@ListEntry{stockwidth}%
+ \ZREF@pl@ListEntry{stockheight}%
+ \ZREF@pl@ListEntry{mediawidth}%
+ \ZREF@pl@ListEntry{mediaheight}%
+ \ZREF@pl@ListEntry{pdfpagewidth}%
+ \ZREF@pl@ListEntry{pdfpageheight}%
+ \ZREF@pl@ListEntry{pdfhorigin}%
+ \ZREF@pl@ListEntry{pdfvorigin}%
+ \ZREF@pl@ListEntry{hoffset}%
+ \ZREF@pl@ListEntry{voffset}%
+ \ZREF@pl@ListEntry{topmargin}%
+ \ZREF@pl@ListEntry{oddsidemargin}%
+ \ZREF@pl@ListEntry{evensidemargin}%
+ \ZREF@pl@ListEntry{textwidth}%
+ \ZREF@pl@ListEntry{textheight}%
+ \ZREF@pl@ListEntry{headheight}%
+ \ZREF@pl@ListEntry{headsep}%
+ \ZREF@pl@ListEntry{footskip}%
+ \ZREF@pl@ListEntry{marginparwidth}%
+ \ZREF@pl@ListEntry{marginparsep}%
+ \ZREF@pl@ListEntry{columnwidth}%
+ \ZREF@pl@ListEntry{columnsep}%
+ \ZREF@pl@ListEntry{trimedge}%
+ \ZREF@pl@ListEntry{spinemargin}%
+ \ZREF@pl@ListEntry{foremargin}%
+ \ZREF@pl@ListEntry{trimtop}%
+ \ZREF@pl@ListEntry{uppermargin}%
+ \ZREF@pl@ListEntry{headmargin}%
+ }%
+ }%
+ }\x
+ \ifnum\ZREF@page@max>\count@
+ \advance\count@ by\ltx@one
+ \else
+ \expandafter\ltx@gobble
+ \fi
+ \ZREF@pl@ListPage
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@pl@ListEntry}
+% \begin{macrocode}
+\def\ZREF@pl@ListEntry#1{%
+ \zref@ifpropundefined{#1}{%
+ }{%
+ \zref@ifrefcontainsprop{thepage\the\count@}{#1}{%
+ \ltx@space\ltx@space#1 = %
+ \zref@extract{thepage\the\count@}{#1}sp = %
+ \the\dimexpr\zref@extract{thepage\the\count@}{#1}sp\relax
+ \noexpand\MessageBreak
+ }{}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\AfterLastShipout{%
+ \ZREF@pl@AfterLastShipout
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pagelayout>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{pageattr}}
+%
+% \begin{macrocode}
+%<*pageattr>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-pageattr}%
+ [2018/11/21 v2.27 Module pageattr for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{ifluatex}[2010/03/01]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifluatex
+ \ifnum\luatexversion<39 %
+ \else
+ \begingroup
+ \escapechar=-1 %
+ \def\ZREF@temp#1{%
+ \ltx@IfUndefined{\string#1}{%
+ \let#1\ltx@undefined
+ \directlua{%
+ if tex.enableprimitives then %
+ tex.enableprimitives('', {'\string#1'})%
+ end%
+ }%
+ \ltx@ifundefined{\string#1}{%
+ }{%
+ \global#1=#1%
+ \@PackageInfoNoLine{zref-pageattr}{%
+ \string#1 enabled%
+ }%
+ }%
+ }{}%
+ }%
+ \ZREF@temp\pdfpageattr
+ \ZREF@temp\pdfpagesattr
+ \endgroup
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\ZREF@temp=N%
+\ltx@IfUndefined{pdfpageattr}{%
+ \@PackageInfoNoLine{zref-pageattr}{%
+ \string\pdfpageattr\space is not available%
+ }%
+ \def\zref@pdfpageattr#1{}%
+ \def\zref@pdfpageattr@used#1{}%
+}{%
+ \RequirePackage{zref-thepage}[2018/11/21]%
+ \zref@newprop*{pdfpageattr}[]{\zref@hex{\the\pdfpageattr}}%
+ \zref@addprop{thepage}{pdfpageattr}%
+ \let\ZREF@temp=Y%
+}
+\ltx@IfUndefined{pdfpagesattr}{%
+ \@PackageInfoNoLine{zref-pageattr}{%
+ \string\pdfpagesattr\space is not available%
+ }%
+ \def\zref@pdfpagesattr{}%
+ \def\zref@pdfpagesattr@used{}%
+}{%
+ \RequirePackage{zref-lastpage}[2018/11/21]%
+ \zref@newprop*{pdfpagesattr}[]{\zref@hex{\the\pdfpagesattr}}%
+ \zref@addprop{LastPage}{pdfpagesattr}%
+ \let\ZREF@temp=Y%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\ifx\ZREF@temp N%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{zref-abspage}[2018/11/21]
+\RequirePackage{atveryend}[2010/03/24]
+\RequirePackage{pdftexcmds}[2010/04/01]
+\let\ZREF@temp=Y%
+\ltx@IfUndefined{pdf@escapehex}{\let\ZREF@temp=N}{}
+\ltx@IfUndefined{pdf@unescapehex}{\let\ZREF@temp=N}{}
+\ifx\ZREF@temp N%
+ \let\zref@hex\ltx@firstofone
+ \let\zref@unhex\ltx@firstofone
+\else
+ \let\zref@hex\pdf@escapehex
+ \let\zref@unhex\pdf@unescapehex
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\ifZREF@pa@list}
+% \begin{macrocode}
+\ltx@newif\ifZREF@pa@list
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@listpageattr}
+% \begin{macrocode}
+\ZREF@IfDefinable\zlistpageattr\def{%
+ {\ZREF@pa@listtrue}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@pa@AfterLastShipout}
+% \begin{macrocode}
+\def\ZREF@pa@AfterLastShipout{%
+ \ifZREF@pa@list
+ \edef\ZREF@page@max{\the\value{abspage}}%
+ \ltx@ifundefined{ZREF@org@testdef}{%
+ \let\ZREF@org@testdef\@testdef
+ \def\@testdef##1##2##3{%
+ \ZREF@org@testdef{##1}{##2}{##3}%
+ \def\ZREF@temp{##1}%
+ \ifx\ZREF@temp\ZREF@RefPrefix
+ \expandafter\xdef\csname##1@##2\endcsname{##3}%
+ \fi
+ }%
+ }{}%
+ \AtVeryEndDocument{\ZREF@pa@AtVeryEnd}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@pa@AtVeryEnd}
+% \begin{macrocode}
+\ltx@IfUndefined{pdfpageattr}{%
+ \def\ZREF@pa@AtVeryEnd{}%
+}{%
+ \def\ZREF@pa@AtVeryEnd{%
+ \begingroup
+ \toks@{List of \ltx@backslashchar pdfpageattr:\MessageBreak}%
+ \count@=1 %
+ \ZREF@pa@ListPage
+ \edef\x{\endgroup
+ \noexpand\@PackageInfoNoLine{zref-pageattr}{%
+ \the\toks@
+ }%
+ }%
+ \x
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@pageattr}
+% \begin{macrocode}
+\def\zref@pageattr#1{%
+ \zref@unhex{%
+ \zref@extract{thepage\ZREF@number{#1}}{pdfpageattr}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@pageattr@used}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@pageattr@used#1{%
+ \zref@refused{thepage\ZREF@number{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@pa@ListPage}
+% \begin{macrocode}
+ \def\ZREF@pa@ListPage{%
+ \edef\x{%
+ \toks@={%
+ \the\toks@
+ Page \the\count@:%
+ \noexpand\MessageBreak
+ \zref@ifrefundefined{thepage\the\count@}{}{%
+ <<\zref@pdfpageattr\count@>>%
+ \noexpand\MessageBreak
+ }%
+ }%
+ }\x
+ \ifnum\ZREF@page@max>\count@
+ \advance\count@ by\ltx@one
+ \else
+ \expandafter\ltx@gobble
+ \fi
+ \ZREF@pa@ListPage
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\ltx@IfUndefined{pdfpagesattr}{%
+}{%
+% \end{macrocode}
+% \begin{macro}{\zref@pdfpagesattr}
+% \begin{macrocode}
+ \def\zref@pdfpagesattr{%
+ \zref@unhex{%
+ \zref@extract{LastPage}{pdfpagesattr}%
+ }%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@pdfpagesattr@used}
+% \begin{macrocode}
+ \ZREF@Robust\def\zref@pdfpagesattr@used{%
+ \zref@refused{LastPage}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+ \ltx@LocalAppendToMacro\ZREF@pa@AtVeryEnd{%
+ \@PackageInfoNoLine{zref-pageattr}{%
+ \ltx@backslashchar pdfpagesattr:\MessageBreak
+ <<\zref@pdfpagesattr>>%
+ \MessageBreak
+ }%
+ }%
+}
+\AfterLastShipout{%
+ \ZREF@pa@AfterLastShipout
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</pageattr>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{marks}}
+%
+% \begin{macrocode}
+%<*marks>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-marks}%
+ [2018/11/21 v2.27 Module marks for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand*{\zref@marks@register}[3][]{%
+ \edef\ZREF@TempName{#1}%
+ \edef\ZREF@TempNum{\ZREF@number{#2}}%
+ \ifnum\ZREF@TempNum<\ltx@zero %
+ \PackageError\ZREF@name{%
+ \string\zref@marks@register\ltx@space is called with invalid%
+ \MessageBreak
+ marks register number (\ZREF@TempNum)%
+ }{%
+ Use `0' or the command, defined by \string\newmarks.\MessageBreak
+ \@ehc
+ }%
+ \else
+ \ifx\ZREF@TempName\ltx@empty
+ \edef\ZREF@TempName{mark\romannumeral\ZREF@TempNum}%
+ \else
+ \edef\ZREF@TempName{marks\ZREF@TempName}%
+ \fi
+ \ZREF@MARKS@DefineProp{top}%
+ \ZREF@MARKS@DefineProp{first}%
+ \ZREF@MARKS@DefineProp{bot}%
+ \kv@parse{#3}{%
+ \ifx\kv@value\relax
+ \def\kv@value{top,first,bot}%
+ \fi
+ \edef\ZREF@temp{\expandafter\ltx@car\kv@key X\@nil}%
+ \ifx\ZREF@temp\ZREF@STAR
+ \edef\kv@key{\expandafter\ltx@cdr\kv@key\@nil}%
+ \zref@newlist\kv@key
+ \fi
+ \expandafter\comma@parse\expandafter{\kv@value}{%
+ \ifcase0\ifx\comma@entry\ZREF@NAME@top 1\else
+ \ifx\comma@entry\ZREF@NAME@first 1\else
+ \ifx\comma@entry\ZREF@NAME@bot 1\fi\fi\fi\ltx@space
+ \PackageWarning{zref-marks}{%
+ Use `top', `first' or `bot' for the list values%
+ \MessageBreak
+ in the third argument of \string\zref@marks@register.%
+ \MessageBreak
+ Ignoring unkown value `\comma@entry'%
+ }%
+ \else
+ \zref@addprop{\kv@key}{\comma@entry\ZREF@TempName}%
+ \fi
+ \ltx@gobble
+ }%
+ \ltx@gobbletwo
+ }%
+ \fi
+}
+\def\ZREF@STAR{*}
+\def\ZREF@NAME@top{top}
+\def\ZREF@NAME@first{first}
+\def\ZREF@NAME@bot{bot}
+\def\ZREF@MARKS@DefineProp#1{%
+ \zref@ifpropundefined{#1\ZREF@TempName}{%
+ \ifnum\ZREF@TempNum=\ltx@zero
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\zref@newprop*{#1\ZREF@TempName}[]{%
+ \expandafter\noexpand\csname#1mark\endcsname
+ }%
+ }%
+ \x
+ \else
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\zref@newprop*{#1\ZREF@TempName}[]{%
+ \expandafter\noexpand\csname#1marks\endcsname
+ \ZREF@TempNum
+ }%
+ }%
+ \x
+ \fi
+ }{%
+ \PackageWarning{zref-marks}{%
+ \string\zref@marks@register\ltx@space does not generate the%
+ \MessageBreak
+ new property `#1\ZREF@TempName', because\MessageBreak
+ it is already defined%
+ }%
+ }%
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</marks>
+% \end{macrocode}
+%
+% \subsection{Module \xmodule{runs}}
+%
+% This module does not use the label-reference-system.
+% The reference changes with each \hologo{LaTeX}~run and would
+% force a rerun warning always.
+% \begin{macrocode}
+%<*runs>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-runs}%
+ [2018/11/21 v2.27 Module runs for zref (HO)]%
+% \end{macrocode}
+%
+% \begin{macro}{\zruns}
+% \begin{macrocode}
+\providecommand*{\zruns}{0}%
+\AtBeginDocument{%
+ \edef\zruns{\number\numexpr\zruns+1}%
+ \begingroup
+ \def\on@line{}%
+ \PackageInfo{zref-runs}{LaTeX runs: \zruns}%
+ \if@filesw
+ \immediate\write\@mainaux{%
+ \string\gdef\string\zruns{\zruns}%
+ }%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</runs>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{perpage}}
+%
+% \begin{macrocode}
+%<*perpage>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-perpage}%
+ [2018/11/21 v2.27 Module perpage for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% This module resets a counter at page boundaries.
+% Because of the asynchronous output routine
+% page counter properties cannot be asked directly,
+% references are necessary.
+%
+% For detecting changed pages module \xmodule{abspage}
+% is loaded.
+% \begin{macrocode}
+\RequirePackage{zref-abspage}[2018/11/21]
+% \end{macrocode}
+%
+% We group the properties for the needed references
+% in the property list |perpage|. The property |pagevalue|
+% records the correct value of the page counter.
+% \begin{macrocode}
+\ZREF@NewPropPageValue
+\zref@newlist{perpage}
+\zref@addprops{perpage}{abspage,page,pagevalue}
+% \end{macrocode}
+% The page value, known by the reference mechanism, will be
+% stored in counter |zpage|.
+% \begin{macrocode}
+\newcounter{zpage}
+% \end{macrocode}
+% Counter |zref@unique| helps in generating unique reference
+% names.
+% \begin{macrocode}
+\zref@require@unique
+% \end{macrocode}
+% In order to be able to reset the counter, we hook here
+% into \cs{stepcounter}. In fact two nested hooks are used
+% to allow other packages to use the first hook at the beginning
+% of \cs{stepcounter}.
+% \begin{macrocode}
+\let\ZREF@org@stepcounter\stepcounter
+\def\stepcounter#1{%
+ \ifcsname @stepcounterhook@#1\endcsname
+ \csname @stepcounterhook@#1\endcsname
+ \fi
+ \ZREF@org@stepcounter{#1}%
+}
+% \end{macrocode}
+% \cs{@stpelt} must be adapted due to the change in latex
+% 2015-01, see https://github.com/ho-tex/oberdiek/issues/26
+% \begin{macrocode}
+\let\ZREF@org@@stpelt\@stpelt
+\def\@stpelt#1{%
+ \ifcsname ZREF@perpage@#1\endcsname
+ \begingroup
+ \let\stepcounter\ZREF@org@stepcounter
+ \ZREF@org@@stpelt{#1}%
+ \endgroup
+ \expandafter\ltx@gobbletwo
+ \fi
+ \ZREF@org@@stpelt{#1}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\zmakeperpage}
+% Makro \cs{zmakeperpage} resets a counter at each page
+% break. It uses the same syntax and semantics as
+% \cs{MakePerPage} from package \xpackage{perpage} \cite{perpage}.
+% The initial start value can be given by the optional
+% argument. Default is one that means after the first
+% \cs{stepcounter} on a new page the counter starts with
+% one.
+% \begin{macrocode}
+\ZREF@IfDefinable\zmakeperpage\def{%
+ {%
+ \@ifnextchar[\ZREF@makeperpage@opt{\ZREF@@makeperpage[\ltx@zero]}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% We hook before the counter is incremented in \cs{stepcounter},
+% package \xpackage{perpage} afterwards. Thus a little
+% calculation is necessary.
+% \begin{macrocode}
+\def\ZREF@makeperpage@opt[#1]{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\ZREF@@makeperpage[\number\numexpr#1-1\relax]%
+ }%
+ \x
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\ZREF@@makeperpage[#1]#2{%
+ \@ifundefined{@stepcounterhook@#2}{%
+ \expandafter\gdef\csname @stepcounterhook@#2\endcsname{}%
+ }{}%
+ \expandafter\gdef\csname ZREF@perpage@#2\endcsname{%
+ \ZREF@@perpage@step{#2}{#1}%
+ }%
+ \expandafter\g@addto@macro\csname @stepcounterhook@#2\endcsname{%
+ \ifcsname ZREF@perpage@#2\endcsname
+ \csname ZREF@perpage@#2\endcsname
+ \fi
+ }%
+}
+% \end{macrocode}
+% \begin{macro}{\ZREF@@perpage@step}
+% The heart of this module follows.
+% \begin{macrocode}
+\def\ZREF@@perpage@step#1#2{%
+% \end{macrocode}
+% First the reference is generated.
+% \begin{macrocode}
+ \global\advance\c@zref@unique\ltx@one
+ \begingroup
+ \expandafter
+ \zref@labelbylist\expandafter{\thezref@unique}{perpage}%
+% \end{macrocode}
+% The \cs{expandafter} commands are necessary, because \cs{ZREF@temp}
+% is also used inside of \cs{zref@labelbylist}.
+%
+% The evaluation of the reference follows. If the reference
+% is not yet kwown, we use the page counter as approximation.
+% \begin{macrocode}
+ \zref@ifrefundefined\thezref@unique{%
+ \global\c@zpage=\c@page
+ \global\let\thezpage\thepage
+ \expandafter\xdef\csname ZREF@abspage@#1\endcsname{%
+ \number\c@abspage
+ }%
+ }{%
+% \end{macrocode}
+% The reference is used to set \cs{thezpage} and counter |zpage|.
+% \begin{macrocode}
+ \global\c@zpage=\zref@extract\thezref@unique{pagevalue}\relax
+ \xdef\thezpage{\noexpand\zref@extract{\thezref@unique}{page}}%
+ \expandafter\xdef\csname ZREF@abspage@#1\endcsname{%
+ \zref@extractdefault\thezref@unique
+ {abspage}{\number\c@abspage}%
+ }%
+ }%
+% \end{macrocode}
+% Page changes are detected by a changed absolute page number.
+% \begin{macrocode}
+ \expandafter\ifx\csname ZREF@abspage@#1\expandafter\endcsname
+ \csname ZREF@currentabspage@#1\endcsname
+ \else
+ \global\csname c@#1\endcsname=#2\relax
+ \global\expandafter\let
+ \csname ZREF@currentabspage@#1\expandafter\endcsname
+ \csname ZREF@abspage@#1\endcsname
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zunmakeperpage}
+% Macro \cs{zunmakeperpage} cancels the effect of \cs{zmakeperpage}.
+% \begin{macrocode}
+\ZREF@IfDefinable\zunmakeperpage\def{%
+ #1{%
+ \global\expandafter
+ \let\csname ZREF@perpage@#1\endcsname\@undefined
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</perpage>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{titleref}}
+%
+% \begin{macrocode}
+%<*titleref>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-titleref}%
+ [2018/11/21 v2.27 Module titleref for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+\RequirePackage{gettitlestring}[2009/12/08]
+% \end{macrocode}
+%
+% \subsubsection{Implementation}
+% \begin{macrocode}
+\RequirePackage{keyval}
+% \end{macrocode}
+%
+% This module makes section and caption titles available
+% for the reference system. It uses some of the ideas
+% of package \xpackage{nameref} and \xpackage{titleref}.
+%
+% Now we can add the property \verb|title| is added to
+% the main property list.
+% \begin{macrocode}
+\ZREF@NewPropTitle
+\zref@addprop\ZREF@mainlist{title}%
+% \end{macrocode}
+%
+% The title strings go into the \xfile{.aux} file, thus
+% they need some kind of protection.
+% Package \xpackage{titleref} uses a protected expansion
+% method. The advantage is that this can be used to
+% cleanup the string and to remove \cs{label}, \cs{index}
+% and other macros unwanted for referencing.
+% But there is the risk that fragile stuff can break.
+%
+% Therefore package \xpackage{nameref} does not expand
+% the string. Thus the entries can safely be written to
+% the \xfile{.aux} file. But potentially dangerous
+% macros such as \cs{label} remain in the string and
+% can cause problems when using the string in references.
+%
+% \begin{macro}{\ifzref@titleref@expand}
+% The switch \cs{ifzref@titleref@expand} distinguishes
+% between the both methods. Package \xpackage{nameref}'s
+% behaviour is achieved by setting the switch to false,
+% otherwise \xpackage{titleref}'s expansion is used.
+% Default is false.
+% \begin{macrocode}
+\newif\ifzref@titleref@expand
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@titleref@hook}
+% The hook \cs{ZREF@titleref@hook} allows to extend
+% the cleanup for the expansion method. Thus
+% unnecessary macros can be removed or dangerous commands
+% removed. The hook is executed before the expansion of
+% \cs{zref@titleref@current}.
+% \begin{macrocode}
+\let\ZREF@titleref@hook\ltx@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zref@titleref@cleanup}
+% The hook should not be used directly, instead we provide the
+% macro \cs{zref@titleref@cleanup} to add stuff to the hook
+% and prevents that a previous non-empty content is not discarded
+% accidently.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@titleref@cleanup#1{%
+ \begingroup
+ \toks@\expandafter{%
+ \ZREF@titleref@hook
+ #1%
+ }%
+ \expandafter\endgroup
+ \expandafter\def\expandafter\ZREF@titleref@hook\expandafter{%
+ \the\toks@
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifzref@titleref@stripperiod}
+% Sometimes a title contains a period at the end.
+% Package \xpackage{nameref} removes this. This behaviour
+% is controlled by the switch \cs{ifzref@titleref@stripperiod}
+% and works regardless of the setting of option \xoption{expand}.
+% Period stripping is the default.
+% \begin{macrocode}
+\newif\ifzref@titleref@stripperiod
+\zref@titleref@stripperiodtrue
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@titleref@setcurrent}
+% Macro \cs{zref@titleref@setcurrent} sets a new current title
+% stored in \cs{zref@titleref@current}. Some cleanup and
+% expansion is performed that can be controlled by the
+% previous switches.
+% \begin{macrocode}
+\ZREF@Robust\def\zref@titleref@setcurrent#1{%
+ \ifzref@titleref@expand
+ \GetTitleStringExpand{#1}%
+ \else
+ \GetTitleStringNonExpand{#1}%
+ \fi
+ \edef\zref@titleref@current{%
+ \detokenize\expandafter{\GetTitleStringResult}%
+ }%
+ \ifzref@titleref@stripperiod
+ \edef\zref@titleref@current{%
+ \expandafter\ZREF@stripperiod\zref@titleref@current
+ \ltx@empty.\ltx@empty\@nil
+ }%
+ \fi
+}%
+\GetTitleStringDisableCommands{%
+ \ZREF@titleref@hook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@stripperiod}
+% If \cs{ZREF@stripperiod} is called, the argument consists of
+% space tokens and tokens with catcode 12 (other), because
+% of \hologo{eTeX}'s \cs{detokenize}.
+% \begin{macrocode}
+\def\ZREF@stripperiod#1.\ltx@empty#2\@nil{#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{User interface}
+%
+% \begin{macro}{\ztitlerefsetup}
+% The behaviour of module \xmodule{titleref} is controlled
+% by switches and a hook. They can be set by \cs{ztitlerefsetup}
+% with a key value interface, provided by package \xpackage{keyval}.
+% Also the current title can be given explicitly by the key
+% \verb|title|.
+% \begin{macrocode}
+\define@key{ZREF@TR}{expand}[true]{%
+ \csname zref@titleref@expand#1\endcsname
+}%
+\define@key{ZREF@TR}{stripperiod}[true]{%
+ \csname zref@titleref@stripperiod#1\endcsname
+}%
+\define@key{ZREF@TR}{cleanup}{%
+ \zref@titleref@cleanup{#1}%
+}%
+\define@key{ZREF@TR}{title}{%
+ \def\zref@titleref@current{#1}%
+}%
+\ZREF@IfDefinable\ztitlerefsetup\def{%
+ {\kvsetkeys{ZREF@TR}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ztitleref}
+% The user command \cs{ztitleref} references the title.
+% For safety \cs{label} is disabled to prevent multiply
+% defined references.
+% \begin{macrocode}
+\ZREF@IfDefinable\ztitleref\def{%
+ {\zref@wrapper@babel\ZREF@titleref}%
+}%
+\def\ZREF@titleref#1{%
+ \begingroup
+ \zref@refused{#1}%
+ \let\label\ltx@gobble
+ \zref@extract{#1}{title}%
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Patches for section and caption commands}
+%
+% The section and caption macros are patched to extract the
+% title data.
+%
+% Captions of figures and tables.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ZREF@patch{@caption}{%
+ \long\def\@caption#1[#2]{%
+ \zref@titleref@setcurrent{#2}%
+ \ZREF@org@@caption{#1}[{#2}]%
+ }%
+ }%
+% \end{macrocode}
+%
+% Section commands without star. The title version for the
+% table of contents is used because it is usually shorter and
+% more robust.
+% \begin{macrocode}
+ \ZREF@patch{@part}{%
+ \def\@part[#1]{%
+ \zref@titleref@setcurrent{#1}%
+ \ZREF@org@@part[{#1}]%
+ }%
+ }%
+ \ZREF@patch{@chapter}{%
+ \def\@chapter[#1]{%
+ \zref@titleref@setcurrent{#1}%
+ \ZREF@org@@chapter[{#1}]%
+ }%
+ }%
+ \ZREF@patch{@sect}{%
+ \def\@sect#1#2#3#4#5#6[#7]{%
+ \zref@titleref@setcurrent{#7}%
+ \ZREF@org@@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]%
+ }%
+ }%
+% \end{macrocode}
+% The star versions of the section commands.
+% \begin{macrocode}
+ \ZREF@patch{@spart}{%
+ \def\@spart#1{%
+ \zref@titleref@setcurrent{#1}%
+ \ZREF@org@@spart{#1}%
+ }%
+ }%
+ \ZREF@patch{@schapter}{%
+ \def\@schapter#1{%
+ \zref@titleref@setcurrent{#1}%
+ \ZREF@org@@schapter{#1}%
+ }%
+ }%
+ \ZREF@patch{@ssect}{%
+ \def\@ssect#1#2#3#4#5{%
+ \zref@titleref@setcurrent{#5}%
+ \ZREF@org@@ssect{#1}{#2}{#3}{#4}{#5}%
+ }%
+ }%
+% \end{macrocode}
+%
+% \subsubsection{Environment \textsf{description}}
+%
+% \begin{macrocode}
+ \ZREF@patch{descriptionlabel}{%
+ \def\descriptionlabel#1{%
+ \zref@titleref@setcurrent{#1}%
+ \ZREF@org@descriptionlabel{#1}%
+ }%
+ }%
+% \end{macrocode}
+%
+% \subsubsection{Class \xclass{memoir}}
+%
+% \begin{macrocode}
+ \@ifclassloaded{memoir}{%
+ \ltx@IfUndefined{ifheadnameref}{}{%
+ \def\@chapter[#1]#2{%
+ \ltx@IfUndefined{ch@pt@c}{%
+ \zref@titleref@setcurrent{#1}%
+ }{%
+ \ifx\ch@pt@c\ltx@empty
+ \zref@titleref@setcurrent{#2}%
+ \else
+ \def\NR@temp{#1}%
+ \ifx\NR@temp\ltx@empty
+ \expandafter\zref@titleref@setcurrent
+ \expandafter{\ch@pt@c}%
+ \else
+ \ifheadnameref
+ \zref@titleref@setcurrent{#1}%
+ \else
+ \expandafter\zref@titleref@setcurrent
+ \expandafter{\ch@pt@c}%
+ \fi
+ \fi
+ \fi
+ }%
+ \ZREF@org@@chapter[{#1}]{#2}%
+ }%
+ \ZREF@patch{M@sect}{%
+ \def\M@sect#1#2#3#4#5#6[#7][#8]{%
+ \ifheadnameref
+ \zref@titleref@setcurrent{#8}%
+ \else
+ \zref@titleref@setcurrent{#7}%
+ \fi
+ \ZREF@org@M@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}][{#8}]%
+ }%
+ }%
+ }%
+ }{}%
+% \end{macrocode}
+%
+% \subsubsection{Class \xclass{beamer}}
+%
+% \begin{macrocode}
+ \@ifclassloaded{beamer}{%
+ \ZREF@patch{beamer@section}{%
+ \long\def\beamer@section[#1]{%
+ \zref@titleref@setcurrent{#1}%
+ \ZREF@org@beamer@section[{#1}]%
+ }%
+ }%
+ \ZREF@patch{beamer@subsection}{%
+ \long\def\beamer@subsection[#1]{%
+ \zref@titleref@setcurrent{#1}%
+ \ZREF@org@beamer@subsection[{#1}]%
+ }%
+ }%
+ \ZREF@patch{beamer@subsubsection}{%
+ \long\def\beamer@subsubsection[#1]{%
+ \zref@titleref@setcurrent{#1}%
+ \ZREF@org@beamer@subsubsection[{#1}]%
+ }%
+ }%
+ }{}%
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{titlesec}}
+%
+% \begin{macrocode}
+ \@ifpackageloaded{titlesec}{%
+ \ZREF@patch{ttl@sect@i}{%
+ \def\ttl@sect@i#1#2[#3]#4{%
+ \zref@titleref@setcurrent{#4}%
+ \ZREF@org@ttl@sect@i{#1}{#2}[{#3}]{#4}%
+ }%
+ }%
+ \ZREF@patch{ttl@straight@i}{%
+ \def\ttl@straight@i#1[#2]#3{%
+ \def\ZREF@temp{#2}%
+ \ifx\ZREF@temp\ltx@empty
+ \zref@titleref@setcurrent{#3}%
+ \else
+ \zref@titleref@setcurrent{#2}%
+ \fi
+ \ZREF@org@ttl@straight@i{#1}[{#2}]{#3}%
+ }%
+ }%
+ }{}%
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{longtable}}
+%
+% Package \xpackage{longtable}: some support for its \cs{caption}.
+% However \cs{label} inside the caption is not supported.
+% \begin{macrocode}
+ \@ifpackageloaded{longtable}{%
+ \ZREF@patch{LT@c@ption}{%
+ \def\LT@c@ption#1[#2]#3{%
+ \ZREF@org@LT@c@ption{#1}[{#2}]{#3}%
+ \zref@titleref@setcurrent{#2}%
+ }%
+ }%
+ }{}%
+% \end{macrocode}
+%
+% \subsubsection{Package \xpackage{listings}}
+%
+% Package \xpackage{listings}: support for its caption.
+% \begin{macrocode}
+ \@ifpackageloaded{listings}{%
+ \ZREF@patch{lst@MakeCaption}{%
+ \def\lst@MakeCaption{%
+ \ifx\lst@label\ltx@empty
+ \else
+ \expandafter\zref@titleref@setcurrent\expandafter{%
+ \lst@@caption
+ }%
+ \fi
+ \ZREF@org@lst@MakeCaption
+ }%
+ }%
+ }{}%
+% \end{macrocode}
+%
+% \subsubsection{Theorems}
+%
+% \begin{macrocode}
+ \ZREF@patch{@opargbegintheorem}{%
+ \def\@opargbegintheorem#1#2#3{%
+ \zref@titleref@setcurrent{#3}%
+ \ZREF@org@@opargbegintheorem{#1}{#2}{#3}%
+ }%
+ }%
+ \@ifpackageloaded{amsthm}{%
+ \begingroup
+ \edef\x{macro:\string#1\string#2[\string#3]}%
+ \@onelevel@sanitize\x
+ \def\y#1->#2\@nil{#1}%
+ \edef\z{\expandafter\y\meaning\@begintheorem->\@nil}%
+ \@onelevel@sanitize\z
+ \expandafter\endgroup
+ \ifx\x\z
+ \ZREF@patch{@begintheorem}{%
+ \def\@begintheorem#1#2[#3]{%
+ \zref@titleref@setcurrent{#3}%
+ \ZREF@org@@begintheorem{#1}{#2}[{#3}]%
+ }%
+ }%
+ \fi
+ }{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</titleref>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{xr}}
+%
+% \begin{macrocode}
+%<*xr>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-xr}%
+ [2018/11/21 v2.27 Module xr for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{keyval}
+\RequirePackage{kvoptions}[2010/02/22]
+% \end{macrocode}
+%
+% We declare property |url|, because this is added,
+% if a reference is imported and has not already set this field.
+% Or if |hyperref| is used, then this property can be asked.
+% \begin{macrocode}
+\zref@newprop{url}{}%
+\zref@newprop{urluse}{}%
+% \end{macrocode}
+% \begin{macrocode}
+\zref@newprop{externaldocument}{}%
+% \end{macrocode}
+%
+% Most code, especially the handling of the \xfile{.aux}
+% files are taken from David Carlisle's \xpackage{xr} package.
+% Therefore I drop the documentation for these macros here.
+%
+% \begin{macro}{\zref@xr@ext}
+% If the URL is not specied, then assume
+% processed file with a guessed extension.
+% Use the setting of \xpackage{hyperref} if available.
+% \begin{macrocode}
+\providecommand*{\zref@xr@ext}{%
+ \ltx@ifundefined{XR@ext}{pdf}{\XR@ext}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifZREF@xr@zreflabel}
+% The use of the star form of \cs{zexternaldocument}
+% is remembered in the switch \cs{ifZREF@xr@zreflabel}.
+% \begin{macrocode}
+\newif\ifZREF@xr@zreflabel
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\SetupKeyvalOptions{%
+ family=ZREF@XR,%
+ prefix=ZREF@xr@%
+}
+\DeclareBoolOption[true]{tozreflabel}
+\DeclareBoolOption[false]{toltxlabel}
+\DeclareBoolOption{verbose}
+\define@key{ZREF@XR}{ext}{%
+ \def\zref@xr@{#1}%
+}
+\DeclareBoolOption[false]{urluse}
+% \end{macrocode}
+% \begin{macro}{\zxrsetup}
+% \begin{macrocode}
+\newcommand*{\zxrsetup}{%
+ \kvsetkeys{ZREF@XR}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@xr@URL}
+% \begin{macrocode}
+\newcount\ZREF@xr@URL
+\ZREF@xr@URL=\ltx@zero
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@xr@AddURL}
+% \begin{macrocode}
+\def\ZREF@xr@AddURL#1{%
+ \begingroup
+ \def\ZREF@temp{#1}%
+ \count@=\ltx@one
+ \ZREF@xr@@AddUrl
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@xr@@AddUrl}
+% \begin{macrocode}
+\def\ZREF@xr@@AddUrl{%
+ \ifnum\count@>\ZREF@xr@URL
+ \global\advance\ZREF@xr@URL by\ltx@one
+ \xdef\ZREF@xr@theURL{\romannumeral\ZREF@xr@URL}%
+ \global\expandafter\let
+ \csname Z@U@\ZREF@xr@theURL\endcsname\ZREF@temp
+ \@PackageInfo{zref-xr}{%
+ \ltx@backslashchar Z@U@\ZREF@xr@theURL:\MessageBreak
+ \ZREF@temp\MessageBreak
+ }%
+ \else
+ \expandafter
+ \ifx\csname Z@U@\romannumeral\count@\endcsname\ZREF@temp
+ \xdef\ZREF@xr@theURL{\romannumeral\count@}%
+ \else
+ \expandafter\expandafter\expandafter\ZREF@xr@@AddUrl
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zexternaldocument}
+% In its star form it looks for \cs{newlabel},
+% otherwise for \cs{zref@newlabel}.
+% Later we
+% will read \xfile{.aux} files that expects
+% |@| to have catcode 11 (letter).
+% \begin{macrocode}
+\ZREF@IfDefinable\zexternaldocument\def{%
+ {%
+ \ZREF@NewPropAnchor
+ \ZREF@NewPropTitle
+ \begingroup
+ \csname @safe@actives@true\endcsname
+ \makeatletter
+ \@ifstar{%
+ \ZREF@xr@zreflabelfalse
+ \@testopt\ZREF@xr@externaldocument{}%
+ }{%
+ \ZREF@xr@zreflabeltrue
+ \@testopt\ZREF@xr@externaldocument{}%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% If the \cs{include} featuer was used, there can be
+% several \xfile{.aux} files. These files are read
+% one after another, especially they are not recursively
+% read in order to save read registers. Thus it can
+% happen that the read order of the newlabel commands
+% differs from \hologo{LaTeX}'s order using \cs{input}.
+%
+% \begin{macro}{\ZREF@xr@externaldocument}
+% It reads the remaining arguments. \cs{newcommand}
+% comes in handy for the optional argument.
+% \begin{macrocode}
+\def\ZREF@xr@externaldocument[#1]#2{%
+ \def\ZREF@xr@prefix{#1}%
+ \let\ZREF@xr@filelist\ltx@empty
+ \edef\ZREF@xr@externalfile{#2}%
+ \edef\ZREF@xr@file{\ZREF@xr@externalfile.aux}%
+ \filename@parse{#2}%
+ \@testopt\ZREF@xr@graburl{#2.\zref@xr@ext}%
+}%
+\def\ZREF@xr@graburl[#1]{%
+ \edef\ZREF@xr@url{#1}%
+ \ifZREF@xr@urluse
+ \expandafter\ZREF@xr@AddURL\expandafter{\ZREF@xr@url}%
+ \expandafter\def\expandafter\ZREF@xr@url
+ \expandafter{\csname Z@U@\ZREF@xr@theURL\endcsname}%
+ \fi
+ \ZREF@xr@checkfile
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@xr@processfile}
+% We follow \xpackage{xr} here, \cs{IfFileExists} offers
+% a nicer test, but we have to open the file anyway.
+% \begin{macrocode}
+\def\ZREF@xr@checkfile{%
+ \openin\@inputcheck\ZREF@xr@file\relax
+ \ifeof\@inputcheck
+ \PackageWarning{zref-xr}{%
+ File `\ZREF@xr@file' not found or empty,\MessageBreak
+ labels not imported%
+ }%
+ \else
+ \PackageInfo{zref-xr}{%
+ Label \ifZREF@xr@zreflabel (zref) \fi
+ import from `\ZREF@xr@file'%
+ }%
+ \def\ZREF@xr@found{0}%
+ \def\ZREF@xr@ignored@empty{0}%
+ \def\ZREF@xr@ignored@zref{0}%
+ \def\ZREF@xr@ignored@ltx{0}%
+ \ZREF@xr@processfile
+ \closein\@inputcheck
+ \begingroup
+ \let\on@line\ltx@empty
+ \PackageInfo{zref-xr}{%
+ Statistics for `\ZREF@xr@file':\MessageBreak
+ \ZREF@xr@found\space
+ \ifZREF@xr@zreflabel zref\else LaTeX\fi\space
+ label(s) found%
+ \ifnum\ZREF@xr@ignored@empty>0 %
+ ,\MessageBreak
+ \ZREF@xr@ignored@empty\space empty label(s) ignored%
+ \fi
+ \ifnum\ZREF@xr@ignored@zref>0 %
+ ,\MessageBreak
+ \ZREF@xr@ignored@zref\space
+ duplicated zref label(s) ignored%
+ \fi
+ \ifnum\ZREF@xr@ignored@ltx>0 %
+ ,\MessageBreak
+ \ZREF@xr@ignored@ltx\space
+ duplicated latex label(s) ignored%
+ \fi
+ }%
+ \endgroup
+ \fi
+ \ifx\ZREF@xr@filelist\ltx@empty
+ \else
+ \edef\ZREF@xr@file{%
+ \expandafter\ltx@car\ZREF@xr@filelist\@nil
+ }%
+ \edef\ZREF@xr@filelist{%
+ \expandafter\ltx@cdr\ZREF@xr@filelist\ltx@empty\@nil
+ }%
+ \expandafter\ZREF@xr@checkfile
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@xr@processfile}
+% \begin{macrocode}
+\def\ZREF@xr@processfile{%
+ \read\@inputcheck to\ZREF@xr@line
+ \expandafter\ZREF@xr@processline\ZREF@xr@line..\ZREF@nil
+ \ifeof\@inputcheck
+ \else
+ \expandafter\ZREF@xr@processfile
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@xr@processline}
+% The most work must be done for analyzing the
+% arguments of \cs{newlabel}.
+% \begin{macrocode}
+\long\def\ZREF@xr@processline#1#2#3\ZREF@nil{%
+ \def\x{#1}%
+ \toks@{#2}%
+ \ifZREF@xr@zreflabel
+ \ifx\x\ZREF@xr@zref@newlabel
+ \expandafter
+ \ZREF@xr@process@zreflabel\ZREF@xr@line...\ZREF@nil
+ \fi
+ \else
+ \ifx\x\ZREF@xr@newlabel
+ \expandafter
+ \ZREF@xr@process@label\ZREF@xr@line...[]\ZREF@nil
+ \fi
+ \fi
+ \ifx\x\ZREF@xr@@input
+ \edef\ZREF@xr@filelist{%
+ \etex@unexpanded\expandafter{\ZREF@xr@filelist}%
+ {\filename@area\the\toks@}%
+ }%
+ \fi
+}%
+\def\ZREF@xr@process@zreflabel\zref@newlabel#1#2#3\ZREF@nil{%
+ \edef\ZREF@xr@refname{Z@R@\ZREF@xr@prefix#1}%
+ \edef\ZREF@xr@found{\the\numexpr\ZREF@xr@found+1\relax}%
+ \def\x{#2}%
+ \edef\ZREF@xr@tempname{$temp$}%
+ \edef\ZREF@xr@temprefname{Z@R@\ZREF@xr@tempname}%
+ \let\ZREF@xr@list\x
+ \ifx\ZREF@xr@list\ltx@empty
+ \PackageWarningNoLine{zref-xr}{%
+ Label `#1' without properties ignored\MessageBreak
+ in file `\ZREF@xr@file'%
+ }%
+ \edef\ZREF@xr@ignored@empty{%
+ \the\numexpr\ZREF@xr@ignored@empty+1\relax
+ }%
+ \else
+ \expandafter\ZREF@xr@checklist\x\ZREF@nil
+ \expandafter\let\csname\ZREF@xr@temprefname\endcsname\x
+ \expandafter\ltx@LocalAppendToMacro
+ \csname\ZREF@xr@temprefname\expandafter\endcsname
+ \expandafter{%
+ \expandafter\externaldocument\expandafter{%
+ \ZREF@xr@externalfile
+ }%
+ }%
+ \ZREF@xr@urlcheck\ZREF@xr@tempname
+ \ifZREF@xr@tozreflabel
+ \@ifundefined{\ZREF@xr@refname}{%
+ \ifZREF@xr@verbose
+ \PackageInfo{zref-xr}{%
+ Import to zref label `\ZREF@xr@tempname#1'%
+ }%
+ \fi
+ \global\expandafter
+ \let\csname\ZREF@xr@refname\expandafter\endcsname
+ \csname\ZREF@xr@temprefname\endcsname
+ }{%
+ \ZREF@xr@zref@ignorewarning{\ZREF@xr@prefix#1}%
+ }%
+ \fi
+ \ifZREF@xr@toltxlabel
+ \ZREF@xr@tolabel{\ZREF@xr@tempname}{\ZREF@xr@prefix#1}%
+ \fi
+ \fi
+}%
+\def\ZREF@xr@process@label\newlabel#1#2#3[#4]#5\ZREF@nil{%
+ \def\ZREF@xr@refname{Z@R@\ZREF@xr@prefix#1}%
+ \edef\ZREF@xr@found{\the\numexpr\ZREF@xr@found+1\relax}%
+ \def\x{#2}%
+ \edef\ZREF@xr@tempname{$temp$}%
+ \edef\ZREF@xr@temprefname{Z@R@\ZREF@xr@tempname}%
+ \expandafter\ZREF@xr@scanparams
+ \csname\ZREF@xr@temprefname\expandafter\endcsname
+ \x{}{}{}{}{}\ZREF@nil
+ \ifx\\#4\\%
+ \else
+ % ntheorem knows an optional argument at the end of \newlabel
+ \ZREF@NewPropTheotype
+ \expandafter\ltx@LocalAppendToMacro
+ \csname\ZREF@xr@temprefname\endcsname{\theotype{#4}}%
+ \fi
+ \expandafter\ltx@LocalAppendToMacro
+ \csname\ZREF@xr@temprefname\expandafter\endcsname\expandafter{%
+ \expandafter\externaldocument\expandafter{%
+ \ZREF@xr@externalfile
+ }%
+ }%
+ \ZREF@xr@urlcheck\ZREF@xr@tempname
+ \ifZREF@xr@tozreflabel
+ \@ifundefined{\ZREF@xr@refname}{%
+ \ifZREF@xr@verbose
+ \PackageInfo{zref-xr}{%
+ Import to zref label `\ZREF@xr@prefix#1'%
+ }%
+ \fi
+ \global\expandafter
+ \let\csname\ZREF@xr@refname\expandafter\endcsname
+ \csname\ZREF@xr@temprefname\endcsname
+ }{%
+ \ZREF@xr@zref@ignorewarning{\ZREF@xr@prefix#1}%
+ }%
+ \fi
+ \ifZREF@xr@toltxlabel
+ \ZREF@xr@tolabel{\ZREF@xr@tempname}{\ZREF@xr@prefix#1}%
+ \fi
+}
+\def\ZREF@xr@zref@newlabel{\zref@newlabel}%
+\def\ZREF@xr@newlabel{\newlabel}%
+\def\ZREF@xr@@input{\@input}%
+\def\ZREF@xr@relax{\relax}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@xr@tolabel}
+% \begin{macrocode}
+\def\ZREF@xr@tolabel#1#2{%
+ \ifZREF@xr@verbose
+ \PackageInfo{zref-xr}{%
+ Import to LaTeX label `#2'%
+ }%
+ \fi
+ \zref@wrapper@unexpanded{%
+ \expandafter\xdef\csname r@#2\endcsname{%
+ {%
+ \ltx@ifundefined{M@TitleReference}{%
+ \ltx@ifundefined{TR@TitleReference}{%
+ \zref@extractdefault{#1}{default}{}%
+ }{%
+ \noexpand\TR@TitleReference
+ {\zref@extractdefault{#1}{default}{}}%
+ {\zref@extractdefault{#1}{title}{}}%
+ }%
+ }{%
+ \noexpand\M@TitleReference
+ {\zref@extractdefault{#1}{default}{}}%
+ {\zref@extractdefault{#1}{title}{}}%
+ }%
+ }%
+ {\zref@extractdefault{#1}{page}{}}%
+ \ltx@ifpackageloaded{nameref}{%
+ {\zref@extractdefault{#1}{title}{}}%
+ {\zref@extractdefault{#1}{anchor}{}}%
+ \zref@ifrefcontainsprop{#1}{urluse}{%
+ {\zref@extractdefault{#1}{urluse}{}}%
+ }{%
+ {\zref@extractdefault{#1}{url}{}}%
+ }%
+ }{}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@xr@zref@ignorewarning}
+% \begin{macrocode}
+\def\ZREF@xr@zref@ignorewarning#1{%
+ \PackageWarningNoLine{zref-xr}{%
+ Zref label `#1' is already in use\MessageBreak
+ in file `\ZREF@xr@file'%
+ }%
+ \edef\ZREF@xr@ignored@zref{%
+ \the\numexpr\ZREF@xr@ignored@zref+1%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@xr@ltx@ignorewarning}
+% \begin{macrocode}
+\def\ZREF@xr@ltx@ignorewarning#1{%
+ \PackageWarningNoLine{zref-xr}{%
+ LaTeX label `#1' is already in use\MessageBreak
+ in file `\ZREF@xr@file'%
+ }%
+ \edef\ZREF@xr@ignored@ltx{%
+ \the\numexpr\ZREF@xr@ignored@ltx+1%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@xr@checklist}
+% \begin{macrocode}
+\def\ZREF@xr@checklist#1#2#3\ZREF@nil{%
+ \ifx\@undefined#1\relax
+ \expandafter\ZREF@xr@checkkey\string#1\@nil
+ \fi
+ \ifx\\#3\\%
+ \else
+ \ltx@ReturnAfterFi{%
+ \ZREF@xr@checklist#3\ZREF@nil
+ }%
+ \fi
+}%
+\def\ZREF@xr@checkkey#1#2\@nil{%
+ \zref@ifpropundefined{#2}{%
+ \zref@newprop{#2}{}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@xr@scanparams}
+% \begin{macrocode}
+\def\ZREF@xr@scanparams#1#2#3#4#5#6#7\ZREF@nil{%
+ \let#1\ltx@empty
+ \ZREF@foundfalse
+ \ZREF@xr@scantitleref#1#2\TR@TitleReference{}{}\ZREF@nil
+ \ifZREF@found
+ \else
+ \ltx@LocalAppendToMacro#1{\default{#2}}%
+ \fi
+ % page
+ \ltx@LocalAppendToMacro#1{\page{#3}}%
+ % nameref title
+ \ifZREF@found
+ \else
+ \ifx\\#4\\%
+ \else
+ \def\ZREF@xr@temp{#4}%
+ \ifx\ZREF@xr@temp\ZREF@xr@relax
+ \else
+ \ltx@LocalAppendToMacro#1{\title{#4}}%
+ \fi
+ \fi
+ \fi
+ % anchor
+ \ifx\\#5\\%
+ \else
+ \ltx@LocalAppendToMacro#1{\anchor{#5}}%
+ \fi
+ \ifx\\#6\\%
+ \else
+ \ifZREF@xr@urluse
+ \ZREF@xr@AddURL{#6}%
+ \expandafter\ltx@LocalAppendToMacro\expandafter#1%
+ \expandafter{%
+ \expandafter\urluse\expandafter{%
+ \csname Z@U@\ZREF@xr@theURL\endcsname
+ }%
+ }%
+ \else
+ \ltx@LocalAppendToMacro#1{\url{#6}}%
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@xr@scantitleref}
+% \begin{macrocode}
+\def\ZREF@xr@scantitleref#1#2\TR@TitleReference#3#4#5\ZREF@nil{%
+ \ifx\\#5\\%
+ \else
+ \ltx@LocalAppendToMacro#1{%
+ \default{#3}%
+ \title{#4}%
+ }%
+ \ZREF@foundtrue
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@xr@urlcheck}%
+% \begin{macrocode}
+\def\ZREF@xr@urlcheck#1{%
+ \zref@ifrefcontainsprop{#1}{anchor}{%
+ \zref@ifrefcontainsprop{#1}{url}{%
+ }{%
+ \expandafter
+ \ltx@LocalAppendToMacro\csname Z@R@#1\expandafter\endcsname
+ \expandafter{%
+ \csname url\ifZREF@xr@urluse use\fi
+ \expandafter\endcsname\expandafter{\ZREF@xr@url}%
+ }%
+ }%
+ }{%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</xr>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{hyperref}}
+%
+% UNFINISHED :-(
+%
+% \begin{macrocode}
+%<*hyperref>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-hyperref}%
+ [2018/11/21 v2.27 Module hyperref for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ZREF@NewPropAnchor
+\zref@addprop\ZREF@mainlist{anchor}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</hyperref>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{savepos}}
+%
+% Module \xmodule{savepos} provides an interface for
+% \pdfTeX's \cmd{\pdfsavepos}, see the manual for
+% \pdfTeX.
+%
+% \subsubsection{Identification}
+%
+% \begin{macrocode}
+%<*savepos>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-savepos}%
+ [2018/11/21 v2.27 Module savepos for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% LuaTeX compatibility
+% \begin{macrocode}
+\ifx\pdfsavepos\@undefined
+ \let\pdfsavepos \savepos
+ \let\pdflastxpos \lastxpos
+ \let\pdflastypos \lastypos
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Availability}
+%
+% First we check, whether the feature is available.
+% \begin{macrocode}
+\ltx@IfUndefined{pdfsavepos}{%
+ \PackageError\ZREF@name{%
+ \string\pdfsavepos\space is not supported.\MessageBreak
+ It is provided by pdfTeX (1.40) or XeTeX%
+ }\ZREF@UpdatePdfTeX
+ \endinput
+}{}%
+% \end{macrocode}
+% In PDF mode we are done. However support for DVI mode
+% was added later in version 1.40.0. In earlier versions
+% \cs{pdfsavepos} is defined, but its execution raises
+% an error. Note that \hologo{XeTeX} also provides \cs{pdfsavepos}.
+% \begin{macrocode}
+\RequirePackage{ifpdf}
+\ifpdf
+\else
+ \ltx@IfUndefined{pdftexversion}{%
+ }{%
+ \ifnum\pdftexversion<140 %
+ \PackageError\ZREF@name{%
+ \string\pdfsavepos\space is not supported in DVI mode%
+ \MessageBreak
+ of this pdfTeX version%
+ }\ZREF@UpdatePdfTeX
+ \expandafter\expandafter\expandafter\endinput
+ \fi
+ }%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Setup}
+%
+% \begin{macrocode}
+\zref@newlist{savepos}
+\zref@newprop*{posx}[0]{\the\pdflastxpos}
+\zref@newprop*{posy}[0]{\the\pdflastypos}
+\zref@addprops{savepos}{posx,posy}
+% \end{macrocode}
+%
+% \subsubsection{User macros}
+%
+% \begin{macro}{\zref@savepos}
+% \begin{macrocode}
+\def\zref@savepos{%
+ \if@filesw
+ \pdfsavepos
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@zsavepos}
+% \begin{macrocode}
+\def\ZREF@zsavepos#1#2#3{%
+ \@bsphack
+ \if@filesw
+ \zref@savepos
+ #1{#3}{#2}%
+ \ltx@IfUndefined{TeXXeTstate}{%
+ }{%
+ \ifnum\TeXXeTstate=\ltx@zero
+ \else
+ \zref@savepos
+ \fi
+ }%
+ \fi
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zsavepos}
+% The current location is stored in a reference with the
+% given name.
+% \begin{macrocode}
+\ZREF@IfDefinable\zsavepos\def{%
+ {%
+ \ZREF@zsavepos\zref@labelbylist{savepos}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zsaveposx}
+% \begin{macrocode}
+\ZREF@IfDefinable\zsaveposx\def{%
+ {%
+ \ZREF@zsavepos\zref@labelbyprops{posx}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\zsaveposy}
+% \begin{macrocode}
+\ZREF@IfDefinable\zsaveposy\def{%
+ {%
+ \ZREF@zsavepos\zref@labelbyprops{posy}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zposx}
+% \begin{macro}{\zposy}
+% The horizontal and vertical position are available by
+% \cs{zposx} and \cs{zposy}. Do not rely on absolute
+% positions. They differ in DVI and PDF mode of \pdfTeX.
+% Use differences instead. The unit of the position numbers
+% is sp.
+% \begin{macrocode}
+\newcommand*{\zposx}[1]{%
+ \zref@extract{#1}{posx}%
+}%
+\newcommand*{\zposy}[1]{%
+ \zref@extract{#1}{posy}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Typically horizontal and vertical positions are used
+% inside calculations. Therefore the extracting macros
+% should be expandable and babel's patch is not applyable.
+%
+% Also it is in the responsibility of the user to marked
+% used positions by \cs{zrefused}
+% in order to notify \hologo{LaTeX} about undefined references.
+%
+% \begin{macro}{\ZREF@savepos@ok}
+% \begin{macrocode}
+\let\ZREF@savepos@ok=Y
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</savepos>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{abspos}}
+%
+% \subsubsection{Identification}
+%
+% \begin{macrocode}
+%<*abspos>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-abspos}%
+ [2018/11/21 v2.27 Module abspos for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{zref-savepos}[2018/11/21]
+\ifx\ZREF@savepos@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{zref-pagelayout}[2018/11/21]
+\zref@addprop{savepos}{abspage}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{ifpdf}[2010/09/13]
+% \end{macrocode}
+%
+% \begin{macro}{\zref@absposx}
+% \begin{macrocode}
+\newcommand*{\zref@absposx}[3]{%
+ \number
+ \expandafter\zref@absposnumx\expandafter{%
+ \number\zref@extractdefault{#1}{abspage}{0}%
+ }{#2}{#3}%
+ \ltx@space
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@absposy}
+% \begin{macrocode}
+\newcommand*{\zref@absposy}[3]{%
+ \number
+ \expandafter\zref@absposnumy\expandafter{%
+ \number\zref@extractdefault{#1}{abspage}{0}%
+ }{#2}{#3}%
+ \ltx@space
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@absposnumx}
+% \begin{macrocode}
+\newcommand*{\zref@absposnumx}[3]{%
+ \number
+% \ifnum#1>\ltx@zero
+% \zref@ifrefundefined{thepage#1}{%
+% 0%
+% }{%
+ \numexpr\ZREF@absposnum{thepage#1}{#2}{x}{#3}\relax
+% }%
+% \else
+% 0%
+% \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@absposnumy}
+% \begin{macrocode}
+\newcommand*{\zref@absposnumy}[3]{%
+ \number
+% \ifnum#1>\ltx@zero
+% \zref@ifrefundefined{thepage#1}{%
+% 0%
+% }{%
+ \numexpr\ZREF@absposnum{thepage#1}{#2}{y}{#3}\relax
+% }%
+% \else
+% 0%
+% \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@absposnum}
+% \begin{macrocode}
+\def\ZREF@absposnum#1#2#3#4{%
+ \ltx@ifundefined{ZREF@abspos@#2@#3@#4}{%
+ 0%
+ }{%
+ \csname ZREF@abspos@#2@#3@#4\endcsname{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@def@absposx}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@def@absposx#1{%
+ \zref@wrapper@babel{\ZREF@def@abspos{#1}\zref@absposx}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@def@absposy}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@def@absposy#1{%
+ \zref@wrapper@babel{\ZREF@def@abspos{#1}\zref@absposy}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@def@absposnumx}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@def@absposnumx#1{%
+ \zref@wrapper@babel{\ZREF@def@abspos{#1}\zref@absposnumx}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@def@absposnumy}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@def@absposnumy#1{%
+ \zref@wrapper@babel{\ZREF@def@abspos{#1}\zref@absposnumy}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@def@abspos}
+% \begin{macrocode}
+\def\ZREF@def@absposnumy#1#2#3#4#5{%
+ \edef#1{#2{#3}{#4}{#5}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@absposused}
+% \begin{macrocode}
+\ZREF@Robust\def\zref@absposused{%
+ \zref@wrapper@babel\ZREF@abspos@used
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@used}
+% \begin{macrocode}
+\def\ZREF@abspos@used#1{%
+ \zref@refused{#1}%
+ \zref@ifrefundefined{#1}{%
+ }{%
+ \begingroup
+ \edef\ZREF@temp{%
+ \zref@extractdefault{#1}{abspage}{0}%
+ }%
+ \ifnum\ZREF@temp>\ltx@zero
+ \zref@refused{thepage\ZREF@temp}%
+ \else
+ \@PackageError{zref-abspos}{%
+ \string\zref@pos@label@used\ltx@space
+ needs property `abspage'\MessageBreak
+ in label `#1'%
+ }\@ehc
+ \fi
+ \endgroup
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@absposnumused}
+% \begin{macrocode}
+\newcommand*{\zref@absposnumused}[1]{%
+ \ifnum#1>\ltx@zero
+ \zref@refused{thepage\number#1}%
+ \else
+ \@PackageError{zref-abspos}{%
+ Invalid absolute page number (#1)\MessageBreak
+ for \string\zref@pos@num@used.\MessageBreak
+ A positive integer is expected%
+ }\@ehc
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@ifabsposundefined}
+% \begin{macrocode}
+\def\zref@ifabsposundefined#1{%
+ \zref@ifrefundefined{#1}\ltx@firsttwo{%
+ \expandafter\zref@ifabsposnumundefined\expandafter{%
+ \number\zref@extractdefault{#1}{abspage}{0}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zref@ifabsposnumundefined}
+% \begin{macrocode}
+\def\zref@ifabsposnumundefined#1{%
+ \ifnum\ZREF@number{#1}>\ltx@zero
+ \zref@ifrefundefined{thepage#1}%
+ \ltx@firstoftwo\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Media}
+%
+% \begin{macro}{\ZREF@abspos@media@width}
+% \begin{macrocode}
+\edef\ZREF@abspos@media@width{%
+ \ltx@ifundefined{pdfpagewidth}{%
+ \ltx@ifundefined{mediawidth}{%
+ \ltx@ifundefined{stockwidth}{%
+ paperwidth%
+ }{%
+ stockwidth%
+ }%
+ }{%
+ mediawidth%
+ }%
+ }{%
+ pdfpagewidth%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@media@height}
+% \begin{macrocode}
+\edef\ZREF@abspos@media@height{%
+ \ltx@ifundefined{pdfpageheight}{%
+ \ltx@ifundefined{mediaheight}{%
+ \ltx@ifundefined{stockheight}{%
+ paperheight%
+ }{%
+ stockheight%
+ }%
+ }{%
+ mediaheight%
+ }%
+ }{%
+ \noexpand\ifcase\pdfpageheight
+ \ltx@ifundefined{stockheight}{%
+ paperheight%
+ }{%
+ stockheight%
+ }%
+ \noexpand\else
+ pdfpageheight%
+ \noexpand\fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@abspos@media@x@left}
+% \begin{macrocode}
+\def\ZREF@abspos@media@x@left#1{%
+ 0%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@media@x@right}
+% \begin{macrocode}
+\def\ZREF@abspos@media@x@right#1{%
+ \zref@extract{#1}\ZREF@abspos@media@width
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@media@x@center}
+% \begin{macrocode}
+\def\ZREF@abspos@media@x@center#1{%
+ \ZREF@abspos@media@x@left{#1}%
+ +\zref@extract{#1}\ZREF@abspos@media@width/2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@abspos@media@y@top}
+% \begin{macrocode}
+\def\ZREF@abspos@media@y@top#1{%
+ \zref@extract{#1}\ZREF@abspos@media@height
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@media@y@bottom}
+% \begin{macrocode}
+\def\ZREF@abspos@media@y@bottom#1{%
+ 0%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@media@y@center}
+% \begin{macrocode}
+\def\ZREF@abspos@media@y@center#1{%
+ \zref@extract{#1}\ZREF@abspos@media@height/2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Paper}
+%
+% \begin{macro}{\ZREF@abspos@paper@x@left}
+% \begin{macrocode}
+\def\ZREF@abspos@paper@x@left#1{%
+ 0%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@paper@x@right}
+% \begin{macrocode}
+\def\ZREF@abspos@paper@x@right#1{%
+ \zref@extract{#1}{paperwidth}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@paper@x@center}
+% \begin{macrocode}
+\def\ZREF@abspos@paper@x@center#1{%
+ \zref@extract{#1}{paperwidth}/2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@abspos@paper@y@top}
+% \begin{macrocode}
+\let\ZREF@abspos@paper@y@top\ZREF@abspos@media@y@top
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@paper@y@bottom}
+% \begin{macrocode}
+\def\ZREF@abspos@paper@y@bottom#1{%
+ \ZREF@abspos@paper@y@top{#1}%
+ -\zref@extract{#1}{paperheight}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@paper@y@center}
+% \begin{macrocode}
+\def\ZREF@abspos@paper@y@center#1{%
+ \ZREF@abspos@paper@y@top{#1}%
+ -\zref@extract{#1}{paperheight}/2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Origin}
+%
+% \begin{macro}{\ZREF@abspos@origin@x}
+% \begin{macrocode}
+\let\ZREF@temp\ltx@two
+\ltx@IfUndefined{pdfhorigin}{}{%
+ \ifpdf
+ \let\ZREF@temp\ltx@zero
+ \fi
+}
+\ifx\ZREF@temp\ltx@two
+ \ifnum\mag=1000 %
+ \let\ZREF@temp\ltx@one
+ \fi
+\fi
+\ifcase\ZREF@temp
+ \def\ZREF@abspos@origin@x#1{%
+ \zref@extract{#1}{pdfhorigin}%
+ }%
+\or
+ \def\ZREF@abspos@origin@x#1{%
+ 4736286%
+ }%
+\or
+ \def\ZREF@abspos@origin@x#1{%
+ \numexpr\mag/1000*\dimexpr 1truein\relax\relax
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@origin@y}
+% \begin{macrocode}
+\let\ZREF@temp\ltx@two
+\ltx@IfUndefined{pdfvorigin}{}{%
+ \ifpdf
+ \let\ZREF@temp\ltx@zero
+ \fi
+}
+\ifx\ZREF@temp\ltx@two
+ \ifnum\mag=1000 %
+ \let\ZREF@temp\ltx@one
+ \fi
+\fi
+\ifcase\ZREF@temp
+ \def\ZREF@abspos@origin@y#1{%
+ \zref@extract{#1}{pdfvorigin}%
+ }%
+\or
+ \def\ZREF@abspos@origin@y#1{%
+ 4736286%
+ }%
+\or
+ \def\ZREF@abspos@origin@y#1{%
+ \numexpr\mag/1000*\dimexpr 1truein\relax\relax
+ }%
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Header}
+%
+% \begin{macro}{\ZREF@abspos@head@x@left}
+% \begin{macrocode}
+\def\ZREF@abspos@head@x@left#1{%
+ \ZREF@abspos@paper@x@left{#1}%
+ +\ZREF@abspos@origin@x{#1}%
+ +\zref@extract{#1}{hoffset}%
+ +\ifodd\zref@extractdefault{#1}{pagevalue}{\number\c@page} %
+ \zref@extract{#1}{oddsidemargin}%
+ \else
+ \zref@extract{#1}{evensidemargin}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@head@x@right}
+% \begin{macrocode}
+\def\ZREF@abspos@head@x@right#1{%
+ \ZREF@abspos@head@x@left{#1}%
+ +\zref@extract{#1}{textwidth}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@head@x@center}
+% \begin{macrocode}
+\def\ZREF@abspos@head@x@center#1{%
+ \ZREF@abspos@head@x@left{#1}%
+ +\zref@extract{#1}{textwidth}/2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@abspos@head@y@top}
+% \begin{macrocode}
+\def\ZREF@abspos@head@y@top#1{%
+ \ZREF@abspos@paper@y@top{#1}%
+ -\ZREF@abspos@origin@y{#1}%
+ -\zref@extract{#1}{voffset}%
+ -\zref@extract{#1}{topmargin}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@head@y@bottom}
+% \begin{macrocode}
+\def\ZREF@abspos@head@y@bottom#1{%
+ \ZREF@abspos@head@y@top{#1}%
+ -\zref@extract{#1}{headheight}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@head@y@center}
+% \begin{macrocode}
+\def\ZREF@abspos@head@y@center#1{%
+ \ZREF@abspos@head@y@top{#1}%
+ -\zref@extract{#1}{headheight}/2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Body}
+%
+% \begin{macro}{\ZREF@abspos@body@x@left}
+% \begin{macrocode}
+\let\ZREF@abspos@body@x@left\ZREF@abspos@head@x@left
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@body@x@right}
+% \begin{macrocode}
+\let\ZREF@abspos@body@x@right\ZREF@abspos@head@x@right
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@body@x@center}
+% \begin{macrocode}
+\let\ZREF@abspos@body@x@center\ZREF@abspos@head@x@center
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@abspos@body@y@top}
+% \begin{macrocode}
+\def\ZREF@abspos@body@y@top#1{%
+ \ZREF@abspos@head@y@bottom{#1}%
+ -\zref@extract{#1}{headsep}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@body@y@bottom}
+% \begin{macrocode}
+\def\ZREF@abspos@body@y@bottom#1{%
+ \ZREF@abspos@body@y@top{#1}%
+ -\zref@extract{#1}{textheight}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@body@y@center}
+% \begin{macrocode}
+\def\ZREF@abspos@body@y@center#1{%
+ \ZREF@abspos@body@y@top{#1}%
+ -\zref@extract{#1}{textheight}/2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Footer}
+%
+% \begin{macro}{\ZREF@abspos@foot@x@left}
+% \begin{macrocode}
+\let\ZREF@abspos@foot@x@left\ZREF@abspos@head@x@left
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@foot@x@right}
+% \begin{macrocode}
+\let\ZREF@abspos@foot@x@right\ZREF@abspos@head@x@right
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@foot@x@center}
+% \begin{macrocode}
+\let\ZREF@abspos@foot@x@center\ZREF@abspos@head@x@center
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@abspos@foot@y@bottom}
+% \begin{macrocode}
+\def\ZREF@abspos@foot@y@bottom#1{%
+ \ZREF@abspos@body@y@bottom{#1}%
+ -\zref@extract{#1}{footskip}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Marginal notes}
+%
+% \begin{macro}{\ZREF@abspos@marginpar@x@left}
+% \begin{macrocode}
+\def\ZREF@abspos@marginpar@x@left#1{%
+ \ifodd\zref@extractdefault{#1}{pagevalue}{\number\c@page} %
+ \ZREF@abspos@body@x@right{#1}%
+ +\zref@extract{#1}{marginparsep}%
+ \else
+ \ZREF@abspos@body@x@left{#1}%
+ -\zref@extract{#1}{marginparsep}%
+ -\zref@extract{#1}{marginparwidth}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@marginpar@x@right}
+% \begin{macrocode}
+\def\ZREF@abspos@marginpar@x@right#1{%
+ \ZREF@abspos@marginpar@x@left{#1}%
+ +\zref@extract{#1}{marginparwidth}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@marginpar@x@center}
+% \begin{macrocode}
+\def\ZREF@abspos@marginpar@x@center#1{%
+ \ZREF@abspos@marginpar@x@left{#1}%
+ +\zref@extract{#1}{marginparwidth}/2%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@abspos@marginpar@y@top}
+% \begin{macrocode}
+\let\ZREF@abspos@marginpar@y@top\ZREF@abspos@body@y@top
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@marginpar@y@bottom}
+% \begin{macrocode}
+\let\ZREF@abspos@marginpar@y@bottom\ZREF@abspos@body@y@bottom
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@marginpar@y@center}
+% \begin{macrocode}
+\let\ZREF@abspos@marginpar@y@center\ZREF@abspos@body@y@center
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Stock paper}
+%
+% \begin{macro}{\ZREF@abspos@stock@x@left}
+% \begin{macrocode}
+\let\ZREF@abspos@stock@x@left\ZREF@abspos@paper@x@left
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@stock@x@right}
+% \begin{macrocode}
+\let\ZREF@abspos@stock@x@right\ZREF@abspos@paper@x@right
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@stock@x@center}
+% \begin{macrocode}
+\let\ZREF@abspos@stock@x@center\ZREF@abspos@paper@x@center
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ZREF@abspos@stock@y@top}
+% \begin{macrocode}
+\let\ZREF@abspos@stock@y@top\ZREF@abspos@paper@y@top
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@stock@y@bottom}
+% \begin{macrocode}
+\let\ZREF@abspos@stock@y@bottom\ZREF@abspos@paper@y@bottom
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@abspos@stock@y@center}
+% \begin{macrocode}
+\let\ZREF@abspos@stock@y@center\ZREF@abspos@paper@y@center
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</abspos>
+% \end{macrocode}
+%
+%
+% \subsection{Module \xmodule{dotfill}}
+%
+% \begin{macrocode}
+%<*dotfill>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-dotfill}%
+ [2018/11/21 v2.27 Module dotfill for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% For measuring the width of \cs{zdotfill} we use the features
+% provided by module \xmodule{savepos}.
+% \begin{macrocode}
+\RequirePackage{zref-savepos}[2018/11/21]
+% \end{macrocode}
+% For automatically generated label names we use the unique
+% counter of module \xmodule{base}.
+% \begin{macrocode}
+\zref@require@unique
+% \end{macrocode}
+% Configuration is done by the key value interface of package
+% \xpackage{keyval}.
+% \begin{macrocode}
+\RequirePackage{keyval}
+% \end{macrocode}
+% The definitions of the keys follow.
+% \begin{macrocode}
+\define@key{ZREF@DF}{unit}{%
+ \def\ZREF@df@unit{#1}%
+}
+\define@key{ZREF@DF}{min}{%
+ \def\ZREF@df@min{#1}%
+}
+\define@key{ZREF@DF}{dot}{%
+ \def\ZREF@df@dot{#1}%
+}
+% \end{macrocode}
+% Defaults are set, see user interface.
+% \begin{macrocode}
+\providecommand\ZREF@df@min{2}
+\providecommand\ZREF@df@unit{.44em}
+\providecommand\ZREF@df@dot{.}
+% \end{macrocode}
+% \begin{macro}{\zdotfillsetup}
+% Configuration of \cs{zdotfill} is done by \cs{zdotfillsetup}.
+% \begin{macrocode}
+\newcommand*{\zdotfillsetup}{\kvsetkeys{ZREF@DF}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\zdotfill}
+% \cs{zdotfill} sets labels at the left and the right to get
+% the horizontal position. \cs{zsavepos} is not used, because
+% we do not need the vertical position.
+% \begin{macrocode}
+\ZREF@IfDefinable\zdotfill\def{%
+ {%
+ \leavevmode
+ \global\advance\c@zref@unique\ltx@one
+ \begingroup
+ \def\ZREF@temp{zref@\number\c@zref@unique}%
+ \pdfsavepos
+ \zref@labelbyprops{\thezref@unique L}{posx}%
+ \setlength{\dimen@}{\ZREF@df@unit}%
+ \zref@ifrefundefined{\thezref@unique R}{%
+ \ZREF@dotfill
+ }{%
+ \ifnum\numexpr\zposx{\thezref@unique R}%
+ -\zposx{\thezref@unique L}\relax
+ <\dimexpr\ZREF@df@min\dimen@\relax
+ \hfill
+ \else
+ \ZREF@dotfill
+ \fi
+ }%
+ \pdfsavepos
+ \zref@labelbyprops{\thezref@unique R}{posx}%
+ \endgroup
+ \kern\z@
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@dotfill}
+% Help macro that actually sets the dots.
+% \begin{macrocode}
+\def\ZREF@dotfill{%
+ \cleaders\hb@xt@\dimen@{\hss\ZREF@df@dot\hss}\hfill
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</dotfill>
+% \end{macrocode}
+%
+% \subsection{Module \xmodule{env}}
+%
+% \begin{macrocode}
+%<*env>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{zref-env}%
+ [2018/11/21 v2.27 Module env for zref (HO)]%
+\RequirePackage{zref-base}[2018/11/21]
+\ifx\ZREF@base@ok Y%
+\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\zref@newprop{envname}[]{\@currenvir}
+\zref@newprop{envline}[]{\zref@env@line}
+% \end{macrocode}
+%
+% \begin{macro}{\zref@env@line}
+% Macro \cs{zref@env@line} extracts the line number
+% from \cs{@currenvline}.
+% \begin{macrocode}
+\def\zref@env@line{%
+ \ifx\@currenvline\ltx@empty
+ \else
+ \expandafter
+ \ZREF@ENV@line\@currenvline\ltx@empty line \ltx@empty\@nil
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ZREF@ENV@line}
+% \begin{macrocode}
+\def\ZREF@ENV@line#1line #2\ltx@empty#3\@nil{#2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</env>
+% \end{macrocode}
+%
+%
+% \section{Test}
+%
+% \subsection{\cs{zref@localaddprop}}
+%
+% \begin{macrocode}
+%<*test1>
+\NeedsTeXFormat{LaTeX2e}
+\nofiles
+\documentclass{article}
+\usepackage{zref-base}[2018/11/21]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\makeatletter
+\def\ExpectList#1#2{%
+ \expandafter\expandafter\expandafter\Expect
+ \expandafter\expandafter\expandafter{\csname Z@L@#1\endcsname}{#2}%
+}
+\begin{qstest}{localaddprop}{localaddprop}
+ \ExpectList{main}{\default\page}%
+ \Expect{undefined}*{\meaning\foobar}%
+ \zref@newprop{foobar}{FOO}%
+ \Expect{undefined}*{\meaning\foobar}%
+ \zref@newlist{alist}%
+ \ExpectList{alist}{}%
+ \begingroup
+ \zref@localaddprop{main}{foobar}%
+ \Expect{undefined}*{\meaning\foobar}%
+ \ExpectList{main}{\default\page\foobar}%
+ \zref@localaddprop{alist}{page}%
+ \ExpectList{alist}{\page}%
+ \endgroup
+ \ExpectList{main}{\default\page}%
+ \ExpectList{alist}{}%
+ \zref@addprop{alist}{foobar}%
+ \ExpectList{alist}{\foobar}%
+ \Expect{undefined}*{\meaning\foobar}%
+\end{qstest}
+\@@end
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Module \xmodule{base}}
+%
+% \begin{macrocode}
+%<*test-base>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{zref-base,zref-titleref}[2018/11/21]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\makeatletter
+\newcommand*{\DefExpand}[2]{%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter{#2}%
+ \@onelevel@sanitize#1%
+}
+\newcommand*{\Test}[3]{%
+ \Expect{#2}*{#1}%
+ \zref@wrapper@unexpanded{%
+ \Expect*{#3}*{#1}%
+ }%
+ \DefExpand\x{#1}%
+ \Expect*{#3}*{\x}%
+}
+\makeatother
+
+\begin{document}
+\section{\textit{Hello} \textbf{World}}
+\label{sec:hello}
+\makeatletter
+\zref@newprop{foo}[\@empty D\@empty efault]{\@empty V\@empty alue}
+\begin{qstest}{getcurrent}{getcurrent}
+ \Test{\zref@getcurrent{foo}}%
+ {Value}{\noexpand\@empty V\noexpand\@empty alue}%
+ \Test{\zref@getcurrent{xy}}{}{}%
+\end{qstest}
+\begin{qstest}{extract}{extract}
+ \def\textbf#1{<#1>}%
+ \def\textit#1{[#1]}% hash-ok
+ \Test{\zref@extractdefault{xy}{page}{\@empty D\@empty efault}}%
+ {Default}{\noexpand\@empty D\noexpand\@empty efault}%
+ \Test{\zref@extractdefault{sec:hello}{foo}{\@empty A\@empty B}}%
+ {AB}{\noexpand\@empty A\noexpand\@empty B}%
+ \Test{\zref@extract{sec:hello}{foo}}%
+ {Default}{\noexpand\@empty D\noexpand\@empty efault}%
+ \zref@ifrefundefined{sec:hello}{%
+ }{%
+ \Test{\zref@extract{sec:hello}{default}}{1}{1}%
+ \Test{\zref@extract{sec:hello}{title}}%
+ {[Hello] <World>}%
+ {\noexpand\textit{Hello} \noexpand\textbf{World}}%
+ }%
+\end{qstest}
+\end{document}
+%</test-base>
+% \end{macrocode}
+%
+% \subsection{Module \xmodule{runs}}
+%
+% \begin{macrocode}
+%<*test-runs>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{article}
+\usepackage{zref-runs}[2018/11/21]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+
+\begin{qstest}{zruns-preamble}{zruns-preamble}
+ \Expect{0}*{\zruns}%
+\end{qstest}
+
+\AtBeginDocument{%
+ \begin{qstest}{zruns-atbegindocument}{zruns-atbegindocument}%
+ \Expect*{\number\ExpectRuns}*{\zruns}%
+ \end{qstest}%
+}
+
+\begin{document}
+\begin{qstest}{zruns-document}{zruns-document}
+ \Expect*{\number\ExpectRuns}*{\zruns}%
+\end{qstest}
+\end{document}
+%</test-runs>
+% \end{macrocode}
+%
+% \subsection{Module \xmodule{titleref}}
+%
+% \begin{macrocode}
+%<*test-titleref-memoir>
+\NeedsTeXFormat{LaTeX2e}
+\documentclass{memoir}
+\usepackage{zref-titleref}[2018/11/21]
+\usepackage{qstest}
+\IncludeTests{*}
+\LogTests{log}{*}{*}
+\begin{document}
+\makeatletter
+\def\List{}
+\def\Label#1{%
+ \zref@label{#1}%
+ \g@addto@macro\List{%
+ \par
+ #1: [\ztitleref{#1}]%
+ }%
+ \mbox{}%
+ \zref@refused{#1}%
+ \zref@ifrefundefined{#1}{%
+ }{%
+ \begingroup
+ \edef\x{\zref@extract{#1}{title}}%
+ \Expect{OK/}*{\expandafter\ltx@carthree\x{}{}{}\@nil}%
+ \endgroup
+ }%
+}
+\def\Test#1{%
+ \csname#1\endcsname*{OK/#1}%
+ \Label{#1*}%
+ \csname#1\endcsname{OK/#1}%
+ \Label{#1}%
+ \csname#1\endcsname[OK/#1-toc]%
+ {WRONG-in-titleref/#1-toc-2}%
+ \Label{#1-toc}%
+ \expandafter\ifx\csname#1\endcsname\part
+ \else
+ \headnamereffalse
+ \csname#1\endcsname[OK/#1-th-toc]%
+ [WRONG-in-titleref/#1-th-toc-2]%
+ {WRONG-in-titleref/#1-th-toc-3}%
+ \Label{#1-th-toc}%
+ \headnamereftrue
+ \csname#1\endcsname[WRONG-in-titleref/#1-th-head-1]%
+ [OK/#1-th-head]%
+ {WRONG-in-titleref/#1-th-head-3}%
+ \Label{#1-th-head}%
+ \fi
+}
+\begin{qstest}{section}{section}
+ \@for\x:=part,chapter,section,subsection,subsubsection\do{%
+ \expandafter\Test\expandafter{\x}%
+ }%
+\end{qstest}
+\newpage
+\List
+\end{document}
+%</test-titleref-memoir>
+% \end{macrocode}
+%
+% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\url{http://ctan.org/pkg/zref}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/oberdiek/zref.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/oberdiek/zref.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[\CTAN{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 zref.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@{}}
+% zref.sty & tex/latex/oberdiek/zref.sty\\
+% zref-base.sty & tex/latex/oberdiek/zref-base.sty\\
+% zref-abspage.sty & tex/latex/oberdiek/zref-abspage.sty\\
+% zref-abspos.sty & tex/latex/oberdiek/zref-abspos.sty\\
+% zref-counter.sty & tex/latex/oberdiek/zref-counter.sty\\
+% zref-dotfill.sty & tex/latex/oberdiek/zref-dotfill.sty\\
+% zref-env.sty & tex/latex/oberdiek/zref-env.sty\\
+% zref-hyperref.sty & tex/latex/oberdiek/zref-hyperref.sty\\
+% zref-lastpage.sty & tex/latex/oberdiek/zref-lastpage.sty\\
+% zref-marks.sty & tex/latex/oberdiek/zref-marks.sty\\
+% zref-nextpage.sty & tex/latex/oberdiek/zref-nextpage.sty\\
+% zref-pageattr.sty & tex/latex/oberdiek/zref-pageattr.sty\\
+% zref-pagelayout.sty & tex/latex/oberdiek/zref-pagelayout.sty\\
+% zref-perpage.sty & tex/latex/oberdiek/zref-perpage.sty\\
+% zref-runs.sty & tex/latex/oberdiek/zref-runs.sty\\
+% zref-savepos.sty & tex/latex/oberdiek/zref-savepos.sty\\
+% zref-thepage.sty & tex/latex/oberdiek/zref-thepage.sty\\
+% zref-titleref.sty & tex/latex/oberdiek/zref-titleref.sty\\
+% zref-totpages.sty & tex/latex/oberdiek/zref-totpages.sty\\
+% zref-user.sty & tex/latex/oberdiek/zref-user.sty\\
+% zref-xr.sty & tex/latex/oberdiek/zref-xr.sty\\
+% zref.pdf & doc/latex/oberdiek/zref.pdf\\
+% zref-example.tex & doc/latex/oberdiek/zref-example.tex\\
+% zref-example-lastpage.tex & doc/latex/oberdiek/zref-example-lastpage.tex\\
+% zref-example-nextpage.tex & doc/latex/oberdiek/zref-example-nextpage.tex\\
+% test/zref-test1.tex & doc/latex/oberdiek/test/zref-test1.tex\\
+% test/zref-test-base.tex & doc/latex/oberdiek/test/zref-test-base.tex\\
+% test/zref-test-runs.tex & doc/latex/oberdiek/test/zref-test-runs.tex\\
+% test/zref-test-titleref-memoir.tex & doc/latex/oberdiek/test/zref-test-titleref-memoir.tex\\
+% zref.dtx & source/latex/oberdiek/zref.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{Attached source.}
+%
+% The PDF documentation on CTAN also includes the
+% \xfile{.dtx} source file. It can be extracted by
+% AcrobatReader 6 or higher. Another option is \textsf{pdftk},
+% e.g. unpack the file into the current directory:
+% \begin{quote}
+% \verb|pdftk zref.pdf unpack_files output .|
+% \end{quote}
+%
+% \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{zref.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 zref.dtx
+%makeindex -s gind.ist zref.idx
+%pdflatex zref.dtx
+%makeindex -s gind.ist zref.idx
+%pdflatex zref.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{zref.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='zref'>
+ <name>zref</name>
+ <caption>A new reference scheme for LaTeX.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2006-2012'/>
+ <license type='lppl1.3'/>
+ <version number='2.26'/>
+ <description>
+ This package offers a means to remove the limitation, of only two
+ properties, that is inherent in the way LaTeX&#x2019;s reference system
+ works. The package implements an extensible referencing system,
+ where properties are handled in a more flexible way. It provides
+ an interface for macro programmers to access the new reference
+ scheme and some applications that use it.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/zref.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/zref.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
+% \newcommand*{\bibpackage}[4]{^^A
+% \bibitem{#1}
+% Package \xpackage{#1}, #2, #3.^^A
+% \ifx\\#4\\\else#4\fi\par
+% }
+%
+% \begin{thebibliography}{99}
+% \bibpackage{footmisc}{Robin Fairbairns}{2004/01/23 v5.3a}
+% {\CTAN{macros/latex/contrib/footmisc/footmisc.dtx}}
+% \bibpackage{hyperref}{Sebastian Rahtz, Heiko Oberdiek}{2006/08/16 v6.75c}
+% {\CTAN{macros/latex/contrib/hyperref/}}
+% \bibpackage{lastpage}{Jeff Goldberg}{1994/06/25 v0.1b}
+% {\CTAN{macros/latex/contrib/lastpage/}}
+% \bibpackage{nameref}{Sebastian Rahtz, Heiko Oberdiek}{2006/02/12 v2.24}
+% {\CTAN{macros/latex/contrib/hyperref/nameref.dtx}}
+% \bibpackage{perpage}{David Kastrup}{2002/12/20 v1.0}
+% {\CTAN{macros/latex/contrib/bigfoot/perpage.dtx}}
+% \bibpackage{titleref}{Donald Arsenau}{2001/04/05 v3.1}
+% {\CTAN{macros/latex/contrib/misc/titleref.sty}}
+% \bibpackage{totpages}{Wilhelm M\"uller}{1999/07/14 v1.00}
+% {\CTAN{macros/latex/contrib/totpages/}}
+% \bibpackage{xr}{David Carlisle}{1994/05/28 v5.02}
+% {\CTAN{macros/latex/required/tools/xr.pdf}}
+% \bibpackage{xr-hyper}{David Carlisle}{2000/03/22 v6.00beta4}
+% {\CTAN{macros/latex/contrib/hyperref/xr-hyper.sty}}
+% \end{thebibliography}
+%
+% \begin{History}
+% \begin{Version}{2006/02/20 v1.0}
+% \item
+% First version.
+% \end{Version}
+% \begin{Version}{2006/05/03 v1.1}
+% \item
+% Module \xmodule{perpage} added.
+% \item
+% Module redesign as packages.
+% \end{Version}
+% \begin{Version}{2006/05/25 v1.2}
+% \item
+% Module \xmodule{dotfillmin} added.
+% \item
+% Module \xmodule{base}: macros \cs{zref@require@uniqe}
+% and \cs{thezref@unique} added
+% (used by modules \xmodule{titleref} and \xmodule{dotfillmin}).
+% \end{Version}
+% \begin{Version}{2006/09/08 v1.3}
+% \item
+% Typo fixes and English cleanup by Per Starback.
+% \end{Version}
+% \begin{Version}{2007/01/23 v1.4}
+% \item
+% Typo in macro name fixed in documentation.
+% \end{Version}
+% \begin{Version}{2007/02/18 v1.5}
+% \item
+% \cs{zref@getcurrent} added (suggestion of Igor Akkerman).
+% \item
+% Module \xmodule{savepos} also supports \hologo{XeTeX}.
+% \end{Version}
+% \begin{Version}{2007/04/06 v1.6}
+% \item
+% Fix in modules \xmodule{abspage} and \xmodule{base}:
+% Now counter |abspage| and |zref@unique|
+% are not remembered by \cs{include}.
+% \item
+% Beamer support for module \xmodule{titleref}.
+% \end{Version}
+% \begin{Version}{2007/04/17 v1.7}
+% \item
+% Package \xpackage{atbegshi} replaces \xpackage{everyshi}.
+% \end{Version}
+% \begin{Version}{2007/04/22 v1.8}
+% \item
+% \cs{zref@wrapper@babel} and \cs{zref@refused} are now expandable
+% if babel is not used or \cs{if@safe@actives} is already set to true.
+% (Feature request of Josselin Noirel)
+% \end{Version}
+% \begin{Version}{2007/05/02 v1.9}
+% \item
+% Module \xmodule{titleref}: Some support for \cs{caption} of package
+% \xpackage{longtable}, but only if \cs{label} is given after
+% \cs{caption}.
+% \end{Version}
+% \begin{Version}{2007/05/06 v2.0}
+% \item
+% Uses package \xpackage{etexcmds} for accessing \hologo{eTeX}'s \cs{unexpanded}.
+% \end{Version}
+% \begin{Version}{2007/05/28 v2.1}
+% \item
+% Module \xmodule{titleref} supports caption of package \xpackage{listings}.
+% \item
+% Fixes in module \xmodule{titleref} for support
+% of packages \xpackage{titlesec} and \xpackage{longtable}.
+% \end{Version}
+% \begin{Version}{2008/09/21 v2.2}
+% \item
+% Module \xmodule{base}: \cs{zref@iflistcontainsprop} is documented, but
+% a broken \cs{zref@listcontainsprop} implemented. Name and
+% implementation fixed (thanks Ohad Kammar).
+% \end{Version}
+% \begin{Version}{2008/10/01 v2.3}
+% \item
+% \cs{zref@localaddprop} added (feature request of Ohad Kammar).
+% \item
+% Module \xmodule{lastpage}: list `LastPage' added. Label `LastPage' will use
+% the properties of this list (default is empty) along with the
+% properties of the main list.
+% \end{Version}
+% \begin{Version}{2009/08/07 v2.4}
+% \item
+% Module \xmodule{runs} added.
+% \end{Version}
+% \begin{Version}{2009/12/06 v2.5}
+% \item
+% Module \xmodule{lastpage}: Uses package \xpackage{atveryend}.
+% \item
+% Module \xmodule{titleref}: Further commands are disabled
+% during string expansion, imported from package \xpackage{nameref}.
+% \end{Version}
+% \begin{Version}{2009/12/07 v2.6}
+% \item
+% Version date added for package \xpackage{atveryend}.
+% \end{Version}
+% \begin{Version}{2009/12/08 v2.7}
+% \item
+% Module \xmodule{titleref}: Use of package \xpackage{gettitlestring}.
+% \end{Version}
+% \begin{Version}{2010/03/26 v2.8}
+% \item
+% \cs{zifrefundefined} added.
+% \item
+% Module \xmodule{lastpage}: Macros \cs{zref@iflastpage}
+% and \cs{ziflastpage} added.
+% \item
+% Module \xmodule{thepage} added.
+% \item
+% Module \xmodule{nextpage} added.
+% \end{Version}
+% \begin{Version}{2010/03/29 v2.9}
+% \item
+% Module \xmodule{marks} added (without documentation).
+% \item
+% \cs{zref@addprop} now adds expanded property to list.
+% \item
+% Useless \cs{ZREF@ErrorNoLine} removed.
+% \end{Version}
+% \begin{Version}{2010/04/08 v2.10}
+% \item
+% Module \xmodule{xr} remembers the external document name
+% in property `externaldocument'.
+% \end{Version}
+% \begin{Version}{2010/04/15 v2.11}
+% \item
+% Module \xmodule{titleref}: Better support of class \xclass{memoir}.
+% \item
+% Module \xmodule{titleref}: Support of theorems.
+% \end{Version}
+% \begin{Version}{2010/04/17 v2.12}
+% \item
+% Module \xmodule{base}: \cs{zref@newprop} ensures global
+% empty default.
+% \item
+% Module \xmodule{xr}: Setup options \xoption{tozreflabel}
+% and \xoption{toltxlabel} added.
+% \end{Version}
+% \begin{Version}{2010/04/19 v2.13}
+% \item
+% \cs{zref@setcurrent} throws an error if the property
+% does not exist (Florent Chervet).
+% \item
+% \cs{zref@getcurrent} the documentation is fixed (Florent Chervet).
+% Also it returns the empty string in case of errors.
+% \item
+% \cs{zref@addprop} and \cs{zref@localaddprop} now take a list of
+% property names (feature request of Florent Chervet).
+% \item
+% Example for \cs{zref@wrapper@unexpanded} corrected (Florent Chervet).
+% \end{Version}
+% \begin{Version}{2010/04/22 v2.14}
+% \item
+% Bug fix for \cs{zref@getcurrent} second argument wasn't eaten in
+% case of unknown property.
+% \item
+% \cs{zref@getcurrent} supports \cs{zref@wrapper@unexpanded}.
+% \item
+% \cs{zref@wrapper@unexpanded} added for \cs{ZREF@xr@tolabel}.
+% \item
+% \cs{zref@extract}, \cs{zref@extractdefault}, \cs{zref@getcurrent}
+% are expandable in exact two steps
+% except inside \cs{zref@wrapper@unexpanded}.
+% \end{Version}
+% \begin{Version}{2010/04/23 v2.15}
+% \item
+% \cs{zexternaldocument} fixed for property `url' when
+% importing \cs{new@label} (bug found by Victor Ivrii).
+% \item
+% Two expansion steps also in \cs{zref@wrapper@unexpanded}.
+% \item
+% Nested calls of \cs{zref@wrapper@unexpanded} possible.
+% \end{Version}
+% \begin{Version}{2010/04/28 v2.16}
+% \item
+% More consequent use of package `ltxcmds' and `hologo'.
+% \item
+% Module \xmodule{pagelayout} added.
+% \item
+% Module \xmodule{pageattr} added.
+% \item
+% Robustness introduced for non-expandable interface macros.
+% \item
+% Internal change of the data format of property lists
+% (suggestion of Florent Chervet).
+% \item
+% Module \xmodule{titleref}: Support of environment \textsf{description}.
+% \end{Version}
+% \begin{Version}{2010/05/01 v2.17}
+% \item
+% \cs{zref@newprop} throws an error if the property already exists.
+% \item
+% Module \xmodule{xr}: Bug fix for the case of several \xext{aux} files
+% (bug found by Victor Ivrii).
+% \item
+% Module \xmodule{xr}: Property `urluse' and option \xoption{urluse} added.
+% \end{Version}
+% \begin{Version}{2010/05/13 v2.18}
+% \item
+% Module \xmodule{env} added.
+% \item
+% Module \xmodule{savepos}: \cs{zref@savepos} added.
+% \end{Version}
+% \begin{Version}{2010/10/22 v2.19}
+% \item
+% \cs{zref@addprop} and \cs{zref@localaddprop} are limited
+% to one property only
+% (incompatibility to versions v2.13 to v2.18).
+% \item
+% \cs{zref@addprops} and \cs{zref@localaddprops} added.
+% \item
+% \cs{zref@delprop} and \cs{zref@localdelprop} added.
+% \item
+% \cs{zref@labelbykv} and \cs{zkvlabel} (module \xmodule{user})
+% with keys \xoption{prop}, \xoption{list}, \xoption{delprop},
+% \xoption{immediate}, \xoption{values} added.
+% \end{Version}
+% \begin{Version}{2011/02/12 v2.20}
+% \item
+% Fix for warning in \xpackage{zref-xr}.
+% \end{Version}
+% \begin{Version}{2011/03/18 v2.21}
+% \item
+% Fix in module \xmodule{pagelayout} for \cs{zlistpagelayout}.
+% \item
+% Fix for \cs{zref@localaddprop} (probably since v2.19).
+% \end{Version}
+% \begin{Version}{2011/10/05 v2.22}
+% \item
+% Documentation fixed for \cs{zref@(local)addprop(s)}.
+% \item
+% Module \xmodule{base}: \cs{zref@def@extract}, \cs{zref@def@extractdefault}
+% added.
+% \item
+% Fix in module \xmodule{pagelayout}: Because of missing \cs{noexpand}
+% commands the values of the pagelayout properties on all pages were
+% the values at package loading.
+% \item
+% Module \xmodule{base}: \cs{zref@showprop} added.
+% \end{Version}
+% \begin{Version}{2011/12/05 v2.23}
+% \item
+% Module \xmodule{savepos}: \cs{zsaveposx} and \cs{zsaveposy} added.
+% \end{Version}
+% \begin{Version}{2012/04/04 v2.24}
+% \item
+% Module \xmodule{titleref}, package \xpackage{titlesec}:
+% some support for class `straight' (\cs{ttl@straight@i}) added.
+% \end{Version}
+% \begin{Version}{2016/05/16 v2.25}
+% \item
+% Documentation updates.
+% \end{Version}
+% \begin{Version}{2016/05/21 v2.26}
+% \item
+% update zref-savepos for new luatex
+% \end{Version}
+% \begin{Version}{2018/11/21 v2.27}
+% \item
+% adapted zref-perpage, see issue https://github.com/ho-tex/oberdiek/issues/26
+% \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/oberdiek/zref.pdf b/macros/latex/contrib/oberdiek/zref.pdf
new file mode 100644
index 0000000000..9b7598d5a7
--- /dev/null
+++ b/macros/latex/contrib/oberdiek/zref.pdf
Binary files differ