summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/oberdiek
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-12-06 03:01:49 +0000
committerNorbert Preining <norbert@preining.info>2019-12-06 03:01:49 +0000
commitac57c892e88b77eb217641d4a1059da681320633 (patch)
treeb874066a34c995a8b4db98062bbadc62347060a5 /macros/latex/contrib/oberdiek
parent2905ee4c8de47cfdeea4787e465eb827f9b99e8b (diff)
CTAN sync 201912060301
Diffstat (limited to 'macros/latex/contrib/oberdiek')
-rw-r--r--macros/latex/contrib/oberdiek/accsupp.dtx1086
-rw-r--r--macros/latex/contrib/oberdiek/accsupp.pdfbin327297 -> 0 bytes
-rw-r--r--macros/latex/contrib/oberdiek/atbegshi.dtx2114
-rw-r--r--macros/latex/contrib/oberdiek/atbegshi.pdfbin406524 -> 0 bytes
-rw-r--r--macros/latex/contrib/oberdiek/atveryend.dtx1437
-rw-r--r--macros/latex/contrib/oberdiek/atveryend.pdfbin380814 -> 0 bytes
6 files changed, 0 insertions, 4637 deletions
diff --git a/macros/latex/contrib/oberdiek/accsupp.dtx b/macros/latex/contrib/oberdiek/accsupp.dtx
deleted file mode 100644
index 5264aed3e2..0000000000
--- a/macros/latex/contrib/oberdiek/accsupp.dtx
+++ /dev/null
@@ -1,1086 +0,0 @@
-% \iffalse meta-comment
-%
-% File: accsupp.dtx
-% Version: 2018/03/28 v0.5
-% Info: Accessibility support by marked content
-%
-% Copyright (C)
-% 2007, 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
-%
-% This work consists of the main source file accsupp.dtx
-% and the derived files
-% accsupp.sty, accsupp.pdf, accsupp.ins, accsupp.drv,
-% accsupp-pdftex.def, \ccsupp-luatex.def, accsupp-dvipdfm.def,
-% accsupp-dvips.def,
-% accsupp-example1.tex, accsupp-example2.tex,
-% accsupp-test1.tex.
-%
-% Distribution:
-% CTAN:macros/latex/contrib/oberdiek/accsupp.dtx
-% CTAN:macros/latex/contrib/oberdiek/accsupp.pdf
-%
-% Unpacking:
-% (a) If accsupp.ins is present:
-% tex accsupp.ins
-% (b) Without accsupp.ins:
-% tex accsupp.dtx
-% (c) If you insist on using LaTeX
-% latex \let\install=y\input{accsupp.dtx}
-% (quote the arguments according to the demands of your shell)
-%
-% Documentation:
-% (a) If accsupp.drv is present:
-% latex accsupp.drv
-% (b) Without accsupp.drv:
-% latex accsupp.dtx; ...
-% The class ltxdoc loads the configuration file ltxdoc.cfg
-% if available. Here you can specify further options, e.g.
-% use A4 as paper format:
-% \PassOptionsToClass{a4paper}{article}
-%
-% Programm calls to get the documentation (example):
-% pdflatex accsupp.dtx
-% makeindex -s gind.ist accsupp.idx
-% pdflatex accsupp.dtx
-% makeindex -s gind.ist accsupp.idx
-% pdflatex accsupp.dtx
-%
-% Installation:
-% TDS:tex/latex/oberdiek/accsupp.sty
-% TDS:tex/latex/oberdiek/accsupp-pdftex.def
-% TDS:tex/latex/oberdiek/accsupp-luatex.def
-% TDS:tex/latex/oberdiek/accsupp-dvipdfm.def
-% TDS:tex/latex/oberdiek/accsupp-dvips.def
-% TDS:doc/latex/oberdiek/accsupp.pdf
-% TDS:doc/latex/oberdiek/accsupp-example1.tex
-% TDS:doc/latex/oberdiek/accsupp-example2.tex
-% TDS:source/latex/oberdiek/accsupp.dtx
-%
-%<*ignore>
-\begingroup
- \catcode123=1 %
- \catcode125=2 %
- \def\x{LaTeX2e}%
-\expandafter\endgroup
-\ifcase 0\ifx\install y1\fi\expandafter
- \ifx\csname processbatchFile\endcsname\relax\else1\fi
- \ifx\fmtname\x\else 1\fi\relax
-\else\csname fi\endcsname
-%</ignore>
-%<*install>
-\input docstrip.tex
-\Msg{************************************************************************}
-\Msg{* Installation}
-\Msg{* Package: accsupp 2018/03/28 v0.5 Accessibility support by marked content (HO)}
-\Msg{************************************************************************}
-
-\keepsilent
-\askforoverwritefalse
-
-\let\MetaPrefix\relax
-\preamble
-
-This is a generated file.
-
-Project: accsupp
-Version: 2018/03/28 v0.5
-
-Copyright (C)
- 2007, 2010 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 accsupp.dtx
-and the derived files
- accsupp.sty, accsupp.pdf, accsupp.ins, accsupp.drv,
- accsupp-pdftex.def, accsupp-luatex.def, accsupp-dvipdfm.def,
- accsupp-dvips.def,
- accsupp-example1.tex, accsupp-example2.tex,
- accsupp-test1.tex.
-
-\endpreamble
-\let\MetaPrefix\DoubleperCent
-
-\generate{%
- \file{accsupp.ins}{\from{accsupp.dtx}{install}}%
- \file{accsupp.drv}{\from{accsupp.dtx}{driver}}%
- \usedir{tex/latex/oberdiek}%
- \file{accsupp.sty}{\from{accsupp.dtx}{package}}%
- \file{accsupp-pdftex.def}{\from{accsupp.dtx}{pdftex}}%
- \file{accsupp-luatex.def}{\from{accsupp.dtx}{luatex}}%
- \file{accsupp-dvipdfm.def}{\from{accsupp.dtx}{dvipdfm}}%
- \file{accsupp-dvips.def}{\from{accsupp.dtx}{dvips}}%
- \usedir{doc/latex/oberdiek}%
- \file{accsupp-example1.tex}{\from{accsupp.dtx}{example1}}%
- \file{accsupp-example2.tex}{\from{accsupp.dtx}{example2}}%
-% \usedir{doc/latex/oberdiek/test}%
-% \file{accsupp-test1.tex}{\from{accsupp.dtx}{test1}}%
-}
-
-\catcode32=13\relax% active space
-\let =\space%
-\Msg{************************************************************************}
-\Msg{*}
-\Msg{* To finish the installation you have to move the following}
-\Msg{* files into a directory searched by TeX:}
-\Msg{*}
-\Msg{* accsupp.sty, accsupp-pdftex.def, accsupp-dvipdfm.def,}
-\Msg{* accsupp-dvips.def}
-\Msg{*}
-\Msg{* To produce the documentation run the file `accsupp.drv'}
-\Msg{* through LaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing!}
-\Msg{*}
-\Msg{************************************************************************}
-
-\endbatchfile
-%</install>
-%<*ignore>
-\fi
-%</ignore>
-%<*driver>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{accsupp.drv}%
- [2018/03/28 v0.5 Accessibility support by marked content (HO)]%
-\documentclass{ltxdoc}
-\usepackage{holtxdoc}[2011/11/22]
-\begin{document}
- \DocInput{accsupp.dtx}%
-\end{document}
-%</driver>
-% \fi
-%
-%
-%
-% \GetFileInfo{accsupp.drv}
-%
-% \title{The \xpackage{accsupp} package}
-% \date{2018/03/28 v0.5}
-% \author{Heiko Oberdiek\thanks
-% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
-%
-% \maketitle
-%
-% \begin{abstract}
-% Since PDF 1.5 portions of a page can be marked for better
-% accessibility support.
-% For example, replacement texts or expansions of abbreviations can be
-% provided. Package \xpackage{accsupp} starts with providing a minimal
-% low-level interface for programmers. Status is experimental.
-% \end{abstract}
-%
-% \tableofcontents
-%
-% \section{Documentation}
-%
-% \subsection{Macros}
-%
-% Section ``10.8 Accessibility Support'' of the PDF reference
-% \cite{pdfspec} lists some features that can be added by
-% operators for marked content.
-%
-% \begin{declcs}{BeginAccSupp} \M{options}
-% \end{declcs}
-% It puts the operator |BDC| in the page stream:
-% \begin{quote}
-% |/Span|\\
-% |<<|\dots|>>| \qquad \textit{\% property dictionary}\\
-% |BDC|
-% \end{quote}
-% The contents of the dictionary is controlled by \meta{options}.
-% See sections \ref{sec:feature} and \ref{sec:method}.
-%
-% \begin{declcs}{EndAccSupp} \M{options}
-% \end{declcs}
-% It puts the operator |EMC| in the page stream.
-% The only option is \xoption{pdfliteral}, see section \ref{sec:pdftex}.
-%
-% \bigskip
-% \noindent\textbf{Note:}
-% The caller is responsible for the placement of \cs{BeginAccSupp}
-% and \cs{EndAccSupp} pairs. Especially page breaks are not allowed
-% in between.
-%
-% \subsubsection{Feature options}\label{sec:feature}
-%
-% The PDF reference \cite{pdfspec} describes and explains the different
-% features. The names of the feature options are the same as the
-% key names for the property dictionary for operator |BDC|, see
-% \cs{BeginAccSupp}.
-%
-% \begin{description}
-% \item[\xoption{ActualText}:]
-% Provides a replacement text, see examples in
-% section \ref{sec:example}.
-% \item[\xoption{Alt}:]
-% Provides an alternate description.
-% \item[\xoption{E}:]
-% Provides the expansion of an abbreviation or an acronym.
-% \item[\xoption{Lang}:]
-% Specifies the language.
-% \end{description}
-%
-% \subsubsection{Input methods}\label{sec:method}
-%
-% Except for \xoption{Lang} option \xoption{method} controls
-% how the argument for \xoption{ActualText}, \xoption{Alt},
-% and \xoption{E} are interpreted.
-% \begin{description}
-% \item[\xoption{method=plain}:]
-% The string is only expanded and written without further
-% treatment. Special characters are not protected, thus this method
-% may result in an invalid PDF file.
-% \item[\xoption{method=escape}:]
-% The string is expanded and special characters are escaped.
-% The result is a valid PDF string.
-% \item[\xoption{method=hex}:]
-% The string is given in hexadecimal notation.
-% Section \ref{sec:example:notparallel} shows an example.
-% \item[\xoption{method=pdfstringdef}:]
-% If package \xpackage{hyperref} is loaded, then its \cs{pdfstringdef}
-% is used. This method is slow, but useful if the string contains
-% arbitrary \hologo{TeX} code.
-% \item[\xoption{unicode}:]
-% This option is needed, if the string is given as Unicode string
-% (16 bit). Internally it adds the string prefix for Unicode.
-% In case of \xoption{method=pdfstringdef} it passes the option
-% to \cs{hypersetup}.
-% \end{description}
-%
-% \subsection{Workaround, option \xoption{space}}
-%
-% PDF specification says in ``10.8.3 Replacement Text''
-% \begin{quote}
-% Just as alternative descriptions can be provided for images and other
-% items that do not translate naturally into text (\dots), replacement
-% text can be specified for content that does translate into text but
-% that is represented in a nonstandard way. These nonstandard representations
-% might include, for example, glyphs for ligatures or custom characters, or
-% inline graphics corresponding to letters in an illuminated manustript or to
-% dropped capitals.
-% \end{quote}
-% However, the ActualText is ignored in Acrobat Reader
-% (until version 9 at least), if the content does not contain glyphs.
-% Option \xoption{space} adds such an invisible glyph, a space
-% character. The font name can be configured by option \xoption{spacefont},
-% the default font is \texttt{phvr8r}. The character slot is given
-% by option \xoption{spacechar}, default is \texttt{32}, the usual
-% position of the space character.
-%
-% These options can also be given as package options or in
-% macro \cs{AccSuppSetup} that takes a key value list as argument.
-% Usually only option \xoption{space} is necessary, if the
-% contents does not contain glyphs otherwise. Option \xoption{space}
-% is enabled by |space| or |space=true| and disabled by |space=false|.
-% It is disabled as default. The option is evaluated by \cs{BeginAccSupp}
-% and ignored by \cs{EndAccSupp}.
-%
-% Note: Even with option \xoption{space} I get sometimes wrong texts
-% when cut \& paste from AR7/Linux or AR8/Linux, e.g.
-% \begin{quote}
-% |Hello| $\rightarrow$ |Helo|, |Helol|, |Hell|, \dots\\
-% |Hello World| $\rightarrow$ |Helo WorldW|, |Helo World|, \dots
-% \end{quote}
-% I do not know what Acrobat Reader is doing here, thus feedback and
-% insights are welcome.
-%
-% \subsection{Driver options}
-%
-% Driver options are package options only.
-% The special \hologo{TeX} compilers \hologo{pdfTeX}, \hologo{LuaTeX} and \hologo{XeTeX}
-% are detected automatically. The default for unrecognized drivers can be
-% set by defining \cs{ActualTextDriverDefault}. This can be done
-% in the configuration file \xfile{accsupp.cfg}.
-%
-% \subsubsection{Option \xoption{pdftex}}\label{sec:pdftex}
-% Package option \xoption{pdftex} is used for \hologo{pdfTeX} in PDF mode.
-% Additionally \cs{BeginAccSupp} and \cs{EndAccSupp} understand
-% option \xoption{pdfliteral}. It controls
-% the modifier keyword for \cs{pdfliteral}:
-% \begin{quote}
-% |pdfliteral=direct| $\Rightarrow$ |\pdfliteral direct{...}|
-% \end{quote}
-%
-% \subsubsection{Option \xoption{luatex}}\label{sec:luatex}
-% Package option \xoption{luatex} is used for \hologo{LuaTeX} in PDF mode.
-% Additionally \cs{BeginAccSupp} and \cs{EndAccSupp} understand
-% option \xoption{pdfliteral}. It controls
-% the modifier keyword for \cs{pdfextension} literal:
-% \begin{quote}
-% |pdfliteral=direct| $\Rightarrow$ |\pdfextension literal direct{...}|
-% \end{quote}
-%
-% \subsubsection{Option \xoption{dvipdfm}}
-%
-% Package option \xoption{dvipdfm} and its aliases \xoption{dvipdfmx}
-% \xoption{xetex} are used for drivers that support
-% \textsf{dvipdfm} specials.
-%
-% \subsubsection{Option \xoption{dvips}}
-%
-% Package option \xoption{dvips} and its alias \xoption{dvipsone}
-% write pdfmark specials in the output. Unhappily these pdfmark
-% operators are ignored by \textsf{ghostscript} (latest tested
-% version is 8.54). Perhaps they are recognized by commercial
-% distiller applications.
-%
-% \subsubsection{Turning off page stream compression}
-%
-% For debugging it is useful to have uncompressed page stream objects.
-% This can be done afterwards via \textsf{pdftk}:
-% \begin{quote}
-% |pdftk file.pdf output file-uncompressed.pdf uncompress|
-% \end{quote}
-% Or the PDF file is generated uncompressed:
-% \begin{description}
-% \item[\hologo{pdfTeX}:] |\pdfcompresslevel=0|
-% \item[dvipdfm:] |dvipdfm -z0 ...|
-% \item[dvipdfmx:] |dvipdfmx -z0 ...|
-% \item[ghostscript/ps2pdf:]
-% |ps2pdf -dCompressPages=false input.ps output.pdf|
-% \end{description}
-%
-% \section{Example}
-% \label{sec:example}
-%
-% \subsection{Example \cs{notparallel}}
-% \label{sec:example:notparallel}
-%
-% \begin{macrocode}
-%<*example1>
-% \end{macrocode}
-% \begin{macrocode}
-%<<END
-\documentclass{article}
-\usepackage{accsupp}[2007/11/14]
-\usepackage{centernot}
-% U+2226 NOT PARALLEL
-% \mathrel{...} prevents page break in between
-\newcommand*{\notparallel}{%
- \ensuremath{%
- \mathrel{%
- \BeginAccSupp{method=hex,unicode,ActualText=2226}%
- \centernot{\parallel}%
- \EndAccSupp{}%
- }%
- }%
-}
-\begin{document}
-\begin{equation}
-A\notparallel B
-\end{equation}
-\end{document}
-%END
-% \end{macrocode}
-% \begin{macrocode}
-%</example1>
-% \end{macrocode}
-%
-% \subsection{Example with \xoption{pdfstringdef}}
-%
-% \begin{macrocode}
-%<*example2>
-% \end{macrocode}
-% \begin{macrocode}
-%<<END
-\documentclass{article}
-\usepackage[unicode]{hyperref}
-\usepackage{accsupp}[2007/11/14]
-\begin{document}
- \begin{equation}
- \BeginAccSupp{
- method=pdfstringdef,
- unicode,
- ActualText={%
- a\texttwosuperior +b\texttwosuperior
- =c\texttwosuperior
- }
- }
- a^2 + b^2 = c^2
- \EndAccSupp{}
- \end{equation}
-\end{document}
-%END
-% \end{macrocode}
-% \begin{macrocode}
-%</example2>
-% \end{macrocode}
-%
-% \StopEventually{
-% }
-%
-% \section{Implementation}
-%
-% \subsection{Package}
-%
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
-%
-% \begin{macrocode}
-\begingroup\catcode61\catcode48\catcode32=10\relax%
- \catcode13=5 % ^^M
- \endlinechar=13 %
- \catcode123=1 % {
- \catcode125=2 % }
- \catcode64=11 % @
- \def\x{\endgroup
- \expandafter\edef\csname ACCSUPP@AtEnd\endcsname{%
- \endlinechar=\the\endlinechar\relax
- \catcode13=\the\catcode13\relax
- \catcode32=\the\catcode32\relax
- \catcode35=\the\catcode35\relax
- \catcode61=\the\catcode61\relax
- \catcode64=\the\catcode64\relax
- \catcode123=\the\catcode123\relax
- \catcode125=\the\catcode125\relax
- }%
- }%
-\x\catcode61\catcode48\catcode32=10\relax%
-\catcode13=5 % ^^M
-\endlinechar=13 %
-\catcode35=6 % #
-\catcode64=11 % @
-\catcode123=1 % {
-\catcode125=2 % }
-\def\TMP@EnsureCode#1#2{%
- \edef\ACCSUPP@AtEnd{%
- \ACCSUPP@AtEnd
- \catcode#1=\the\catcode#1\relax
- }%
- \catcode#1=#2\relax
-}
-\TMP@EnsureCode{10}{12}% ^^J
-\TMP@EnsureCode{33}{12}% !
-\TMP@EnsureCode{39}{12}% '
-\TMP@EnsureCode{40}{12}% (
-\TMP@EnsureCode{41}{12}% )
-\TMP@EnsureCode{42}{12}% *
-\TMP@EnsureCode{44}{12}% ,
-\TMP@EnsureCode{45}{12}% -
-\TMP@EnsureCode{46}{12}% .
-\TMP@EnsureCode{47}{12}% /
-\TMP@EnsureCode{58}{12}% :
-\TMP@EnsureCode{60}{12}% <
-\TMP@EnsureCode{62}{12}% >
-\TMP@EnsureCode{94}{7}% ^ (superscript)
-\TMP@EnsureCode{96}{12}% `
-\TMP@EnsureCode{254}{12}% ^^fe
-\TMP@EnsureCode{255}{12}% ^^ff
-\edef\ACCSUPP@AtEnd{\ACCSUPP@AtEnd\noexpand\endinput}
-% \end{macrocode}
-%
-% Package identification.
-% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{accsupp}%
- [2018/03/28 v0.5 Accessibility support by marked content (HO)]
-% \end{macrocode}
-%
-% \begin{macrocode}
-\RequirePackage{pdfescape}[2007/02/25]
-\RequirePackage{ifpdf}
-\RequirePackage{ifxetex}
-\RequirePackage{kvoptions}
-% \end{macrocode}
-% \begin{macrocode}
-\SetupKeyvalOptions{%
- family=ACCSUPP,%
- prefix=ACCSUPP@%
-}
-% \end{macrocode}
-%
-% \subsection{Space setup}
-%
-% \begin{macrocode}
-\DeclareBoolOption{space}
-\DeclareStringOption[phvr8r]{spacefont}
-\DeclareStringOption[32]{spacechar}
-% \end{macrocode}
-%
-% \subsection{Driver detection and setup}
-%
-% \paragraph{Driver declarations.}
-%
-% \begin{macrocode}
-\def\ACCSUPP@DefineDriverKey{%
- \@dblarg\ACCSUPP@@DefineDriverKey
-}
-\def\ACCSUPP@@DefineDriverKey[#1]#2{%
- \define@key{ACCSUPP}{#2}[]{%
- \def\ACCSUPP@driver{#1}%
- }%
- \g@addto@macro\ACCSUPP@DisableOptions{%
- \DisableKeyvalOption{ACCSUPP}{#2}%
- }%
-}
-\let\ACCSUPP@DisableOptions\@empty
-\ACCSUPP@DefineDriverKey{pdftex}
-\ACCSUPP@DefineDriverKey{luatex}
-\ACCSUPP@DefineDriverKey{dvips}
-\ACCSUPP@DefineDriverKey[dvips]{dvipsone}
-\ACCSUPP@DefineDriverKey{dvipdfm}
-\ACCSUPP@DefineDriverKey[dvipdfm]{dvipdfmx}
-\ACCSUPP@DefineDriverKey[dvipdfm]{xetex}
-\let\ACCSUPP@driver\relax
-\InputIfFileExists{accsupp.cfg}{}{}
-\providecommand*{\ActualTextDriverDefault}{dvips}
-\ifpdf
- \ifx\pdfextension\@undefined
- \def\ACCSUPP@driver{pdftex}%
- \else
- \def\ACCSUPP@driver{luatex}%
- \fi
-\else
- \ifxetex
- \def\ACCSUPP@driver{dvipdfm}%
- \else
- \ifx\ACCSUPP@driver\relax
- \let\ACCSUPP@driver\ActualTextDriverDefault
- \fi
- \fi
-\fi
-% \end{macrocode}
-%
-% \paragraph{Process options.}
-%
-% \begin{macrocode}
-\ProcessKeyvalOptions*
-\ACCSUPP@DisableOptions
-% \end{macrocode}
-%
-% \paragraph{Driver validation and loading.}
-%
-% \begin{macrocode}
-\def\ACCSUPP@temp{pdftex}%
-\ifpdf
- \ifx\pdfextension\@undefined\else
- \def\ACCSUPP@temp{luatex}%
- \fi
- \ifx\ACCSUPP@temp\ACCSUPP@driver
- \else
- \PackageWarningNoLine{accsupp}{%
- Wrong driver `\ACCSUPP@driver', using `pdftex' instead%
- }%
-ed as
- \let\ACCSUPP@driver\ACCSUPP@temp
- \fi
-\else
- \ifx\ACCSUPP@temp\ACCSUPP@driver
- \PackageError{accsupp}{%
- Wrong driver, pdfTeX is not running in PDF mode.\MessageBreak
- Package loading is aborted%
- }\@ehc
- \expandafter\expandafter\expandafter\ACCSUPP@AtEnd
- \fi
- \def\ACCSUPP@temp{dvipdfm}%
- \ifxetex
- \ifx\ACCSUPP@temp\ACCSUPP@driver
- \else
- \PackageWarningNoLine{accsupp}{%
- Wrong driver `\ACCSUPP@driver',\MessageBreak
- using `dvipdfm' for XeTeX instead%
- }%
- \let\ACCSUPP@driver\ACCSUPP@temp
- \fi
- \fi
-\fi%
-\ifx\ACCSUPP@driver\relax
- \PackageError{accsupp}{%
- Missing driver option.\MessageBreak
- Package loading is aborted%
- }\@ehc
- \expandafter\ACCSUPP@AtEnd
-\fi%
-\InputIfFileExists{accsupp-\ACCSUPP@driver.def}{}{%
- \PackageError{accsupp}{%
- Unsupported driver `\ACCSUPP@driver'.\MessageBreak
- Package loading is aborted%
- }\@ehc
- \ACCSUPP@AtEnd
-}%
-% \end{macrocode}
-%
-% \subsection{Main macro}
-%
-% \begin{macrocode}
-\DeclareBoolOption{unicode}
-\DeclareStringOption[page]{pdfliteral}
-\DeclareStringOption{Lang}
-\def\ACCSUPP@method{escape}
-\define@key{ACCSUPP}{method}{%
- \@ifundefined{ACCSUPP@method@#1}{%
- \PackageError{accsupp}{%
- Ignoring unknown method `#1'%
- }\@ehc
- }{%
- \edef\ACCSUPP@method{#1}%
- }%
-}
-\let\ACCSUPP@Lang\relax
-\def\ACCSUPP@temp#1{%
- \expandafter\ACCSUPP@@temp\csname ACCSUPP@#1\endcsname{#1}%
-}
-\def\ACCSUPP@@temp#1#2{%
- \let#1\relax
- \define@key{ACCSUPP}{#2}{%
- \def#1{##1}%
- \ifx#1\@empty
- \def#1{()}%
- \else
- \csname ACCSUPP@method@\ACCSUPP@method\endcsname#1%
- \fi
- }%
-}
-\ACCSUPP@temp{Alt}
-\ACCSUPP@temp{ActualText}
-\ACCSUPP@temp{E}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\newcommand*{\BeginAccSupp}[1]{%
- \begingroup
- \setkeys{ACCSUPP}{#1}%
- \edef\ACCSUPP@span{%
- /Span<<%
- \ifx\ACCSUPP@Lang\relax
- \else
- /Lang\ACCSUPP@Lang
- \fi
- \ifx\ACCSUPP@Alt\relax
- \else
- /Alt\ACCSUPP@Alt
- \fi
- \ifx\ACCSUPP@ActualText\relax
- \else
- /ActualText\ACCSUPP@ActualText
- \fi
- \ifx\ACCSUPP@E\relax
- \else
- /E\ACCSUPP@E
- \fi
- >>%
- }%
- \ACCSUPP@bdc
- \ACCSUPP@space
- \endgroup
-}
-\newcommand*{\EndAccSupp}[1]{%
- \begingroup
- \setkeys{ACCSUPP}{#1}%
- \ACCSUPP@emc
- \endgroup
-}
-\def\ACCSUPP@space{%
- \ifACCSUPP@space
- \begingroup
- \@ifundefined{ACCSUPP@Font}{%
- \global\font\ACCSUPP@Font=\ACCSUPP@spacefont\relax
- }{}%
- \leavevmode
- \setbox\z@\hbox{\ACCSUPP@Font\char\ACCSUPP@spacechar}%
- \wd\z@\z@
- \ht\z@\z@
- \dp\z@\z@
- \copy\z@
- \endgroup
- \fi
-}
-\newcommand*{\AccSuppSetup}{%
- \setkeys{ACCSUPP}%
-}
-% \end{macrocode}
-%
-% \subsubsection{Input methods}
-%
-% \begin{macrocode}
-\def\ACCSUPP@method@plain#1{%
- \csname @safe@activestrue\endcsname
- \edef#1{%
- (%
- \ifACCSUPP@unicode
- \string\376\string\377%
- \fi
- #1%
- )%
- }%
- \@onelevel@sanitize#1%
-}
-% \end{macrocode}
-% \begin{macrocode}
-\def\ACCSUPP@method@escape#1{%
- \EdefEscapeString#1{%
- \ifACCSUPP@unicode
- ^^fe^^ff%
- \fi
- #1%
- }%
- \edef#1{(#1)}%
-}%
-% \end{macrocode}
-% \begin{macrocode}
-\def\ACCSUPP@method@hex#1{%
- \edef#1{%
- <%
- \ifACCSUPP@unicode
- FEFF%
- \fi
- #1%
- >%
- }%
-}
-% \end{macrocode}
-% \begin{macrocode}
-\def\ACCSUPP@method@pdfstringdef#1{%
- \ifACCSUPP@unicode
- \@ifundefined{hypersetup}{}{%
- \hypersetup{unicode}%
- }%
- \fi
- \@ifundefined{pdfstringdef}{%
- \PackageError{accsupp}{%
- Method `pdfstringdef' requires package `hyperref'%
- }\@ehc
- \let\ACCSUPP@temp\@empty
- }{%
- \begingroup
- \setbox0=\hbox{%
- \pdfstringdef\ACCSUPP@temp#1%
- \global\let\ACCSUPP@temp\ACCSUPP@temp
- }%
- \endgroup
- }%
- \edef#1{(\ACCSUPP@temp)}%
-}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ACCSUPP@AtEnd%
-%</package>
-% \end{macrocode}
-%
-% \subsection{Drivers}
-%
-% \subsubsection{Driver \xoption{pdftex}}
-%
-% \begin{macrocode}
-%<*pdftex>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{accsupp-pdftex.def}%
- [2018/03/28 v0.5 accsupp driver for pdfTeX (HO)]%
-% \end{macrocode}
-%
-% \begin{macrocode}
-\def\ACCSUPP@bdc{%
- \pdfliteral\ACCSUPP@pdfliteral{\ACCSUPP@span BDC}%
-}
-\def\ACCSUPP@emc{%
- \pdfliteral\ACCSUPP@pdfliteral{EMC}%
-}
-% \end{macrocode}
-% \begin{macrocode}
-%</pdftex>
-% \end{macrocode}
-%
-% \subsubsection{Driver \xoption{luatex}}
-%
-% \begin{macrocode}
-%<*luatex>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{accsupp-luatex.def}%
- [2018/03/28 v0.5 accsupp driver for pdfTeX (HO)]%
-% \end{macrocode}
-%
-% \begin{macrocode}
-\protected\def\ACCSUPP@pdf@literal{\pdfextension literal}
-\def\ACCSUPP@bdc{%
- \ACCSUPP@pdf@literal\ACCSUPP@pdfliteral{\ACCSUPP@span BDC}%
-}
-\def\ACCSUPP@emc{%
- \ACCSUPP@pdf@literal\ACCSUPP@pdfliteral{EMC}%
-}
-% \end{macrocode}
-% \begin{macrocode}
-%</luatex>
-% \end{macrocode}
-%
-% \subsubsection{Driver \xoption{dvipdfm}}
-%
-% \begin{macrocode}
-%<*dvipdfm>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{accsupp-dvipdfm.def}%
- [2018/03/28 v0.5 accsupp driver for dvipdfm (HO)]%
-% \end{macrocode}
-%
-% \begin{macrocode}
-\def\ACCSUPP@bdc{%
- \special{pdf:content \ACCSUPP@span BDC}%
-}
-\def\ACCSUPP@emc{%
- \special{pdf:content EMC}%
-}
-% \end{macrocode}
-% \begin{macrocode}
-%</dvipdfm>
-% \end{macrocode}
-%
-% \subsubsection{Driver \xoption{dvips}}
-%
-% \begin{macrocode}
-%<*dvips>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{accsupp-dvips.def}%
- [2018/03/28 v0.5 accsupp driver for dvips (HO)]%
-% \end{macrocode}
-%
-% \begin{macrocode}
-\def\ACCSUPP@bdc{%
- \special{ps:[\ACCSUPP@span/BDC pdfmark}%
-}
-\def\ACCSUPP@emc{%
- \special{ps:[/EMC pdfmark}%
-}
-% \end{macrocode}
-% \begin{macrocode}
-%</dvips>
-% \end{macrocode}
-% \section{Installation}
-%
-% \subsection{Download}
-%
-% \paragraph{Package.} This package is available on
-% CTAN\footnote{\CTANpkg{accsupp}}:
-% \begin{description}
-% \item[\CTAN{macros/latex/contrib/oberdiek/accsupp.dtx}] The source file.
-% \item[\CTAN{macros/latex/contrib/oberdiek/accsupp.pdf}] Documentation.
-% \end{description}
-%
-%
-% \paragraph{Bundle.} All the packages of the bundle `oberdiek'
-% are also available in a TDS compliant ZIP archive. There
-% the packages are already unpacked and the documentation files
-% are generated. The files and directories obey the TDS standard.
-% \begin{description}
-% \item[\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 accsupp.dtx|
-% \end{quote}
-%
-% \paragraph{TDS.} Now the different files must be moved into
-% the different directories in your installation TDS tree
-% (also known as \xfile{texmf} tree):
-% \begin{quote}
-% \def\t{^^A
-% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
-% accsupp.sty & tex/latex/oberdiek/accsupp.sty\\
-% accsupp-pdftex.def & tex/latex/oberdiek/accsupp-pdftex.def\\
-% accsupp-luatex.def & tex/latex/oberdiek/accsupp-luatex.def\\
-% accsupp-dvipdfm.def & tex/latex/oberdiek/accsupp-dvipdfm.def\\
-% accsupp-dvips.def & tex/latex/oberdiek/accsupp-dvips.def\\
-% accsupp.pdf & doc/latex/oberdiek/accsupp.pdf\\
-% accsupp-example1.tex & doc/latex/oberdiek/accsupp-example1.tex\\
-% accsupp-example2.tex & doc/latex/oberdiek/accsupp-example2.tex\\
-% accsupp.dtx & source/latex/oberdiek/accsupp.dtx\\
-% \end{tabular}^^A
-% }^^A
-% \sbox0{\t}^^A
-% \ifdim\wd0>\linewidth
-% \begingroup
-% \advance\linewidth by\leftmargin
-% \advance\linewidth by\rightmargin
-% \edef\x{\endgroup
-% \def\noexpand\lw{\the\linewidth}^^A
-% }\x
-% \def\lwbox{^^A
-% \leavevmode
-% \hbox to \linewidth{^^A
-% \kern-\leftmargin\relax
-% \hss
-% \usebox0
-% \hss
-% \kern-\rightmargin\relax
-% }^^A
-% }^^A
-% \ifdim\wd0>\lw
-% \sbox0{\small\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\footnotesize\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\scriptsize\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\tiny\t}^^A
-% \ifdim\wd0>\linewidth
-% \lwbox
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \end{quote}
-% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
-% TDS installing feature, then some files can already be in the right
-% place, see the documentation of \docstrip.
-%
-% \subsection{Refresh file name databases}
-%
-% If your \TeX~distribution
-% (\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{accsupp.dtx}|
-% \end{quote}
-% Do not forget to quote the argument according to the demands
-% of your shell.
-%
-% \paragraph{Generating the documentation.}
-% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
-% the documentation. The process can be configured by the
-% configuration file \xfile{ltxdoc.cfg}. For instance, put this
-% line into this file, if you want to have A4 as paper format:
-% \begin{quote}
-% \verb|\PassOptionsToClass{a4paper}{article}|
-% \end{quote}
-% An example follows how to generate the
-% documentation with pdf\LaTeX:
-% \begin{quote}
-%\begin{verbatim}
-%pdflatex accsupp.dtx
-%makeindex -s gind.ist accsupp.idx
-%pdflatex accsupp.dtx
-%makeindex -s gind.ist accsupp.idx
-%pdflatex accsupp.dtx
-%\end{verbatim}
-% \end{quote}
-%
-% \begin{thebibliography}{9}
-% \bibitem{pdfspec}
-% Adobe Systems Incorporated,
-% \textit{PDF Reference}, 6th edition, 2006.
-% \url{http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference.pdf}
-%
-% \end{thebibliography}
-%
-% \begin{History}
-% \begin{Version}{2007/03/21 v0.1}
-% \item
-% First version.
-% \end{Version}
-% \begin{Version}{2007/11/14 v0.2}
-% \item
-% Various bug fixes.
-% \item
-% Catcode section rewritten, test added.
-% \end{Version}
-% \begin{Version}{2010/01/16 v0.3}
-% \item
-% \cs{AccSuppSetup} added.
-% \item
-% Options \xoption{space}, \xoption{spacefont}, \xoption{spacechar} added.
-% \end{Version}
-% \begin{Version}{2016/05/16 v0.4}
-% \item
-% Documentation updates.
-% \end{Version}
-% \begin{Version}{2018/03/28 v0.5}
-% \item
-% LuaTeX support added.
-% \end{Version}
-% \end{History}
-%
-% \PrintIndex
-%
-% \Finale
-\endinput
diff --git a/macros/latex/contrib/oberdiek/accsupp.pdf b/macros/latex/contrib/oberdiek/accsupp.pdf
deleted file mode 100644
index 6f35b10ffd..0000000000
--- a/macros/latex/contrib/oberdiek/accsupp.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/atbegshi.dtx b/macros/latex/contrib/oberdiek/atbegshi.dtx
deleted file mode 100644
index 7827606797..0000000000
--- a/macros/latex/contrib/oberdiek/atbegshi.dtx
+++ /dev/null
@@ -1,2114 +0,0 @@
-% \iffalse meta-comment
-%
-% File: atbegshi.dtx
-% Version: 2016/06/09 v1.18
-% Info: At begin shipout hook
-%
-% 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
-%
-% The Base Interpreter refers to any `TeX-Format',
-% because some files are installed in TDS:tex/generic//.
-%
-% This work consists of the main source file atbegshi.dtx
-% and the derived files
-% atbegshi.sty, atbegshi.pdf, atbegshi.ins, atbegshi.drv,
-% atbegshi-example1.tex, atbegshi-example2.tex,
-% atbegshi-test1.tex, atbegshi-test2.tex, atbegshi-test3.tex.
-%
-% Distribution:
-% CTAN:macros/latex/contrib/oberdiek/atbegshi.dtx
-% CTAN:macros/latex/contrib/oberdiek/atbegshi.pdf
-%
-% Unpacking:
-% (a) If atbegshi.ins is present:
-% tex atbegshi.ins
-% (b) Without atbegshi.ins:
-% tex atbegshi.dtx
-% (c) If you insist on using LaTeX
-% latex \let\install=y\input{atbegshi.dtx}
-% (quote the arguments according to the demands of your shell)
-%
-% Documentation:
-% (a) If atbegshi.drv is present:
-% latex atbegshi.drv
-% (b) Without atbegshi.drv:
-% latex atbegshi.dtx; ...
-% The class ltxdoc loads the configuration file ltxdoc.cfg
-% if available. Here you can specify further options, e.g.
-% use A4 as paper format:
-% \PassOptionsToClass{a4paper}{article}
-%
-% Programm calls to get the documentation (example):
-% pdflatex atbegshi.dtx
-% makeindex -s gind.ist atbegshi.idx
-% pdflatex atbegshi.dtx
-% makeindex -s gind.ist atbegshi.idx
-% pdflatex atbegshi.dtx
-%
-% Installation:
-% TDS:tex/generic/oberdiek/atbegshi.sty
-% TDS:doc/latex/oberdiek/atbegshi.pdf
-% TDS:doc/latex/oberdiek/atbegshi-example1.tex
-% TDS:doc/latex/oberdiek/atbegshi-example2.tex
-% TDS:source/latex/oberdiek/atbegshi.dtx
-%
-%<*ignore>
-\begingroup
- \catcode123=1 %
- \catcode125=2 %
- \def\x{LaTeX2e}%
-\expandafter\endgroup
-\ifcase 0\ifx\install y1\fi\expandafter
- \ifx\csname processbatchFile\endcsname\relax\else1\fi
- \ifx\fmtname\x\else 1\fi\relax
-\else\csname fi\endcsname
-%</ignore>
-%<*install>
-\input docstrip.tex
-\Msg{************************************************************************}
-\Msg{* Installation}
-\Msg{* Package: atbegshi 2016/06/09 v1.18 At begin shipout hook (HO)}
-\Msg{************************************************************************}
-
-\keepsilent
-\askforoverwritefalse
-
-\let\MetaPrefix\relax
-\preamble
-
-This is a generated file.
-
-Project: atbegshi
-Version: 2016/06/09 v1.18
-
-Copyright (C)
- 2007-2011 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 atbegshi.dtx
-and the derived files
- atbegshi.sty, atbegshi.pdf, atbegshi.ins, atbegshi.drv,
- atbegshi-example1.tex, atbegshi-example2.tex,
- atbegshi-test1.tex, atbegshi-test2.tex, atbegshi-test3.tex.
-
-\endpreamble
-\let\MetaPrefix\DoubleperCent
-
-\generate{%
- \file{atbegshi.ins}{\from{atbegshi.dtx}{install}}%
- \file{atbegshi.drv}{\from{atbegshi.dtx}{driver}}%
- \usedir{tex/generic/oberdiek}%
- \file{atbegshi.sty}{\from{atbegshi.dtx}{package}}%
- \usedir{doc/latex/oberdiek}%
- \file{atbegshi-example1.tex}{\from{atbegshi.dtx}{example1}}%
- \file{atbegshi-example2.tex}{\from{atbegshi.dtx}{example2}}%
-% \usedir{doc/latex/oberdiek/test}%
-% \file{atbegshi-test1.tex}{\from{atbegshi.dtx}{test1}}%
-% \file{atbegshi-test2.tex}{\from{atbegshi.dtx}{test2}}%
-% \file{atbegshi-test3.tex}{\from{atbegshi.dtx}{test3}}%
-}
-
-\catcode32=13\relax% active space
-\let =\space%
-\Msg{************************************************************************}
-\Msg{*}
-\Msg{* To finish the installation you have to move the following}
-\Msg{* file into a directory searched by TeX:}
-\Msg{*}
-\Msg{* atbegshi.sty}
-\Msg{*}
-\Msg{* To produce the documentation run the file `atbegshi.drv'}
-\Msg{* through LaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing!}
-\Msg{*}
-\Msg{************************************************************************}
-
-\endbatchfile
-%</install>
-%<*ignore>
-\fi
-%</ignore>
-%<*driver>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{atbegshi.drv}%
- [2016/06/09 v1.18 At begin shipout hook (HO)]%
-\documentclass{ltxdoc}
-\usepackage{holtxdoc}[2011/11/22]
-\begin{document}
- \DocInput{atbegshi.dtx}%
-\end{document}
-%</driver>
-% \fi
-%
-%
-%
-% \GetFileInfo{atbegshi.drv}
-%
-% \title{The \xpackage{atbegshi} package}
-% \date{2016/06/09 v1.18}
-% \author{Heiko Oberdiek\thanks
-% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
-%
-% \maketitle
-%
-% \begin{abstract}
-% This package is a modern reimplementation of package \xpackage{everyshi}
-% without the burden of compatibility. It makes use of \eTeX's if available.
-% Both \LaTeX\ and \plainTeX\ are supported.
-% \end{abstract}
-%
-% \tableofcontents
-%
-% \section{Documentation}
-%
-% Package \xpackage{atbegshi} redefines \cs{shipout} to insert
-% hooks for user code that is executed before the page is shipped out.
-% The code may modify or even discard the output page.
-% Three hooks are implemented:
-% \begin{enumerate}
-% \item A hook that is executed for every page, see\\
-% \cs{AtBeginShipout}
-% \item A hook that is executed for the next page only, see\\
-% \cs{AtBeginShipoutNext}
-% \item A hook that is only executed for the first page, see\\
-% \cs{AtBeginShipoutFirst}
-% \end{enumerate}
-% The hooks are executed in this order. The following three macros
-% provide the user interface for adding code to these hooks:
-%
-% \begin{declcs}{AtBeginShipout} \M{code}\\
-% \cs{AtBeginShipoutBox}
-% \end{declcs}
-% Execute the \meta{code} for every page.
-% The page contents is held in box register \cs{AtBeginShipoutBox}
-% and may be modified. Use \cs{AtBeginShipoutDiscard} if you want to
-% discard the page.
-%
-% \emph{Note:} Package \xpackage{everyshi} uses box register 255. With
-% package \xpackage{atbegshi} you must use \cs{AtBeginShipoutBox} instead.
-%
-% If \LaTeX\ calls \cs{shipout} in \cs{@outputpage} (part of its output
-% routine),
-% the meaning of \cs{protect} is \cs{noexpand}. \LaTeX\ sets
-% \cs{protect} to the appropriate \cs{@typeset@protect} in the box
-% that is shipped out. This is too late for the hooks, they
-% are called earlier in the redefined \cs{shipout}. Therefore
-% package \xpackage{atbegshi} sets \cs{protect} to \cs{@typeset@protect}
-% before it calls the hooks.
-% (In \cs{EveryShipout} of package \xpackage{everyshi} the
-% user is responsible for the correct setting of \cs{protect}.)
-%
-% \begin{declcs}{AtBeginShipoutNext} \M{code}
-% \end{declcs}
-% This reimplements package \xpackage{everyshi}'s \cs{AtNextShipout}.
-% The \meta{code} is executed at shipout time of the next page only.
-% It is just a convenience macro, it can be easily replaced by something
-% like:
-%\begin{quote}
-%\begin{verbatim}
-%\newcommand{\MyShipoutHook}{}%
-%\AtBeginShipout{\MyShipoutHook}
-%\gdef\MyShipoutHook{%
-% ... do something with next page ...
-% \gdef\MyShipoutHook{}%
-% }
-%\end{verbatim}
-%\end{quote}
-% (This can be necessary, if hook order does matter).
-%
-% \begin{declcs}{AtBeginShipoutFirst} \M{code}
-% \end{declcs}
-% This reimplements \LaTeX's \cs{AtBeginDvi}. This hook is
-% usually used for \cs{special} commands that include PostScript
-% header files. The \cs{code} is directly executed in a \cs{vbox}
-% that is put at the beginning of the output page. Dealing with
-% the output box \cs{AtBeginShipoutBox} is not necessary and
-% not permitted here.
-%
-% \begin{declcs}{AtBeginShipoutDiscard}
-% \end{declcs}
-% This macro notifies package \xpackage{atbegshi} that
-% the output page is discarded. The remaining hook code
-% and the remaining hooks are not executed and the page is thrown away.
-% Also \cs{deadcycles} is cleared to zero like an ordinary \cs{shipout}
-% would do.
-%
-% \begin{declcs}{AtBeginShipoutInit}
-% \end{declcs}
-% Usually the redefinition of \cs{shipout} is delayed by
-% \cs{AtBeginDocument} (if this macro exists). This can be
-% too late, if other packages also redefines \cs{shipout}
-% and the order does matter.
-% \cs{AtBeginShipoutInit} forces the immediate redefinition
-% of \cs{shipout}.
-%
-% \begin{declcs}{AtBeginShipoutAddToBox} \M{stuff}\\
-% \cs{AtBeginShipoutAddToBoxForeground} \M{stuff}
-% \end{declcs}
-% A quite common use case is the addition of \cs{special}
-% or other whatsits to the page output box. Macro
-% \cs{AtBeginShipoutAddToBox} puts \meta{stuff} in a
-% box with zeroed dimensions. The box with the \meta{stuff}
-% is put in the upper left corner of the shipout box
-% \cs{AtBeginShipoutBox}. Macro \cs{AtBeginShipoutAddToBox}
-% puts the \meta{stuff} in the background, the other macro
-% \cs{AtBeginShipoutAddToBoxForeground} in the foreground
-% after the original shipout box contents is set.
-%
-% A void shipout box (that means a discarded page)
-% remains void that means \meta{stuff} is ignored in this case.
-% The box type of \cs{AtBeginShipoutBox} is preserved.
-% Also the box nesting level for the original contents
-% of \cs{AtBeginShipoutBox} remains, for example, to avoid trouble
-% with links across pages in case of \hologo{pdfTeX}.
-%
-% \begin{declcs}{AtBeginShipoutUpperLeft} \M{background material}
-% \end{declcs}
-% This is a macro that puts material in the background of
-% box \cs{AtBeginShipoutBox}.
-% The \meta{background material} is set in an \cs{hbox}, the
-% reference point is the upper left corner of the output page.
-% In case of \pdfTeX\ in PDF mode, the settings of
-% \cs{pdfhorigin} and \cs{pdfvorigin} are respected.
-%
-% The macro \cs{AtBeginShipoutUpperLeft} is intended to be used
-% in one of the hook setting macros, such as
-% \cs{AtBeginShipout}, \cs{AtBeginShipoutFirst}, or
-% \cs{AtBeginShipoutNext}.
-%
-% For \LaTeX\ users the \meta{background material} is set
-% inside a \texttt{picture} environment:
-% \begin{quote}
-% |\begin{picture}(0,0)|\\
-% \mbox{}\quad |\setlength{\unitlength}{1pt}%|\\
-% \mbox{}\quad \meta{background material}\\
-% |\end{picture}|
-% \end{quote}
-%
-% \begin{declcs}{AtBeginShipoutUpperLeftForeground} \M{foreground material}
-% \end{declcs}
-% See \cs{AtBeginShipoutUpperLeft}. The difference is that the material
-% is put in the foreground.
-%
-% \begin{declcs}{AtBeginShipoutOriginalShipout} \meta{box}
-% \end{declcs}
-% It stores the meaning of \cs{shipout} at the time this package
-% is loaded.
-%
-% \begin{declcs}{AtBeginShipoutBoxWidth}\\
-% \cs{AtBeginShipoutBoxHeight}\\
-% \cs{AtBeginShipoutBoxDepth}\\
-% \end{declcs}
-% These macros store the dimensions of the output box \cs{AtBeginShipoutBox}
-% before the original shipout is called. If \cs{shipout} is not
-% redefined before the package loading or the box dimensions
-% are not changed by the redefined \cs{shipout}, these macros
-% contain the dimensions of the shipout box. These values can be
-% remembered by \cs{label} and \cs{ref}. For example, this is done
-% by the package module \xpackage{zref-pagelayout} of project \xpackage{zref}.
-% The dimensions of the shipout page can be used in some \hologo{TeX}
-% engines (\hologo{pdfTeX} in PDF mode, \hologo{XeTeX}) to calculate
-% the media size of the shipout page if \cs{pdfpagewidth} and
-% \cs{pdfpageheight} are not set.
-%
-% \subsection{Examples}
-%
-% \subsubsection{Example: circle in background}
-%
-% In this example we put a circle in the background in the middle
-% of the paper.
-%
-% \begin{macrocode}
-%<*example1>
-% \end{macrocode}
-% \begin{macrocode}
-\documentclass[a4paper]{article}
-\usepackage{color}
-\usepackage{atbegshi}
-% \end{macrocode}
-% Package \xpackage{picture} makes life a little easier, because
-% we can now also use length specifications in |picture|'s commands.
-% \begin{macrocode}
-\usepackage{picture}
-% \end{macrocode}
-% Now we draw the circle in the middle of the paper.
-% \cs{put} moves downwards, because the origin is at the top
-% of the page, not at its bottom.
-% \begin{macrocode}
-\AtBeginShipout{%
- \AtBeginShipoutUpperLeft{%
- \put(0.5\paperwidth,-0.5\paperheight){\circle{10}}%
- }%
-}
-\begin{document}
-\section{Hello World}
-\newpage
-\AtBeginShipoutNext{%
- \AtBeginShipoutUpperLeft{%
- \color{red}%
- \put(0,-0.5\paperheight){\line(1,0){\paperwidth}}%
- \put(0.5\paperwidth, 0){\line(0,-1){\paperheight}}%
- }%
-}
-Only on this page we add a red cross.
-\newpage
-This page has the circle only.
-\par
-\vspace{\fill}
-The next page will be discarded.
-\newpage
-\AtBeginShipoutNext{%
- \AtBeginShipoutDiscard
-}
-This page is discarded.
-\newpage
-The last page.
-\end{document}
-% \end{macrocode}
-% \begin{macrocode}
-%</example1>
-% \end{macrocode}
-%
-% \subsubsection{Example: adding TrimBox for dvipdfmx}
-%
-% Now an example from ``real life'' follows. Someone from the mailing list
-% for dvipdfmx wants to put a TrimBox on every page. If we use
-% \cs{AtBeginShipout}, we have to put the \cs{special} inside the
-% box \cs{AtBeginShipoutBox} that gets shipped out.
-% \begin{macrocode}
-%<*example2>
-\documentclass{minimal}
-\usepackage{atbegshi}
-\usepackage[
- dvipdfm,
- paperwidth=630bp,
- paperheight=810bp
-]{geometry}
-\AtBeginShipout{%
- \setbox\AtBeginShipoutBox=\hbox{%
- \special{pdf: put @thispage <</TrimBox[9 9 621 801]>>}%
- \box\AtBeginShipoutBox
- }%
-}
-\begin{document}
- First page
- \newpage
- Second page
-\end{document}
-%</example2>
-% \end{macrocode}
-% Remember, in \cs{AtBeginShipoutBoxFirst} the \cs{setbox} wrapper code
-% is implicitly given and the \cs{special} is used directly.
-%
-% \section{Method of \cs{shipout} overloading}
-%
-% \subsection{\cs{shipout}}
-%
-% The \TeX\ primitive command \cs{shipout} takes a box specification
-% and puts the box as a new page in the output file.
-% There are two kinds of box specifications:
-% \begin{description}
-% \item[Direct boxes:]
-% They are given by \cs{hbox}, \cs{vbox}, or \cs{vtop},\\
-% e.g. |\shipout\hbox{Hello World}|.
-% \item[Indirect boxes:]
-% \cs{box} or \cs{copy} references a box register by number.
-% The box register contains the contents of the box.
-%
-% \emph{Note:} \cs{box} also clears the box register globally.
-% \end{description}
-% Then we have to differentiate between void and empty boxes:
-% \begin{description}
-% \item[Void:]
-% Initially or after \cs{box} there is no box in the box register.
-% In this cases the box register is not empty, but \emph{void}.
-% \item[Empty:]
-% A box with empty contents, such as
-% |\hbox{}| (= \cs{null}) or |\vbox{}| is an \emph{empty \cs{hbox}}
-% or \emph{empty \cs{vbox}}. If a box register holds such a
-% box, the box still exists, therefore the box register is
-% \emph{not void}.
-% \end{description}
-%
-% \subsection{\cs{afterassignment}}
-%
-% We want to overload \cs{shipout} to do something with the box.
-% It is quite impossible to do this reliable by catching the box
-% using macro arguments. The
-% variety of box specifications is too large, Examples:
-% \begin{quote}
-% |\shipout\null|\\
-% |\shipout\vbox{...}|\\
-% |\shipout\vtop\bgroup ...\egroup|\\
-% |\shipout\box255|
-% \end{quote}
-% Even worse, the braces don't need to be balanced:
-% \begin{quote}
-% |\shipout\hbox\bgroup}|\\
-% |\shipout\vbox{\egroup|
-% \end{quote}
-% Happily TeX provides a reliable way via \cs{afterassignment}.
-% It takes a macro name and executes it just after the assignment.
-%
-% Now we can redefine \cs{shipout}. The box specification that
-% follows \cs{shipout} is catched by \cs{setbox}. This is an
-% assignment to a box register. \cs{afterassignment}
-% notifies \TeX, that we want to call \cs{@test} right after
-% the assignment:
-%\begin{quote}
-%\begin{verbatim}
-%\shipout :=
-% \afterassignment\@test
-% \setbox\mybox=
-%\end{verbatim}
-%\end{quote}
-% We have seen different box specifications. Indirect boxes are easy
-% to understand:
-% \begin{quote}
-% |\shipout\box0| $\Rightarrow$ |\setbox\mybox=\box0 |\fbox{\cs{@test}}
-% \end{quote}
-% However direct boxes can have arbitrary contents with lots of
-% other assignments. It would be quite inpredictable if \TeX\ would
-% put |\@test| after the first of such an assignment or after the
-% box specification if the box lacks of assignments.
-% Therefore \TeX\ puts |\@test| right at the beginning of the
-% box specification, e.g:
-% \begin{quote}
-% |\shipout\hbox{Hello World}|\\
-% $\Rightarrow$
-% |\setbox\mybox=\hbox{|\fbox{\cs{@test}}| Hello World}|
-% \end{quote}
-%
-% \subsection{Test for direct or indirect boxes}
-%
-% Now we want to execute \cs{@test}, but where are we?
-% We can be after the completed box assignment, if \cs{shipout}
-% was called with an indirect box. Or we are right at the beginning
-% of a direct box.
-%
-% \subsubsection{With \eTeX}
-%
-% With the \eTeX's extensions the answer is very easy:
-% Being inside the direct box means that we are inside a new group.
-% The new primitive command \cs{currentgrouplevel} tells how
-% deeply the groups are currently nested. Macro \cs{@test} just
-% compares the previously stored group level with the current one:
-%\begin{quote}
-%\begin{verbatim}
-%\shipout :=
-% \edef\saved@grouplevel{\number\currentgrouplevel}
-% \afterassignment\@test
-% \setbox\mybox=
-%
-%\@test :=
-% \ifnum\saved@grouplevel=\currentgrouplevel
-% % case: indirect box, the assignment is completed
-% \@output
-% \else
-% % case: direct box, we are inside the box
-% \aftergroup\@outbox
-% \fi
-%\end{verbatim}
-%\end{quote}
-%
-% \subsubsection{Without \eTeX}
-%
-% Life becomes complicate without \eTeX. We cannot ask the
-% group level. However, if we are inside a direct box,
-% the box register \cs{mybox} is not yet changed by \cs{setbox}.
-% Thus we need a special initial value and compare
-% it in \cs{@test} with the current value of the box.
-%
-% What can be used as initial value? Arbitrary box contents cannot
-% be compared. \TeX\ only tells us a few properties:
-% \begin{itemize}
-% \item Box type:\cs{ifhbox}, \cs{ifvbox}
-% \item Dimensions: \cs{wd}, \cs{ht}, \cs{dp}
-% \item Voidness: \cs{ifvoid}
-% \end{itemize}
-% Unhappily all these qualities even combined are not sufficient
-% for constructing an initial box value, because \cs{shipout} can be
-% called with a box that is accidently just the same as the choosen
-% initial value.
-%
-% Nevertheless we have two alternatives for an initial value:
-% \begin{itemize}
-% \item A box of some type with some funny settings that are
-% unlikely to occur in real life, e.g a height of |4911sp-\maxdimen|.
-% \item A void box.
-% \end{itemize}
-% A collision between this initial value and an indirect \cs{shipout}
-% box with just the same value is possible.
-% Then \cs{@test} will make a wrong decision that it is executed
-% inside a direct box and delays \cs{@output} by \cs{aftergroup}.
-% Thus \cs{@output} is not called at the place we want.
-% In contrary, the result is an uncertainty about the place:
-% \begin{itemize}
-% \item \cs{shipout} is used in a group that perhaps closes some
-% pages later. A bad place for \cs{@output}.
-% \item Without a surrounding group \cs{aftergroup} effectively kills
-% its argument.
-% \end{itemize}
-% In the first case of a box with special dimensions we can even loose
-% the page. However in the case of the void box, this effect is even
-% desired, because the original \cs{shipout} does not output void boxes.
-% All we have to do is to ensure that our box \cs{mybox} is always
-% void except for the phase when the overloaded \cs{shipout} is executed.
-% And secondly we must keep this semantics of \cs{shipout} for the void case
-% in our macros, namely \cs{@output}.
-%\begin{quote}
-%\begin{verbatim}
-%\shipout :=
-% % trick to get a void box \mybox
-% \begingroup
-% \setbox\mybox=\box\mybox
-% \endgroup
-% \afterassignment\@test
-% \setbox\mybox=
-%
-%\@test :=
-% \ifvoid\mybox
-% \aftergroup\@output
-% \else
-% \@output
-% \fi
-%\end{verbatim}
-%\end{quote}
-% The nasty case is |\shipout\box\voidb@x| where the indirect box
-% is void and that must not generate an output page.
-% If a surrounding group is missing the output is ignored
-% because of \cs{aftergroup}.
-% Otherwise \@output is called some time
-% later when the surrounding group closes.
-% But \cs{mybox} is void outside the execution phase
-% of the redefined \cs{shipout}. Also \cs{@output} checks for a
-% void box and cancels the page output.
-% The disadvantage remains that the hook in \cs{@output} is called
-% for a page that will not be output.
-%
-% \subsubsection{\cs{lastkern} method}
-%
-% At the beginning of a new box, there is no \cs{kern}, the contents
-% of the box is still empty and \cs{lastkern} returns 0\,pt.
-% This can be used to distinguish between direct and indirect boxes:
-% We execute \cs{setbox} in a box with a preceding non-zero kern.
-% After an indirect box, \cs{lastkern} sees this kern, otherwise
-% it returns 0\,pt.
-%\begin{quote}
-%\begin{verbatim}
-%\shipout :=
-% \begingroup
-% \setbox\mybox=\hbox\bgroup
-% \kern1pt
-% \afterassignment\shipout@test
-% \global\setbox\mybox=
-%\@test :=
-% \ifdim\lastkern=0pt
-% % direct box
-% \aftergroup\egroup
-% \aftergroup\endgroup
-% \aftergroup\@output
-% \else
-% \egroup
-% \endgroup
-% \@output
-% \fi
-%\end{verbatim}
-%\end{quote}
-% We have two \cs{setbox} commands. The first creates a controlled
-% context box where we can safely insert a \cs{kern}. We get rid of
-% this temporarily used context box by putting the local \cs{setbox}
-% in a group.
-%
-% After the group we want to have our shipout box in \cs{mybox}.
-% Therefore we use a global assignment here.
-%
-% \subsection{Output}
-%
-% With or without \eTeX\ we ensure the original behaviour of
-% \cs{shipout} that void boxes do not generate output pages.
-%
-% Now we can place the hook \cs{@hook} for the user code that
-% wants to manipulate the output box.
-%\begin{quote}
-%\begin{verbatim}
-%\@output :=
-% \ifvoid\mybox
-% % cancel output of void box
-% \else
-% \@hook
-% \ifvoid\mybox
-% % user code in \@hook could has voided the box
-% \else
-% \original@shipout\box\mybox
-% \fi
-% \fi
-%\end{verbatim}
-%\end{quote}
-%
-% \subsection{Separate box register}
-%
-% So far we have said nothing about the box number of \cs{mybox}.
-% The following case that outputs the same page twice
-% shows that we are not free in the use
-% of the box register:
-% \begin{quote}
-% |\shipout\copy<num> \shipout\box<num>|
-% \end{quote}
-% We manipulate the box by the hook and without \eTeX\ the box
-% must even be voided. However, the use case above requires that
-% the box contents does not change at all. Therefore we must
-% reserve a separate box register to avoid collisions with
-% user box registers.
-%
-% \emph{Note:} Box register number 255 is special for the output
-% routine, because TeX complains if this box is not voided
-% by the output routine.
-% However, this requirement does not apply to \cs{shipout} at all.
-% In fact \cs{shipout} does not change any box register. This is
-% usually done by a call of \cs{box}, but the output routine
-% can do it later \emph{after} invoking of \cs{shipout}.
-%
-% \subsection{Summary}
-%
-% \subsubsection{With \eTeX}
-%
-% Putting the pieces together we get for \eTeX:
-%\begin{quote}
-%\begin{verbatim}
-%\newbox\mybox
-%\let\original@shipout\shipout
-%
-%\shipout :=
-% \edef\saved@grouplevel{\number\currentgrouplevel}
-% \afterassignment\@test
-% \setbox\mybox=
-%
-%\@test :=
-% \ifnum\saved@grouplevel<\currentgrouplevel
-% \expandafter\aftergroup
-% \fi
-% \@output
-%
-%\@output :=
-% \ifvoid\mybox
-% % cancel output of void box
-% \else
-% \@hook
-% \ifvoid\mybox
-% % user code in \@hook could have voided the box
-% \else
-% \original@shipout\box\mybox
-% \fi
-% \fi
-%\end{verbatim}
-%\end{quote}
-%
-% \subsubsection{Without \eTeX, traditional way}
-%
-% And for \TeX\ without \eTeX:
-%\begin{quote}
-%\begin{verbatim}
-%\newbox\mybox
-%\begingroup
-% \setbox\mybox=\box\mybox % ensure \mybox is void
-%\endgroup
-%\let\original@shipout\shipout
-%
-%\shipout :=
-% % trick to get a void box \mybox
-% \begingroup
-% \setbox\mybox=\box\mybox
-% \endgroup
-% \afterassignment\@test
-% \setbox\mybox=
-%
-%\@test :=
-% \ifvoid\mybox
-% \expandafter\aftergroup
-% \fi
-% \@output
-%
-%\@output :=
-% \ifvoid\mybox
-% % cancel output of void box
-% \else
-% \@hook
-% \ifvoid\mybox
-% % user code in \@hook could have voided the box
-% \else
-% \original@shipout\box\mybox
-% \fi
-% \fi
-%\end{verbatim}
-%\end{quote}
-%
-% \subsubsection{\cs{lastkern} method}
-%
-% And for \TeX\ without \eTeX\ using the \cs{lastkern} method:
-%\begin{quote}
-%\begin{verbatim}
-%\newbox\mybox
-%\let\original@shipout\shipout
-%
-%\shipout :=
-% \begingroup
-% \setbox\mybox=\hbox\bgroup
-% \kern1pt
-% \afterassignment\@test
-% \setbox\mybox=
-%
-%\@test :=
-% \ifdim\lastkern=0pt
-% \expandafter\aftergroup
-% \fi
-% \@output
-%
-%\@output :=
-% \egroup
-% \endgroup
-% \ifvoid\mybox
-% % cancel output of void box
-% \else
-% \@hook
-% \ifvoid\mybox
-% % user code in \@hook could have voided the box
-% \else
-% \original@shipout\box\mybox
-% \fi
-% \fi
-%\end{verbatim}
-%\end{quote}
-%
-%
-% \StopEventually{
-% }
-%
-% \section{Implementation}
-%
-% Package \xpackage{atbegshi} uses \eTeX's \cs{currentgrouplevel},
-% if it is available. Otherwise the \cs{lastkern} method is used.
-%
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
-%
-% \subsection{Reload check and package identification}
-% Reload check, especially if the package is not used with \LaTeX.
-% \begin{macrocode}
-\begingroup\catcode61\catcode48\catcode32=10\relax%
- \catcode13=5 % ^^M
- \endlinechar=13 %
- \catcode35=6 % #
- \catcode39=12 % '
- \catcode44=12 % ,
- \catcode45=12 % -
- \catcode46=12 % .
- \catcode58=12 % :
- \catcode64=11 % @
- \catcode123=1 % {
- \catcode125=2 % }
- \expandafter\let\expandafter\x\csname ver@atbegshi.sty\endcsname
- \ifx\x\relax % plain-TeX, first loading
- \else
- \def\empty{}%
- \ifx\x\empty % LaTeX, first loading,
- % variable is initialized, but \ProvidesPackage not yet seen
- \else
- \expandafter\ifx\csname PackageInfo\endcsname\relax
- \def\x#1#2{%
- \immediate\write-1{Package #1 Info: #2.}%
- }%
- \else
- \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
- \fi
- \x{atbegshi}{The package is already loaded}%
- \aftergroup\endinput
- \fi
- \fi
-\endgroup%
-% \end{macrocode}
-% Package identification:
-% \begin{macrocode}
-\begingroup\catcode61\catcode48\catcode32=10\relax%
- \catcode13=5 % ^^M
- \endlinechar=13 %
- \catcode35=6 % #
- \catcode39=12 % '
- \catcode40=12 % (
- \catcode41=12 % )
- \catcode44=12 % ,
- \catcode45=12 % -
- \catcode46=12 % .
- \catcode47=12 % /
- \catcode58=12 % :
- \catcode64=11 % @
- \catcode91=12 % [
- \catcode93=12 % ]
- \catcode123=1 % {
- \catcode125=2 % }
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1#2#3[#4]{\endgroup
- \immediate\write-1{Package: #3 #4}%
- \xdef#1{#4}%
- }%
- \else
- \def\x#1#2[#3]{\endgroup
- #2[{#3}]%
- \ifx#1\@undefined
- \xdef#1{#3}%
- \fi
- \ifx#1\relax
- \xdef#1{#3}%
- \fi
- }%
- \fi
-\expandafter\x\csname ver@atbegshi.sty\endcsname
-\ProvidesPackage{atbegshi}%
- [2016/06/09 v1.18 At begin shipout hook (HO)]%
-% \end{macrocode}
-%
-% \subsection{Catcodes}
-%
-% \begin{macrocode}
-\begingroup\catcode61\catcode48\catcode32=10\relax%
- \catcode13=5 % ^^M
- \endlinechar=13 %
- \catcode123=1 % {
- \catcode125=2 % }
- \catcode64=11 % @
- \def\x{\endgroup
- \expandafter\edef\csname AtBegShi@AtEnd\endcsname{%
- \endlinechar=\the\endlinechar\relax
- \catcode13=\the\catcode13\relax
- \catcode32=\the\catcode32\relax
- \catcode35=\the\catcode35\relax
- \catcode61=\the\catcode61\relax
- \catcode64=\the\catcode64\relax
- \catcode123=\the\catcode123\relax
- \catcode125=\the\catcode125\relax
- }%
- }%
-\x\catcode61\catcode48\catcode32=10\relax%
-\catcode13=5 % ^^M
-\endlinechar=13 %
-\catcode35=6 % #
-\catcode64=11 % @
-\catcode123=1 % {
-\catcode125=2 % }
-\def\TMP@EnsureCode#1#2{%
- \edef\AtBegShi@AtEnd{%
- \AtBegShi@AtEnd
- \catcode#1=\the\catcode#1\relax
- }%
- \catcode#1=#2\relax
-}
-\TMP@EnsureCode{40}{12}% (
-\TMP@EnsureCode{41}{12}% )
-\TMP@EnsureCode{44}{12}% ,
-\TMP@EnsureCode{45}{12}% -
-\TMP@EnsureCode{47}{12}% /
-\TMP@EnsureCode{46}{12}% .
-\TMP@EnsureCode{58}{12}% :
-\TMP@EnsureCode{91}{12}% [
-\TMP@EnsureCode{93}{12}% ]
-\TMP@EnsureCode{94}{7}% ^(superscript)
-\TMP@EnsureCode{96}{12}% `
-\edef\AtBegShi@AtEnd{\AtBegShi@AtEnd\noexpand\endinput}
-% \end{macrocode}
-%
-% \subsection{Preparations}
-%
-% \begin{macrocode}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \def\TMP@RequirePackage#1[#2]{%
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname ver@#1.sty\endcsname\relax
- \input #1.sty\relax
- \fi
- }%
- \TMP@RequirePackage{infwarerr}[2007/09/09]%
- \TMP@RequirePackage{ltxcmds}[2010/03/01]%
-\else
- \RequirePackage{infwarerr}[2007/09/09]%
- \RequirePackage{ltxcmds}[2010/03/01]%
-\fi
-% \end{macrocode}
-%
-% \begin{macro}{\AtBegShi@CheckDefinable}
-% \begin{macrocode}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname @ifdefinable\endcsname\relax
- \def\AtBegShi@CheckDefinable#1{%
- \ifcase\ifx#1\relax
- \ltx@one
- \else
- \ifx#1\@undefined
- \ltx@one
- \else
- \ltx@zero
- \fi
- \fi
- \@PackageError{atbegshi}{%
- \string#1\space is already defined%
- }\@ehd
- \fi
- }%
-\else
- \def\AtBegShi@CheckDefinable#1{%
- \@ifdefinable{#1}{}%
- }%
-\fi
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\ifAtBegShi@Discarded}
-% \begin{macrocode}
-\ltx@newif\ifAtBegShi@Discarded
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBeginShipoutDiscard}
-% \begin{macrocode}
-\AtBegShi@CheckDefinable\AtBeginShipoutDiscard
-\def\AtBeginShipoutDiscard{%
- \deadcycles=\ltx@zero
- \global\AtBegShi@Discardedtrue
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname currentgrouplevel\endcsname\relax
- \catcode`X=9 % ignore
- \catcode`E=14 % comment
-\else
- \catcode`X=14 % comment
- \catcode`E=9 % ignore
-\fi
-% \end{macrocode}
-%
-% \begin{macro}{\AtBegShi@Shipout}
-% \begin{macrocode}
-\def\AtBegShi@Shipout{%
-X \begingroup
-X \setbox\AtBeginShipoutBox=\hbox\bgroup
-X \kern\p@
-E \edef\AtBegShi@GroupLevel{\number\currentgrouplevel}%
- \afterassignment\AtBegShi@Test
-X \global
- \setbox\AtBeginShipoutBox=%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBegShi@Test}
-% \begin{macrocode}
-\def\AtBegShi@Test{%
-X \ifdim\lastkern=0pt %
-E \ifnum\AtBegShi@GroupLevel<\currentgrouplevel
- \expandafter\aftergroup
- \fi
- \AtBegShi@Output
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBegShi@Output}
-% \begin{macrocode}
-\def\AtBegShi@Output{%
-X \egroup
-X \endgroup
- \ifvoid\AtBeginShipoutBox
- \@PackageWarning{atbegshi}{Ignoring void shipout box}%
- \else
- \let\AtBegShi@OrgProtect\protect
- \csname set@typeset@protect\endcsname
- \global\AtBegShi@Discardedfalse
- \AtBegShi@Hook
- \expandafter\gdef\expandafter\AtBegShi@HookNext
- \expandafter{\expandafter}%
- \AtBegShi@HookNext
- \ifAtBegShi@Discarded
- \@PackageInfoNoLine{atbegshi}{Shipout page discarded}%
- \global\AtBegShi@Discardedfalse
- \begingroup
- \setbox\AtBeginShipoutBox\box\AtBeginShipoutBox
- \endgroup
- \let\protect\AtBegShi@OrgProtect
- \else
- \AtBegShi@First
- \let\protect\AtBegShi@OrgProtect
- \AtBegShi@GetBoxSize\AtBeginShipoutBox
- \ltx@ifundefined{AtNextShipout}{%
- }{%
- \AtNextShipout{\AtBegShi@GetBoxSize\@cclv}%
- }%
- \AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox
- \fi
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBegShi@GetBoxSize}
-% \begin{macrocode}
-\def\AtBegShi@GetBoxSize#1{%
- \xdef\AtBeginShipoutBoxWidth{\the\wd#1}%
- \xdef\AtBeginShipoutBoxHeight{\the\ht#1}%
- \xdef\AtBeginShipoutBoxDepth{\the\dp#1}%
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBeginShipoutBoxWidth}
-% \begin{macrocode}
-\def\AtBeginShipoutBoxWidth{0pt}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBeginShipoutBoxHeight}
-% \begin{macrocode}
-\def\AtBeginShipoutBoxHeight{0pt}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBeginShipoutBoxDepth}
-% \begin{macrocode}
-\def\AtBeginShipoutBoxDepth{0pt}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-\catcode`\X=11 %
-\catcode`\E=11 %
-% \end{macrocode}
-%
-% \begin{macro}{\AtBegShi@First}
-% \begin{macrocode}
-\def\AtBegShi@First{%
- \ifx\AtBegShi@HookFirst\ltx@empty
- \else
- \AtBeginShipoutAddToBox{\AtBegShi@HookFirst}%
- \fi
- \global\let\AtBegShi@First\ltx@empty
- \global\let\AtBeginShipoutFirst\AtBegShi@FirstDisabled
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBegShi@Hook}
-% \begin{macrocode}
-\gdef\AtBegShi@Hook{}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBegShi@HookNext}
-% \begin{macrocode}
-\gdef\AtBegShi@HookNext{}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBegShi@HookFirst}
-% \begin{macrocode}
-\gdef\AtBegShi@HookFirst{}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBeginShipout}
-% \begin{macrocode}
-\AtBegShi@CheckDefinable\AtBeginShipout
-\def\AtBeginShipout{%
- \AtBegShi@AddHook\AtBegShi@Hook
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBeginShipoutNext}
-% \begin{macrocode}
-\AtBegShi@CheckDefinable\AtBeginShipoutNext
-\def\AtBeginShipoutNext{%
- \AtBegShi@AddHook\AtBegShi@HookNext
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBeginShipoutFirst}
-% \begin{macrocode}
-\AtBegShi@CheckDefinable\AtBeginShipoutFirst
-\def\AtBeginShipoutFirst{%
- \AtBegShi@AddTo\AtBegShi@HookFirst
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtBegShi@FirstDisabled}
-% \begin{macrocode}
-\long\def\AtBegShi@FirstDisabled#1{%
- \@PackageWarning{atbegshi}{%
- First page is already shipped out, ignoring\MessageBreak
- \string\AtBeginShipoutFirst
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBegShi@AddTo}
-% \begin{macrocode}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname g@addto@macro\endcsname\relax
- \long\def\AtBegShi@AddTo#1#2{%
- \begingroup
- \toks\ltx@zero\expandafter{#1#2}%
- \xdef#1{\the\toks\ltx@zero}%
- \endgroup
- }%
-\else
- \let\AtBegShi@AddTo\g@addto@macro
-\fi
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBegShi@AddHook}
-% \begin{macrocode}
-\long\def\AtBegShi@AddHook#1#2{%
- \AtBegShi@AddTo#1{\AtBegShi@Item{#2}}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBegShi@Item}
-% \begin{macrocode}
-\long\def\AtBegShi@Item#1{%
- \ifAtBegShi@Discarded
- \else
- #1%
- \ifAtBegShi@Discarded
- \else
- \ifvoid\AtBeginShipoutBox
- \@PackageWarning{atbegshi}{%
- Shipout box was voided by hook,\MessageBreak
- ignoring shipout box%
- }%
- \AtBeginShipoutDiscard
- \fi
- \fi
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBeginShipoutInit}
-% \begin{macrocode}
-\AtBegShi@CheckDefinable\AtBeginShipoutInit
-\def\AtBeginShipoutInit{%
- \ltx@IfUndefined{newbox}{%
- \@PackageError{atbegshi}{%
- \string\AtBeginShipoutInit\space failed\MessageBreak
- because of missing \expandafter\string\csname newbox\endcsname
- }\@ehc
- }{%
- \csname newbox\endcsname\AtBeginShipoutBox
- \AtBegShi@CheckDefinable\AtBeginShipoutOriginalShipout
- \global\let\AtBeginShipoutOriginalShipout\shipout
- \global\let\shipout\AtBegShi@Shipout
- }%
- \gdef\AtBeginShipoutInit{}%
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macrocode}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname AtBeginDocument\endcsname\relax
- \AtBeginShipoutInit
-\else
- \AtBeginDocument{\AtBeginShipoutInit}%
-\fi
-% \end{macrocode}
-%
-% \subsection{Additions to the shipout box}
-%
-% \begin{macro}{\AtBeginShipoutAddToBox}
-% \begin{macrocode}
-\def\AtBeginShipoutAddToBox#1{%
- \ifhbox\AtBeginShipoutBox
- \edef\AtBegShi@restore{%
- \hfuzz=\the\hfuzz\relax
- \hbadness=\the\hbadness\relax
- }%
- \hfuzz=1073741823sp\relax
- \hbadness=2147483647\relax
- \setbox\AtBeginShipoutBox=\hbox to \wd\AtBeginShipoutBox{%
- \setbox\ltx@zero=\hbox{%
- \begingroup
- \AtBegShi@restore
- #1%
- \endgroup
- }%
- \wd\ltx@zero=0pt\relax
- \ht\ltx@zero=0pt\relax
- \dp\ltx@zero=0pt\relax
- \raise\ht\AtBeginShipoutBox\copy\ltx@zero
- \unhcopy\AtBeginShipoutBox
- }%
- \AtBegShi@restore
- \else
- \ifvbox\AtBeginShipoutBox
- \edef\AtBegShi@restore{%
- \vfuzz=\the\vfuzz\relax
- \vbadness=\the\vbadness\relax
- \dimen\ltx@zero=\the\dimen\ltx@zero\relax
- }%
- \edef\AtBegShi@restorebox{%
- \ht\AtBeginShipoutBox=\the\ht\AtBeginShipoutBox\relax
- \dp\AtBeginShipoutBox=\the\dp\AtBeginShipoutBox\relax
- }%
- \vfuzz=1073741823sp\relax
- \vbadness=2147483647\relax
- \dimen\ltx@zero=\ht\AtBeginShipoutBox
- \advance\dimen\ltx@zero by \dp\AtBeginShipoutBox
- \setbox\AtBeginShipoutBox=\vbox to \dimen\ltx@zero{%
- \setbox\ltx@zero=\hbox{%
- \begingroup
- \AtBegShi@restore
- #1%
- \endgroup
- }%
- \wd\ltx@zero=0pt\relax
- \ht\ltx@zero=0pt\relax
- \dp\ltx@zero=0pt\relax
- \baselineskip=0pt\relax
- \lineskip=0pt\relax
- \lineskiplimit=0pt\relax
- \copy\ltx@zero
- \unvbox\AtBeginShipoutBox
- \kern0pt%
- }%
- \AtBegShi@restore
- \AtBegShi@restorebox
- \fi
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBeginShipoutAddToBoxForeground}
-% \begin{macrocode}
-\def\AtBeginShipoutAddToBoxForeground#1{%
- \ifhbox\AtBeginShipoutBox
- \edef\AtBegShi@restore{%
- \hfuzz=\the\hfuzz\relax
- \hbadness=\the\hbadness\relax
- }%
- \hfuzz=1073741823sp\relax
- \hbadness=2147483647\relax
- \setbox\AtBeginShipoutBox=\hbox to \wd\AtBeginShipoutBox{%
- \unhcopy\AtBeginShipoutBox
- \kern-\wd\AtBeginShipoutBox
- \setbox\ltx@zero=\hbox{%
- \begingroup
- \AtBegShi@restore
- #1%
- \endgroup
- }%
- \wd\ltx@zero=0pt\relax
- \ht\ltx@zero=0pt\relax
- \dp\ltx@zero=0pt\relax
- \raise\ht\AtBeginShipoutBox\copy\ltx@zero
- \kern\wd\AtBeginShipoutBox
- }%
- \AtBegShi@restore
- \else
- \ifvbox\AtBeginShipoutBox
- \edef\AtBegShi@restore{%
- \vfuzz=\the\vfuzz\relax
- \vbadness=\the\vbadness\relax
- \dimen\ltx@zero=\the\dimen\ltx@zero\relax
- }%
- \edef\AtBegShi@restorebox{%
- \ht\AtBeginShipoutBox=\the\ht\AtBeginShipoutBox\relax
- \dp\AtBeginShipoutBox=\the\dp\AtBeginShipoutBox\relax
- }%
- \vfuzz=1073741823sp\relax
- \vbadness=2147483647\relax
- \dimen\ltx@zero=\ht\AtBeginShipoutBox
- \advance\dimen\ltx@zero by \dp\AtBeginShipoutBox
- \setbox\AtBeginShipoutBox=\vbox to \dimen\ltx@zero{%
- \setbox\ltx@zero=\hbox{%
- \begingroup
- \AtBegShi@restore
- #1%
- \endgroup
- }%
- \wd\ltx@zero=0pt\relax
- \ht\ltx@zero=0pt\relax
- \dp\ltx@zero=0pt\relax
- \baselineskip=0pt\relax
- \lineskip=0pt\relax
- \lineskiplimit=0pt\relax
- \unvbox\AtBeginShipoutBox
- \kern-\dimen\ltx@zero
- \copy\ltx@zero
- \kern\dimen\ltx@zero
- }%
- \AtBegShi@restore
- \AtBegShi@restorebox
- \fi
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Positioning}
-%
-% \begin{macrocode}
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \def\TMP@RequirePackage#1[#2]{%
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname ver@#1.sty\endcsname\relax
- \input #1.sty\relax
- \fi
- }%
- \TMP@RequirePackage{ifpdf}[2011/01/30]%
-\else
- \RequirePackage{ifpdf}[2011/01/30]%
-\fi
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ifpdf
- \def\AtBegShi@horigin{%
- \ifx\pdfhorigin\@undefined\pdfvariable horigin\else\pdfhorigin\fi}%
- \def\AtBegShi@vorigin{%
- \ifx\pdfvorigin\@undefined\pdfvariable vorigin\else\pdfvorigin\fi}%
-\else
- \def\AtBegShi@horigin{72.27pt}%
- \def\AtBegShi@vorigin{72.27pt}%
-\fi
-% \end{macrocode}
-%
-% \begin{macrocode}
-\begingroup
-\ifcase
- \expandafter\ifx\csname picture\endcsname\relax
- 1%
- \else
- \expandafter\ifx\csname endpicture\endcsname\relax
- 1%
- \else
- 0%
- \fi
- \fi
- \endgroup
- \def\AtBegShi@BeginPicture{%
- \begingroup
- \picture(0,0)\relax
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname unitlength\endcsname\relax
- \else
- \unitlength=1pt\relax
- \fi
- \ignorespaces
- }%
- \def\AtBegShi@EndPicture{%
- \endpicture
- \endgroup
- }%
-\else
- \endgroup
- \def\AtBegShi@BeginPicture{%
- \setbox\ltx@zero=\hbox\bgroup
- \begingroup
- \ignorespaces
- }%
- \def\AtBegShi@EndPicture{%
- \endgroup
- \egroup
- \ht\ltx@zero=0pt\relax
- \dp\ltx@zero=0pt\relax
- \copy\ltx@zero
- }%
-\fi
-% \end{macrocode}
-%
-% \begin{macro}{\AtBeginShipoutUpperLeft}
-% A surrounding \cs{rlap} is not necessary, because
-% the stuff is put in an \cs{hbox} with zero width.
-% \begin{macrocode}
-\def\AtBeginShipoutUpperLeft#1{%
- \AtBeginShipoutAddToBox{%
- \kern-\AtBegShi@horigin\relax
- \vbox to 0pt{%
- \kern-\AtBegShi@vorigin\relax
- \AtBegShi@BeginPicture
- #1%
- \AtBegShi@EndPicture
- \vss
- }%
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtBeginShipoutUpperLeftForeground}
-% \begin{macrocode}
-\def\AtBeginShipoutUpperLeftForeground#1{%
- \AtBeginShipoutAddToBoxForeground{%
- \kern-\AtBegShi@horigin\relax
- \vbox to 0pt{%
- \kern-\AtBegShi@vorigin\relax
- \AtBegShi@BeginPicture
- #1%
- \AtBegShi@EndPicture
- \vss
- }%
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Patches}
-%
-% Patches for \LaTeX\ packages that redefine \cs{shipout}.
-% \LaTeX\ is now supposed to use \eTeX. Thus we do not patch,
-% without \LaTeX\ and \eTeX.
-% \begin{macrocode}
-\def\AtBegShi@AbortIfUndefined#1{%
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname#1\endcsname\relax
- \expandafter\AtBegShi@AtEnd
- \fi
-}
-\AtBegShi@AbortIfUndefined{currentgrouplevel}%
-\AtBegShi@AbortIfUndefined{AtBeginDocument}%
-\AtBegShi@AbortIfUndefined{@ifpackageloaded}%
-\AtBegShi@AbortIfUndefined{@ifclassloaded}%
-% \end{macrocode}
-%
-% \subsubsection{Package \xpackage{crop}}
-%
-% Fix of method and box.
-% \begin{macrocode}
-\def\AtBegShi@PatchCrop{%
- \begingroup
- \def\AtBegShi@Crop@shipout{%
- \afterassignment\CROP@ship
- \setbox\@cclv=%
- }%
- \def\AtBegShi@Crop@ship{%
- \ifvoid\@cclv
- \expandafter\aftergroup
- \fi
- \CROP@@ship
- }%
- \def\AtBegShi@Crop@shiplist{%
- \lineskip\z@
- \lineskiplimit\z@
- \baselineskip\z@
- \CROP@kernel
- \box\@cclv
- }%
- \def\AtBegShi@Crop@@ship{%
- \CROP@shipout\vbox{%
- \CROP@shiplist
- }%
- }%
- \ifx\AtBegShi@Crop@ship\CROP@ship
- \ifx\AtBegShi@Crop@shiplist\CROP@shiplist
- \ifx\AtBegShi@Crop@@ship\CROP@@ship
- \let\AtBegShi@found\relax
- \ifx\shipout\AtBegShi@Crop@shipout
- \def\AtBegShi@found{\shipout}%
- \else\ifx\AtBeginShipoutOriginalShipout\AtBegShi@Crop@shipout
- \def\AtBegShi@found{\AtBeginShipoutOriginalShipout}%
- \else\ifx\@EveryShipout@Org@Shipout\AtBegShi@Crop@shipout
- \def\AtBegShi@found{\@EveryShipout@Org@Shipout}%
- \else\ifx\GPTorg@shipout\AtBegShi@Crop@shipout
- \def\AtBegShi@found{\GPTorg@shipout}%
- \else\ifx\THBorg@shipout\AtBegShi@Crop@shipout
- \def\AtBegShi@found{\THBorg@shipout}%
- \else\ifx\mem@oldshipout\AtBegShi@Crop@shipout
- \def\AtBegShi@found{\mem@oldshipout}%
- \fi\fi\fi\fi\fi\fi
- \ifx\AtBegShi@found\relax
- \else
- \expandafter\endgroup
- \expandafter\def\AtBegShi@found{%
- \edef\AtBegShi@GroupLevel{\number\currentgrouplevel}%
- \afterassignment\CROP@ship
- \setbox\AtBeginShipoutBox=%
- }%
- \def\CROP@ship{%
- \ifnum\AtBegShi@GroupLevel=\currentgrouplevel
- \else
- \expandafter\aftergroup
- \fi
- \CROP@@ship
- }%
- \def\CROP@shiplist{%
- \lineskip 0pt\relax
- \lineskiplimit 0pt\relax
- \baselineskip 0pt\relax
- \CROP@kernel
- \box\AtBeginShipoutBox
- }%
- \def\CROP@@ship{%
- \ifvoid\AtBeginShipoutBox
- \else
- \setbox\AtBeginShipoutBox=\vbox{%
- \CROP@shiplist
- }%
- \AtBegShi@GetBoxSize\AtBeginShipoutBox
- \expandafter\CROP@shipout
- \expandafter\box
- \expandafter\AtBeginShipoutBox
- \fi
- }%
- \@PackageInfoNoLine{atbegshi}{Package `crop' patched}%
- \begingroup
- \fi
- \fi
- \fi
- \fi
- \endgroup
- \let\AtBegShi@PatchCrop\relax
-}
-\@ifpackageloaded{crop}{%
- \AtBegShi@PatchCrop
-}{%
- \AtBeginDocument{\AtBegShi@PatchCrop}%
-}
-% \end{macrocode}
-%
-% \subsubsection{Package \xpackage{everyshi}}
-%
-% Fix of method. Use of box 255 is not changed.
-% \begin{macrocode}
-\def\AtBegShi@PatchEveryshi{%
- \begingroup
- \long\def\AtBegShi@Everyshi@shipout{%
- \afterassignment\@EveryShipout@Test
- \global\setbox\@cclv= %
- }%
- \long\def\AtBegShi@Everyshi@Test{%
- \ifvoid\@cclv\relax
- \aftergroup\@EveryShipout@Output
- \else
- \@EveryShipout@Output
- \fi
- }%
- \ifx\AtBegShi@Everyshi@Test\@EveryShipout@Test
- \let\AtBegShi@found\relax
- \ifx\shipout\AtBegShi@Everyshi@shipout
- \def\AtBegShi@found{\shipout}%
- \else\ifx\AtBeginShipoutOriginalShipout\AtBegShi@Everyshi@shipout
- \def\AtBegShi@found{\AtBeginShipoutOriginalShipout}%
- \else\ifx\CROP@shipout\AtBegShi@Everyshi@shipout
- \def\AtBegShi@found{\CROP@shipout}%
- \else\ifx\GPTorg@shipout\AtBegShi@Everyshi@shipout
- \def\AtBegShi@found{\GPTorg@shipout}%
- \else\ifx\THBorg@shipout\AtBegShi@Everyshi@shipout
- \def\AtBegShi@found{\THBorg@shipout}%
- \else\ifx\mem@oldshipout\AtBegShi@Everyshi@shipout
- \def\AtBegShi@found{\mem@oldshipout}%
- \else
- \expandafter\ifx\csname @EveryShipout@Org@Shipout\endcsname
- \relax
- \ifx\@EveryShipout@Shipout\AtBegShi@Everyshi@shipout
- \def\AtBegShi@found{\@EveryShipout@Shipout}%
- \fi
- \fi
- \fi\fi\fi\fi\fi\fi
- \ifx\AtBegShi@found\relax
- \else
- \expandafter\endgroup
- \expandafter\def\AtBegShi@found{%
- \edef\AtBegShi@GroupLevel{\number\currentgrouplevel}%
- \afterassignment\@EveryShipout@Test
- \setbox\AtBeginShipoutBox=%
- }%
- \def\@EveryShipout@Test{%
- \ifnum\AtBegShi@GroupLevel=\currentgrouplevel
- \else
- \expandafter\aftergroup
- \fi
- \AtBegShi@Everyshi@Output
- }%
- \def\AtBegShi@Everyshi@Output{%
- \ifvoid\AtBeginShipoutBox
- \else
- \global\setbox\ltx@cclv\box\AtBeginShipoutBox
- \expandafter\@EveryShipout@Output
- \fi
- }%
- \@PackageInfoNoLine{atbegshi}{Package `everyshi' patched}%
- \begingroup
- \fi
- \fi
- \endgroup
- \let\AtBegShi@PatchEveryshi\relax
-}
-\@ifpackageloaded{everyshi}{%
- \AtBegShi@PatchEveryshi
-}{%
- \AtBeginDocument{\AtBegShi@PatchEveryshi}%
-}
-% \end{macrocode}
-%
-% \subsubsection{Class \xpackage{memoir}}
-%
-% Fix of method and box.
-% \begin{macrocode}
-\def\AtBegShi@PatchMemoir{%
- \begingroup
- \def\AtBegShi@Memoir@shipout{%
- \afterassignment\mem@shipi
- \setbox\@cclv=%
- }%
- \def\AtBegShi@Memoir@shipi{%
- \ifvoid\@cclv
- \expandafter\aftergroup
- \fi
- \mem@shipii
- }%
- \def\AtBegShi@Memoir@shipiiA{%
- \mem@oldshipout\vbox{%
- \trimmarks
- \unvbox\@cclv
- }%
- }%
- \def\AtBegShi@Memoir@shipiiB{%
- \ifvoid\@cclv
- \mem@oldshipout\box\@cclv
- \else
- \mem@oldshipout\vbox{%
- \trimmarks
- \unvbox\@cclv
- }%
- \fi
- }%
- \def\AtBegShi@Memoir@PatchAB{%
- \ifvoid\AtBeginShipoutBox
- \else
- \setbox\AtBeginShipoutBox=\vbox{%
- \trimmarks
- \ifvbox\AtBeginShipoutBox
- \unvbox\AtBeginShipoutBox
- \else
- \box\AtBeginShipoutBox
- \fi
- }%
- \AtBegShi@GetBoxSize\AtBeginShipoutBox
- \expandafter\mem@oldshipout
- \expandafter\box
- \expandafter\AtBeginShipoutBox
- \fi
- }%
- \def\AtBegShi@Memoir@shipiiC{% 2008/08/07 v1.6180339a
- \ifvoid\@cclv
- \mem@oldshipout\box\@cclv
- \else
- \ifshowtrims
- \mem@oldshipout\vbox{\trimmarks\unvbox\@cclv}%
- \else
- \mem@oldshipout\box\@cclv
- \fi
- \fi
- }%
- \def\AtBegShi@Memoir@shipiiD{% 2011/03/06 v3.6j
- \ifvoid\@cclv
- \mem@oldshipout\box\@cclv
- \else
- \ifshowtrims
- \mem@oldshipout\vbox{%
- \trimmarks
- \nointerlineskip
- \box\@cclv
- }%
- \else
- \mem@oldshipout\box\@cclv
- \fi
- \fi
- }%
- \def\AtBegShi@Memoir@PatchCD{%
- \ifvoid\AtBeginShipoutBox
- \else
- \ifshowtrims
- \setbox\AtBeginShipoutBox=\vbox{%
- \trimmarks
- \nointerlineskip
- \box\AtBeginShipoutBox
- }%
- \fi
- \AtBegShi@GetBoxSize\AtBeginShipoutBox
- \expandafter\mem@oldshipout
- \expandafter\box
- \expandafter\AtBeginShipoutBox
- \fi
- }%
- \ifx\AtBegShi@Memoir@shipi\mem@shipi
- \let\AtBegShi@found\ltx@one
- \ifx\AtBegShi@Memoir@shipiiA\mem@shipii
- \let\AtBegShi@found\ltx@zero
- \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchAB
- \else\ifx\AtBegShi@Memoir@shipiiB\mem@shipii
- \let\AtBegShi@found\ltx@zero
- \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchAB
- \else\ifx\AtBegShi@Memoir@shipiiC\mem@shipii
- \let\AtBegShi@found\ltx@zero
- \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchCD
- \else\ifx\AtBegShi@Memoir@shipiiD\mem@shipii
- \let\AtBegShi@found\ltx@zero
- \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchCD
- \fi\fi\fi\fi
- \ifcase\AtBegShi@found
- \let\AtBegShi@found\relax
- \ifx\shipout\AtBegShi@Memoir@shipout
- \def\AtBegShi@found{\shipout}%
- \else\ifx\AtBeginShipoutOriginalShipout\AtBegShi@Memoir@shipout
- \def\AtBegShi@found{\AtBeginShipoutOriginalShipout}%
- \else\ifx\CROP@shipout\AtBegShi@Memoir@shipout
- \def\AtBegShi@found{\CROP@shipout}%
- \else\ifx\GPTorg@shipout\AtBegShi@Memoir@shipout
- \def\AtBegShi@found{\GPTorg@shipout}%
- \else\ifx\THBorg@shipout\AtBegShi@Memoir@shipout
- \def\AtBegShi@found{\THBorg@shipout}%
- \else\ifx\@EveryShipout@Org@Shipout\AtBegShi@Memoir@shipout
- \def\AtBegShi@found{\@EveryShipout@Org@Shipout}%
- \fi\fi\fi\fi\fi\fi
- \ifx\AtBegShi@found\relax
- \else
- \expandafter\endgroup
- \expandafter\def\AtBegShi@found{%
- \edef\AtBegShi@GroupLevel{\number\currentgrouplevel}%
- \afterassignment\mem@shipi
- \setbox\AtBeginShipoutBox=%
- }%
- \def\mem@shipi{%
- \ifnum\AtBegShi@GroupLevel=\currentgrouplevel
- \else
- \expandafter\aftergroup
- \fi
- \mem@shipii
- }%
- \let\mem@shipii\AtBegShi@Memoir@PatchX
- \@PackageInfoNoLine{atbegshi}{Class `memoir' patched}%
- \begingroup
- \fi
- \fi
- \fi
- \endgroup
- \let\AtBegShi@PatchMemoir\relax
-}
-\@ifclassloaded{memoir}{%
- \AtBegShi@PatchMemoir
-}{%
- \AtBeginDocument{\AtBegShi@PatchMemoir}%
-}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\AtBegShi@AtEnd%
-%</package>
-% \end{macrocode}
-%% \section{Installation}
-%
-% \subsection{Download}
-%
-% \paragraph{Package.} This package is available on
-% CTAN\footnote{\CTANpkg{atbegshi}}:
-% \begin{description}
-% \item[\CTAN{macros/latex/contrib/oberdiek/atbegshi.dtx}] The source file.
-% \item[\CTAN{macros/latex/contrib/oberdiek/atbegshi.pdf}] Documentation.
-% \end{description}
-%
-%
-% \paragraph{Bundle.} All the packages of the bundle `oberdiek'
-% are also available in a TDS compliant ZIP archive. There
-% the packages are already unpacked and the documentation files
-% are generated. The files and directories obey the TDS standard.
-% \begin{description}
-% \item[\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 atbegshi.dtx|
-% \end{quote}
-%
-% \paragraph{TDS.} Now the different files must be moved into
-% the different directories in your installation TDS tree
-% (also known as \xfile{texmf} tree):
-% \begin{quote}
-% \def\t{^^A
-% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
-% atbegshi.sty & tex/generic/oberdiek/atbegshi.sty\\
-% atbegshi.pdf & doc/latex/oberdiek/atbegshi.pdf\\
-% atbegshi-example1.tex & doc/latex/oberdiek/atbegshi-example1.tex\\
-% atbegshi-example2.tex & doc/latex/oberdiek/atbegshi-example2.tex\\
-% atbegshi.dtx & source/latex/oberdiek/atbegshi.dtx\\
-% \end{tabular}^^A
-% }^^A
-% \sbox0{\t}^^A
-% \ifdim\wd0>\linewidth
-% \begingroup
-% \advance\linewidth by\leftmargin
-% \advance\linewidth by\rightmargin
-% \edef\x{\endgroup
-% \def\noexpand\lw{\the\linewidth}^^A
-% }\x
-% \def\lwbox{^^A
-% \leavevmode
-% \hbox to \linewidth{^^A
-% \kern-\leftmargin\relax
-% \hss
-% \usebox0
-% \hss
-% \kern-\rightmargin\relax
-% }^^A
-% }^^A
-% \ifdim\wd0>\lw
-% \sbox0{\small\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\footnotesize\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\scriptsize\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\tiny\t}^^A
-% \ifdim\wd0>\linewidth
-% \lwbox
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \end{quote}
-% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
-% TDS installing feature, then some files can already be in the right
-% place, see the documentation of \docstrip.
-%
-% \subsection{Refresh file name databases}
-%
-% If your \TeX~distribution
-% (\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{atbegshi.dtx}|
-% \end{quote}
-% Do not forget to quote the argument according to the demands
-% of your shell.
-%
-% \paragraph{Generating the documentation.}
-% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
-% the documentation. The process can be configured by the
-% configuration file \xfile{ltxdoc.cfg}. For instance, put this
-% line into this file, if you want to have A4 as paper format:
-% \begin{quote}
-% \verb|\PassOptionsToClass{a4paper}{article}|
-% \end{quote}
-% An example follows how to generate the
-% documentation with pdf\LaTeX:
-% \begin{quote}
-%\begin{verbatim}
-%pdflatex atbegshi.dtx
-%makeindex -s gind.ist atbegshi.idx
-%pdflatex atbegshi.dtx
-%makeindex -s gind.ist atbegshi.idx
-%pdflatex atbegshi.dtx
-%\end{verbatim}
-% \end{quote}
-%
-% \begin{History}
-% \begin{Version}{2007/04/17 v1.0}
-% \item
-% First version.
-% \end{Version}
-% \begin{Version}{2007/04/18 v1.1}
-% \item
-% New method based on \cs{lastkern} is used if \eTeX\ is missing.
-% \item
-% \cs{AtBeginShipoutDiscard} also resets \cs{deadcycles}.
-% \end{Version}
-% \begin{Version}{2007/04/19 v1.2}
-% \item
-% \cs{AtBeginShipoutEarly} removed for simplification reasons.
-% \item
-% Forgotten definition of \cs{AtBegShi@Info} added.
-% \item
-% Patches for packages \xpackage{crop} and \xpackage{everyshi}
-% and class \xclass{memoir} added.
-% \end{Version}
-% \begin{Version}{2007/04/26 v1.3}
-% \item
-% Use of package \xpackage{infwarerr}.
-% \item
-% Catcode section after generic header.
-% \end{Version}
-% \begin{Version}{2007/04/27 v1.4}
-% \item
-% Small optimizations.
-% \end{Version}
-% \begin{Version}{2007/06/06 v1.5}
-% \item
-% \cs{AtBeginShipoutUpperLeft} added.
-% \item
-% Example added.
-% \item
-% Fix in second test file for newer version of \xclass{memoir}.
-% \end{Version}
-% \begin{Version}{2007/09/09 v1.6}
-% \item
-% Catcode section rewritten.
-% \end{Version}
-% \begin{Version}{2008/07/18 v1.7}
-% \item
-% Documentation of \cs{AtBeginShipoutUpperLeft} fixed and extended.
-% \end{Version}
-% \begin{Version}{2008/07/19 v1.8}
-% \item
-% \cs{AtBeginShipoutUpperLeftForeground} added.
-% \end{Version}
-% \begin{Version}{2008/07/31 v1.9}
-% \item
-% Second example (TrimBox for dvipdfmx) added.
-% \item
-% No changes in package code.
-% \end{Version}
-% \begin{Version}{2009/12/02 v1.10}
-% \item
-% \cs{AtBeginShipoutOriginalShipout} added.
-% \item
-% Test file fixed.
-% \end{Version}
-% \begin{Version}{2010/03/01 v1.11}
-% \item
-% Compatibility with \iniTeX\ except for \cs{newbox}.
-% \end{Version}
-% \begin{Version}{2010/03/25 v1.12}
-% \item
-% \cs{AtBeginShipoutNext} can now be used inside
-% \cs{AtBeginShipoutNext}.
-% \end{Version}
-% \begin{Version}{2010/08/18 v1.13}
-% \item
-% Fixes for \cs{AtBegShi@CheckDefinable}.
-% \end{Version}
-% \begin{Version}{2010/12/02 v1.14}
-% \item
-% Remove the warning because of void box if the hook
-% calls \AtBeginShipoutDiscard.
-% \end{Version}
-% \begin{Version}{2011/01/30 v1.15}
-% \item
-% Already loaded package files are not input in \hologo{plainTeX}.
-% \end{Version}
-% \begin{Version}{2011/10/05 v1.16}
-% \item
-% \cs{AtBeginShipoutAddToBox}, \cs{AtBeginShipoutAddToBoxForeground} added.
-% \item
-% \cs{AtBeginShipoutBoxWidth}, \cs{AtBeginShipoutBoxHeight},
-% \cs{AtBeginShipoutBoxDepth} added.
-% \item
-% Updates for patches of class \xclass{memoir}.
-% \end{Version}
-% \begin{Version}{2016/05/16 v1.17}
-% \item
-% Documentation updates.
-% \end{Version}
-% \begin{Version}{2016/06/09 v1.18}
-% \item
-% Update for \cs{pdfhorign} in new LuaTeX.
-% \end{Version}
-% \end{History}
-%
-% \PrintIndex
-%
-% \Finale
-\endinput
diff --git a/macros/latex/contrib/oberdiek/atbegshi.pdf b/macros/latex/contrib/oberdiek/atbegshi.pdf
deleted file mode 100644
index 3423553408..0000000000
--- a/macros/latex/contrib/oberdiek/atbegshi.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/oberdiek/atveryend.dtx b/macros/latex/contrib/oberdiek/atveryend.dtx
deleted file mode 100644
index a6e2ef52fa..0000000000
--- a/macros/latex/contrib/oberdiek/atveryend.dtx
+++ /dev/null
@@ -1,1437 +0,0 @@
-% \iffalse meta-comment
-%
-% File: atveryend.dtx
-% Version: 2016/05/16 v1.9
-% Info: Hooks at the very end of document
-%
-% 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
-%
-% This work consists of the main source file atveryend.dtx
-% and the derived files
-% atveryend.sty, atveryend.pdf, atveryend.ins, atveryend.drv,
-% atveryend-test1.tex.
-%
-% Distribution:
-% CTAN:macros/latex/contrib/oberdiek/atveryend.dtx
-% CTAN:macros/latex/contrib/oberdiek/atveryend.pdf
-%
-% Unpacking:
-% (a) If atveryend.ins is present:
-% tex atveryend.ins
-% (b) Without atveryend.ins:
-% tex atveryend.dtx
-% (c) If you insist on using LaTeX
-% latex \let\install=y\input{atveryend.dtx}
-% (quote the arguments according to the demands of your shell)
-%
-% Documentation:
-% (a) If atveryend.drv is present:
-% latex atveryend.drv
-% (b) Without atveryend.drv:
-% latex atveryend.dtx; ...
-% The class ltxdoc loads the configuration file ltxdoc.cfg
-% if available. Here you can specify further options, e.g.
-% use A4 as paper format:
-% \PassOptionsToClass{a4paper}{article}
-%
-% Programm calls to get the documentation (example):
-% pdflatex atveryend.dtx
-% makeindex -s gind.ist atveryend.idx
-% pdflatex atveryend.dtx
-% makeindex -s gind.ist atveryend.idx
-% pdflatex atveryend.dtx
-%
-% Installation:
-% TDS:tex/latex/oberdiek/atveryend.sty
-% TDS:doc/latex/oberdiek/atveryend.pdf
-% TDS:source/latex/oberdiek/atveryend.dtx
-%
-%<*ignore>
-\begingroup
- \catcode123=1 %
- \catcode125=2 %
- \def\x{LaTeX2e}%
-\expandafter\endgroup
-\ifcase 0\ifx\install y1\fi\expandafter
- \ifx\csname processbatchFile\endcsname\relax\else1\fi
- \ifx\fmtname\x\else 1\fi\relax
-\else\csname fi\endcsname
-%</ignore>
-%<*install>
-\input docstrip.tex
-\Msg{************************************************************************}
-\Msg{* Installation}
-\Msg{* Package: atveryend 2016/05/16 v1.9 Hooks at the very end of document (HO)}
-\Msg{************************************************************************}
-
-\keepsilent
-\askforoverwritefalse
-
-\let\MetaPrefix\relax
-\preamble
-
-This is a generated file.
-
-Project: atveryend
-Version: 2016/05/16 v1.9
-
-Copyright (C)
- 2009-2011 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 atveryend.dtx
-and the derived files
- atveryend.sty, atveryend.pdf, atveryend.ins, atveryend.drv,
- atveryend-test1.tex.
-
-\endpreamble
-\let\MetaPrefix\DoubleperCent
-
-\generate{%
- \file{atveryend.ins}{\from{atveryend.dtx}{install}}%
- \file{atveryend.drv}{\from{atveryend.dtx}{driver}}%
- \usedir{tex/latex/oberdiek}%
- \file{atveryend.sty}{\from{atveryend.dtx}{package}}%
-% \usedir{doc/latex/oberdiek/test}%
-% \file{atveryend-test1.tex}{\from{atveryend.dtx}{test1}}%
-}
-
-\catcode32=13\relax% active space
-\let =\space%
-\Msg{************************************************************************}
-\Msg{*}
-\Msg{* To finish the installation you have to move the following}
-\Msg{* file into a directory searched by TeX:}
-\Msg{*}
-\Msg{* atveryend.sty}
-\Msg{*}
-\Msg{* To produce the documentation run the file `atveryend.drv'}
-\Msg{* through LaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing!}
-\Msg{*}
-\Msg{************************************************************************}
-
-\endbatchfile
-%</install>
-%<*ignore>
-\fi
-%</ignore>
-%<*driver>
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{atveryend.drv}%
- [2016/05/16 v1.9 Hooks at the very end of document (HO)]%
-\documentclass{ltxdoc}
-\usepackage{holtxdoc}[2011/11/22]
-\begin{document}
- \DocInput{atveryend.dtx}%
-\end{document}
-%</driver>
-% \fi
-%
-%
-%
-% \GetFileInfo{atveryend.drv}
-%
-% \title{The \xpackage{atveryend} package}
-% \date{2016/05/16 v1.9}
-% \author{Heiko Oberdiek\thanks
-% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
-%
-% \maketitle
-%
-% \begin{abstract}
-% This \LaTeX\ package provides two hooks for \verb|\end{document}|
-% that are executed after the hook of \cs{AtEndDocument}.
-% \cs{AfterLastShipout} can be used for code that is to be executed
-% right after the last \cs{clearpage} before the \xext{aux} file
-% is closed. \cs{AtVeryEndDocument} is used for code after closing
-% and final reading of the \xext{aux} file.
-% \end{abstract}
-%
-% \tableofcontents
-%
-% \section{Documentation}
-%
-% There are packages (e.g. \xpackage{hyperref} \cite{hyperref},
-% \xpackage{lastpage} \cite{lastpage})
-% that want to call code after the typesetting is done, for example
-% to remember the last page number. \LaTeX\ provides the hook
-% \cs{AtEndDocument} (\xpackage{clsguide} \cite{clsguide}).
-% There are packages that use this hook to do their job for
-% typesetting pages (e.g. \xpackage{endfloat} emits the floats here
-% \cite{endfloat}).
-% Also a user might provide additional code in \cs{AtEndDocument}.
-% Therefore packages have to call \cs{clearpage} in \cs{AtEndDocument}
-% to get after the last shipout page. But this is not too reliable,
-% because the right timing is important between packages that want
-% or have to do things before the last page is output and packages
-% that only work properly if they can reach the point after the
-% last shipout.
-%
-% Therefore the task of this package is to provide additional
-% hooks for |\end{document}|. All hooks are called after
-% the hook of \cs{AtEndDocument}.
-% \begin{declcs}{BeforeClearDocument} \M{code}
-% \end{declcs}
-% The code is called before the final \cs{clearpage} in
-% \cs{enddocument}. However it is unknown, whether the last
-% page is already shipped out or if this will be triggered by the
-% final \cs{clearpage}.
-%
-% \begin{declcs}{AfterLastShipout} \M{code}
-% \end{declcs}
-% The code is called after the final \cs{clearpage} of \cs{enddocument}
-% before the main \xext{aux} file is closed. This is the right place
-% to remember the last page in the \xext{aux} file, for instance.
-%
-% \begin{declcs}{AtVeryEndDocument} \M{code}
-% \end{declcs}
-% The code is called after the \xext{aux} file is closed and read in again.
-% It is the place for final checks, rerun hints, final messages.
-%
-% \begin{declcs}{AtEndAfterFileList} \M{code}
-% \end{declcs}
-% After the \xext{aux} file closing and reading \hologo{LaTeX}
-% prints the file list if requested by \cs{listfiles}.
-% Then this hook is executed.
-%
-% \begin{declcs}{AtVeryVeryEnd} \M{code}
-% \end{declcs}
-% This code is called right before the final \cs{@@end}.
-%
-% \subsection{Related work}
-%
-% \begin{description}
-% \item[Package \xpackage{scrfile}:]
-% Markus Kohm has written package \xpackage{scrlfile}
-% (part of KOMA-Script \cite{koma})
-% that provides
-% hooks \cs{BeforeClosingMainAux} and after \cs{AfterReadingMainAux}.
-% They have the same function as the hooks of this package. In fact
-% this package uses them, if they are available.
-% \item[Class \xclass{revtex4-1}:]
-% This class calls \cs{clear@document} in \cs{enddocument}
-% that wraps the final call of \cs{clearpage}.
-% Thus it can be used as hook to call stuff after that \cs{clearpage}.
-% This is also done by this package.
-% \item[Package \xpackage{etoolbox}:]
-% It provides \cs{AfterEndDocument}, a hook right before
-% \cs{deadcycles} or \cs{@@end} \cite{etoolbox}.
-% \end{description}
-% This package tries to combine as many approaches as possible:
-% \begin{itemize}
-% \item It looks for a known \cs{enddocument} and redefines it.
-% \item Hooks that are provided by others are used (package
-% \xpackage{scrlfile} or class \xclass{revtex4-1}.
-% \item It redefines \cs{@checkend} and \cs{@dofilelist} to insert
-% the hooks similar to package \xpackage{scrlfile}.
-% \item The hook execution is wrapped in a macro that
-% is redefined by its first call to prevent calling the hook
-% more than once.
-% \end{itemize}
-%
-% \StopEventually{
-% }
-%
-% \section{Implementation}
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
-%
-% \begin{macrocode}
-\begingroup\catcode61\catcode48\catcode32=10\relax%
- \catcode13=5 % ^^M
- \endlinechar=13 %
- \catcode123=1 % {
- \catcode125=2 % }
- \catcode64=11 % @
- \def\x{\endgroup
- \expandafter\edef\csname AtVeryEnd@AtEnd\endcsname{%
- \endlinechar=\the\endlinechar\relax
- \catcode13=\the\catcode13\relax
- \catcode32=\the\catcode32\relax
- \catcode35=\the\catcode35\relax
- \catcode61=\the\catcode61\relax
- \catcode64=\the\catcode64\relax
- \catcode123=\the\catcode123\relax
- \catcode125=\the\catcode125\relax
- }%
- }%
-\x\catcode61\catcode48\catcode32=10\relax%
-\catcode13=5 % ^^M
-\endlinechar=13 %
-\catcode35=6 % #
-\catcode64=11 % @
-\catcode123=1 % {
-\catcode125=2 % }
-\def\TMP@EnsureCode#1#2{%
- \edef\AtVeryEnd@AtEnd{%
- \AtVeryEnd@AtEnd
- \catcode#1=\the\catcode#1\relax
- }%
- \catcode#1=#2\relax
-}
-\TMP@EnsureCode{9}{10}% (tab)
-\TMP@EnsureCode{39}{12}% '
-\TMP@EnsureCode{40}{12}% (
-\TMP@EnsureCode{41}{12}% )
-\TMP@EnsureCode{42}{12}% *
-\TMP@EnsureCode{45}{12}% -
-\TMP@EnsureCode{46}{12}% .
-\TMP@EnsureCode{47}{12}% /
-\TMP@EnsureCode{62}{12}% >
-\TMP@EnsureCode{91}{12}% [
-\TMP@EnsureCode{93}{12}% ]
-\TMP@EnsureCode{96}{12}% `
-\edef\AtVeryEnd@AtEnd{\AtVeryEnd@AtEnd\noexpand\endinput}
-% \end{macrocode}
-%
-% Package identification.
-% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{atveryend}%
- [2016/05/16 v1.9 Hooks at the very end of document (HO)]
-% \end{macrocode}
-%
-% \subsection{Tools}
-%
-% \begin{macro}{\AtVeryEnd@ifundefined}
-% \begin{macrocode}
-\def\AtVeryEnd@ifundefined#1{%
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname #1\endcsname\relax
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Hooks}
-%
-% \begin{macro}{\AtVeryEnd@BeforeClearDocumentHook}
-% \begin{macrocode}
-\let\AtVeryEnd@BeforeClearDocumentHook\@empty
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@AfterLastShipoutHook}
-% \begin{macrocode}
-\let\AtVeryEnd@AfterLastShipoutHook\@empty
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@AtVeryEndDocumentHook}
-% \begin{macrocode}
-\let\AtVeryEnd@AtVeryEndDocumentHook\@empty
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@AtEndAfterFileListHook}
-% \begin{macrocode}
-\let\AtVeryEnd@AtEndAfterFileListHook\@empty
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@AtVeryVeryEndHook}
-% \begin{macrocode}
-\let\AtVeryEnd@AtVeryVeryEndHook\@empty
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\BeforeClearDocument}
-% \begin{macrocode}
-\newcommand*{\BeforeClearDocument}{%
- \g@addto@macro\AtVeryEnd@BeforeClearDocumentHook
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AfterLastShipout}
-% \begin{macrocode}
-\newcommand*{\AfterLastShipout}{%
- \g@addto@macro\AtVeryEnd@AfterLastShipoutHook
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEndDocument}
-% \begin{macrocode}
-\newcommand*{\AtVeryEndDocument}{%
- \g@addto@macro\AtVeryEnd@AtVeryEndDocumentHook
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtEndAfterFileList}
-% \begin{macrocode}
-\newcommand*{\AtEndAfterFileList}{%
- \g@addto@macro\AtVeryEnd@AtEndAfterFileListHook
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryVeryEnd}
-% \begin{macrocode}
-\newcommand*{\AtVeryVeryEnd}{%
- \g@addto@macro\AtVeryEnd@AtVeryVeryEndHook
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\Call@BeforeClearDocument}
-% \begin{macrocode}
-\newcommand*{\Call@BeforeClearDocument}{%
- \let\BeforeClearDocument\@firstofone
- \ifx\AtVeryEnd@BeforeClearDocumentHook\@empty
- \PackageInfo{atveryend}{Empty hook `BeforeClearDocument'}%
- \else
- \PackageInfo{atveryend}{Executing hook `BeforeClearDocument'}%
- \AtVeryEnd@BeforeClearDocumentHook
- \fi
- \global\let\AtVeryEnd@BeforeClearDocumentHook\@undefined
- \global\let\Call@BeforeClearDocument\relax
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\Call@AfterLastShipout}
-% \begin{macrocode}
-\newcommand*{\Call@AfterLastShipout}{%
- \let\AfterLastShipout\@firstofone
- \ifx\AtVeryEnd@AfterLastShipoutHook\@empty
- \PackageInfo{atveryend}{Empty hook `AfterLastShipout'}%
- \else
- \PackageInfo{atveryend}{Executing hook `AfterLastShipout'}%
- \AtVeryEnd@AfterLastShipoutHook
- \fi
- \global\let\AtVeryEnd@AfterLastShipoutHook\@undefined
- \global\let\Call@AfterLastShipout\relax
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\Call@AtVeryEndDocument}
-% \begin{macrocode}
-\newcommand*{\Call@AtVeryEndDocument}{%
- \let\AtVeryEndDocument\@firstofone
- \ifx\AtVeryEnd@AtVeryEndDocumentHook\@empty
- \PackageInfo{atveryend}{Empty hook `AtVeryEndDocument'}%
- \else
- \PackageInfo{atveryend}{Executing hook `AtVeryEndDocument'}%
- \AtVeryEnd@AtVeryEndDocumentHook
- \fi
- \global\let\AtVeryEnd@AtVeryEndDocumentHook\@undefined
- \global\let\Call@AtVeryEndDocument\relax
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\Call@AtEndAfterFileList}
-% \begin{macrocode}
-\newcommand*{\Call@AtEndAfterFileList}{%
- \Call@AtVeryEndDocument
- \let\AtEndAfterFileList\@firstofone
- \ifx\AtVeryEnd@AtEndAfterFileListHook\@empty
- \PackageInfo{atveryend}{Empty hook `AtEndAfterFileList'}%
- \else
- \PackageInfo{atveryend}{Executing hook `AtEndAfterFileList'}%
- \AtVeryEnd@AtEndAfterFileListHook
- \fi
- \global\let\AtVeryEnd@AtEndAfterFileListHook\@undefined
- \global\let\Call@AtEndAfterFileList\relax
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\Call@AtVeryVeryEnd}
-% \begin{macrocode}
-\newcommand*{\Call@AtVeryVeryEnd}{%
- \Call@AtEndAfterFileList
- \let\AtVeryVeryEnd\@firstofone
- \ifx\AtVeryEnd@AtVeryVeryEndHook\@empty
- \PackageInfo{atveryend}{Empty hook `AtVeryVeryEnd'}%
- \else
- \PackageInfo{atveryend}{Executing hook `AtVeryVeryEnd'}%
- \AtVeryEnd@AtVeryVeryEndHook
- \fi
- \global\let\AtVeryEnd@AtVeryVeryEndHook\@undefined
- \global\let\Call@AtVeryVeryEnd\relax
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Redefining \cs{enddocument}}
-%
-% This approach looks for known versions of \cs{enddocument}
-% and redefines it. Class \xclass{seminar}
-% and package \xpackage{slidesec} are not checked, because
-% there would be too much combinations to check.
-%
-% \subsubsection{\LaTeX\ kernel}
-%
-% \begin{macro}{\AtVeryEnd@test@standard}
-% \begin{macrocode}
-\def\AtVeryEnd@test@standard{%
- \let\AtEndDocument\@firstofone
- \@enddocumenthook
- \@checkend{document}%
- \clearpage
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter
- \input\jobname.aux %
- \fi
- \@dofilelist
- \ifdim \font@submax >\fontsubfuzz\relax
- \@font@warning{Size substitutions with differences\MessageBreak
- up to \font@submax\space have occurred.\@gobbletwo}%
- \fi
- \@defaultsubs
- \@refundefined
- \if@filesw
- \ifx \@multiplelabels \relax
- \if@tempswa
- \@latex@warning@no@line{Label(s) may have changed. %
- Rerun to get cross-references right}%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@standard}
-% \begin{macrocode}
-\def\AtVeryEnd@enddocument@standard{%
- \let\AtEndDocument\@firstofone
- \@enddocumenthook
- \@checkend{document}%
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter
- \input\jobname.aux %
- \fi
- \Call@AtVeryEndDocument
- \@dofilelist
- \Call@AtEndAfterFileList
- \ifdim \font@submax >\fontsubfuzz\relax
- \@font@warning{Size substitutions with differences\MessageBreak
- up to \font@submax\space have occurred.\@gobbletwo}%
- \fi
- \@defaultsubs
- \@refundefined
- \if@filesw
- \ifx \@multiplelabels \relax
- \if@tempswa
- \@latex@warning@no@line{Label(s) may have changed. %
- Rerun to get cross-references right}%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{\LaTeX\ kernel 2011/06/27}
-%
-% The \hologo{LaTeX2e} release 2011/06/27 has changed \cs{enddocument}
-% (\cs{input} is replaced by \cs{@@input}).
-% \begin{macro}{\AtVeryEnd@test@standard20110627}
-% \begin{macrocode}
-\expandafter\def\csname AtVeryEnd@test@standard20110627\endcsname{%
- \let\AtEndDocument\@firstofone
- \@enddocumenthook
- \@checkend{document}%
- \clearpage
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter
- \@@input\jobname.aux %
- \fi
- \@dofilelist
- \ifdim \font@submax >\fontsubfuzz\relax
- \@font@warning{Size substitutions with differences\MessageBreak
- up to \font@submax\space have occurred.\@gobbletwo}%
- \fi
- \@defaultsubs
- \@refundefined
- \if@filesw
- \ifx \@multiplelabels \relax
- \if@tempswa
- \@latex@warning@no@line{Label(s) may have changed. %
- Rerun to get cross-references right}%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@standard20110627}
-% \begin{macrocode}
-\expandafter\def\csname AtVeryEnd@enddocument@standard20110627\endcsname{%
- \let\AtEndDocument\@firstofone
- \@enddocumenthook
- \@checkend{document}%
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter
- \@@input\jobname.aux %
- \fi
- \Call@AtVeryEndDocument
- \@dofilelist
- \Call@AtEndAfterFileList
- \ifdim \font@submax >\fontsubfuzz\relax
- \@font@warning{Size substitutions with differences\MessageBreak
- up to \font@submax\space have occurred.\@gobbletwo}%
- \fi
- \@defaultsubs
- \@refundefined
- \if@filesw
- \ifx \@multiplelabels \relax
- \if@tempswa
- \@latex@warning@no@line{Label(s) may have changed. %
- Rerun to get cross-references right}%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Package \xpackage{booklet}, file \xpackage{2up.tex}}
-%
-% \begin{macro}{\AtVeryEnd@test@booklet}
-% \begin{macrocode}
-\expandafter\def\expandafter\AtVeryEnd@test@booklet\expandafter{%
- \expandafter\twoupclearpage
- \AtVeryEnd@test@standard
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@booklet}
-% \begin{macrocode}
-\expandafter\def\expandafter\AtVeryEnd@enddocument@booklet\expandafter{%
- \expandafter\twoclearpage
- \AtVeryEnd@enddocument@standard
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Class \xclass{dinbrief}}
-%
-% \begin{macro}{\AtVeryEnd@test@dinbrief}
-% \begin{macrocode}
-\def\AtVeryEnd@test@dinbrief{%
- \@checkend{document} %
- \newpage
- \begingroup
- \if@filesw
- \ifnum\c@labelgen>0 %
- \immediate\closeout\@mainlbl
- \makeatletter
- \input \jobname@lbl\relax
- \clearpage
- \fi
- \immediate\closeout\@mainaux
- \fi
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@dinbrief}
-% \begin{macrocode}
-\def\AtVeryEnd@enddocument@dinbrief{%
- \@checkend{document}%
- \Call@BeforeClearDocument
- \newpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \ifnum\c@labelgen>\z@
- \immediate\closeout\@mainlbl
- \makeatletter
- \input \jobname@lbl\relax
- \clearpage
- \fi
- \immediate\closeout\@mainaux
- \fi
- \Call@AtVeryEndDocument
- \csname @dofilelist\endcsname
- \Call@AtEndAfterFileList
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Class \xclass{combine}}
-%
-% \begin{macro}{\AtVeryEnd@test@combine}
-% \begin{macrocode}
-\def\AtVeryEnd@test@combine{%
- \@enddocumenthook
- \@checkend{document}%
- \clearpage
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \immediate\closeout\@partaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter \input\c@lmainauxfile %% change here
- \fi
- \c@lenddoca %% a replacement
- \@refundefined
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@combine}
-% \begin{macrocode}
-\def\AtVeryEnd@enddocument@combine{%
- \@enddocumenthook
- \@checkend{document}%
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \immediate\closeout\@partaux
- \let\@setckpt\@gobbletwo
- \let\@newl@bel\@testdef
- \@tempswafalse
- \makeatletter \input\c@lmainauxfile %% change here
- \fi
- \Call@AtVeryEndDocument
- \c@lenddoca %% a replacement
- \@refundefined
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AtVeryEnd@test@c@lenddoca}
-% \begin{macrocode}
-\long\def\AtVeryEnd@test@c@lenddoca{%
- \@dofilelist
- \ifdim\font@submax>\fontsubfuzz\relax
- \@font@warning{%
- Size substitutions with differences\MessageBreak
- up to \font@submax\space have occured.\@gobbletwo
- }%
- \fi
- \@defaultsubs
- \if@filesw
- \ifx\@multiplelabels\relax
- \if@tempswa
- \@latex@warning@no@line{%
- Label(s) may have changed. %
- Rerun to get cross-references right%
- }%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\c@lenddoca}
-% \begin{macrocode}
-\ifx\AtVeryEnd@c@lenddoca\c@lenddoca
- \def\c@lenddoca{%
- \@dofilelist
- \Call@AtEndAfterFileList
- \ifdim\font@submax>\fontsubfuzz\relax
- \@font@warning{%
- Size substitutions with differences\MessageBreak
- up to \font@submax\space have occured.\@gobbletwo
- }%
- \fi
- \@defaultsubs
- \if@filesw
- \ifx\@multiplelabels\relax
- \if@tempswa
- \@latex@warning@no@line{%
- Label(s) may have changed. %
- Rerun to get cross-references right%
- }%
- \fi
- \else
- \@multiplelabels
- \fi
- \fi
- }%
-\fi
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Class \xpackage{jpsj2}}
-%
-% \begin{macro}{\AtVeryEnd@test@jpsj}
-% \begin{macrocode}
-\def\AtVeryEnd@test@jpsj{%
- \if@lastpagebalancing
- \global\let\@outputdblcol=\balancing@outputdblcol
- \fi
- \@checkend{document}%
- \clearpage
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \def\global\@namedef##1##2{}%
- \def\newlabel{\@testdef r}%
- \def\bibcite{\@testdef b}%
- \@tempswafalse
- \makeatletter
- \input \jobname.aux %
- \if@tempswa
- \@warning{%
- Label(s) may have changed. %
- Rerun to get cross-references right%
- }%
- \fi
- \fi
- \endgroup
- \deadcycles\z@
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@enddocument@jpsj}
-% \begin{macrocode}
-\def\AtVeryEnd@enddocument@jpsj{%
- \if@lastpagebalancing
- \global\let\@outputdblcol=\balancing@outputdblcol
- \fi
- \@checkend{document}%
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- \begingroup
- \if@filesw
- \immediate\closeout\@mainaux
- \def\global\@namedef##1##2{}%
- \def\newlabel{\@testdef r}%
- \def\bibcite{\@testdef b}%
- \@tempswafalse
- \makeatletter
- \input \jobname.aux %
- \if@tempswa
- \@warning{%
- Label(s) may have changed. %
- Rerun to get cross-references right%
- }%
- \fi
- \fi
- \Call@AtVeryEndDocument
- \csname @dofilelist\endcsname
- \Call@AtEndAfterFileList
- \endgroup
- \deadcycles\z@
- \Call@AtVeryVeryEnd
- \@@end
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Testing and redefining}
-%
-% \begin{macro}{\AtVeryEnd@Test}
-% \begin{macrocode}
-\def\AtVeryEnd@Test#1#2{%
- \expandafter\ifx\csname AtVeryEnd@test@#2\endcsname#1%
- \expandafter\let\expandafter#1%
- \csname AtVeryEnd@enddocument@#2\endcsname
- \begingroup
- \let\on@line\@empty
- \PackageInfo{atveryend}{%
- \string#1 detected (#2)%
- }%
- \endgroup
- \expandafter\AtVeryEnd@SkipToNil
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@SkipToNil}
-% \begin{macrocode}
-\def\AtVeryEnd@SkipToNil#1\@nil{}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AtVeryEnd@RedefEndDocument}
-% \begin{macrocode}
-\def\AtVeryEnd@RedefEndDocument#1{%
- \ifx#1\@undefined
- \else
- \AtVeryEnd@Test#1{standard20110627}%
- \AtVeryEnd@Test#1{standard}%
- \AtVeryEnd@Test#1{booklet}%
- \AtVeryEnd@Test#1{dinbrief}%
- \AtVeryEnd@Test#1{combine}%
- \AtVeryEnd@Test#1{jpsj}%
- \AtVeryEnd@SkipToNil
- \@nil
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-% \begin{macrocode}
-\AtVeryEnd@RedefEndDocument\enddocument
-\AtVeryEnd@RedefEndDocument\AP@enddocument % afterpage.sty
-\AtVeryEnd@RedefEndDocument\hyper@back@cite@enddocument % htx-bc.sty
-\AtVeryEnd@RedefEndDocument\hyper@enddocument % hyper.sty
-\AtVeryEnd@RedefEndDocument\hyper@fn@enddocument % hyper.sty
-\AtVeryEnd@RedefEndDocument\cweb@save@enddocument % cweb.cls
-\AtVeryEnd@RedefEndDocument\prev@enddocument % flushend.sty
-\AtVeryEnd@RedefEndDocument\endorigdocument % gaceta.cls
-\AtVeryEnd@RedefEndDocument\keependdoc % aguplus.sty
-\AtVeryEnd@RedefEndDocument\EMenddocument % t-angles.sty
-\AtVeryEnd@RedefEndDocument\docmute@enddocument % docmute.sty
-\AtVeryEnd@RedefEndDocument\a@enddocument % alatex.sty
-\AtVeryEnd@RedefEndDocument\enddocumentasusual % frenchle.sty
-\AtVeryEnd@RedefEndDocument\old@enddocument % uwthesis.cls
-% \end{macrocode}
-%
-% \subsection{Hack into \cs{enddocument}}
-%
-% \begin{macrocode}
-\def\AtVeryEnd@document{document}%
-\def\AtVeryEnd@RedefCheckEnd{%
- \expandafter\def\expandafter\@checkend
- \expandafter##\expandafter1\expandafter{%
- \@checkend{##1}%
- \def\AtVeryEnd@temp{##1}%
- \ifx\AtVeryEnd@temp\AtVeryEnd@document
- \let\AtVeryEnd@OrgClearpage\clearpage
- \def\clearpage{%
- \let\clearpage\AtVeryEnd@OrgClearpage
- \Call@BeforeClearDocument
- \clearpage
- \Call@AfterLastShipout
- }%
- \fi
- }%
- \aftergroup\AtVeryEnd@RedefCheckEnd
-}%
-\AtBeginDocument{%
- \AtEndDocument{%
- \AtVeryEnd@RedefCheckEnd
- }%
-}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\AtEndDocument{%
- \@ifundefined{@dofilelist}{%
- \gdef\@dofilelist{%
- \Call@AtVeryEndDocument
- \Call@AtEndAfterFileList
- }%
- }{%
- \begingroup
- \toks@\expandafter{\@dofilelist}%
- \xdef\@dofilelist{%
- \noexpand\Call@AtVeryEndDocument
- \the\toks@
- \noexpand\Call@AtEndAfterFileList
- }%
- \endgroup
- }%
-}
-% \end{macrocode}
-%
-% \subsection{Using hooks of other packages}
-%
-% \subsubsection{Package \xpackage{scrlfile}}
-%
-% \begin{macrocode}
-\AtBeginDocument{%
- \@ifpackageloaded{scrlfile}{%
- \AtVeryEnd@ifundefined{BeforeClosingMainAux}{}{%
- \BeforeClosingMainAux{\Call@AfterLastShipout}%
- }%
- \AtVeryEnd@ifundefined{AfterReadingMainAux}{}{%
- \AfterReadingMainAux{\Call@AtVeryEndDocument}%
- }%
- }{}%
-% \end{macrocode}
-%
-% \subsubsection{Package \xpackage{etoolbox}}
-%
-% \begin{macrocode}
- \@ifpackageloaded{etoolbox}{%
- \AtVeryEnd@ifundefined{AfterEndDocument}{}{%
- \AfterEndDocument{\Call@AtVeryEndDocument}%
- }%
- }{}%
-% \end{macrocode}
-% \begin{macrocode}
-}
-% \end{macrocode}
-%
-% \subsection{Class \xclass{letter}}
-%
-% The class \xclass{letter} and some similar classes
-% insert material (\cs{@startlabels}) at the end of the document.
-% However, this method violates
-% a precondition of this package that the \cs{clearpage} in
-% \cs{enddocument} is the final call with no material at
-% later times. Therefore we move the label making
-% from the \xext{aux} file to \cs{AtEndDocument}.
-% \begin{macrocode}
-\def\AtVeryEnd@temp{%
- \AtBeginDocument{%
- \let\@startlabels\startlabels
- \let\@mlabel\mlabel
- \if@filesw
- \immediate\write\@mainaux{\string\@startlabels}%
- \fi
- }%
- \AtEndDocument{%
- \if@filesw
- \immediate\write\@mainaux{\string\clearpage}%
- \fi
- }%
-}
-\ifx\makelabels\AtVeryEnd@temp
-\else
- \expandafter\AtVeryEnd@AtEnd
-\fi%
-\let\AtVeryEnd@PatchLetter=N%
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname endletter\endcsname\relax
-\else
- \long\def\AtVeryEnd@TestEndLetter#1\@auxout#2#3\AtVeryEnd@Nil{%
- \def\AtVeryEnd@temp{#2}%
- \ifx\AtVeryEnd@temp\@empty
- \else
- \@onelevel@sanitize\AtVeryEnd@temp
- \edef\AtVeryEnd@StringMlabel{%
- \string\string
- \string\@mlabel
- \expandafter\@gobble\string\{%
- }%
- \def\AtVeryEnd@CatchFirst##1##2##3##4##5##6##7##8{%
- ##1##2##3##4##5##6##7##8\AtVeryEnd@CatchSecond
- }%
- \def\AtVeryEnd@CatchSecond##1##2##3##4##5##6##7##8##9\@nil{%
- ##1##2##3##4##5##6##7##8%
- }%
- \edef\AtVeryEnd@temp{%
- \expandafter\AtVeryEnd@CatchFirst\AtVeryEnd@temp
- {}{}{}{}{}{}{}{}%
- {}{}{}{}{}{}{}{}%
- \@nil
- }%
- \ifx\AtVeryEnd@temp\AtVeryEnd@StringMlabel
- \expandafter\def\expandafter\endletter\expandafter{%
- \endletter
- \begingroup
- \let\\=\relax
- \let\protect\@unexpandable@protect
- \let\@mlabel=\relax
- \edef\x{\endgroup
- \noexpand\AtEndDocument{%
- \@gobble#2%
- }%
- }%
- \x
- }%
- \let\AtVeryEnd@PatchLetter=Y%
- \fi
- \fi
- }%
- \expandafter\AtVeryEnd@TestEndLetter\endletter
- \@auxout{}\AtVeryEnd@Nil
-\fi
-\ifx\AtVeryEnd@PatchLetter Y%
- \begingroup
- \let\on@line\@empty
- \PackageInfo{atveryend}{%
- \@backslashchar makelabels detected. %
- Moving labels\MessageBreak
- from `.aux' file to \@backslashchar AtEndDocument%
- }%
- \endgroup
- \def\makelabels{%
- \AtBeginDocument{%
- \let\@startlabels\startlabels
- \let\@mlabel\mlabel
- }%
- }%
- \AtEndDocument{%
- \AtVeryEnd@ifundefined{@startlabels}{%
- }{%
- \clearpage
- \@startlabels
- }%
- }%
- \AfterLastShipout{%
- \let\@startlabels\relax
- \let\@mlabel\@gobbletwo
- }%
-\else
- \PackageWarningNoLine{atveryend}{%
- \@backslashchar makelabels detected, but labels cannot\MessageBreak
- be moved to \@backslashchar AtEndDocument, because\MessageBreak
- \@backslashchar endletter is not in expected form%
- }%
-\fi
-% \end{macrocode}
-%
-% \begin{macrocode}
-\AtVeryEnd@AtEnd%
-%</package>
-% \end{macrocode}
-%% \section{Installation}
-%
-% \subsection{Download}
-%
-% \paragraph{Package.} This package is available on
-% CTAN\footnote{\CTANpkg{atveryend}}:
-% \begin{description}
-% \item[\CTAN{macros/latex/contrib/oberdiek/atveryend.dtx}] The source file.
-% \item[\CTAN{macros/latex/contrib/oberdiek/atveryend.pdf}] Documentation.
-% \end{description}
-%
-%
-% \paragraph{Bundle.} All the packages of the bundle `oberdiek'
-% are also available in a TDS compliant ZIP archive. There
-% the packages are already unpacked and the documentation files
-% are generated. The files and directories obey the TDS standard.
-% \begin{description}
-% \item[\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 atveryend.dtx|
-% \end{quote}
-%
-% \paragraph{TDS.} Now the different files must be moved into
-% the different directories in your installation TDS tree
-% (also known as \xfile{texmf} tree):
-% \begin{quote}
-% \def\t{^^A
-% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
-% atveryend.sty & tex/latex/oberdiek/atveryend.sty\\
-% atveryend.pdf & doc/latex/oberdiek/atveryend.pdf\\
-% atveryend.dtx & source/latex/oberdiek/atveryend.dtx\\
-% \end{tabular}^^A
-% }^^A
-% \sbox0{\t}^^A
-% \ifdim\wd0>\linewidth
-% \begingroup
-% \advance\linewidth by\leftmargin
-% \advance\linewidth by\rightmargin
-% \edef\x{\endgroup
-% \def\noexpand\lw{\the\linewidth}^^A
-% }\x
-% \def\lwbox{^^A
-% \leavevmode
-% \hbox to \linewidth{^^A
-% \kern-\leftmargin\relax
-% \hss
-% \usebox0
-% \hss
-% \kern-\rightmargin\relax
-% }^^A
-% }^^A
-% \ifdim\wd0>\lw
-% \sbox0{\small\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\footnotesize\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\scriptsize\t}^^A
-% \ifdim\wd0>\linewidth
-% \ifdim\wd0>\lw
-% \sbox0{\tiny\t}^^A
-% \ifdim\wd0>\linewidth
-% \lwbox
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \else
-% \lwbox
-% \fi
-% \else
-% \usebox0
-% \fi
-% \end{quote}
-% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
-% TDS installing feature, then some files can already be in the right
-% place, see the documentation of \docstrip.
-%
-% \subsection{Refresh file name databases}
-%
-% If your \TeX~distribution
-% (\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{atveryend.dtx}|
-% \end{quote}
-% Do not forget to quote the argument according to the demands
-% of your shell.
-%
-% \paragraph{Generating the documentation.}
-% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
-% the documentation. The process can be configured by the
-% configuration file \xfile{ltxdoc.cfg}. For instance, put this
-% line into this file, if you want to have A4 as paper format:
-% \begin{quote}
-% \verb|\PassOptionsToClass{a4paper}{article}|
-% \end{quote}
-% An example follows how to generate the
-% documentation with pdf\LaTeX:
-% \begin{quote}
-%\begin{verbatim}
-%pdflatex atveryend.dtx
-%makeindex -s gind.ist atveryend.idx
-%pdflatex atveryend.dtx
-%makeindex -s gind.ist atveryend.idx
-%pdflatex atveryend.dtx
-%\end{verbatim}
-% \end{quote}
-%
-% \section{Acknowledgement}
-%
-% \begin{description}
-% \item[Arthur Ogawa:] He proposed the new API with \cs{AfterLastShipout}
-% and gave me much feedback, comprehensive class/package lists, many
-% suggestions and comments.
-% \end{description}
-%
-% \begin{thebibliography}{9}
-%
-% \bibitem{clsguide}
-% The \LaTeX3 Project:
-% \textit{\LaTeX2e\ for class and package writers}
-% 2006/02/15;
-% \CTANpkg{clsguide}.
-%
-% \bibitem{endfloat}
-% James Darrell McCauley, Jeff Goldberg:
-% \textit{The \xpackage{endfloat} package};
-% 1995/10/11 v2.4i;
-% \CTANpkg{endfloat}.
-%
-% \bibitem{etoolbox}
-% Philipp Lehmann:
-% \textit{The \xpackage{etoolbox} package};
-% 2009/08/06 v1.8;
-% \CTANpkg{etoolbox}.
-%
-% \bibitem{hyperref}
-% Sebastian Rahtz, Heiko Oberdiek:
-% \textit{The \xpackage{hyperref} package};
-% 2009/12/05 v6.79l;
-% \CTANpkg{hyperref}.
-%
-% \bibitem{koma}
-% Markus Kohm:
-% \textit{KOMA-Script};
-% 2009/07/24 v3.04a;
-% \url{https://www.komascript.de/}.
-%
-% \bibitem{lastpage}
-% Jeff Goldberg:
-% \textit{The \xpackage{lastpage} package};
-% 1994/07/20 v0.1b;
-% \CTANpkg{lastpage}.
-%
-% \bibitem{revtex}
-% APS, AIP, Arthur Orgawa;
-% ReVTeX 4.1;
-% 2009/10/13 v4.1;
-% \url{http://authors.aps.org/revtex4/}.
-%
-% \end{thebibliography}
-%
-% \begin{History}
-% \begin{Version}{2009/12/06 v1.0}
-% \item
-% The first version.
-% \end{Version}
-% \begin{Version}{2009/12/07 v1.1}
-% \item
-% Bug fixes.
-% \end{Version}
-% \begin{Version}{2009/12/09 v1.2}
-% \item
-% Additional support of classes and packages.
-% \end{Version}
-% \begin{Version}{2009/12/11 v1.3}
-% \item
-% Patch for letter like classes that puts label into the `.aux' file.
-% \item
-% Hook \cs{BeforeClearDocument} added (request from Arthur Ogawa).
-% \item
-% Patch of \cs{clear@document} removed (Arthur Ogawa).
-% \item
-% A nested \cs{AtBeginDocument} removed.
-% \end{Version}
-% \begin{Version}{2010/01/25 v1.4}
-% \item
-% Moved from \texttt{TDS:*/generic/*} to \texttt{TDS:*/latex/*}.
-% \end{Version}
-% \begin{Version}{2010/03/24 v1.5}
-% \item
-% \cs{Call@BeforeClearDocument} fixed (Ahmed Musa).
-% \end{Version}
-% \begin{Version}{2011/04/15 v1.6}
-% \item
-% \cs{Call@AtEndAfterFileList} and \cs{Call@AtVeryVeryEnd} added.
-% \end{Version}
-% \begin{Version}{2011/04/23 v1.7}
-% \item
-% Some fix for \cs{AtVeryEnd@RedefCheckEnd}
-% to avoid error because of undefined control sequence
-% in some circumstances (thanks to D.P. Story for bug report).
-% \end{Version}
-% \begin{Version}{2011/06/30 v1.8}
-% \item
-% Support of changed \cs{enddocument} of \hologo{LaTeX2e} 2011/06/27.
-% \end{Version}
-% \begin{Version}{2016/05/16 v1.9}
-% \item
-% Documentation updates.
-% \end{Version}
-% \end{History}
-%
-% \PrintIndex
-%
-% \Finale
-\endinput
diff --git a/macros/latex/contrib/oberdiek/atveryend.pdf b/macros/latex/contrib/oberdiek/atveryend.pdf
deleted file mode 100644
index 8a25fcdc9a..0000000000
--- a/macros/latex/contrib/oberdiek/atveryend.pdf
+++ /dev/null
Binary files differ