From 6d3d0706f9b7085f8bc6efa81398dbfe551272db Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 18 Dec 2019 03:01:19 +0000 Subject: CTAN sync 201912180301 --- macros/latex/contrib/auxhook/auxhook.dtx | 15 +- macros/latex/contrib/auxhook/auxhook.pdf | Bin 285712 -> 286006 bytes macros/latex/contrib/bigintcalc/README.md | 9 + macros/latex/contrib/bigintcalc/bigintcalc.dtx | 3561 ++++++++++++++++++++ macros/latex/contrib/bigintcalc/bigintcalc.pdf | Bin 0 -> 468037 bytes macros/latex/contrib/etexcmds/README.md | 11 + macros/latex/contrib/etexcmds/etexcmds.dtx | 731 ++++ macros/latex/contrib/etexcmds/etexcmds.pdf | Bin 0 -> 301594 bytes .../system-install-fonts/MinionGreekSmallCaps.otf | Bin 17548 -> 0 bytes .../PalatinoGreekSmallCaps.otf | Bin 25412 -> 0 bytes .../system-install-fonts/README-fonts.txt | 13 + macros/latex/contrib/gettitlestring/README.md | 10 + .../contrib/gettitlestring/gettitlestring.dtx | 812 +++++ .../contrib/gettitlestring/gettitlestring.pdf | Bin 0 -> 319256 bytes macros/latex/contrib/hycolor/README.md | 10 + macros/latex/contrib/hycolor/hycolor.dtx | 1616 +++++++++ macros/latex/contrib/hycolor/hycolor.pdf | Bin 0 -> 364587 bytes macros/latex/contrib/intcalc/README.md | 7 + macros/latex/contrib/intcalc/intcalc.dtx | 3286 ++++++++++++++++++ macros/latex/contrib/intcalc/intcalc.pdf | Bin 0 -> 431897 bytes macros/latex/contrib/kvdefinekeys/README.md | 9 + macros/latex/contrib/kvdefinekeys/kvdefinekeys.dtx | 612 ++++ macros/latex/contrib/kvdefinekeys/kvdefinekeys.pdf | Bin 0 -> 296070 bytes macros/latex/contrib/kvsetkeys/README.md | 11 + macros/latex/contrib/kvsetkeys/kvsetkeys.dtx | 1676 +++++++++ macros/latex/contrib/kvsetkeys/kvsetkeys.pdf | Bin 0 -> 374946 bytes macros/latex/contrib/ltxcmds/README.md | 10 + macros/latex/contrib/ltxcmds/ltxcmds.dtx | 2425 +++++++++++++ macros/latex/contrib/ltxcmds/ltxcmds.pdf | Bin 0 -> 393914 bytes macros/latex/contrib/oberdiek/README.txt | 2 +- macros/latex/contrib/oberdiek/aliascnt.pdf | Bin 293095 -> 293095 bytes macros/latex/contrib/oberdiek/alphalph.pdf | Bin 354229 -> 0 bytes macros/latex/contrib/oberdiek/bigintcalc.dtx | 3561 -------------------- macros/latex/contrib/oberdiek/bigintcalc.pdf | Bin 468260 -> 0 bytes macros/latex/contrib/oberdiek/bitset.pdf | Bin 626116 -> 0 bytes macros/latex/contrib/oberdiek/bmpsize.pdf | Bin 498211 -> 498211 bytes macros/latex/contrib/oberdiek/catchfile.pdf | Bin 298873 -> 0 bytes macros/latex/contrib/oberdiek/centernot.pdf | Bin 275199 -> 275199 bytes macros/latex/contrib/oberdiek/chemarr.pdf | Bin 289226 -> 289226 bytes macros/latex/contrib/oberdiek/classlist.pdf | Bin 271947 -> 271947 bytes macros/latex/contrib/oberdiek/colonequals.pdf | Bin 284949 -> 284949 bytes macros/latex/contrib/oberdiek/dvipscol.pdf | Bin 269922 -> 269922 bytes macros/latex/contrib/oberdiek/engord.pdf | Bin 319151 -> 319151 bytes macros/latex/contrib/oberdiek/enparen.pdf | Bin 305218 -> 305218 bytes macros/latex/contrib/oberdiek/eolgrab.pdf | Bin 317170 -> 317170 bytes macros/latex/contrib/oberdiek/etexcmds.dtx | 730 ---- macros/latex/contrib/oberdiek/etexcmds.pdf | Bin 300824 -> 0 bytes macros/latex/contrib/oberdiek/fibnum.pdf | Bin 354648 -> 354648 bytes macros/latex/contrib/oberdiek/flags.pdf | Bin 283961 -> 283961 bytes macros/latex/contrib/oberdiek/gettitlestring.dtx | 811 ----- macros/latex/contrib/oberdiek/gettitlestring.pdf | Bin 318747 -> 0 bytes macros/latex/contrib/oberdiek/holtxdoc.pdf | Bin 306330 -> 306330 bytes macros/latex/contrib/oberdiek/hopatch.pdf | Bin 293225 -> 293225 bytes macros/latex/contrib/oberdiek/hycolor.dtx | 1624 --------- macros/latex/contrib/oberdiek/hycolor.pdf | Bin 364626 -> 0 bytes macros/latex/contrib/oberdiek/hypbmsec.pdf | Bin 290353 -> 290353 bytes macros/latex/contrib/oberdiek/hypcap.pdf | Bin 284122 -> 284122 bytes macros/latex/contrib/oberdiek/hypdestopt.pdf | Bin 318258 -> 318258 bytes macros/latex/contrib/oberdiek/hypdoc.pdf | Bin 320178 -> 320178 bytes macros/latex/contrib/oberdiek/hypgotoe.pdf | Bin 285077 -> 285077 bytes macros/latex/contrib/oberdiek/hyphsubst.pdf | Bin 300446 -> 300446 bytes macros/latex/contrib/oberdiek/ifdraft.pdf | Bin 265890 -> 265890 bytes macros/latex/contrib/oberdiek/iflang.pdf | Bin 314990 -> 314990 bytes macros/latex/contrib/oberdiek/intcalc.dtx | 3287 ------------------ macros/latex/contrib/oberdiek/intcalc.pdf | Bin 431637 -> 0 bytes macros/latex/contrib/oberdiek/kvdefinekeys.dtx | 607 ---- macros/latex/contrib/oberdiek/kvdefinekeys.pdf | Bin 296060 -> 0 bytes macros/latex/contrib/oberdiek/kvsetkeys.dtx | 1686 --------- macros/latex/contrib/oberdiek/kvsetkeys.pdf | Bin 375389 -> 0 bytes macros/latex/contrib/oberdiek/ltxcmds.dtx | 2429 ------------- macros/latex/contrib/oberdiek/ltxcmds.pdf | Bin 394196 -> 0 bytes macros/latex/contrib/oberdiek/oberdiek-bundle.bib | 85 +- macros/latex/contrib/oberdiek/oberdiek-source.bib | 2 +- macros/latex/contrib/oberdiek/oberdiek.ins | 14 +- macros/latex/contrib/oberdiek/oberdiek.pdf | Bin 319133 -> 278247 bytes macros/latex/contrib/oberdiek/oberdiek.tex | 155 +- macros/latex/contrib/oberdiek/pagegrid.pdf | Bin 311938 -> 311938 bytes macros/latex/contrib/oberdiek/pagesel.pdf | Bin 312194 -> 312194 bytes macros/latex/contrib/oberdiek/pdfcol.pdf | Bin 303046 -> 303046 bytes macros/latex/contrib/oberdiek/pdfcolfoot.pdf | Bin 294724 -> 294724 bytes macros/latex/contrib/oberdiek/pdfcolparallel.pdf | Bin 320329 -> 320329 bytes macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf | Bin 308338 -> 308338 bytes macros/latex/contrib/oberdiek/pdfcrypt.pdf | Bin 311898 -> 311898 bytes macros/latex/contrib/oberdiek/pdfescape.pdf | Bin 346746 -> 0 bytes macros/latex/contrib/oberdiek/pdfrender.pdf | Bin 383290 -> 383290 bytes macros/latex/contrib/oberdiek/picture.pdf | Bin 295928 -> 0 bytes macros/latex/contrib/oberdiek/protecteddef.pdf | Bin 308115 -> 308115 bytes macros/latex/contrib/oberdiek/refcount.dtx | 1099 ------ macros/latex/contrib/oberdiek/refcount.pdf | Bin 326895 -> 0 bytes macros/latex/contrib/oberdiek/resizegather.pdf | Bin 517717 -> 517717 bytes macros/latex/contrib/oberdiek/rotchiffre.pdf | Bin 317497 -> 317497 bytes macros/latex/contrib/oberdiek/scrindex.pdf | Bin 283886 -> 283886 bytes macros/latex/contrib/oberdiek/selinput.pdf | Bin 537938 -> 0 bytes macros/latex/contrib/oberdiek/setouterhbox.pdf | Bin 330126 -> 330126 bytes macros/latex/contrib/oberdiek/settobox.pdf | Bin 293875 -> 293875 bytes macros/latex/contrib/oberdiek/soulutf8.dtx | 1300 ------- macros/latex/contrib/oberdiek/soulutf8.pdf | Bin 352082 -> 0 bytes macros/latex/contrib/oberdiek/stackrel.pdf | Bin 282341 -> 282341 bytes macros/latex/contrib/oberdiek/stampinclude.pdf | Bin 278115 -> 278115 bytes macros/latex/contrib/oberdiek/tabularht.pdf | Bin 331646 -> 331646 bytes macros/latex/contrib/oberdiek/tabularkv.pdf | Bin 255279 -> 255279 bytes macros/latex/contrib/oberdiek/telprint.pdf | Bin 303826 -> 303826 bytes macros/latex/contrib/oberdiek/thepdfnumber.pdf | Bin 347573 -> 347451 bytes macros/latex/contrib/oberdiek/twoopt.pdf | Bin 275011 -> 275011 bytes macros/latex/contrib/oberdiek/uniquecounter.dtx | 694 ---- macros/latex/contrib/oberdiek/uniquecounter.pdf | Bin 290336 -> 0 bytes macros/latex/contrib/refcount/README.md | 12 + macros/latex/contrib/refcount/refcount.dtx | 1097 ++++++ macros/latex/contrib/refcount/refcount.pdf | Bin 0 -> 326909 bytes macros/latex/contrib/soulutf8/README.md | 17 + macros/latex/contrib/soulutf8/soulutf8.dtx | 1298 +++++++ macros/latex/contrib/soulutf8/soulutf8.pdf | Bin 0 -> 351673 bytes macros/latex/contrib/tuda-ci/README.md | 11 +- .../contrib/tuda-ci/doc/DEMO-TUDaAnnouncement.pdf | Bin 576177 -> 576177 bytes .../latex/contrib/tuda-ci/doc/DEMO-TUDaBeamer.pdf | Bin 622092 -> 622092 bytes .../contrib/tuda-ci/doc/DEMO-TUDaExercise.pdf | Bin 570005 -> 570001 bytes .../latex/contrib/tuda-ci/doc/DEMO-TUDaLetter.pdf | Bin 590864 -> 590862 bytes macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPhD.pdf | Bin 825794 -> 826643 bytes .../latex/contrib/tuda-ci/doc/DEMO-TUDaPoster.pdf | Bin 562162 -> 562162 bytes macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPub.pdf | Bin 852539 -> 852625 bytes .../latex/contrib/tuda-ci/doc/DEMO-TUDaReport.pdf | Bin 551525 -> 551532 bytes .../contrib/tuda-ci/doc/DEMO-TUDaSciPoster.pdf | Bin 590728 -> 590728 bytes .../latex/contrib/tuda-ci/doc/DEMO-TUDaThesis.pdf | Bin 819560 -> 820383 bytes .../tuda-ci/example/DEMO-TUDaAnnouncement.tex | 2 +- .../contrib/tuda-ci/example/DEMO-TUDaBeamer.tex | 2 +- .../tuda-ci/example/DEMO-TUDaBibliography.bib | 2 +- .../contrib/tuda-ci/example/DEMO-TUDaExercise.tex | 2 +- .../tuda-ci/example/DEMO-TUDaFromaddress.lco | 2 +- .../contrib/tuda-ci/example/DEMO-TUDaLetter.tex | 2 +- .../latex/contrib/tuda-ci/example/DEMO-TUDaPhD.tex | 49 +- .../contrib/tuda-ci/example/DEMO-TUDaPoster.tex | 2 +- .../latex/contrib/tuda-ci/example/DEMO-TUDaPub.tex | 2 +- .../contrib/tuda-ci/example/DEMO-TUDaReport.tex | 2 +- .../contrib/tuda-ci/example/DEMO-TUDaSciPoster.tex | 2 +- .../contrib/tuda-ci/example/DEMO-TUDaThesis.tex | 47 +- .../contrib/tuda-ci/tex/beamercolorthemeTUDa.sty | 6 +- .../contrib/tuda-ci/tex/beamerfontthemeTUDa.sty | 6 +- .../contrib/tuda-ci/tex/beamerinnerthemeTUDa.sty | 6 +- .../contrib/tuda-ci/tex/beamerouterthemeTUDa.sty | 6 +- .../latex/contrib/tuda-ci/tex/beamerthemeTUDa.sty | 6 +- macros/latex/contrib/tuda-ci/tex/tuda-a0paper.clo | 6 +- macros/latex/contrib/tuda-ci/tex/tuda-a1paper.clo | 6 +- macros/latex/contrib/tuda-ci/tex/tuda-a2paper.clo | 6 +- macros/latex/contrib/tuda-ci/tex/tuda-a3paper.clo | 6 +- macros/latex/contrib/tuda-ci/tex/tuda-a4paper.clo | 6 +- macros/latex/contrib/tuda-ci/tex/tuda-a5paper.clo | 6 +- macros/latex/contrib/tuda-ci/tex/tuda-pgfplots.sty | 6 +- macros/latex/contrib/tuda-ci/tex/tudabeamer.cls | 6 +- macros/latex/contrib/tuda-ci/tex/tudacolors.def | 6 +- macros/latex/contrib/tuda-ci/tex/tudacolors.sty | 6 +- macros/latex/contrib/tuda-ci/tex/tudaexercise.cls | 128 +- macros/latex/contrib/tuda-ci/tex/tudafonts.sty | 6 +- macros/latex/contrib/tuda-ci/tex/tudaletter.cls | 6 +- .../contrib/tuda-ci/tex/tudalettersize10pt.clo | 6 +- macros/latex/contrib/tuda-ci/tex/tudaposter.cls | 6 +- macros/latex/contrib/tuda-ci/tex/tudapub.cls | 32 +- macros/latex/contrib/tuda-ci/tex/tudarules.sty | 6 +- macros/latex/contrib/tuda-ci/tex/tudasciposter.cls | 6 +- macros/latex/contrib/tuda-ci/tex/tudasize9pt.clo | 6 +- macros/latex/contrib/tuda-ci/tex/tudathesis.cfg | 29 +- macros/latex/contrib/uniquecounter/README.md | 10 + .../latex/contrib/uniquecounter/uniquecounter.dtx | 694 ++++ .../latex/contrib/uniquecounter/uniquecounter.pdf | Bin 0 -> 291049 bytes 163 files changed, 18189 insertions(+), 18297 deletions(-) create mode 100644 macros/latex/contrib/bigintcalc/README.md create mode 100644 macros/latex/contrib/bigintcalc/bigintcalc.dtx create mode 100644 macros/latex/contrib/bigintcalc/bigintcalc.pdf create mode 100644 macros/latex/contrib/etexcmds/README.md create mode 100644 macros/latex/contrib/etexcmds/etexcmds.dtx create mode 100644 macros/latex/contrib/etexcmds/etexcmds.pdf delete mode 100644 macros/latex/contrib/fontsetup/system-install-fonts/MinionGreekSmallCaps.otf delete mode 100644 macros/latex/contrib/fontsetup/system-install-fonts/PalatinoGreekSmallCaps.otf create mode 100644 macros/latex/contrib/fontsetup/system-install-fonts/README-fonts.txt create mode 100644 macros/latex/contrib/gettitlestring/README.md create mode 100644 macros/latex/contrib/gettitlestring/gettitlestring.dtx create mode 100644 macros/latex/contrib/gettitlestring/gettitlestring.pdf create mode 100644 macros/latex/contrib/hycolor/README.md create mode 100644 macros/latex/contrib/hycolor/hycolor.dtx create mode 100644 macros/latex/contrib/hycolor/hycolor.pdf create mode 100644 macros/latex/contrib/intcalc/README.md create mode 100644 macros/latex/contrib/intcalc/intcalc.dtx create mode 100644 macros/latex/contrib/intcalc/intcalc.pdf create mode 100644 macros/latex/contrib/kvdefinekeys/README.md create mode 100644 macros/latex/contrib/kvdefinekeys/kvdefinekeys.dtx create mode 100644 macros/latex/contrib/kvdefinekeys/kvdefinekeys.pdf create mode 100644 macros/latex/contrib/kvsetkeys/README.md create mode 100644 macros/latex/contrib/kvsetkeys/kvsetkeys.dtx create mode 100644 macros/latex/contrib/kvsetkeys/kvsetkeys.pdf create mode 100644 macros/latex/contrib/ltxcmds/README.md create mode 100644 macros/latex/contrib/ltxcmds/ltxcmds.dtx create mode 100644 macros/latex/contrib/ltxcmds/ltxcmds.pdf delete mode 100644 macros/latex/contrib/oberdiek/alphalph.pdf delete mode 100644 macros/latex/contrib/oberdiek/bigintcalc.dtx delete mode 100644 macros/latex/contrib/oberdiek/bigintcalc.pdf delete mode 100644 macros/latex/contrib/oberdiek/bitset.pdf delete mode 100644 macros/latex/contrib/oberdiek/catchfile.pdf delete mode 100644 macros/latex/contrib/oberdiek/etexcmds.dtx delete mode 100644 macros/latex/contrib/oberdiek/etexcmds.pdf delete mode 100644 macros/latex/contrib/oberdiek/gettitlestring.dtx delete mode 100644 macros/latex/contrib/oberdiek/gettitlestring.pdf delete mode 100644 macros/latex/contrib/oberdiek/hycolor.dtx delete mode 100644 macros/latex/contrib/oberdiek/hycolor.pdf delete mode 100644 macros/latex/contrib/oberdiek/intcalc.dtx delete mode 100644 macros/latex/contrib/oberdiek/intcalc.pdf delete mode 100644 macros/latex/contrib/oberdiek/kvdefinekeys.dtx delete mode 100644 macros/latex/contrib/oberdiek/kvdefinekeys.pdf delete mode 100644 macros/latex/contrib/oberdiek/kvsetkeys.dtx delete mode 100644 macros/latex/contrib/oberdiek/kvsetkeys.pdf delete mode 100644 macros/latex/contrib/oberdiek/ltxcmds.dtx delete mode 100644 macros/latex/contrib/oberdiek/ltxcmds.pdf delete mode 100644 macros/latex/contrib/oberdiek/pdfescape.pdf delete mode 100644 macros/latex/contrib/oberdiek/picture.pdf delete mode 100644 macros/latex/contrib/oberdiek/refcount.dtx delete mode 100644 macros/latex/contrib/oberdiek/refcount.pdf delete mode 100644 macros/latex/contrib/oberdiek/selinput.pdf delete mode 100644 macros/latex/contrib/oberdiek/soulutf8.dtx delete mode 100644 macros/latex/contrib/oberdiek/soulutf8.pdf delete mode 100644 macros/latex/contrib/oberdiek/uniquecounter.dtx delete mode 100644 macros/latex/contrib/oberdiek/uniquecounter.pdf create mode 100644 macros/latex/contrib/refcount/README.md create mode 100644 macros/latex/contrib/refcount/refcount.dtx create mode 100644 macros/latex/contrib/refcount/refcount.pdf create mode 100644 macros/latex/contrib/soulutf8/README.md create mode 100644 macros/latex/contrib/soulutf8/soulutf8.dtx create mode 100644 macros/latex/contrib/soulutf8/soulutf8.pdf create mode 100644 macros/latex/contrib/uniquecounter/README.md create mode 100644 macros/latex/contrib/uniquecounter/uniquecounter.dtx create mode 100644 macros/latex/contrib/uniquecounter/uniquecounter.pdf (limited to 'macros/latex') diff --git a/macros/latex/contrib/auxhook/auxhook.dtx b/macros/latex/contrib/auxhook/auxhook.dtx index 29b45b5b9e..1235a89682 100644 --- a/macros/latex/contrib/auxhook/auxhook.dtx +++ b/macros/latex/contrib/auxhook/auxhook.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % % File: auxhook.dtx -% Version: 2019/12/15 v1.5 +% Version: 2019-12-17 v1.6 % Info: Hooks for auxiliary files % % Copyright (C) @@ -79,7 +79,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: auxhook 2019/12/15 v1.5 Hooks for auxiliary files (HO)} +\Msg{* Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)} \Msg{************************************************************************} \keepsilent @@ -91,7 +91,7 @@ This is a generated file. Project: auxhook -Version: 2019/12/15 v1.5 +Version: 2019-12-17 v1.6 Copyright (C) 2006, 2007, 2009, 2011 Heiko Oberdiek @@ -152,7 +152,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{auxhook.drv}% - [2019/12/15 v1.5 Hooks for auxiliary files (HO)]% + [2019-12-17 v1.6 Hooks for auxiliary files (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2011/11/22] \begin{document} @@ -166,7 +166,7 @@ and the derived files % \GetFileInfo{auxhook.drv} % % \title{The \xpackage{auxhook} package} -% \date{2019/12/15 v1.5} +% \date{2019-12-17 v1.6} % \author{Heiko Oberdiek\thanks % {Please report any issues at \url{https://github.com/ho-tex/auxhook/issues}}} % @@ -248,7 +248,7 @@ and the derived files %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{auxhook}% - [2019/12/15 v1.5 Hooks for auxiliary files (HO)]% + [2019-12-17 v1.6 Hooks for auxiliary files (HO)]% % \end{macrocode} % % \subsection{Hook setup} @@ -603,6 +603,9 @@ and the derived files % \item % Documentation updates. % \end{Version} +% \begin{Version}{2019-12-17 v1.6} +% \item Updated +% \end{Version} % \end{History} % % \PrintIndex diff --git a/macros/latex/contrib/auxhook/auxhook.pdf b/macros/latex/contrib/auxhook/auxhook.pdf index 80e71b83d4..67c5edf2c6 100644 Binary files a/macros/latex/contrib/auxhook/auxhook.pdf and b/macros/latex/contrib/auxhook/auxhook.pdf differ diff --git a/macros/latex/contrib/bigintcalc/README.md b/macros/latex/contrib/bigintcalc/README.md new file mode 100644 index 0000000000..f143f03b46 --- /dev/null +++ b/macros/latex/contrib/bigintcalc/README.md @@ -0,0 +1,9 @@ +# bigintcalc + +bigintcalc package for LaTeX + + +This package provides expandable arithmetic operations +with big integers that can exceed TeX's number limits. + + diff --git a/macros/latex/contrib/bigintcalc/bigintcalc.dtx b/macros/latex/contrib/bigintcalc/bigintcalc.dtx new file mode 100644 index 0000000000..6c0dd0f561 --- /dev/null +++ b/macros/latex/contrib/bigintcalc/bigintcalc.dtx @@ -0,0 +1,3561 @@ +% \iffalse meta-comment +% +% File: bigintcalc.dtx +% Version: 2019/12/15 v1.5 +% Info: Expandable calculations on big integers +% +% Copyright (C) +% 2007, 2011, 2012 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/bigintcalc/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/bigintcalc/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file 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/bigintcalc/bigintcalc.dtx +% CTAN:macros/latex/contrib/bigintcalc/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/bigintcalc/bigintcalc.sty +% TDS:doc/latex/bigintcalc/bigintcalc.pdf +% TDS:source/latex/bigintcalc/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: bigintcalc +Version: 2019/12/15 v1.5 + +Copyright (C) + 2007, 2011, 2012 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/bigintcalc/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/bigintcalc}% + \file{bigintcalc.sty}{\from{bigintcalc.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{* bigintcalc.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `bigintcalc.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{bigintcalc.drv}% + [2019/12/15 v1.5 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} +% +% \fi +% +% +% +% \GetFileInfo{bigintcalc.drv} +% +% \title{The \xpackage{bigintcalc} package} +% \date{2019/12/15 v1.5} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/bigintcalc/issues}}} +% +% \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=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 $xy$}\\ +% 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 $xy$} +% \end{cases} +% \end{gather*} +% These values can be distinguished by \cs{ifcase}: +%\begin{quote} +%\begin{verbatim} +%\ifcase\bigintcalcCmp{}{} +% $x=y$ +%\or +% $x>y$ +%\else +% $x +% \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}% + [2019/12/15 v1.5 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 + \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} +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{bigintcalc}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/bigintcalc/bigintcalc.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/bigintcalc/bigintcalc.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `bigintcalc' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/bigintcalc.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{bigintcalc.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip bigintcalc.tds.zip -d ~/texmf| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex 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/bigintcalc/bigintcalc.sty\\ +% bigintcalc.pdf & doc/latex/bigintcalc/bigintcalc.pdf\\ +% bigintcalc.dtx & source/latex/bigintcalc/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \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} +% \begin{Version}{2019/12/15 v1.5} +% \item +% Documentation updates. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/bigintcalc/bigintcalc.pdf b/macros/latex/contrib/bigintcalc/bigintcalc.pdf new file mode 100644 index 0000000000..d9527a5e42 Binary files /dev/null and b/macros/latex/contrib/bigintcalc/bigintcalc.pdf differ diff --git a/macros/latex/contrib/etexcmds/README.md b/macros/latex/contrib/etexcmds/README.md new file mode 100644 index 0000000000..866ab912e7 --- /dev/null +++ b/macros/latex/contrib/etexcmds/README.md @@ -0,0 +1,11 @@ +# etexcmds + +etexcmds package for LaTeX + + +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 \csunexpanded is provided as \etex@unexpanded. + + diff --git a/macros/latex/contrib/etexcmds/etexcmds.dtx b/macros/latex/contrib/etexcmds/etexcmds.dtx new file mode 100644 index 0000000000..2175ced8b0 --- /dev/null +++ b/macros/latex/contrib/etexcmds/etexcmds.dtx @@ -0,0 +1,731 @@ +% \iffalse meta-comment +% +% File: etexcmds.dtx +% Version: 2019/12/15 v1.7 +% Info: Avoid name clashes with e-TeX commands +% +% Copyright (C) +% 2007, 2010, 2011 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/etexcmds/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/etexcmds/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file 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/etexcmds/etexcmds.dtx +% CTAN:macros/latex/contrib/etexcmds/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/etexcmds/etexcmds.sty +% TDS:doc/latex/etexcmds/etexcmds.pdf +% TDS:source/latex/etexcmds/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: etexcmds +Version: 2019/12/15 v1.7 + +Copyright (C) + 2007, 2010, 2011 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/etexcmds/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/etexcmds}% + \file{etexcmds.sty}{\from{etexcmds.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{* etexcmds.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `etexcmds.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{etexcmds.drv}% + [2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{etexcmds.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{etexcmds.drv} +% +% \title{The \xpackage{etexcmds} package} +% \date{2019/12/15 v1.7} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/etexcmds/issues}}} +% +% \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}% + [2019/12/15 v1.7 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{iftex}[2019/11/07]% +\else + \RequirePackage{infwarerr}[2007/09/09]% + \RequirePackage{iftex}[2019/11/07]% +\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% +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{etexcmds}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/etexcmds/etexcmds.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/etexcmds/etexcmds.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `etexcmds' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/etexcmds.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{etexcmds.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip etexcmds.tds.zip -d ~/texmf| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex 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/etexcmds/etexcmds.sty\\ +% etexcmds.pdf & doc/latex/etexcmds/etexcmds.pdf\\ +% etexcmds.dtx & source/latex/etexcmds/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \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} +% \begin{Version}{2019/12/15 v1.7} +% \item +% Documentation updates. +% \item +% Use \xpackage{iftex} package. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/etexcmds/etexcmds.pdf b/macros/latex/contrib/etexcmds/etexcmds.pdf new file mode 100644 index 0000000000..69af64e6cf Binary files /dev/null and b/macros/latex/contrib/etexcmds/etexcmds.pdf differ diff --git a/macros/latex/contrib/fontsetup/system-install-fonts/MinionGreekSmallCaps.otf b/macros/latex/contrib/fontsetup/system-install-fonts/MinionGreekSmallCaps.otf deleted file mode 100644 index d6fb1d47de..0000000000 Binary files a/macros/latex/contrib/fontsetup/system-install-fonts/MinionGreekSmallCaps.otf and /dev/null differ diff --git a/macros/latex/contrib/fontsetup/system-install-fonts/PalatinoGreekSmallCaps.otf b/macros/latex/contrib/fontsetup/system-install-fonts/PalatinoGreekSmallCaps.otf deleted file mode 100644 index 716e2ae554..0000000000 Binary files a/macros/latex/contrib/fontsetup/system-install-fonts/PalatinoGreekSmallCaps.otf and /dev/null differ diff --git a/macros/latex/contrib/fontsetup/system-install-fonts/README-fonts.txt b/macros/latex/contrib/fontsetup/system-install-fonts/README-fonts.txt new file mode 100644 index 0000000000..8558ac3148 --- /dev/null +++ b/macros/latex/contrib/fontsetup/system-install-fonts/README-fonts.txt @@ -0,0 +1,13 @@ + + The directory ctan:/macros/latex/contrib/fontsetup/system-install-fonts/ + used to contain the fonts + MinionGreekSmallCaps.otf + and PalatinoGreekSmallCaps.otf + + These fonts have been temporarily removed because some doubt + has been cast on the copyright situation of some of the glyphs + in these fonts. + + They will be restored as soon as the situation has been clarified. + + Petra Rübe-Pugliese for the CTAN Team, 2019-12-17 diff --git a/macros/latex/contrib/gettitlestring/README.md b/macros/latex/contrib/gettitlestring/README.md new file mode 100644 index 0000000000..7586ee31c3 --- /dev/null +++ b/macros/latex/contrib/gettitlestring/README.md @@ -0,0 +1,10 @@ +# gettitlestring + +gettitlestring for LaTeX + +The LaTeX package addresses packages that are dealing with +references to titles (\section, \caption, ...). +The package tries to remove \label and other +commands from title strings. + + diff --git a/macros/latex/contrib/gettitlestring/gettitlestring.dtx b/macros/latex/contrib/gettitlestring/gettitlestring.dtx new file mode 100644 index 0000000000..a724d78612 --- /dev/null +++ b/macros/latex/contrib/gettitlestring/gettitlestring.dtx @@ -0,0 +1,812 @@ +% \iffalse meta-comment +% +% File: gettitlestring.dtx +% Version: 2019/12/15 v1.6 +% Info: Cleanup title references +% +% Copyright (C) +% 2009, 2010 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/gettitlestring/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/gettitlestring/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file 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/gettitlestring/gettitlestring.dtx +% CTAN:macros/latex/contrib/gettitlestring/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/gettitlestring/gettitlestring.sty +% TDS:doc/latex/gettitlestring/gettitlestring.pdf +% TDS:source/latex/gettitlestring/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: gettitlestring +Version: 2019/12/15 v1.6 + +Copyright (C) + 2009, 2010 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/gettitlestring/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/gettitlestring}% + \file{gettitlestring.sty}{\from{gettitlestring.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{* gettitlestring.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `gettitlestring.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{gettitlestring.drv}% + [2019/12/15 v1.6 Cleanup title references (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{gettitlestring.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{gettitlestring.drv} +% +% \title{The \xpackage{gettitlestring} package} +% \date{2019/12/15 v1.6} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/gettitlestring/issues}}} +% +% \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}% + [2019/12/15 v1.6 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% +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{gettitlestring}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/gettitlestring/gettitlestring.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/gettitlestring/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[\CTANinstall{install/macros/latex/contrib/gettitlestring.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). 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} +% +% \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/gettitlestring/gettitlestring.sty\\ +% gettitlestring.pdf & doc/latex/gettitlestring/gettitlestring.pdf\\ +% gettitlestring.dtx & source/latex/gettitlestring/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \begin{thebibliography}{9} +% +% \bibitem{memoir} +% Peter Wilson, Lars Madsen: +% \textit{The Memoir Class}; +% 2009/11/17 v1.61803398c; +% \CTANpkg{memoir} +% +% \bibitem{titleref} +% Donald Arsenau: +% \textit{Titleref.sty}; +% 2001/04/05 ver 3.1; +% \CTANpkg{titleref} +% +% \bibitem{zref} +% Heiko Oberdiek: +% \textit{The \xpackage{zref} package}; +% 2009/12/08 v2.7; +% \CTANpkg{zref} +% +% \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} +% \begin{Version}{2019/12/15 v1.6} +% \item +% Documentation updates. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/gettitlestring/gettitlestring.pdf b/macros/latex/contrib/gettitlestring/gettitlestring.pdf new file mode 100644 index 0000000000..a17d2bb615 Binary files /dev/null and b/macros/latex/contrib/gettitlestring/gettitlestring.pdf differ diff --git a/macros/latex/contrib/hycolor/README.md b/macros/latex/contrib/hycolor/README.md new file mode 100644 index 0000000000..aa2bfcf60f --- /dev/null +++ b/macros/latex/contrib/hycolor/README.md @@ -0,0 +1,10 @@ +# hycolor + +hycolor package for LaTeX + + +Package hycolor implements the color option stuff that +is used by packages hyperref and bookmark. +It is not intended as package for the user. + + diff --git a/macros/latex/contrib/hycolor/hycolor.dtx b/macros/latex/contrib/hycolor/hycolor.dtx new file mode 100644 index 0000000000..8282fb0547 --- /dev/null +++ b/macros/latex/contrib/hycolor/hycolor.dtx @@ -0,0 +1,1616 @@ +% \iffalse meta-comment +% +% File: hycolor.dtx +% Version: 2019/12/15 v1.9 +% Info: Color options for hyperref/bookmark +% +% Copyright (C) +% 2007-2011 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/hycolor/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/hycolor/issues +% +% 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 +% +% Distribution: +% CTAN:macros/latex/contrib/hycolor/hycolor.dtx +% CTAN:macros/latex/contrib/hycolor/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/hycolor/hycolor.sty +% TDS:tex/latex/hycolor/xcolor-patch.sty +% TDS:doc/latex/hycolor/hycolor.pdf +% TDS:source/latex/hycolor/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: hycolor 2019/12/15 v1.9 Color options for hyperref/bookmark (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: hycolor +Version: 2019/12/15 v1.9 + +Copyright (C) + 2007-2011 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/hycolor/issues + + +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 + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{hycolor.ins}{\from{hycolor.dtx}{install}}% + \file{hycolor.drv}{\from{hycolor.dtx}{driver}}% + \usedir{tex/latex/hycolor}% + \file{hycolor.sty}{\from{hycolor.dtx}{package}}% + \file{xcolor-patch.sty}{\from{hycolor.dtx}{xcolor}}% +} + +\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 +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{hycolor.drv}% + [2019/12/15 v1.9 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} +% +% \fi +% +% +% +% \GetFileInfo{hycolor.drv} +% +% \title{The \xpackage{hycolor} package} +% \date{2019/12/15 v1.9} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/hycolor/issues}}} +% +% \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}% + [2019/12/15 v1.9 Color options for hyperref/bookmark (HO)]% +% \end{macrocode} +% +% \begin{macrocode} +\RequirePackage{xcolor-patch}[2019/12/15] +% \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} +% +% \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}[2019/12/15 xcolor patch] +% \end{macrocode} +% \begin{macrocode} +\RequirePackage{hopatch} +\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} +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{hycolor}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/hycolor/hycolor.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/hycolor/hycolor.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `hycolor' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/hycolor.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{hycolor.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip hycolor.tds.zip -d ~/texmf| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex 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/hycolor/hycolor.sty\\ +% xcolor-patch.sty & tex/latex/hycolor/xcolor-patch.sty\\ +% hycolor.pdf & doc/latex/hycolor/hycolor.pdf\\ +% hycolor.dtx & source/latex/hycolor/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \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} +% \begin{Version}{2019/12/15 v1.9} +% \item +% Documentation updates. +% \item +% Do not load \xpackage{xcolor-patch} by default. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/hycolor/hycolor.pdf b/macros/latex/contrib/hycolor/hycolor.pdf new file mode 100644 index 0000000000..f2c73d016f Binary files /dev/null and b/macros/latex/contrib/hycolor/hycolor.pdf differ diff --git a/macros/latex/contrib/intcalc/README.md b/macros/latex/contrib/intcalc/README.md new file mode 100644 index 0000000000..fb7396b29b --- /dev/null +++ b/macros/latex/contrib/intcalc/README.md @@ -0,0 +1,7 @@ +# intcalc + +intcalc package for LaTeX + +This package provides expandable arithmetic operations +with integers. + diff --git a/macros/latex/contrib/intcalc/intcalc.dtx b/macros/latex/contrib/intcalc/intcalc.dtx new file mode 100644 index 0000000000..fec737844c --- /dev/null +++ b/macros/latex/contrib/intcalc/intcalc.dtx @@ -0,0 +1,3286 @@ +% \iffalse meta-comment +% +% File: intcalc.dtx +% Version: 2019/12/15 v1.3 +% Info: Expandable calculations with integers +% +% Copyright (C) +% 2007 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/intcalc/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/intcalc/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file 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/intcalc/intcalc.dtx +% CTAN:macros/latex/contrib/intcalc/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/intcalc/intcalc.sty +% TDS:doc/latex/intcalc/intcalc.pdf +% TDS:source/latex/intcalc/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: intcalc +Version: 2019/12/15 v1.3 + +Copyright (C) + 2007 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/intcalc/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/intcalc}% + \file{intcalc.sty}{\from{intcalc.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{* intcalc.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `intcalc.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{intcalc.drv}% + [2019/12/15 v1.3 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} +% +% \fi +% +% +% +% \GetFileInfo{intcalc.drv} +% +% \title{The \xpackage{intcalc} package} +% \date{2019/12/15 v1.3} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/intcalc/issues}}} +% +% \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=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 $xy$}\\ +% 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 $xy$} +% \end{cases} +% \end{gather*} +% These values can be distinguished by \cs{ifcase}: +%\begin{quote} +%\begin{verbatim} +%\ifcase\intcalcCmp{}{} +% $x=y$ +%\or +% $x>y$ +%\else +% $x +% \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}% + [2019/12/15 v1.3 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} +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{intcalc}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/intcalc/intcalc.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/intcalc/intcalc.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `intcalc' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/intcalc.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{intcalc.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip intcalc.tds.zip -d ~/texmf| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex 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/intcalc/intcalc.sty\\ +% intcalc.pdf & doc/latex/intcalc/intcalc.pdf\\ +% intcalc.dtx & source/latex/intcalc/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \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} +% \begin{Version}{2019/12/15 v1.3} +% \item +% Documentation updates. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/intcalc/intcalc.pdf b/macros/latex/contrib/intcalc/intcalc.pdf new file mode 100644 index 0000000000..17092fd12f Binary files /dev/null and b/macros/latex/contrib/intcalc/intcalc.pdf differ diff --git a/macros/latex/contrib/kvdefinekeys/README.md b/macros/latex/contrib/kvdefinekeys/README.md new file mode 100644 index 0000000000..6909f3d488 --- /dev/null +++ b/macros/latex/contrib/kvdefinekeys/README.md @@ -0,0 +1,9 @@ +# kvdefinekeys + +kvdefinekeys package for LaTeX + + +Package kvdefinekeys provides \kv@define@key to define +keys the same way as keyval's \define@key. However, it +works also using iniTeX. + diff --git a/macros/latex/contrib/kvdefinekeys/kvdefinekeys.dtx b/macros/latex/contrib/kvdefinekeys/kvdefinekeys.dtx new file mode 100644 index 0000000000..11810e3324 --- /dev/null +++ b/macros/latex/contrib/kvdefinekeys/kvdefinekeys.dtx @@ -0,0 +1,612 @@ +% \iffalse meta-comment +% +% File: kvdefinekeys.dtx +% Version: 2019/12/15 v1.5 +% Info: Define keys +% +% Copyright (C) +% 2010, 2011 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/kvdefinekeys/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/kvdefinekeys/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file kvdefinekeys.dtx +% and the derived files +% kvdefinekeys.sty, kvdefinekeys.pdf, kvdefinekeys.ins, kvdefinekeys.drv, +% kvdefinekeys-test1.tex. +% +% Distribution: +% CTAN:macros/latex/contrib/kvdefinekeys/kvdefinekeys.dtx +% CTAN:macros/latex/contrib/kvdefinekeys/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/kvdefinekeys/kvdefinekeys.sty +% TDS:doc/latex/kvdefinekeys/kvdefinekeys.pdf +% TDS:source/latex/kvdefinekeys/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: kvdefinekeys 2019/12/15 v1.5 Define keys (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: kvdefinekeys +Version: 2019/12/15 v1.5 + +Copyright (C) + 2010, 2011 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/kvdefinekeys/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/kvdefinekeys}% + \file{kvdefinekeys.sty}{\from{kvdefinekeys.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{* kvdefinekeys.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `kvdefinekeys.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{kvdefinekeys.drv}% + [2019/12/15 v1.5 Define keys (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{kvdefinekeys.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{kvdefinekeys.drv} +% +% \title{The \xpackage{kvdefinekeys} package} +% \date{2019/12/15 v1.5} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/kvdefinekeys/issues}}} +% +% \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}% + [2019/12/15 v1.5 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]% + \let\@ifundefined\ltx@IfUndefined + \let\@ifnextchar\ltx@ifnextchar + \long\def\@firstoftwo#1#2{#1} + \long\def\@secondoftwo#1#2{#2} +\else +\fi +% \end{macrocode} +% +% +% \subsection{Provide key defining macro} +% +% \begin{macro}{\kv@define@key} +% \begin{macrocode} +\@ifundefined{protected}{% + \@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{% + \@ifnextchar[\@firstoftwo\@secondoftwo{% + \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% +% +% \end{macrocode} +% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{kvdefinekeys}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/kvdefinekeys/kvdefinekeys.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/kvdefinekeys/kvdefinekeys.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `kvdefinekeys' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/kvdefinekeys.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{kvdefinekeys.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip kvdefinekeys.tds.zip -d ~/texmf| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex 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/kvdefinekeys/kvdefinekeys.sty\\ +% kvdefinekeys.pdf & doc/latex/kvdefinekeys/kvdefinekeys.pdf\\ +% kvdefinekeys.dtx & source/latex/kvdefinekeys/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \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} +% \begin{Version}{2019/12/15 v1.5} +% \item +% Documentation updates. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/kvdefinekeys/kvdefinekeys.pdf b/macros/latex/contrib/kvdefinekeys/kvdefinekeys.pdf new file mode 100644 index 0000000000..5006be590c Binary files /dev/null and b/macros/latex/contrib/kvdefinekeys/kvdefinekeys.pdf differ diff --git a/macros/latex/contrib/kvsetkeys/README.md b/macros/latex/contrib/kvsetkeys/README.md new file mode 100644 index 0000000000..a7e822fa0f --- /dev/null +++ b/macros/latex/contrib/kvsetkeys/README.md @@ -0,0 +1,11 @@ +# kvsetkeys + +kvsetkeys package for LaTeX + + +Package kvsetkeys provides kvsetkeys, a variant +of package 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 babel's shorthands) and +only one level of curly braces is removed from the values. + diff --git a/macros/latex/contrib/kvsetkeys/kvsetkeys.dtx b/macros/latex/contrib/kvsetkeys/kvsetkeys.dtx new file mode 100644 index 0000000000..c04507c297 --- /dev/null +++ b/macros/latex/contrib/kvsetkeys/kvsetkeys.dtx @@ -0,0 +1,1676 @@ +% \iffalse meta-comment +% +% File: kvsetkeys.dtx +% Version: 2019/12/15 v1.18 +% Info: Key value parser +% +% Copyright (C) +% 2006, 2007, 2009-2012 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/kvsetkeys/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/kvsetkeys/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file 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/kvsetkeys/kvsetkeys.dtx +% CTAN:macros/latex/contrib/kvsetkeys/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/kvsetkeys/kvsetkeys.sty +% TDS:doc/latex/kvsetkeys/kvsetkeys.pdf +% TDS:doc/latex/kvsetkeys/kvsetkeys-example.tex +% TDS:source/latex/kvsetkeys/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: kvsetkeys +Version: 2019/12/15 v1.18 + +Copyright (C) + 2006, 2007, 2009-2012 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/kvsetkeys/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/kvsetkeys}% + \file{kvsetkeys.sty}{\from{kvsetkeys.dtx}{package}}% + \usedir{doc/latex/kvsetkeys}% + \file{kvsetkeys-example.tex}{\from{kvsetkeys.dtx}{example}}% +} + +\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 +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{kvsetkeys.drv}% + [2019/12/15 v1.18 Key value parser (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{kvsetkeys.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{kvsetkeys.drv} +% +% \title{The \xpackage{kvsetkeys} package} +% \date{2019/12/15 v1.18} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/kvsetkeys/issues}}} +% +% \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 2019/12/15 v1.18 \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 2019/12/15 v1.18 \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} +% +% \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}% + [2019/12/15 v1.18 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]% + \let\PackageError\@PackageError +\else +\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} +\ifx\numexpr\@undefined + \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{\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{\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 +& \unexpanded{#1},% +& \fi +& \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% +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{kvsetkeys}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/kvsetkeys/kvsetkeys.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/kvsetkeys/kvsetkeys.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `kvsetkeys' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/kvsetkeys.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{kvsetkeys.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip kvsetkeys.tds.zip -d ~/texmf| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex 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/kvsetkeys/kvsetkeys.sty\\ +% kvsetkeys.pdf & doc/latex/kvsetkeys/kvsetkeys.pdf\\ +% kvsetkeys-example.tex & doc/latex/kvsetkeys/kvsetkeys-example.tex\\ +% kvsetkeys.dtx & source/latex/kvsetkeys/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \begin{thebibliography}{9} +% \bibitem{tb94wright} +% A guide to key-value methods, Joseph Wright, second draft for +% \href{https://www.tug.org/tugboat}{TUGBoat}, 2009-03-17. +% \url{https://www.texdev.net/uploads/2009/03/keyval.pdf} +% +% \bibitem{keyval} +% David Carlisle: +% \textit{The \xpackage{keyval} package}; +% 1999/03/16 v1.13; +% \CTANpkg{keyval}. +% +% \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} +% \begin{Version}{2019/12/15 v1.18} +% \item +% Documentation updates. +% \item +% Avoid \xpackage{etexcmds} and \xpackage{infwarwerr} in \LaTeX. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/kvsetkeys/kvsetkeys.pdf b/macros/latex/contrib/kvsetkeys/kvsetkeys.pdf new file mode 100644 index 0000000000..7d4a72c04f Binary files /dev/null and b/macros/latex/contrib/kvsetkeys/kvsetkeys.pdf differ diff --git a/macros/latex/contrib/ltxcmds/README.md b/macros/latex/contrib/ltxcmds/README.md new file mode 100644 index 0000000000..9cc3a34e32 --- /dev/null +++ b/macros/latex/contrib/ltxcmds/README.md @@ -0,0 +1,10 @@ +# ltxcmds + +ltxcmds package for latex + + + +The package ltxcmds exports some utility macros +from the LaTeX kernel into a separate namespace and +also provides them for other formats such as plain-TeX. + diff --git a/macros/latex/contrib/ltxcmds/ltxcmds.dtx b/macros/latex/contrib/ltxcmds/ltxcmds.dtx new file mode 100644 index 0000000000..f9169a21db --- /dev/null +++ b/macros/latex/contrib/ltxcmds/ltxcmds.dtx @@ -0,0 +1,2425 @@ +% \iffalse meta-comment +% +% File: ltxcmds.dtx +% Version: 2019/12/15 v1.24 +% Info: LaTeX kernel commands for general use +% +% Copyright (C) +% 2009-2011 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/ltxcmds/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/ltxcmds/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file 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/ltxcmds/ltxcmds.dtx +% CTAN:macros/latex/contrib/ltxcmds/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/ltxcmds/ltxcmds.sty +% TDS:doc/latex/ltxcmds/ltxcmds.pdf +% TDS:source/latex/ltxcmds/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: ltxcmds 2019/12/15 v1.24 LaTeX kernel commands for general use (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: ltxcmds +Version: 2019/12/15 v1.24 + +Copyright (C) + 2009-2011 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/ltxcmds/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/ltxcmds}% + \file{ltxcmds.sty}{\from{ltxcmds.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{* ltxcmds.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `ltxcmds.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{ltxcmds.drv}% + [2019/12/15 v1.24 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} +% +% \fi +% +% +% +% \GetFileInfo{ltxcmds.drv} +% +% \title{The \xpackage{ltxcmds} package} +% \date{2019/12/15 v1.24} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/ltxcmds/issues}}} +% +% \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 2019/12/15 v1.24: +% \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}% + [2019/12/15 v1.24 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% +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{ltxcmds}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/ltxcmds/ltxcmds.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/ltxcmds/ltxcmds.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `ltxcmds' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/ltxcmds.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{ltxcmds.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip ltxcmds.tds.zip -d ~/texmf| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex 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/ltxcmds/ltxcmds.sty\\ +% ltxcmds.pdf & doc/latex/ltxcmds/ltxcmds.pdf\\ +% ltxcmds.dtx & source/latex/ltxcmds/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \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{https://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{https://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{https://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{https://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{https://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{https://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{https://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{https://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{https://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} +% \begin{Version}{2019/12/15 v1.24} +% \item +% Documentation updates. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/ltxcmds/ltxcmds.pdf b/macros/latex/contrib/ltxcmds/ltxcmds.pdf new file mode 100644 index 0000000000..dc3eabc9e7 Binary files /dev/null and b/macros/latex/contrib/ltxcmds/ltxcmds.pdf differ diff --git a/macros/latex/contrib/oberdiek/README.txt b/macros/latex/contrib/oberdiek/README.txt index 1a01bea365..b5fb9d51e3 100644 --- a/macros/latex/contrib/oberdiek/README.txt +++ b/macros/latex/contrib/oberdiek/README.txt @@ -1,4 +1,4 @@ -README 2019/12/09 +README 2019/12/15 This file describes the directory CTAN:macros/latex/contrib/oberdiek/ diff --git a/macros/latex/contrib/oberdiek/aliascnt.pdf b/macros/latex/contrib/oberdiek/aliascnt.pdf index 2710d52efd..a40b98bd76 100644 Binary files a/macros/latex/contrib/oberdiek/aliascnt.pdf and b/macros/latex/contrib/oberdiek/aliascnt.pdf differ diff --git a/macros/latex/contrib/oberdiek/alphalph.pdf b/macros/latex/contrib/oberdiek/alphalph.pdf deleted file mode 100644 index 91dc509bc1..0000000000 Binary files a/macros/latex/contrib/oberdiek/alphalph.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/bigintcalc.dtx b/macros/latex/contrib/oberdiek/bigintcalc.dtx deleted file mode 100644 index 40fa56ed1d..0000000000 --- a/macros/latex/contrib/oberdiek/bigintcalc.dtx +++ /dev/null @@ -1,3561 +0,0 @@ -% \iffalse meta-comment -% -% File: bigintcalc.dtx -% Version: 2016/05/16 v1.4 -% Info: Expandable calculations on big integers -% -% Copyright (C) -% 2007, 2011, 2012 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{bigintcalc.drv} -% -% \title{The \xpackage{bigintcalc} package} -% \date{2016/05/16 v1.4} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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=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 $xy$}\\ -% 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 $xy$} -% \end{cases} -% \end{gather*} -% These values can be distinguished by \cs{ifcase}: -%\begin{quote} -%\begin{verbatim} -%\ifcase\bigintcalcCmp{}{} -% $x=y$ -%\or -% $x>y$ -%\else -% $x -% \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 - \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} -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \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 deleted file mode 100644 index a1a19b5c49..0000000000 Binary files a/macros/latex/contrib/oberdiek/bigintcalc.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/bitset.pdf b/macros/latex/contrib/oberdiek/bitset.pdf deleted file mode 100644 index 297aada2e4..0000000000 Binary files a/macros/latex/contrib/oberdiek/bitset.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/bmpsize.pdf b/macros/latex/contrib/oberdiek/bmpsize.pdf index e18c07f58d..1463b4f0c5 100644 Binary files a/macros/latex/contrib/oberdiek/bmpsize.pdf and b/macros/latex/contrib/oberdiek/bmpsize.pdf differ diff --git a/macros/latex/contrib/oberdiek/catchfile.pdf b/macros/latex/contrib/oberdiek/catchfile.pdf deleted file mode 100644 index 1b11040757..0000000000 Binary files a/macros/latex/contrib/oberdiek/catchfile.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/centernot.pdf b/macros/latex/contrib/oberdiek/centernot.pdf index e81a9f1694..cb0e956e73 100644 Binary files a/macros/latex/contrib/oberdiek/centernot.pdf and b/macros/latex/contrib/oberdiek/centernot.pdf differ diff --git a/macros/latex/contrib/oberdiek/chemarr.pdf b/macros/latex/contrib/oberdiek/chemarr.pdf index 172148fcee..fed6fccba9 100644 Binary files a/macros/latex/contrib/oberdiek/chemarr.pdf and b/macros/latex/contrib/oberdiek/chemarr.pdf differ diff --git a/macros/latex/contrib/oberdiek/classlist.pdf b/macros/latex/contrib/oberdiek/classlist.pdf index ecca7ecf83..659c2f2d31 100644 Binary files a/macros/latex/contrib/oberdiek/classlist.pdf and b/macros/latex/contrib/oberdiek/classlist.pdf differ diff --git a/macros/latex/contrib/oberdiek/colonequals.pdf b/macros/latex/contrib/oberdiek/colonequals.pdf index e10037aed6..a4f1d51687 100644 Binary files a/macros/latex/contrib/oberdiek/colonequals.pdf and b/macros/latex/contrib/oberdiek/colonequals.pdf differ diff --git a/macros/latex/contrib/oberdiek/dvipscol.pdf b/macros/latex/contrib/oberdiek/dvipscol.pdf index 9bb4fbc40b..744a511eb2 100644 Binary files a/macros/latex/contrib/oberdiek/dvipscol.pdf and b/macros/latex/contrib/oberdiek/dvipscol.pdf differ diff --git a/macros/latex/contrib/oberdiek/engord.pdf b/macros/latex/contrib/oberdiek/engord.pdf index 8eeae27be3..785f67e11c 100644 Binary files a/macros/latex/contrib/oberdiek/engord.pdf and b/macros/latex/contrib/oberdiek/engord.pdf differ diff --git a/macros/latex/contrib/oberdiek/enparen.pdf b/macros/latex/contrib/oberdiek/enparen.pdf index 35289c7891..98574b2b3d 100644 Binary files a/macros/latex/contrib/oberdiek/enparen.pdf and b/macros/latex/contrib/oberdiek/enparen.pdf differ diff --git a/macros/latex/contrib/oberdiek/eolgrab.pdf b/macros/latex/contrib/oberdiek/eolgrab.pdf index 821556a722..2291a3681d 100644 Binary files a/macros/latex/contrib/oberdiek/eolgrab.pdf and b/macros/latex/contrib/oberdiek/eolgrab.pdf differ diff --git a/macros/latex/contrib/oberdiek/etexcmds.dtx b/macros/latex/contrib/oberdiek/etexcmds.dtx deleted file mode 100644 index 236169a3af..0000000000 --- a/macros/latex/contrib/oberdiek/etexcmds.dtx +++ /dev/null @@ -1,730 +0,0 @@ -% \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 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{etexcmds.drv} -% -% \title{The \xpackage{etexcmds} package} -% \date{2016/05/16 v1.6} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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% -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \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 deleted file mode 100644 index eb9473f910..0000000000 Binary files a/macros/latex/contrib/oberdiek/etexcmds.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/fibnum.pdf b/macros/latex/contrib/oberdiek/fibnum.pdf index f8c79dad83..e0cec4c380 100644 Binary files a/macros/latex/contrib/oberdiek/fibnum.pdf and b/macros/latex/contrib/oberdiek/fibnum.pdf differ diff --git a/macros/latex/contrib/oberdiek/flags.pdf b/macros/latex/contrib/oberdiek/flags.pdf index 9f83f6937e..9d3060952b 100644 Binary files a/macros/latex/contrib/oberdiek/flags.pdf and b/macros/latex/contrib/oberdiek/flags.pdf differ diff --git a/macros/latex/contrib/oberdiek/gettitlestring.dtx b/macros/latex/contrib/oberdiek/gettitlestring.dtx deleted file mode 100644 index 724ed7fecc..0000000000 --- a/macros/latex/contrib/oberdiek/gettitlestring.dtx +++ /dev/null @@ -1,811 +0,0 @@ -% \iffalse meta-comment -% -% File: gettitlestring.dtx -% Version: 2016/05/16 v1.5 -% Info: Cleanup title references -% -% Copyright (C) -% 2009, 2010 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{gettitlestring.drv} -% -% \title{The \xpackage{gettitlestring} package} -% \date{2016/05/16 v1.5} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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% -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \begin{thebibliography}{9} -% -% \bibitem{memoir} -% Peter Wilson, Lars Madsen: -% \textit{The Memoir Class}; -% 2009/11/17 v1.61803398c; -% \CTANpkg{memoir} -% -% \bibitem{titleref} -% Donald Arsenau: -% \textit{Titleref.sty}; -% 2001/04/05 ver 3.1; -% \CTANpkg{titleref} -% -% \bibitem{zref} -% Heiko Oberdiek: -% \textit{The \xpackage{zref} package}; -% 2009/12/08 v2.7; -% \CTANpkg{zref} -% -% \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 deleted file mode 100644 index dfaf666d88..0000000000 Binary files a/macros/latex/contrib/oberdiek/gettitlestring.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/holtxdoc.pdf b/macros/latex/contrib/oberdiek/holtxdoc.pdf index a21413b359..2aaf208267 100644 Binary files a/macros/latex/contrib/oberdiek/holtxdoc.pdf and b/macros/latex/contrib/oberdiek/holtxdoc.pdf differ diff --git a/macros/latex/contrib/oberdiek/hopatch.pdf b/macros/latex/contrib/oberdiek/hopatch.pdf index 8dc4c73267..d18e0e5b4a 100644 Binary files a/macros/latex/contrib/oberdiek/hopatch.pdf and b/macros/latex/contrib/oberdiek/hopatch.pdf differ diff --git a/macros/latex/contrib/oberdiek/hycolor.dtx b/macros/latex/contrib/oberdiek/hycolor.dtx deleted file mode 100644 index d55a709153..0000000000 --- a/macros/latex/contrib/oberdiek/hycolor.dtx +++ /dev/null @@ -1,1624 +0,0 @@ -% \iffalse meta-comment -% -% File: hycolor.dtx -% Version: 2016/05/16 v1.8 -% Info: Color options for hyperref/bookmark -% -% Copyright (C) -% 2007-2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work consists of the main source file 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -This work consists of the main source file 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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{hycolor.drv} -% -% \title{The \xpackage{hycolor} package} -% \date{2016/05/16 v1.8} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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} -% -% \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} -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \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 deleted file mode 100644 index b608d36b0e..0000000000 Binary files a/macros/latex/contrib/oberdiek/hycolor.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/hypbmsec.pdf b/macros/latex/contrib/oberdiek/hypbmsec.pdf index 74f70c400e..ed31889a28 100644 Binary files a/macros/latex/contrib/oberdiek/hypbmsec.pdf and b/macros/latex/contrib/oberdiek/hypbmsec.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypcap.pdf b/macros/latex/contrib/oberdiek/hypcap.pdf index 68c34af72f..0a7600a791 100644 Binary files a/macros/latex/contrib/oberdiek/hypcap.pdf and b/macros/latex/contrib/oberdiek/hypcap.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypdestopt.pdf b/macros/latex/contrib/oberdiek/hypdestopt.pdf index fa890946b1..03af206eb9 100644 Binary files a/macros/latex/contrib/oberdiek/hypdestopt.pdf and b/macros/latex/contrib/oberdiek/hypdestopt.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypdoc.pdf b/macros/latex/contrib/oberdiek/hypdoc.pdf index 0ce0880828..4e86928175 100644 Binary files a/macros/latex/contrib/oberdiek/hypdoc.pdf and b/macros/latex/contrib/oberdiek/hypdoc.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypgotoe.pdf b/macros/latex/contrib/oberdiek/hypgotoe.pdf index 28a110e643..9de9b30ab4 100644 Binary files a/macros/latex/contrib/oberdiek/hypgotoe.pdf and b/macros/latex/contrib/oberdiek/hypgotoe.pdf differ diff --git a/macros/latex/contrib/oberdiek/hyphsubst.pdf b/macros/latex/contrib/oberdiek/hyphsubst.pdf index c158c7221e..ecd41340e9 100644 Binary files a/macros/latex/contrib/oberdiek/hyphsubst.pdf and b/macros/latex/contrib/oberdiek/hyphsubst.pdf differ diff --git a/macros/latex/contrib/oberdiek/ifdraft.pdf b/macros/latex/contrib/oberdiek/ifdraft.pdf index 1f35b1f8c9..76c7db5032 100644 Binary files a/macros/latex/contrib/oberdiek/ifdraft.pdf and b/macros/latex/contrib/oberdiek/ifdraft.pdf differ diff --git a/macros/latex/contrib/oberdiek/iflang.pdf b/macros/latex/contrib/oberdiek/iflang.pdf index 4ca258cfed..ab0c138b60 100644 Binary files a/macros/latex/contrib/oberdiek/iflang.pdf and b/macros/latex/contrib/oberdiek/iflang.pdf differ diff --git a/macros/latex/contrib/oberdiek/intcalc.dtx b/macros/latex/contrib/oberdiek/intcalc.dtx deleted file mode 100644 index 245cc21812..0000000000 --- a/macros/latex/contrib/oberdiek/intcalc.dtx +++ /dev/null @@ -1,3287 +0,0 @@ -% \iffalse meta-comment -% -% File: intcalc.dtx -% Version: 2016/05/16 v1.2 -% Info: Expandable calculations with integers -% -% Copyright (C) -% 2007 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{intcalc.drv} -% -% \title{The \xpackage{intcalc} package} -% \date{2016/05/16 v1.2} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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=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 $xy$}\\ -% 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 $xy$} -% \end{cases} -% \end{gather*} -% These values can be distinguished by \cs{ifcase}: -%\begin{quote} -%\begin{verbatim} -%\ifcase\intcalcCmp{}{} -% $x=y$ -%\or -% $x>y$ -%\else -% $x -% \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} -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \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 deleted file mode 100644 index 7a28f6ffb1..0000000000 Binary files a/macros/latex/contrib/oberdiek/intcalc.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/kvdefinekeys.dtx b/macros/latex/contrib/oberdiek/kvdefinekeys.dtx deleted file mode 100644 index 3b864fc73b..0000000000 --- a/macros/latex/contrib/oberdiek/kvdefinekeys.dtx +++ /dev/null @@ -1,607 +0,0 @@ -% \iffalse meta-comment -% -% File: kvdefinekeys.dtx -% Version: 2016/05/16 v1.4 -% Info: Define keys -% -% Copyright (C) -% 2010, 2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{kvdefinekeys.drv} -% -% \title{The \xpackage{kvdefinekeys} package} -% \date{2016/05/16 v1.4} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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% -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \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 deleted file mode 100644 index 810c2fbebc..0000000000 Binary files a/macros/latex/contrib/oberdiek/kvdefinekeys.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/kvsetkeys.dtx b/macros/latex/contrib/oberdiek/kvsetkeys.dtx deleted file mode 100644 index 7bbd4fe568..0000000000 --- a/macros/latex/contrib/oberdiek/kvsetkeys.dtx +++ /dev/null @@ -1,1686 +0,0 @@ -% \iffalse meta-comment -% -% File: kvsetkeys.dtx -% Version: 2016/05/16 v1.17 -% Info: Key value parser -% -% Copyright (C) -% 2006, 2007, 2009-2012 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{kvsetkeys.drv} -% -% \title{The \xpackage{kvsetkeys} package} -% \date{2016/05/16 v1.17} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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} -% -% \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% -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \begin{thebibliography}{9} -% \bibitem{tb94wright} -% A guide to key-value methods, Joseph Wright, second draft for -% \href{https://www.tug.org/tugboat}{TUGBoat}, 2009-03-17. -% \url{https://www.texdev.net/uploads/2009/03/keyval.pdf} -% -% \bibitem{keyval} -% David Carlisle: -% \textit{The \xpackage{keyval} package}; -% 1999/03/16 v1.13; -% \CTANpkg{keyval}. -% -% \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 deleted file mode 100644 index 71e0f55877..0000000000 Binary files a/macros/latex/contrib/oberdiek/kvsetkeys.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/ltxcmds.dtx b/macros/latex/contrib/oberdiek/ltxcmds.dtx deleted file mode 100644 index 7de6b53dfe..0000000000 --- a/macros/latex/contrib/oberdiek/ltxcmds.dtx +++ /dev/null @@ -1,2429 +0,0 @@ -% \iffalse meta-comment -% -% File: ltxcmds.dtx -% Version: 2016/05/16 v1.23 -% Info: LaTeX kernel commands for general use -% -% Copyright (C) -% 2009-2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{ltxcmds.drv} -% -% \title{The \xpackage{ltxcmds} package} -% \date{2016/05/16 v1.23} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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% -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \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{https://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{https://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{https://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{https://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{https://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{https://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{https://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{https://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{https://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 deleted file mode 100644 index 9efe9c4031..0000000000 Binary files a/macros/latex/contrib/oberdiek/ltxcmds.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/oberdiek-bundle.bib b/macros/latex/contrib/oberdiek/oberdiek-bundle.bib index c08ab94024..1062c31745 100644 --- a/macros/latex/contrib/oberdiek/oberdiek-bundle.bib +++ b/macros/latex/contrib/oberdiek/oberdiek-bundle.bib @@ -5,20 +5,6 @@ version={1.5}, url={https://ctan.org/pkg/aliascnt}, } -@manual{oberdiek:auxhook, - title={The auxhook package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.4}, - url={https://ctan.org/pkg/auxhook}, -} -@manual{oberdiek:bigintcalc, - title={The bigintcalc package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.4}, - url={https://ctan.org/pkg/bigintcalc}, -} @manual{oberdiek:bmpsize, title={The bmpsize package}, author={Heiko Oberdiek}, @@ -82,13 +68,6 @@ version={1.1}, url={https://ctan.org/pkg/eolgrab}, } -@manual{oberdiek:etexcmds, - title={The etexcmds package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.6}, - url={https://ctan.org/pkg/etexcmds}, -} @manual{oberdiek:fibnum, title={The fibnum package}, author={Heiko Oberdiek}, @@ -103,13 +82,6 @@ version={0.5}, url={https://ctan.org/pkg/flags}, } -@manual{oberdiek:gettitlestring, - title={The gettitlestring package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.5}, - url={https://ctan.org/pkg/gettitlestring}, -} @manual{oberdiek:holtxdoc, title={The holtxdoc package}, author={Heiko Oberdiek}, @@ -124,13 +96,6 @@ version={1.3}, url={https://ctan.org/pkg/hopatch}, } -@manual{oberdiek:hycolor, - title={The hycolor package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.8}, - url={https://ctan.org/pkg/hycolor}, -} @manual{oberdiek:hypbmsec, title={The hypbmsec package}, author={Heiko Oberdiek}, @@ -187,34 +152,6 @@ version={1.7}, url={https://ctan.org/pkg/iflang}, } -@manual{oberdiek:intcalc, - title={The intcalc package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.2}, - url={https://ctan.org/pkg/intcalc}, -} -@manual{oberdiek:kvdefinekeys, - title={The kvdefinekeys package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.4}, - url={https://ctan.org/pkg/kvdefinekeys}, -} -@manual{oberdiek:kvsetkeys, - title={The kvsetkeys package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.17}, - url={https://ctan.org/pkg/kvsetkeys}, -} -@manual{oberdiek:ltxcmds, - title={The ltxcmds package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.23}, - url={https://ctan.org/pkg/ltxcmds}, -} @manual{oberdiek:pagegrid, title={The pagegrid package}, author={Heiko Oberdiek}, @@ -292,13 +229,6 @@ version={1.1}, url={https://ctan.org/pkg/protecteddef}, } -@manual{oberdiek:refcount, - title={The refcount package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={3.5}, - url={https://ctan.org/pkg/refcount}, -} @manual{oberdiek:resizegather, title={The resizegather package}, author={Heiko Oberdiek}, @@ -334,13 +264,6 @@ version={1.5}, url={https://ctan.org/pkg/settobox}, } -@manual{oberdiek:soulutf8, - title={The soulutf8 package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.1}, - url={https://ctan.org/pkg/soulutf8}, -} @manual{oberdiek:stackrel, title={The stackrel package}, author={Heiko Oberdiek}, @@ -390,10 +313,4 @@ version={1.6}, url={https://ctan.org/pkg/twoopt}, } -@manual{oberdiek:uniquecounter, - title={The uniquecounter package}, - author={Heiko Oberdiek}, - date={2016-05-16}, - version={1.3}, - url={https://ctan.org/pkg/uniquecounter}, -} + diff --git a/macros/latex/contrib/oberdiek/oberdiek-source.bib b/macros/latex/contrib/oberdiek/oberdiek-source.bib index 36f546aa53..428ae118c0 100644 --- a/macros/latex/contrib/oberdiek/oberdiek-source.bib +++ b/macros/latex/contrib/oberdiek/oberdiek-source.bib @@ -3,7 +3,7 @@ title={Document management -- Portable document format -- Part 1: PDF 1.7}, date={2008-07-01}, edition=1, - url={https://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf}, + url={https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf}, urldate={2011-11-25}, } @manual{pdftex-manual, diff --git a/macros/latex/contrib/oberdiek/oberdiek.ins b/macros/latex/contrib/oberdiek/oberdiek.ins index a0a0048ce0..5c1ac2e5c2 100644 --- a/macros/latex/contrib/oberdiek/oberdiek.ins +++ b/macros/latex/contrib/oberdiek/oberdiek.ins @@ -1,5 +1,5 @@ % oberdiek.ins -% 2019/12/09 +% 2019/12/15 % % Copyright (C) % 1999, 2001, 2006 Heiko Oberdiek @@ -27,8 +27,6 @@ \input docstrip \batchinput{aliascnt.dtx} -\batchinput{auxhook.dtx} -\batchinput{bigintcalc.dtx} \batchinput{bmpsize.dtx} \batchinput{centernot.dtx} \batchinput{chemarr.dtx} @@ -38,13 +36,10 @@ \batchinput{engord.dtx} \batchinput{enparen.dtx} \batchinput{eolgrab.dtx} -\batchinput{etexcmds.dtx} \batchinput{fibnum.dtx} \batchinput{flags.dtx} -\batchinput{gettitlestring.dtx} \batchinput{holtxdoc.dtx} \batchinput{hopatch.dtx} -\batchinput{hycolor.dtx} \batchinput{hypbmsec.dtx} \batchinput{hypcap.dtx} \batchinput{hypdestopt.dtx} @@ -53,10 +48,6 @@ \batchinput{hyphsubst.dtx} \batchinput{ifdraft.dtx} \batchinput{iflang.dtx} -\batchinput{intcalc.dtx} -\batchinput{kvdefinekeys.dtx} -\batchinput{kvsetkeys.dtx} -\batchinput{ltxcmds.dtx} \batchinput{pagegrid.dtx} \batchinput{pagesel.dtx} \batchinput{pdfcol.dtx} @@ -66,13 +57,11 @@ \batchinput{pdfcrypt.dtx} \batchinput{pdfrender.dtx} \batchinput{protecteddef.dtx} -\batchinput{refcount.dtx} \batchinput{resizegather.dtx} \batchinput{rotchiffre.dtx} \batchinput{scrindex.dtx} \batchinput{setouterhbox.dtx} \batchinput{settobox.dtx} -\batchinput{soulutf8.dtx} \batchinput{stackrel.dtx} \batchinput{stampinclude.dtx} \batchinput{tabularht.dtx} @@ -80,7 +69,6 @@ \batchinput{telprint.dtx} \batchinput{thepdfnumber.dtx} \batchinput{twoopt.dtx} -\batchinput{uniquecounter.dtx} \Msg{} \Msg{********************************************************} diff --git a/macros/latex/contrib/oberdiek/oberdiek.pdf b/macros/latex/contrib/oberdiek/oberdiek.pdf index c664986df5..857ca0904c 100644 Binary files a/macros/latex/contrib/oberdiek/oberdiek.pdf and b/macros/latex/contrib/oberdiek/oberdiek.pdf differ diff --git a/macros/latex/contrib/oberdiek/oberdiek.tex b/macros/latex/contrib/oberdiek/oberdiek.tex index 676c3ab28c..f96a0cc7f6 100644 --- a/macros/latex/contrib/oberdiek/oberdiek.tex +++ b/macros/latex/contrib/oberdiek/oberdiek.tex @@ -10,7 +10,7 @@ \newcommand*{\Author}{Heiko Oberdiek} \newcommand*{\Email}{ho-tex at tug.org} -\newcommand*{\Date}{2019/12/09} +\newcommand*{\Date}{2019/12/15} % Copyright (C) 2006-2016 by % Heiko Oberdiek @@ -176,12 +176,6 @@ \begin{overview} \entry{aliascnt}{Alias counters}% [\entrysep] -\entry{atveryend}{Hooks at the very end of document}% -[\entrysep] -\entry{auxhook}{Hooks for auxiliary files}% -[\entrysep] -\entry{bigintcalc}{Expandable calculations on big integers}% -[\entrysep] \entry{bmpsize}{Extract size/resolution from bitmap files}% [\entrysep] \entry{centernot}{Centers the not symbol horizontally}% @@ -200,20 +194,14 @@ [\entrysep] \entry{eolgrab}{Catch arguments delimited by end of line}% [\entrysep] -\entry{etexcmds}{Avoid name clashes with \hologo{eTeX} commands}% -[\entrysep] \entry{fibnum}{Fibonacci numbers}% [\entrysep] \entry{flags}{Setting/clearing of flags in bit fields}% [\entrysep] -\entry{gettitlestring}{Cleanup title references}% -[\entrysep] \entry{holtxdoc}{Private additional ltxdoc support}% [\entrysep] \entry{hopatch}{Wrapper for package hooks}% [\entrysep] -\entry{hycolor}{Color options for hyperref/bookmark}% -[\entrysep] \entry{hypbmsec}{Bookmarks in sectioning commands}% [\entrysep] \entry{hypcap}{Adjusting the anchors of captions}% @@ -230,14 +218,6 @@ [\entrysep] \entry{iflang}{Checks for the current language}% [\entrysep] -\entry{intcalc}{Expandable calculations with integers}% -[\entrysep] -\entry{kvdefinekeys}{Define keys}% -[\entrysep] -\entry{kvsetkeys}{Key value parser}% -[\entrysep] -\entry{ltxcmds}{\hologo{LaTeX} kernel commands for general use}% -[\entrysep] \entry{pagegrid}{Print page grid in background}% [\entrysep] \entry{pagesel}{Select pages of a document for output}% @@ -256,22 +236,16 @@ [\entrysep] \entry{protecteddef}{Define protected commands}% [\entrysep] -\entry{refcount}{Data extraction from label references}% -[\entrysep] \entry{resizegather}{Resize overly large equations}% [\entrysep] \entry{rotchiffre}{Perform simple rotation ciphers}% [\entrysep] \entry{scrindex}{Package index with \hologo{KOMAScript} classes}% [\entrysep] -\entry{selinput}{Semi-automatic input encoding detection}% -[\entrysep] \entry{setouterhbox}{Set hbox in outer horizontal mode}% [\entrysep] \entry{settobox}{Assign box dimensions to length registers}% [\entrysep] -\entry{soulutf8}{Permit use of UTF-8 characters in soul}% -[\entrysep] \entry{stackrel}{Adding subscript option to stackrel}% [\entrysep] \entry{stampinclude}{Include files based on time stamps}% @@ -285,8 +259,6 @@ \entry{thepdfnumber}{Print PDF numbers with minimal digits}% [\entrysep] \entry{twoopt}{Definitions with two optional arguments}% -[\entrysep] -\entry{uniquecounter}{Provide unlimited unique counter}% \end{overview} \section{Packages} @@ -300,24 +272,6 @@ share the same counter register and clear list. \end{abstract} \tocinclude{aliascnt} -\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{bmpsize}} \label{bmpsize} @@ -411,17 +365,6 @@ to catch an argument that is delimited by the line end. \end{abstract} \tocinclude{eolgrab} -\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} @@ -441,17 +384,6 @@ 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{holtxdoc}} \label{holtxdoc} @@ -473,16 +405,6 @@ 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} @@ -567,47 +489,6 @@ based on macro \cs{languagename} or hyphenation patterns. \end{abstract} \tocinclude{iflang} -\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{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{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{pagegrid}} \label{pagegrid} @@ -698,20 +579,6 @@ 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{resizegather}} \label{resizegather} @@ -765,17 +632,6 @@ 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} @@ -846,14 +702,5 @@ 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} \end{document} diff --git a/macros/latex/contrib/oberdiek/pagegrid.pdf b/macros/latex/contrib/oberdiek/pagegrid.pdf index cf9f9072ec..94d92f93a2 100644 Binary files a/macros/latex/contrib/oberdiek/pagegrid.pdf and b/macros/latex/contrib/oberdiek/pagegrid.pdf differ diff --git a/macros/latex/contrib/oberdiek/pagesel.pdf b/macros/latex/contrib/oberdiek/pagesel.pdf index a8ad281ae5..f6f3b69662 100644 Binary files a/macros/latex/contrib/oberdiek/pagesel.pdf and b/macros/latex/contrib/oberdiek/pagesel.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcol.pdf b/macros/latex/contrib/oberdiek/pdfcol.pdf index 758cccf4c2..e2743fdbb0 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcol.pdf and b/macros/latex/contrib/oberdiek/pdfcol.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcolfoot.pdf b/macros/latex/contrib/oberdiek/pdfcolfoot.pdf index c9c70c032c..885efa68f9 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolfoot.pdf and b/macros/latex/contrib/oberdiek/pdfcolfoot.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcolparallel.pdf b/macros/latex/contrib/oberdiek/pdfcolparallel.pdf index c93a4f537f..957d5052b8 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolparallel.pdf and b/macros/latex/contrib/oberdiek/pdfcolparallel.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf b/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf index acc877258f..26312b422f 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf and b/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcrypt.pdf b/macros/latex/contrib/oberdiek/pdfcrypt.pdf index 922be507ea..459de0522f 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcrypt.pdf and b/macros/latex/contrib/oberdiek/pdfcrypt.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfescape.pdf b/macros/latex/contrib/oberdiek/pdfescape.pdf deleted file mode 100644 index b722009b2f..0000000000 Binary files a/macros/latex/contrib/oberdiek/pdfescape.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/pdfrender.pdf b/macros/latex/contrib/oberdiek/pdfrender.pdf index 1f121b5bcc..685c28bfd4 100644 Binary files a/macros/latex/contrib/oberdiek/pdfrender.pdf and b/macros/latex/contrib/oberdiek/pdfrender.pdf differ diff --git a/macros/latex/contrib/oberdiek/picture.pdf b/macros/latex/contrib/oberdiek/picture.pdf deleted file mode 100644 index f2a3565297..0000000000 Binary files a/macros/latex/contrib/oberdiek/picture.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/protecteddef.pdf b/macros/latex/contrib/oberdiek/protecteddef.pdf index 64cbbdcc0c..4b813bdad5 100644 Binary files a/macros/latex/contrib/oberdiek/protecteddef.pdf and b/macros/latex/contrib/oberdiek/protecteddef.pdf differ diff --git a/macros/latex/contrib/oberdiek/refcount.dtx b/macros/latex/contrib/oberdiek/refcount.dtx deleted file mode 100644 index b70bd4799e..0000000000 --- a/macros/latex/contrib/oberdiek/refcount.dtx +++ /dev/null @@ -1,1099 +0,0 @@ -% \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 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work consists of the main source file 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -This work consists of the main source file 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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{refcount.drv} -% -% \title{The \xpackage{refcount} package} -% \date{2016/05/16 v3.5} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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% -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \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 -% {https://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 deleted file mode 100644 index d2e118959e..0000000000 Binary files a/macros/latex/contrib/oberdiek/refcount.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/resizegather.pdf b/macros/latex/contrib/oberdiek/resizegather.pdf index 140e92db20..9a9a30c380 100644 Binary files a/macros/latex/contrib/oberdiek/resizegather.pdf and b/macros/latex/contrib/oberdiek/resizegather.pdf differ diff --git a/macros/latex/contrib/oberdiek/rotchiffre.pdf b/macros/latex/contrib/oberdiek/rotchiffre.pdf index 6797d5b214..cd4a9903e2 100644 Binary files a/macros/latex/contrib/oberdiek/rotchiffre.pdf and b/macros/latex/contrib/oberdiek/rotchiffre.pdf differ diff --git a/macros/latex/contrib/oberdiek/scrindex.pdf b/macros/latex/contrib/oberdiek/scrindex.pdf index b25becaf6e..9e22cb51c0 100644 Binary files a/macros/latex/contrib/oberdiek/scrindex.pdf and b/macros/latex/contrib/oberdiek/scrindex.pdf differ diff --git a/macros/latex/contrib/oberdiek/selinput.pdf b/macros/latex/contrib/oberdiek/selinput.pdf deleted file mode 100644 index 21478e37be..0000000000 Binary files a/macros/latex/contrib/oberdiek/selinput.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/setouterhbox.pdf b/macros/latex/contrib/oberdiek/setouterhbox.pdf index 0470b00a37..4e41306089 100644 Binary files a/macros/latex/contrib/oberdiek/setouterhbox.pdf and b/macros/latex/contrib/oberdiek/setouterhbox.pdf differ diff --git a/macros/latex/contrib/oberdiek/settobox.pdf b/macros/latex/contrib/oberdiek/settobox.pdf index 117a435aa4..d4f498fbe9 100644 Binary files a/macros/latex/contrib/oberdiek/settobox.pdf and b/macros/latex/contrib/oberdiek/settobox.pdf differ diff --git a/macros/latex/contrib/oberdiek/soulutf8.dtx b/macros/latex/contrib/oberdiek/soulutf8.dtx deleted file mode 100644 index f5708e8ac2..0000000000 --- a/macros/latex/contrib/oberdiek/soulutf8.dtx +++ /dev/null @@ -1,1300 +0,0 @@ -% \iffalse meta-comment -% -% File: soulutf8.dtx -% Version: 2016/05/16 v1.1 -% Info: Permit use of UTF-8 characters in soul -% -% Copyright (C) -% 2007 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{soulutf8.drv} -% -% \title{The \xpackage{soulutf8} package} -% \date{2016/05/16 v1.1} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \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} -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \begin{thebibliography}{9} -% -% \bibitem{soul} -% Melchior Franz: \textit{The \xpackage{soul} package}; -% 2003/11/17;\\ -% \CTANpkg{soul}. -% -% \bibitem{ucs} -% Dominique P. G. Unruh: \textit{\xpackage{ucs.sty} -- Unicode Support}; -% 2004/10/17;\\ -% \CTANpkg{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 deleted file mode 100644 index 05b4fef252..0000000000 Binary files a/macros/latex/contrib/oberdiek/soulutf8.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/stackrel.pdf b/macros/latex/contrib/oberdiek/stackrel.pdf index 88e47f65e6..52015ac031 100644 Binary files a/macros/latex/contrib/oberdiek/stackrel.pdf and b/macros/latex/contrib/oberdiek/stackrel.pdf differ diff --git a/macros/latex/contrib/oberdiek/stampinclude.pdf b/macros/latex/contrib/oberdiek/stampinclude.pdf index c3954d3d8e..a8082d4f50 100644 Binary files a/macros/latex/contrib/oberdiek/stampinclude.pdf and b/macros/latex/contrib/oberdiek/stampinclude.pdf differ diff --git a/macros/latex/contrib/oberdiek/tabularht.pdf b/macros/latex/contrib/oberdiek/tabularht.pdf index 212e19eaea..82415daa74 100644 Binary files a/macros/latex/contrib/oberdiek/tabularht.pdf and b/macros/latex/contrib/oberdiek/tabularht.pdf differ diff --git a/macros/latex/contrib/oberdiek/tabularkv.pdf b/macros/latex/contrib/oberdiek/tabularkv.pdf index 99ffc78cd9..967d697a31 100644 Binary files a/macros/latex/contrib/oberdiek/tabularkv.pdf and b/macros/latex/contrib/oberdiek/tabularkv.pdf differ diff --git a/macros/latex/contrib/oberdiek/telprint.pdf b/macros/latex/contrib/oberdiek/telprint.pdf index a603248f11..7d1663343e 100644 Binary files a/macros/latex/contrib/oberdiek/telprint.pdf and b/macros/latex/contrib/oberdiek/telprint.pdf differ diff --git a/macros/latex/contrib/oberdiek/thepdfnumber.pdf b/macros/latex/contrib/oberdiek/thepdfnumber.pdf index 72c69e0657..3b371ff727 100644 Binary files a/macros/latex/contrib/oberdiek/thepdfnumber.pdf and b/macros/latex/contrib/oberdiek/thepdfnumber.pdf differ diff --git a/macros/latex/contrib/oberdiek/twoopt.pdf b/macros/latex/contrib/oberdiek/twoopt.pdf index 55d9590d35..fca056eda1 100644 Binary files a/macros/latex/contrib/oberdiek/twoopt.pdf and b/macros/latex/contrib/oberdiek/twoopt.pdf differ diff --git a/macros/latex/contrib/oberdiek/uniquecounter.dtx b/macros/latex/contrib/oberdiek/uniquecounter.dtx deleted file mode 100644 index 172d081435..0000000000 --- a/macros/latex/contrib/oberdiek/uniquecounter.dtx +++ /dev/null @@ -1,694 +0,0 @@ -% \iffalse meta-comment -% -% File: uniquecounter.dtx -% Version: 2016/05/16 v1.3 -% Info: Provide unlimited unique counter -% -% Copyright (C) -% 2009, 2011 Heiko Oberdiek -% 2016-2019 Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% 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: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 -% -%<*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 Heiko Oberdiek - 2016-2019 Oberdiek Package Support Group - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -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}}% -} - -\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 -% -%<*ignore> -\fi -% -%<*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} -% -% \fi -% -% -% -% \GetFileInfo{uniquecounter.drv} -% -% \title{The \xpackage{uniquecounter} package} -% \date{2016/05/16 v1.3} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% This package 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} -% -% \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} -% -% \end{macrocode} -%% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{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[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTANpkg{tds}). 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} -% -% \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\\ -% 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 -% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh -% these. For example, \TeX\,Live\ users run \verb|texhash| or -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \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} -% -% \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 deleted file mode 100644 index 722768852b..0000000000 Binary files a/macros/latex/contrib/oberdiek/uniquecounter.pdf and /dev/null differ diff --git a/macros/latex/contrib/refcount/README.md b/macros/latex/contrib/refcount/README.md new file mode 100644 index 0000000000..84d9e20076 --- /dev/null +++ b/macros/latex/contrib/refcount/README.md @@ -0,0 +1,12 @@ +# refcount + +refcount package for LaTeX + + +References are not numbers, however they often store numerical +data such as section or page numbers. \ref or \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 hyperref, nameref, +titleref, and babel are supported. \ No newline at end of file diff --git a/macros/latex/contrib/refcount/refcount.dtx b/macros/latex/contrib/refcount/refcount.dtx new file mode 100644 index 0000000000..08dceda657 --- /dev/null +++ b/macros/latex/contrib/refcount/refcount.dtx @@ -0,0 +1,1097 @@ +% \iffalse meta-comment +% +% File: refcount.dtx +% Version: 2019/12/15 v3.6 +% Info: Data extraction from label references +% +% Copyright (C) +% 1998, 2000, 2006, 2008, 2010, 2011 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/refcount/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/refcount/issues +% +% 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/refcount/refcount.dtx +% CTAN:macros/latex/contrib/refcount/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/refcount/refcount.sty +% TDS:doc/latex/refcount/refcount.pdf +% TDS:source/latex/refcount/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: refcount +Version: 2019/12/15 v3.6 + +Copyright (C) + 1998, 2000, 2006, 2008, 2010, 2011 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/refcount/issues + + +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/refcount}% + \file{refcount.sty}{\from{refcount.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{* refcount.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `refcount.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{refcount.drv}% + [2019/12/15 v3.6 Data extraction from label references (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{refcount.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{refcount.drv} +% +% \title{The \xpackage{refcount} package} +% \date{2019/12/15 v3.6} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/refcount/issues}}} +% +% \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}% + [2019/12/15 v3.6 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% +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{refcount}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/refcount/refcount.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/refcount/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[\CTANinstall{install/macros/latex/contrib/refcount.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). 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} +% +% \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/refcount/refcount.sty\\ +% refcount.pdf & doc/latex/refcount/refcount.pdf\\ +% refcount.dtx & source/latex/refcount/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \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 +% {https://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} +% \begin{Version}{2019/12/15 v3.6} +% \item +% Documentation updates. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/refcount/refcount.pdf b/macros/latex/contrib/refcount/refcount.pdf new file mode 100644 index 0000000000..5767d49459 Binary files /dev/null and b/macros/latex/contrib/refcount/refcount.pdf differ diff --git a/macros/latex/contrib/soulutf8/README.md b/macros/latex/contrib/soulutf8/README.md new file mode 100644 index 0000000000..9c9fc7381c --- /dev/null +++ b/macros/latex/contrib/soulutf8/README.md @@ -0,0 +1,17 @@ +# soulutf8 + +soulutf8 package for latex + + +This repository is a fork of https://github.com/drehscheibe/soul + +Currently the files forked from soul are unused. +Just used to build the extension soulutf8 originally by Heiko Oberdiek. + +## soulutf8 + +This package extends package soul and adds some support +for UTF-8. Namely the input encodings utf8.def +from package inputenc and +package ucs's utf8x.def are supported. + diff --git a/macros/latex/contrib/soulutf8/soulutf8.dtx b/macros/latex/contrib/soulutf8/soulutf8.dtx new file mode 100644 index 0000000000..46afd8c29f --- /dev/null +++ b/macros/latex/contrib/soulutf8/soulutf8.dtx @@ -0,0 +1,1298 @@ +% \iffalse meta-comment +% +% File: soulutf8.dtx +% Version: 2019/12/15 v1.2 +% Info: Permit use of UTF-8 characters in soul +% +% Copyright (C) +% 2007 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/soul/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/soul/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file 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/soulutf8/soulutf8.dtx +% CTAN:macros/latex/contrib/soulutf8/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/soulutf8/soulutf8.sty +% TDS:doc/latex/soulutf8/soulutf8.pdf +% TDS:source/latex/soulutf8/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: soulutf8 2019/12/15 v1.2 Permit use of UTF-8 characters in soul (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: soulutf8 +Version: 2019/12/15 v1.2 + +Copyright (C) + 2007 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/soul/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/soulutf8}% + \file{soulutf8.sty}{\from{soulutf8.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{* soulutf8.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `soulutf8.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{soulutf8.drv}% + [2019/12/15 v1.2 Permit use of UTF-8 characters in soul (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{soulutf8.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{soulutf8.drv} +% +% \title{The \xpackage{soulutf8} package} +% \date{2019/12/15 v1.2} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/soul/issues}}} +% +% \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}% + [2019/12/15 v1.2 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}[2019/12/03]% + \RequirePackage{etexcmds}[2019/12/15]% +\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} +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{soulutf8}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/soulutf8/soulutf8.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/soulutf8/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[\CTANinstall{install/macros/latex/contrib/soulutf8.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). 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} +% +% \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/soulutf8/soulutf8.sty\\ +% soulutf8.pdf & doc/latex/soulutf8/soulutf8.pdf\\ +% soulutf8.dtx & source/latex/soulutf8/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \begin{thebibliography}{9} +% +% \bibitem{soul} +% Melchior Franz: \textit{The \xpackage{soul} package}; +% 2003/11/17;\\ +% \CTANpkg{soul}. +% +% \bibitem{ucs} +% Dominique P. G. Unruh: \textit{\xpackage{ucs.sty} -- Unicode Support}; +% 2004/10/17;\\ +% \CTANpkg{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} +% \begin{Version}{2019/12/15 v1.2} +% \item +% Documentation updates. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/soulutf8/soulutf8.pdf b/macros/latex/contrib/soulutf8/soulutf8.pdf new file mode 100644 index 0000000000..b8a6565e49 Binary files /dev/null and b/macros/latex/contrib/soulutf8/soulutf8.pdf differ diff --git a/macros/latex/contrib/tuda-ci/README.md b/macros/latex/contrib/tuda-ci/README.md index a305f121ee..03025676c4 100644 --- a/macros/latex/contrib/tuda-ci/README.md +++ b/macros/latex/contrib/tuda-ci/README.md @@ -2,7 +2,7 @@ Copyright (C) Marei Peischl , 2018–2019 - tuda-ci 2019/11/28 v2.03a (only different from v2.03 for CTAN) + tuda-ci 2019/12/17 v2.04 *************************************************************************** @@ -162,10 +162,15 @@ exercise sheets/exams | DEMO-TUDaExercise.tex | tudaexercise.cls * v2.02 (2019-11-16) bugfixes - fix font issues and Type1 mode - improve marginpar adjustment for tudaposter - * v2.03 (2019-11-28) bugfixes + small implemtation corrections + * v2.03 (2019-11-28) bugfixes + small implemetation corrections - allow verbatim in solution environment for tudaexercise - add affidavit* to provide custom texts - add \AffidavitSignature - fix typos - extended documentation - * v2.03a (2019-11-29) Fix CTAN Version, due to deployment issues \ No newline at end of file + * v2.03a (2019-11-29) Fix CTAN Version, due to deployment issues + * v2.04 (2019-12-17) Bugfixes & Layout adjustments + - bugfixes in tudaexercise.cls (#114, #103, #113) + - add mechanism to use \studentID for tudapub's thesis mode + - extend documentation + - improved implementation of tudaexercise's headline mechanism \ No newline at end of file diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaAnnouncement.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaAnnouncement.pdf index eab924bf6a..788c03790f 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaAnnouncement.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaAnnouncement.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaBeamer.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaBeamer.pdf index 260612ec51..c7e8f65e15 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaBeamer.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaBeamer.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaExercise.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaExercise.pdf index 0813cd242a..71f4303328 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaExercise.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaExercise.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaLetter.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaLetter.pdf index d3aa0422d5..bc0380dc59 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaLetter.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaLetter.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPhD.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPhD.pdf index 834ce1a340..d9617bbb56 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPhD.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPhD.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPoster.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPoster.pdf index 1d5ad887c0..1bd50046a8 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPoster.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPoster.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPub.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPub.pdf index 6fdde1fc8e..a33696d583 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPub.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaPub.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaReport.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaReport.pdf index 6e3d190a6d..2d37d83ad5 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaReport.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaReport.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaSciPoster.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaSciPoster.pdf index eb9c31175d..0adb925fb7 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaSciPoster.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaSciPoster.pdf differ diff --git a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaThesis.pdf b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaThesis.pdf index abd1f53ee3..33d0cb94b6 100644 Binary files a/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaThesis.pdf and b/macros/latex/contrib/tuda-ci/doc/DEMO-TUDaThesis.pdf differ diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaAnnouncement.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaAnnouncement.tex index 99cd6aec1c..15fd18fa7e 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaAnnouncement.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaAnnouncement.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaAnnouncement.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaAnnouncement.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaBeamer.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaBeamer.tex index 84581afb03..a7c5510434 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaBeamer.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaBeamer.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaBeamer.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaBeamer.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaBibliography.bib b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaBibliography.bib index 478180189a..72672ff03f 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaBibliography.bib +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaBibliography.bib @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaBibliography.bib' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaBibliography.bib' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaExercise.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaExercise.tex index 212271b9de..1de5d5c8da 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaExercise.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaExercise.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaExercise.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaExercise.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaFromaddress.lco b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaFromaddress.lco index b49c2630a6..825809a13b 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaFromaddress.lco +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaFromaddress.lco @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaFromaddress.lco' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaFromaddress.lco' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaLetter.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaLetter.tex index 51172278b7..9cbb24a504 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaLetter.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaLetter.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaLetter.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaLetter.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPhD.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPhD.tex index 51d87d9049..3973e2caec 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPhD.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPhD.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaPhD.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaPhD.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -42,7 +42,7 @@ custommargins=true,% Ränder werden mithilfe von typearea automatisch berechnet marginpar=false,% Kopfzeile und Fußzeile erstrecken sich nicht über die Randnotizspalte %BCOR=5mm,%Bindekorrektur, falls notwendig - parskip=half-,%Absatzkennzeichnung durch Abstand vgl. KOMA-Sript +% parskip=half-,%Absatzkennzeichnung durch Abstand vgl. KOMA-Sript fontsize=11pt,%Basisschriftgröße laut Corporate Design ist mit 9pt häufig zu klein % logofile=example-image, %Falls die Logo Dateien nicht vorliegen ]{tudapub} @@ -109,6 +109,7 @@ \author[M. Peischl]{Marei Peischl}%optionales Argument ist die Signatur, \birthplace{Geburtsort}%Geburtsort, bei Dissertationen zwingend notwendig \reviewer{Gutachter 1 \and Gutachter 2 \and noch einer \and falls das immernoch nicht reicht}%Gutachter +\publishers{Darmstadt}% Feld für die Ortsangabe oder einen Verlag. Dies ist mit Darmstadt -- D17 vorbelegt, s.u. jedoch wurde die Anforderung für diese Vorgabe reduziert, daher genügt auch die Ortsangabe. %%Sofern keine passende Option verfügbar ist @@ -146,24 +147,24 @@ Für Erläuterungen zu den TUDaPub spezifischen Optionen, sei auf die Datei DEMO Da die Basisklasse für beide identisch ist, kann jede Option abgeändert werden. Die Folgende Liste zeigt lediglich die gezeigten Features bei Standardeinstellungen. \begin{tabularx}{\linewidth}{@{}p{.25\linewidth}*3{>{\centering\arraybackslash}X}@{}} -\toprule -Option&DEMO-TUDaThesis&DEMO-TUDaPhD&DEMO-TUDapub\\ -\midrule -twoside&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule -parskip&\FeatureTrue&\FeatureFalse&\FeatureTrue\\\midrule -Kolophon&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule -Widmung&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule -Schriftgröße&11pt&11pt&9pt\\\midrule -ruledheaders§ion&chapter&all\\\midrule -Basisklasse&scrreprt&scrbook&scrartcl\\\midrule -thesis&\ttfamily type=bachelor&\ttfamily type=dr, + \toprule + Option&DEMO-TUDaThesis&DEMO-TUDaPhD&DEMO-TUDapub\\ + \midrule + twoside&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule + parskip&\FeatureTrue&\FeatureFalse&\FeatureTrue\\\midrule + Kolophon&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule + Widmung&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule + Schriftgröße&11pt&11pt&9pt\\\midrule + ruledheaders§ion&chapter&all\\\midrule + Basisklasse&scrreprt&scrbook&scrartcl\\\midrule + thesis&\ttfamily type=bachelor&\ttfamily type=dr, dr=rernat -&\FeatureFalse\\\midrule -marginpar&\FeatureTrue&\FeatureFalse&\FeatureTrue\\\midrule -Affidavit\newline\rlap{(Selbstständigkeitserklärung)}&\FeatureTrue&\FeatureTrue&\FeatureFalse\\\midrule -abstract&\FeatureFalse&\FeatureTrue&\FeatureTrue\\\midrule -custommargins&\FeatureFalse&\FeatureTrue&\FeatureFalse\\ -\bottomrule + &\FeatureFalse\\\midrule + marginpar&\FeatureFalse&\FeatureFalse&\FeatureTrue\\\midrule + Affidavit\newline\rlap{(Selbstständigkeitserklärung)}&\FeatureTrue&\FeatureTrue&\FeatureFalse\\\midrule + abstract&\FeatureFalse&\FeatureTrue&\FeatureTrue\\\midrule + custommargins&\FeatureTrue&\FeatureTrue&\FeatureFalse\\ + \bottomrule \end{tabularx} @@ -208,6 +209,7 @@ Es ist zu beachten, dass für die Erzeugung der Titelseite nach Übergabe aller \item[title] Titel, wird in sehr großer Schrift im obersten Block der Titelseite platziert. Die Schriftgröße ist aufgrund der Häufigkeit für lange Titel kleiner gewählt als für andere Publikationen. \item[subtitle] Untertitel. Dieses Feld kann alternativ für eine Übersetzung genutzt werden. \item[author] Der Autor/dir Autoren. Mehere Autoren werden durch \verb+\and+ getrennt. + \item[studentID] Matrikelnummer. Nach den Vorgaben des Templates ist diese Angabe immer optional. \item[birthplace] Geburtsort. Angabe ist bei Dissertationen notwendig. \item[reviewer] Gutachter. Mehrere Gutachter werden, wie Autoren durch \verb+\and+ getrennt. Die Nummerierung läuft von links nach rechts. \item[institution] Einrichtung. Dieser Eintrag, wie auch die beiden folgenden, werden unterhalb des Logos auf der Titelseite platziert. @@ -264,6 +266,15 @@ Daher existiert die Klassenoption \code{custommargins}, die für dieses Dokument Die Option \code{custommargins} verfügt ab Version 1.10 auch über den Wert \code{geometry}. Damit können die Ränder auch durch einen Aufruf von \code{\tbs{}geometry} vor Beginn des Dokuments manuell angepasst werden. +Hierbei ist zu beachten, dass die Einstellungen als Ausgangspunkt den Voreingestellten Satzspiegel nutzen (je nach Option mit Randnotizspalte oder ohne). Es ist möglich diese Optionen vor den eigenen mit zurückzusetzen: +\begin{verbatim} +\geometry{ +reset, + +} +\end{verbatim} +Die gilt insbesondere für die Optionen \code{includehead}, \code{includefoot} und \code{includemp}. + Diese Variante wird auf Wunsch zur Verfügung gestellt, allerdings wird darauf hingewiesen, dass manuelle Randeinstellungen oft nicht zu einem harmonischen Satzspiegel führen. Auch ist das Standard-Layout der Kolumnentitel wenig vorteilhaft, da die Kolumnentitel damit local größer sein können als die eigentliche Überschrift. diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPoster.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPoster.tex index a0c9842346..b1cbc0fe51 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPoster.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPoster.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaPoster.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaPoster.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPub.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPub.tex index 0bf8f1750b..827839e5c5 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPub.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaPub.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaPub.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaPub.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaReport.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaReport.tex index 4ed9c638d1..d6ab2aeb2c 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaReport.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaReport.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaReport.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaReport.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaSciPoster.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaSciPoster.tex index 08d0c1b611..2c6feb7bca 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaSciPoster.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaSciPoster.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaSciPoster.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaSciPoster.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaThesis.tex b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaThesis.tex index 6777b9c9d3..8503cc2290 100644 --- a/macros/latex/contrib/tuda-ci/example/DEMO-TUDaThesis.tex +++ b/macros/latex/contrib/tuda-ci/example/DEMO-TUDaThesis.tex @@ -1,4 +1,4 @@ -%% This is file `DEMO-TUDaThesis.tex' version 2.03a (2019/11/29), +%% This is file `DEMO-TUDaThesis.tex' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -138,24 +138,23 @@ Für Erläuterungen zu den TUDaPub spezifischen Optionen, sei auf die Datei DEMO Da die Basisklasse für beide identisch ist, kann jede Option abgeändert werden. Die Folgende Liste zeigt lediglich die gezeigten Features bei Standardeinstellungen. \begin{tabularx}{\linewidth}{@{}p{.25\linewidth}*3{>{\centering\arraybackslash}X}@{}} -\toprule -Option&DEMO-TUDaThesis&DEMO-TUDaPhD&DEMO-TUDapub\\ -\midrule -twoside&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule -parskip&\FeatureTrue&\FeatureFalse&\FeatureTrue\\\midrule -Kolophon&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule -Widmung&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule -Schriftgröße&11pt&11pt&9pt\\\midrule -ruledheaders§ion&chapter&all\\\midrule -Basisklasse&scrreprt&scrbook&scrartcl\\\midrule -thesis&\ttfamily type=bachelor&\ttfamily type=dr, - dr=rernat -&\FeatureFalse\\\midrule -marginpar&\FeatureTrue&\FeatureFalse&\FeatureTrue\\\midrule -Affidavit\newline\rlap{(Selbstständigkeitserklärung)}&\FeatureTrue&\FeatureTrue&\FeatureFalse\\\midrule -abstract&\FeatureFalse&\FeatureTrue&\FeatureTrue\\\midrule -custommargins&\FeatureFalse&\FeatureTrue&\FeatureFalse\\ -\bottomrule + \toprule + Option&DEMO-TUDaThesis&DEMO-TUDaPhD&DEMO-TUDapub\\ + \midrule + twoside&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule + parskip&\FeatureTrue&\FeatureFalse&\FeatureTrue\\\midrule + Kolophon&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule + Widmung&\FeatureFalse&\FeatureTrue&\FeatureFalse\\\midrule + Schriftgröße&11pt&11pt&9pt\\\midrule + ruledheaders§ion&chapter&all\\\midrule + Basisklasse&scrreprt&scrbook&scrartcl\\\midrule + thesis&\ttfamily type=bachelor&\ttfamily type=dr, dr=rernat + &\FeatureFalse\\\midrule + marginpar&\FeatureFalse&\FeatureFalse&\FeatureTrue\\\midrule + Affidavit\newline\rlap{(Selbstständigkeitserklärung)}&\FeatureTrue&\FeatureTrue&\FeatureFalse\\\midrule + abstract&\FeatureFalse&\FeatureTrue&\FeatureTrue\\\midrule + custommargins&\FeatureTrue&\FeatureTrue&\FeatureFalse\\ + \bottomrule \end{tabularx} @@ -183,6 +182,7 @@ Es ist zu beachten, dass für die Erzeugung der Titelseite nach Übergabe aller \item[title] Titel, wird in sehr großer Schrift im obersten Block der Titelseite platziert. Die Schriftgröße ist aufgrund der Häufigkeit für lange Titel kleiner gewählt als für andere Publikationen. \item[subtitle] Untertitel. Dieses Feld kann alternativ für eine Übersetzung genutzt werden. \item[author] Der Autor/dir Autoren. Mehere Autoren werden durch \verb+\and+ getrennt. + \item[studentID] Matrikelnummer. Nach den Vorgaben des Templates ist diese Angabe immer optional. \item[birthplace] Geburtsort. Angabe ist bei Dissertationen notwendig. \item[reviewer] Gutachter. Mehrere Gutachter werden, wie Autoren durch \verb+\and+ getrennt. Die Nummerierung läuft von links nach rechts. \item[institution] Einrichtung. Dieser Eintrag, wie auch die beiden folgenden, werden unterhalb des Logos auf der Titelseite platziert. @@ -239,6 +239,15 @@ Daher existiert die Klassenoption \code{custommargins}, die für dieses Dokument Die Option \code{custommargins} verfügt ab Version 1.10 auch über den Wert \code{geometry}. Damit können die Ränder auch durch einen Aufruf von \code{\tbs{}geometry} vor Beginn des Dokuments manuell angepasst werden. +Hierbei ist zu beachten, dass die Einstellungen als Ausgangspunkt den Voreingestellten Satzspiegel nutzen (je nach Option mit Randnotizspalte oder ohne). Es ist möglich diese Optionen vor den eigenen mit zurückzusetzen: +\begin{verbatim} +\geometry{ + reset, + +} +\end{verbatim} +Die gilt insbesondere für die Optionen \code{includehead}, \code{includefoot} und \code{includemp}. + Diese Variante wird auf Wunsch zur Verfügung gestellt, allerdings wird darauf hingewiesen, dass manuelle Randeinstellungen oft nicht zu einem harmonischen Satzspiegel führen. Auch ist das Standard-Layout der Kolumnentitel wenig vorteilhaft, da die Kolumnentitel damit local größer sein können als die eigentliche Überschrift. diff --git a/macros/latex/contrib/tuda-ci/tex/beamercolorthemeTUDa.sty b/macros/latex/contrib/tuda-ci/tex/beamercolorthemeTUDa.sty index a29d8748f4..55054148d6 100644 --- a/macros/latex/contrib/tuda-ci/tex/beamercolorthemeTUDa.sty +++ b/macros/latex/contrib/tuda-ci/tex/beamercolorthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamercolorthemeTUDa.sty' version 2.03a (2019/11/29), +%% This is file `beamercolorthemeTUDa.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamercolorthemeTUDa} [\filedate\space\fileversion] diff --git a/macros/latex/contrib/tuda-ci/tex/beamerfontthemeTUDa.sty b/macros/latex/contrib/tuda-ci/tex/beamerfontthemeTUDa.sty index 6a1874321a..33d4350606 100644 --- a/macros/latex/contrib/tuda-ci/tex/beamerfontthemeTUDa.sty +++ b/macros/latex/contrib/tuda-ci/tex/beamerfontthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamerfontthemeTUDa.sty' version 2.03a (2019/11/29), +%% This is file `beamerfontthemeTUDa.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamerfontthemeTUDa} [\filedate\space\fileversion] diff --git a/macros/latex/contrib/tuda-ci/tex/beamerinnerthemeTUDa.sty b/macros/latex/contrib/tuda-ci/tex/beamerinnerthemeTUDa.sty index f32a28aa68..069b46f5f3 100644 --- a/macros/latex/contrib/tuda-ci/tex/beamerinnerthemeTUDa.sty +++ b/macros/latex/contrib/tuda-ci/tex/beamerinnerthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamerinnerthemeTUDa.sty' version 2.03a (2019/11/29), +%% This is file `beamerinnerthemeTUDa.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} %% This is file `beamerinnerthemeTUDa.sty' version 1.11 (2019/10/15), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt diff --git a/macros/latex/contrib/tuda-ci/tex/beamerouterthemeTUDa.sty b/macros/latex/contrib/tuda-ci/tex/beamerouterthemeTUDa.sty index c408dca5ba..77e071887d 100644 --- a/macros/latex/contrib/tuda-ci/tex/beamerouterthemeTUDa.sty +++ b/macros/latex/contrib/tuda-ci/tex/beamerouterthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamerouterthemeTUDa.sty' version 2.03a (2019/11/29), +%% This is file `beamerouterthemeTUDa.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamerouterthemeTUDa} [\filedate\space\fileversion] diff --git a/macros/latex/contrib/tuda-ci/tex/beamerthemeTUDa.sty b/macros/latex/contrib/tuda-ci/tex/beamerthemeTUDa.sty index 68c179c8c9..8ca8592d79 100644 --- a/macros/latex/contrib/tuda-ci/tex/beamerthemeTUDa.sty +++ b/macros/latex/contrib/tuda-ci/tex/beamerthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamerthemeTUDa.sty' version 2.03a (2019/11/29), +%% This is file `beamerthemeTUDa.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamerthemeTUDa} [\filedate\space\fileversion\space beamer theme using the Corporate Design of TU Darmstadt] diff --git a/macros/latex/contrib/tuda-ci/tex/tuda-a0paper.clo b/macros/latex/contrib/tuda-ci/tex/tuda-a0paper.clo index a87a6376c8..4a66760752 100644 --- a/macros/latex/contrib/tuda-ci/tex/tuda-a0paper.clo +++ b/macros/latex/contrib/tuda-ci/tex/tuda-a0paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a0paper.clo' version 2.03a (2019/11/29), +%% This is file `tuda-a0paper.clo' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \ProvidesExplFile{tuda-a0paper.clo}{\filedate}{\fileversion}{tuda-ci size adjustments for a0paper} \cs_set:Nn \TUDa_setup_title_sizes: { \cs_set:Nn \TUDa_title_fontsize: {{125pt}{165pt}} diff --git a/macros/latex/contrib/tuda-ci/tex/tuda-a1paper.clo b/macros/latex/contrib/tuda-ci/tex/tuda-a1paper.clo index 74788591b6..c5359a30c5 100644 --- a/macros/latex/contrib/tuda-ci/tex/tuda-a1paper.clo +++ b/macros/latex/contrib/tuda-ci/tex/tuda-a1paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a1paper.clo' version 2.03a (2019/11/29), +%% This is file `tuda-a1paper.clo' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \ProvidesExplFile{tuda-a1paper.clo}{\filedate}{\fileversion}{tuda-ci size adjustments for a0paper} \cs_set:Nn \TUDa_setup_title_sizes: { \cs_set:Nn \TUDa_title_fontsize: {{86pt}{120pt}} diff --git a/macros/latex/contrib/tuda-ci/tex/tuda-a2paper.clo b/macros/latex/contrib/tuda-ci/tex/tuda-a2paper.clo index 0d7210d0e3..687b3fc81e 100644 --- a/macros/latex/contrib/tuda-ci/tex/tuda-a2paper.clo +++ b/macros/latex/contrib/tuda-ci/tex/tuda-a2paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a2paper.clo' version 2.03a (2019/11/29), +%% This is file `tuda-a2paper.clo' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \ProvidesExplFile{tuda-a2paper.clo}{\filedate}{\fileversion}{tuda-ci size adjustments for a0paper} \cs_set:Nn \TUDa_setup_title_sizes: { \cs_set:Nn \TUDa_title_fontsize: {{65pt}{82pt}} diff --git a/macros/latex/contrib/tuda-ci/tex/tuda-a3paper.clo b/macros/latex/contrib/tuda-ci/tex/tuda-a3paper.clo index 20e2ba4198..3afd4fd66d 100644 --- a/macros/latex/contrib/tuda-ci/tex/tuda-a3paper.clo +++ b/macros/latex/contrib/tuda-ci/tex/tuda-a3paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a3paper.clo' version 2.03a (2019/11/29), +%% This is file `tuda-a3paper.clo' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \ProvidesExplFile{tuda-a3paper.clo}{\filedate}{\fileversion}{tuda-ci size adjustments for a3paper} \cs_set:Nn \TUDa_setup_title_sizes: { \cs_set:Nn \TUDa_title_fontsize: {{47pt}{61pt}} diff --git a/macros/latex/contrib/tuda-ci/tex/tuda-a4paper.clo b/macros/latex/contrib/tuda-ci/tex/tuda-a4paper.clo index 877a320766..b3e482826e 100644 --- a/macros/latex/contrib/tuda-ci/tex/tuda-a4paper.clo +++ b/macros/latex/contrib/tuda-ci/tex/tuda-a4paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a4paper.clo' version 2.03a (2019/11/29), +%% This is file `tuda-a4paper.clo' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \ProvidesExplFile{tuda-a4paper.clo}{\filedate}{\fileversion}{tuda-ci size adjustments for a4paper} \cs_set:Nn \TUDa_setup_title_sizes: { \cs_set:Nn \TUDa_title_fontsize: {{36pt}{47pt}} diff --git a/macros/latex/contrib/tuda-ci/tex/tuda-a5paper.clo b/macros/latex/contrib/tuda-ci/tex/tuda-a5paper.clo index 6bedf0a550..58acd4f5f7 100644 --- a/macros/latex/contrib/tuda-ci/tex/tuda-a5paper.clo +++ b/macros/latex/contrib/tuda-ci/tex/tuda-a5paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a5paper.clo' version 2.03a (2019/11/29), +%% This is file `tuda-a5paper.clo' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \ProvidesExplFile{tuda-a5paper.clo}{\filedate}{\fileversion}{tuda-ci size adjustments for a5paper} \cs_set:Nn \TUDa_setup_title_sizes: { \cs_set:Nn \TUDa_title_fontsize: {{22pt}{28pt}} diff --git a/macros/latex/contrib/tuda-ci/tex/tuda-pgfplots.sty b/macros/latex/contrib/tuda-ci/tex/tuda-pgfplots.sty index b6ffdfa90e..e8aae6a334 100644 --- a/macros/latex/contrib/tuda-ci/tex/tuda-pgfplots.sty +++ b/macros/latex/contrib/tuda-ci/tex/tuda-pgfplots.sty @@ -1,4 +1,4 @@ -%% This is file `tuda-pgfplots.sty' version 2.03a (2019/11/29), +%% This is file `tuda-pgfplots.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} % Special thanks to: Sebastian Schöps Institut Theorie Elektromagnetischer Felder (TEMF), TU Darmstadt % The original version of this file has been inspired by the colorscheme in the Metropolis beamer theme by Matthias Vogelgesang https://github.com/matze/mtheme \ProvidesPackage{tuda-pgfplots}[\filedate\space\fileversion\space tuda-ci pgfplots color schemes] diff --git a/macros/latex/contrib/tuda-ci/tex/tudabeamer.cls b/macros/latex/contrib/tuda-ci/tex/tudabeamer.cls index 84bd6218b3..7a0c06a276 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudabeamer.cls +++ b/macros/latex/contrib/tuda-ci/tex/tudabeamer.cls @@ -1,4 +1,4 @@ -%% This is file `tudabeamer.cls' version 2.03a (2019/11/29), +%% This is file `tudabeamer.cls' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{tudabeamer} [\filedate\space\fileversion\space] diff --git a/macros/latex/contrib/tuda-ci/tex/tudacolors.def b/macros/latex/contrib/tuda-ci/tex/tudacolors.def index 728f9a6f1e..5870e18e96 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudacolors.def +++ b/macros/latex/contrib/tuda-ci/tex/tudacolors.def @@ -1,4 +1,4 @@ -%% This is file `tudacolors.def' version 2.03a (2019/11/29), +%% This is file `tudacolors.def' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \ProvidesFile{tudacolors.def} [\filedate\space\fileversion\space Color definitions for tuda-ci] diff --git a/macros/latex/contrib/tuda-ci/tex/tudacolors.sty b/macros/latex/contrib/tuda-ci/tex/tudacolors.sty index 560e9fb0b7..85f5950dfa 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudacolors.sty +++ b/macros/latex/contrib/tuda-ci/tex/tudacolors.sty @@ -1,4 +1,4 @@ -%% This is file `tudacolors.sty' version 2.03a (2019/11/29), +%% This is file `tudacolors.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudacolors}{\filedate}{\fileversion}{Color definition for TU Darmstadt's tuda-ci bundle} diff --git a/macros/latex/contrib/tuda-ci/tex/tudaexercise.cls b/macros/latex/contrib/tuda-ci/tex/tudaexercise.cls index 953a1309fb..c6f3f5d977 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudaexercise.cls +++ b/macros/latex/contrib/tuda-ci/tex/tudaexercise.cls @@ -1,4 +1,4 @@ -%% This is file `tudaexercise.cls' version 2.03a (2019/11/29), +%% This is file `tudaexercise.cls' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,11 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} -%% -\def\fileversion{1.01} -\def\filedate{2019/09/09} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{tudaexercise} @@ -57,10 +54,32 @@ \bool_new:N \g_TUDa_geometry_bool \bool_new:N \g_TUDa_custommargins_bool +\bool_new:N \l_TUDa_ex_solution_bool + +\RequirePackage{environ} + +\def\solution{\TUDa_ex_solutionheader:} +\def\endsolution{} + +\cs_new:Nn \TUDa_setup_solution: { + \bool_if:NTF \l_TUDa_ex_solution_bool { + \def\solution{\TUDa_ex_solutionheader:} + \def\endsolution{} + }{ + \RenewEnviron{solution}{ + \if_false: + \BODY + \fi: + } + } +} \keys_define:nn {TUDa/exercise} { - solution .bool_set:N = \l_TUDa_ex_solution_bool, + solution .code:n = { + \bool_set_eq:Nc \l_TUDa_ex_solution_bool {c_#1_bool} + \TUDa_setup_solution: + }, solution .initial:n = false, solution .default:n = true, compat .bool_gset:N = \g_TUDa_ex_compatibility_bool, @@ -149,6 +168,7 @@ colorback .initial:n = true, } +\RequirePackage{tudarules} \ProcessKeysOptions{TUDa/pub} \prop_map_inline:Nn \g_TUDa_clsopts_prop { @@ -166,13 +186,19 @@ \LoadClass{scrartcl} +%Has to be loaded here due to headwidth options +\RequirePackage[draft=false]{scrlayer-scrpage} +\KOMAoptions {twoside = false} + \prop_map_inline:Nn \g_TUDa_unknown_clsopts_prop { \cs_if_exist:cT {KV@KOMA.scrartcl.cls@#1} { \tl_if_empty:nTF {#2} - {\KOMAoptions{#1} } - {\clist_map_inline:nn {#2} {\KOMAoptions{#1=##1}}} + {\KOMAoptions{#1}} + {\KOMAoption{#1}{#2} } } +} + \renewcommand*\sectionlinesformat[4]{% \parbox{\linewidth}{ \rule[5\g_TUDa_titlerule_dim]{\linewidth}{\g_TUDa_titlerule_dim}\par\nointerlineskip @@ -188,9 +214,6 @@ }} - - -\usepackage{tudarules} \usepackage{tudafonts} \dim_new:N \g_TUDa_innerMargin_dim @@ -248,13 +271,9 @@ \dim_new:N \g_TUDa_headheight_dim \dim_new:N \g_TUDa_headwidth_dim - -\dim_gset:Nn \g_TUDa_headheight_dim {1.25\baselineskip +\c_TUDa_largerule_dim +\c_TUDa_rulesep_dim +\c_TUDa_smallrule_dim} - +\dim_gset:Nn \g_TUDa_headheight_dim {\c_TUDa_largerule_dim +\c_TUDa_rulesep_dim +\c_TUDa_smallrule_dim} %%%%%Anfang Randeinstellungen Geometry -%Has to be loaded here due to headwidth options -\usepackage[draft=false]{scrlayer-scrpage} \bool_if:NTF \g_TUDa_geometry_bool { \RequirePackage[top=\g_TUDa_topMargin_dim, inner=\g_TUDa_innerMargin_dim, outer=\dim_eval:n {\g_TUDa_outerMargin_dim}, bottom=\g_TUDa_bottomMargin_dim, columnsep= \g_TUDa_columnSep_dim, includehead, includefoot, headheight=\g_TUDa_headheight_dim @@ -263,13 +282,9 @@ \KOMAoptions{headinclude, footinclude, headwidth=text,footwidth=text} } - %%%%%%%% %Ende Randeinstellungen klassisch - - - \newcommand*{\institution}[1]{ \def\TUDa@institution{#1} } @@ -299,9 +314,6 @@ \addtokomafont{captionlabel}{\accentfont} \addtokomafont{caption}{\accentfont} -\KOMAoptions{footsepline=.5\c_TUDa_smallrule_dim} -\KOMAoptions{headsepline=.5\c_TUDa_smallrule_dim} - \box_new:N \g_TUDa_ex_headline_odd_box \box_new:N \g_TUDa_ex_headline_even_box \box_new:N \g_TUDa_ex_headline_oneside_box @@ -358,8 +370,8 @@ \if@twoside \dim_set:Nn \l_tmpa_dim { \dim_max:nn - {\box_ht:N \g_TUDa_ex_headline_odd_box} - {\box_ht:N \g_TUDa_ex_headline_even_box} + {\box_ht:N \g_TUDa_ex_headline_odd_box+\box_dp:N \g_TUDa_ex_headline_odd_box} + {\box_ht:N \g_TUDa_ex_headline_even_box+\box_dp:N \g_TUDa_ex_headline_even_box} } \else \dim_set:Nn \l_tmpa_dim { @@ -367,11 +379,17 @@ + \box_dp:N \g_TUDa_ex_headline_oneside_box } \fi - \dim_add:Nn \l_tmpa_dim {\box_dp:N \TUDa@headline_box} - \KOMAoptions{headinclude, headheight=\l_tmpa_dim} - \global\setlength{\headheight}{\l_tmpa_dim} - \clist_map_inline:nn {odd, even, oneside} { - \ModifyLayer[contents={\raisebox{\c_TUDa_rulesep_dim}[0pt][0pt]{\box_use:c {g_TUDa_ex_headline_##1_box}}}]{TUDa.ex.head.##1} + \dim_compare:nT {\l_tmpa_dim > \z@} + { + \dim_add:Nn \l_tmpa_dim {\box_dp:N \TUDa@headline_box +\c_TUDa_rulesep_dim} + \KOMAoptions{headinclude, headheight=\l_tmpa_dim,headsepline = .5\c_TUDa_smallrule_dim} + \if@twoside + \cehead{\box_use:c {g_TUDa_ex_headline_even_box}} + \cohead{\box_use:c {g_TUDa_ex_headline_odd_box}} + \else + \chead{\box_use:c {g_TUDa_ex_headline_oneside_box}} + \fi + \global\setlength{\headheight}{\l_tmpa_dim} } } @@ -385,29 +403,20 @@ \box_if_exist:NF \TUDa@headline_box { \TUDa@makeheadrule[color=identbarcolor, width=\sls@headwidth]{TUDa@headline} } +\ModifyLayer[ + background, + height=\box_dp:N \TUDa@headline_box, + align=tl, + voffset=\g_TUDa_topMargin_dim, + contents=\raisebox{\depth}{\box_use:N \TUDa@headline_box}, + ]{plain.TUDa.ex.head.above.line} \ModifyLayer[ - background, - mode=picture, - contents={%\layercontentsmeasure - \dim_compare:nF {\box_wd:N \TUDa@headline_box=\layerwidth} { - \TUDa@makeheadrule*[color=identbarcolor, width=\layerwidth]{TUDa@headline} - } - \box_use:N \TUDa@headline_box - }, - addvoffset=-\box_dp:N \TUDa@headline_box + background, + height=\box_dp:N \TUDa@headline_box, + align=tl, + voffset=\g_TUDa_topMargin_dim, + contents=\raisebox{\depth}{\box_use:N \TUDa@headline_box}, ]{TUDa.ex.head.above.line} - \ModifyLayer[ - background, -% mode=picture, - contents={%\layercontentsmeasure - \dim_compare:nF {\box_wd:N \TUDa@headline_box=\layerwidth} { - \TUDa@makeheadrule*[color=identbarcolor, width=\layerwidth]{TUDa@headline} - } - \box_use:N \TUDa@headline_box - }, - ]{plain.TUDa.ex.head.above.line} - \lehead{headmark}%TODO - \lohead{headmark}%TODO \ofoot[\pagemark]{\pagemark} } @@ -478,9 +487,10 @@ \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative \vspace*{-\dim_eval:n { \headheight + -\c_TUDa_largerule_dim -\c_TUDa_rulesep_dim +\headsep - +\topskip - -\dp\strutbox + +\ht\strutbox + +\p@ }} \par \nointerlineskip @@ -662,7 +672,7 @@ tocnumwidth=\cs_if_exist_use:NF \scr@tso@subsubsection@numwidth {2.3em},% \cs_undefine:N \subtask \NewDocumentEnvironment{subtask}{o}{ - \@subtask{#1} + \@subtask{\IfNoValueF{#1}{#1}} }{} %Solution mechanism @@ -679,14 +689,6 @@ tocnumwidth=\cs_if_exist_use:NF \scr@tso@subsubsection@numwidth {2.3em},% ]{@solution} -\def\solution{ -\bool_if:NTF \l_TUDa_ex_solution_bool \TUDa_ex_solutionheader: \iffalse -} - -\def\endsolution{ - \bool_if:NF \l_TUDa_ex_solution_bool \fi -} - \setkomafont{@solution}{\normalfont} \cs_new:Nn \TUDa_ex_solutionheader: { diff --git a/macros/latex/contrib/tuda-ci/tex/tudafonts.sty b/macros/latex/contrib/tuda-ci/tex/tudafonts.sty index 06c8548fdb..fce88b4bb7 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudafonts.sty +++ b/macros/latex/contrib/tuda-ci/tex/tudafonts.sty @@ -1,4 +1,4 @@ -%% This is file `tudafonts.sty' version 2.03a (2019/11/29), +%% This is file `tudafonts.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{tudafonts} [\filedate\space\fileversion\space diff --git a/macros/latex/contrib/tuda-ci/tex/tudaletter.cls b/macros/latex/contrib/tuda-ci/tex/tudaletter.cls index 03e7fbfba0..133a7fcac3 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudaletter.cls +++ b/macros/latex/contrib/tuda-ci/tex/tudaletter.cls @@ -1,4 +1,4 @@ -%% This is file `tudaletter.cls' version 2.03a (2019/11/29), +%% This is file `tudaletter.cls' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{tudaletter} diff --git a/macros/latex/contrib/tuda-ci/tex/tudalettersize10pt.clo b/macros/latex/contrib/tuda-ci/tex/tudalettersize10pt.clo index ad12cbdfbd..efc3c95668 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudalettersize10pt.clo +++ b/macros/latex/contrib/tuda-ci/tex/tudalettersize10pt.clo @@ -1,4 +1,4 @@ -%% This is file `tudalettersize10pt.clo' version 2.03a (2019/11/29), +%% This is file `tudalettersize10pt.clo' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} %% This is file `tudalettersize10pt.clo' version 1.0 (2018/12/12), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt diff --git a/macros/latex/contrib/tuda-ci/tex/tudaposter.cls b/macros/latex/contrib/tuda-ci/tex/tudaposter.cls index 5c950fe40c..767e63c67e 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudaposter.cls +++ b/macros/latex/contrib/tuda-ci/tex/tudaposter.cls @@ -1,4 +1,4 @@ -%% This is file `tudaposter.cls' version 2.03a (2019/11/29), +%% This is file `tudaposter.cls' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudaposter}{\filedate}{\fileversion}{Poster Layouts for the Corporate Design of TU Darmstadt} diff --git a/macros/latex/contrib/tuda-ci/tex/tudapub.cls b/macros/latex/contrib/tuda-ci/tex/tudapub.cls index 4edef74333..9e1e2edda7 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudapub.cls +++ b/macros/latex/contrib/tuda-ci/tex/tudapub.cls @@ -1,4 +1,4 @@ -%% This is file `tudapub.cls' version 2.03a (2019/11/29), +%% This is file `tudapub.cls' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{tudapub} @@ -189,8 +189,8 @@ \prop_map_inline:Nn \g_TUDa_unknown_clsopts_prop { \cs_if_exist:cT {KV@KOMA.\g_TUDa_pub_class_tl.cls@#1} { \tl_if_empty:nTF {#2} - {\KOMAoptions{#1} } - {\clist_map_inline:nn {#2} {\KOMAoptions{#1=##1}}} + {\KOMAoptions{#1}} + {\KOMAoption{#1}{#2}} } } @@ -373,21 +373,14 @@ \cs_set:Nn \TUDa_restore_typearea: {\loadgeometry{\c_TUDa_default_geometry_tl}} }{ -\bool_if:NTF \g_TUDa_geometry_bool { - \RequirePackage[top=\g_TUDa_topMargin_dim, inner=\g_TUDa_innerMargin_dim, outer=\dim_eval:n {\g_TUDa_outerMargin_dim}, bottom=\g_TUDa_bottomMargin_dim, columnsep= \g_TUDa_columnSep_dim, includehead, includefoot,includemp, nomarginpar, headheight=\g_TUDa_headheight_dim - ]{geometry} - - - \savegeometry{TUDa@nomarginpar} - \cs_set:Nn \TUDa_disable_marginpar: {\loadgeometry{TUDa@nomarginpar}} -}{ - \KOMAoptions{headinclude, footinclude, headwidth=text,footwidth=text} \let\TUDa_disable_marginpar:\relax \def\TUDa_restore_typearea:{ - \KOMAoptions{headinclude, footinclude, headwidth=text,footwidth=text}\recalctypearea + \KOMAoptions{headinclude, footinclude} + \bool_if:NTF \g_TUDa_marginpar_bool {\KOMAoptions{headwidth=textwithmarginpar,footwidth=textwithmarginpar}} + {\KOMAoptions{headwidth=text,footwidth=text}} + \recalctypearea } -} -%maybe enforce marginar?=false in that case + \TUDa_restore_typearea: } @@ -564,7 +557,10 @@ } \renewcommand*{\@author}{ - \seq_use:Nnnn \g_TUDa_author_seq {~\authorandname{}~} {,~} {~\&~} + \begingroup + \hyphenpenalty=100000 + \seq_use:Nnnn \g_TUDa_author_seq {~\authorandname{}~} {,~} {~\&~} + \endgroup } \msg_new:nnn {TUDaPub} {infobox-too-high} { diff --git a/macros/latex/contrib/tuda-ci/tex/tudarules.sty b/macros/latex/contrib/tuda-ci/tex/tudarules.sty index 440f4a7b1c..bbedefcde6 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudarules.sty +++ b/macros/latex/contrib/tuda-ci/tex/tudarules.sty @@ -1,4 +1,4 @@ -%% This is file `tudarules.sty' version 2.03a (2019/11/29), +%% This is file `tudarules.sty' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudarules}{\filedate}{\fileversion}{Creation of colored bars for tuda-ci bundle} diff --git a/macros/latex/contrib/tuda-ci/tex/tudasciposter.cls b/macros/latex/contrib/tuda-ci/tex/tudasciposter.cls index 43f03fbcf8..5716718067 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudasciposter.cls +++ b/macros/latex/contrib/tuda-ci/tex/tudasciposter.cls @@ -1,4 +1,4 @@ -%% This is file `tudasciposter.cls' version 2.03a (2019/11/29), +%% This is file `tudasciposter.cls' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudasciposter}{\filedate}{\fileversion}{Scientific Poster Layout for TU Darmstadt} diff --git a/macros/latex/contrib/tuda-ci/tex/tudasize9pt.clo b/macros/latex/contrib/tuda-ci/tex/tudasize9pt.clo index 488799be6c..16a95bef03 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudasize9pt.clo +++ b/macros/latex/contrib/tuda-ci/tex/tudasize9pt.clo @@ -1,4 +1,4 @@ -%% This is file `tudasize9pt.clo' version 2.03a (2019/11/29), +%% This is file `tudasize9pt.clo' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} %% This is file `tudasize9pt.clo' version 1.0 (2018/12/12), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt diff --git a/macros/latex/contrib/tuda-ci/tex/tudathesis.cfg b/macros/latex/contrib/tuda-ci/tex/tudathesis.cfg index 5ae8aa6b84..28292c0ecf 100644 --- a/macros/latex/contrib/tuda-ci/tex/tudathesis.cfg +++ b/macros/latex/contrib/tuda-ci/tex/tudathesis.cfg @@ -1,4 +1,4 @@ -%% This is file `tudathesis.cfg' version 2.03a (2019/11/29), +%% This is file `tudathesis.cfg' version 2.04 (2019/12/17), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{2.03a} -\def\filedate{2019/11/29} +\def\fileversion{2.04} +\def\filedate{2019/12/17} \RequirePackage{expl3} \ProvidesExplFile{tudathesis.cfg} {\filedate}{\fileversion}{Special Features for publication type 'thesis' using TU Darmstadt's Coporate Design (tuda-ci)} @@ -103,11 +103,17 @@ } } +\cs_new:Nn \TUDa_insert_studentID:n { + (\TUDa@studentIDname :\nobreakspace#1) +} + \TUDa_declare_caption:Nnn \TUDa@byname {von} {by} +\TUDa_declare_caption:Nnn \TUDa@fromname {aus} {from} \TUDa_declare_caption:Nnn \TUDa_in_department {im~ \departmentname}{in~the~\departmentname{}~ of} \TUDa_declare_caption:Nnn \TUDa@reviewname {Gutachten}{review} \TUDa_declare_caption:Nnnn \TUDa@examdatename {Tag~ der~ Prüfung}{Date~ of~ thesis~ defense}{Date~ of~ thesis~ defence} \TUDa_declare_caption:Nnn \TUDa@submissiondatename {Tag~ der~ Einreichung}{Date~ of~ submission} +\TUDa_declare_caption:Nnn \TUDa@studentIDname {Matrikelnummer} {Student\nobreakspace ID} %Fallback content for box if not overwritten \newcommand*\TUDa@box_department {\cs_if_exist_use:NF \departmentfullname {\TUDa@department}} @@ -188,9 +194,14 @@ {\def\TUDa@signature{#1}} } +\newcommand*{\studentID}[1]{ + \gdef\TUDa@studentID{#1} +} + \gdef\TUDa@institution{} \gdef\TUDa@institute{} \gdef\TUDa@department{} +\gdef\TUDa@studentID{} \NewDocumentCommand{\department}{som}{% \IfBooleanTF{#1}{ @@ -302,18 +313,12 @@ } \gdef\@subject{ - \bool_if:NTF \g_TUDa_dr_bool { - \TUDa@thesisStatus{}~ - \tl_mixed_case:n{\TUDa@thesisType}~ - \tl_if_empty:NF \TUDa@in_department {\TUDa@in_department{}~} - \seq_if_empty:NF \g_TUDa_author_seq {\TUDa@byname{}~\@author} - \tl_if_empty:NF \TUDa@birthplace {~aus~\TUDa@birthplace} - } { \cs_if_exist:NT \TUDa@thesisStatus {\TUDa@thesisStatus{}~ } \tl_mixed_case:n{\TUDa@thesisType}~ \tl_if_empty:NF \TUDa@in_department {\TUDa@in_department{}~} - \tl_if_empty:NF \@author {\TUDa@byname\nobreakspace\mbox{\@author}} - } + \seq_if_empty:NF \g_TUDa_author_seq {\TUDa@byname\nobreakspace\@author} + \tl_if_empty:NF \TUDa@birthplace {\space\TUDa@fromname\space\TUDa@birthplace} + \tl_if_empty:NF \TUDa@studentID {\space\TUDa_insert_studentID:n {\TUDa@studentID}} } \uppertitleback{ diff --git a/macros/latex/contrib/uniquecounter/README.md b/macros/latex/contrib/uniquecounter/README.md new file mode 100644 index 0000000000..8ea569bca2 --- /dev/null +++ b/macros/latex/contrib/uniquecounter/README.md @@ -0,0 +1,10 @@ +# uniquecounter + +uniquecounter for LaTeX + + +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. + + diff --git a/macros/latex/contrib/uniquecounter/uniquecounter.dtx b/macros/latex/contrib/uniquecounter/uniquecounter.dtx new file mode 100644 index 0000000000..9ee6fa41f3 --- /dev/null +++ b/macros/latex/contrib/uniquecounter/uniquecounter.dtx @@ -0,0 +1,694 @@ +% \iffalse meta-comment +% +% File: uniquecounter.dtx +% Version: 2019/12/15 v1.4 +% Info: Provide unlimited unique counter +% +% Copyright (C) +% 2009, 2011 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/uniquecounter/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/uniquecounter/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file 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/uniquecounter/uniquecounter.dtx +% CTAN:macros/latex/contrib/uniquecounter/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/uniquecounter/uniquecounter.sty +% TDS:doc/latex/uniquecounter/uniquecounter.pdf +% TDS:doc/latex/uniquecounter/uniquecounter-example.tex +% TDS:source/latex/uniquecounter/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: uniquecounter +Version: 2019/12/15 v1.4 + +Copyright (C) + 2009, 2011 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/uniquecounter/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file 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/uniquecounter}% + \file{uniquecounter.sty}{\from{uniquecounter.dtx}{package}}% + \usedir{doc/latex/uniquecounter}% + \file{uniquecounter-example.tex}{\from{uniquecounter.dtx}{example}}% +} + +\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 +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{uniquecounter.drv}% + [2019/12/15 v1.4 Provide unlimited unique counter (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{uniquecounter.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{uniquecounter.drv} +% +% \title{The \xpackage{uniquecounter} package} +% \date{2019/12/15 v1.4} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/uniquecounter/issues}}} +% +% \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} +% +% \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}% + [2019/12/15 v1.4 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} +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{uniquecounter}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/uniquecounter/uniquecounter.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/uniquecounter/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[\CTANinstall{install/macros/latex/contrib/uniquecounter.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTANpkg{tds}). 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} +% +% \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/uniquecounter/uniquecounter.sty\\ +% uniquecounter.pdf & doc/latex/uniquecounter/uniquecounter.pdf\\ +% uniquecounter-example.tex & doc/latex/uniquecounter/uniquecounter-example.tex\\ +% uniquecounter.dtx & source/latex/uniquecounter/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 +% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh +% these. For example, \TeX\,Live\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \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} +% +% \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} +% \begin{Version}{2019/12/15 v1.4} +% \item +% Documentation updates. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/uniquecounter/uniquecounter.pdf b/macros/latex/contrib/uniquecounter/uniquecounter.pdf new file mode 100644 index 0000000000..275600e3b7 Binary files /dev/null and b/macros/latex/contrib/uniquecounter/uniquecounter.pdf differ -- cgit v1.2.3