From 915162e27a26ac4fb9cd8c1c3ca043546ddb60d0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Dec 2019 22:59:30 +0000 Subject: atveryend (12dec19) git-svn-id: svn://tug.org/texlive/trunk@53108 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/atveryend/atveryend.dtx | 1442 ++++++++++++++++++++ 1 file changed, 1442 insertions(+) create mode 100644 Master/texmf-dist/source/latex/atveryend/atveryend.dtx (limited to 'Master/texmf-dist/source/latex/atveryend') diff --git a/Master/texmf-dist/source/latex/atveryend/atveryend.dtx b/Master/texmf-dist/source/latex/atveryend/atveryend.dtx new file mode 100644 index 00000000000..24c67081b37 --- /dev/null +++ b/Master/texmf-dist/source/latex/atveryend/atveryend.dtx @@ -0,0 +1,1442 @@ +% \iffalse meta-comment +% +% File: atveryend.dtx +% Version: 2019-12-11 v1.11 +% 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/atveryend/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/atveryend/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/atveryend/atveryend.dtx +% CTAN:macros/latex/contrib/atveryend/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/atveryend/atveryend.sty +% TDS:doc/latex/atveryend/atveryend.pdf +% TDS:source/latex/atveryend/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 +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: atveryend 2019-12-11 v1.11 Hooks at the very end of document (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: atveryend +Version: 2019-12-11 v1.11 + +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/atveryend/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/atveryend}% + \file{atveryend.sty}{\from{atveryend.dtx}{package}}% +} + +\catcode32=13\relax% active space +\let =\space% +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* atveryend.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `atveryend.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{atveryend.drv}% + [2019-12-11 v1.11 Hooks at the very end of document (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{atveryend.dtx}% +\end{document} +% +% \fi +% +% +% +% \GetFileInfo{atveryend.drv} +% +% \title{The \xpackage{atveryend} package} +% \date{2019-12-11 v1.11} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/atveryend/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}% + [2019-12-11 v1.11 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% +% +% \end{macrocode} +%% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{atveryend}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/atveryend/atveryend.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/atveryend/atveryend.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `atveryend' +% 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/atveryend.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{atveryend.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip atveryend.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/atveryend/atveryend.sty\\ +% atveryend.pdf & doc/latex/atveryend/atveryend.pdf\\ +% atveryend.dtx & source/latex/atveryend/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} +% \begin{Version}{2019/12/05 v1.10} +% \item +% Documentation updates. +% \end{Version} +% \begin{Version}{2019-12-11 v1.11} +% \item Updated +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput -- cgit v1.2.3