Debian Codegraph @

texmf-dist/source/latex/atveryend/atveryend.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: atveryend.dtx
4 % Version: 2024-08-06 v1.12
5 % Info: Hooks at the very end of document
6 %
7 % Copyright (C)
8 % 2009-2011 Heiko Oberdiek
9 % 2016-2024 Oberdiek Package Support Group
10 % https://github.com/ho-tex/atveryend/issues
11 %
12 % This work may be distributed and/or modified under the
13 % conditions of the LaTeX Project Public License, either
14 % version 1.3c of this license or (at your option) any later
15 % version. This version of this license is in
16 % https://www.latex-project.org/lppl/lppl-1-3c.txt
17 % and the latest version of this license is in
18 % https://www.latex-project.org/lppl.txt
19 % and version 1.3 or later is part of all distributions of
20 % LaTeX version 2005/12/01 or later.
21 %
22 % This work has the LPPL maintenance status "maintained".
23 %
24 % The Current Maintainers of this work are
25 % Heiko Oberdiek and the Oberdiek Package Support Group
26 % https://github.com/ho-tex/atveryend/issues
27 %
28 % This work consists of the main source file atveryend.dtx
29 % and the derived files
30 % atveryend.sty, atveryend.pdf, atveryend.ins, atveryend.drv,
31 % atveryend-test1.tex.
32 %
33 % Distribution:
34 % CTAN:macros/latex/contrib/atveryend/atveryend.dtx
35 % CTAN:macros/latex/contrib/atveryend/atveryend.pdf
36 %
37 % Unpacking:
38 % (a) If atveryend.ins is present:
39 % tex atveryend.ins
40 % (b) Without atveryend.ins:
41 % tex atveryend.dtx
42 % (c) If you insist on using LaTeX
43 % latex \let\install=y\input{atveryend.dtx}
44 % (quote the arguments according to the demands of your shell)
45 %
46 % Documentation:
47 % (a) If atveryend.drv is present:
48 % latex atveryend.drv
49 % (b) Without atveryend.drv:
50 % latex atveryend.dtx; ...
51 % The class ltxdoc loads the configuration file ltxdoc.cfg
52 % if available. Here you can specify further options, e.g.
53 % use A4 as paper format:
54 % \PassOptionsToClass{a4paper}{article}
55 %
56 % Programm calls to get the documentation (example):
57 % pdflatex atveryend.dtx
58 % makeindex -s gind.ist atveryend.idx
59 % pdflatex atveryend.dtx
60 % makeindex -s gind.ist atveryend.idx
61 % pdflatex atveryend.dtx
62 %
63 % Installation:
64 % TDS:tex/latex/atveryend/atveryend.sty
65 % TDS:doc/latex/atveryend/atveryend.pdf
66 % TDS:source/latex/atveryend/atveryend.dtx
67 %
68 %<*ignore>
69 \begingroup
70 \catcode123=1 %
71 \catcode125=2 %
72 \def\x{LaTeX2e}%
73 \expandafter\endgroup
74 \ifcase 0\ifx\install y1\fi\expandafter
75 \ifx\csname processbatchFile\endcsname\relax\else1\fi
76 \ifx\fmtname\x\else 1\fi\relax
77 \else\csname fi\endcsname
78 %</ignore>
79 %<*install>
80 \input docstrip.tex
81 \Msg{************************************************************************}
82 \Msg{* Installation}
83 \Msg{* Package: atveryend 2024-08-06 v1.12 Hooks at the very end of document (HO)}
84 \Msg{************************************************************************}
85
86 \keepsilent
87 \askforoverwritefalse
88
89 \let\MetaPrefix\relax
90 \preamble
91
92 This is a generated file.
93
94 Project: atveryend
95 Version: 2024-08-06 v1.12
96
97 Copyright (C)
98 2009-2011 Heiko Oberdiek
99 2016-2024 Oberdiek Package Support Group
100
101 This work may be distributed and/or modified under the
102 conditions of the LaTeX Project Public License, either
103 version 1.3c of this license or (at your option) any later
104 version. This version of this license is in
105 https://www.latex-project.org/lppl/lppl-1-3c.txt
106 and the latest version of this license is in
107 https://www.latex-project.org/lppl.txt
108 and version 1.3 or later is part of all distributions of
109 LaTeX version 2005/12/01 or later.
110
111 This work has the LPPL maintenance status "maintained".
112
113 The Current Maintainers of this work are
114 Heiko Oberdiek and the Oberdiek Package Support Group
115 https://github.com/ho-tex/atveryend/issues
116
117
118 This work consists of the main source file atveryend.dtx
119 and the derived files
120 atveryend.sty, atveryend.pdf, atveryend.ins, atveryend.drv,
121 atveryend-test1.tex.
122
123 \endpreamble
124 \let\MetaPrefix\DoubleperCent
125
126 \generate{%
127 \file{atveryend.ins}{\from{atveryend.dtx}{install}}%
128 \file{atveryend.drv}{\from{atveryend.dtx}{driver}}%
129 \usedir{tex/latex/atveryend}%
130 \file{atveryend.sty}{\from{atveryend.dtx}{package}}%
131 }
132
133 \catcode32=13\relax% active space
134 \let =\space%
135 \Msg{************************************************************************}
136 \Msg{*}
137 \Msg{* To finish the installation you have to move the following}
138 \Msg{* file into a directory searched by TeX:}
139 \Msg{*}
140 \Msg{* atveryend.sty}
141 \Msg{*}
142 \Msg{* To produce the documentation run the file `atveryend.drv'}
143 \Msg{* through LaTeX.}
144 \Msg{*}
145 \Msg{* Happy TeXing!}
146 \Msg{*}
147 \Msg{************************************************************************}
148
149 \endbatchfile
150 %</install>
151 %<*ignore>
152 \fi
153 %</ignore>
154 %<*driver>
155 \NeedsTeXFormat{LaTeX2e}
156 \ProvidesFile{atveryend.drv}%
157 [2024-08-06 v1.12 Hooks at the very end of document (HO)]%
158 \documentclass{ltxdoc}
159 \usepackage{holtxdoc}[2011/11/22]
160 \begin{document}
161 \DocInput{atveryend.dtx}%
162 \end{document}
163 %</driver>
164 % \fi
165 %
166 %
167 %
168 % \GetFileInfo{atveryend.drv}
169 %
170 % \title{The \xpackage{atveryend} package}
171 % \date{2024-08-06 v1.12}
172 % \author{Heiko Oberdiek\thanks
173 % {Please report any issues at \url{https://github.com/ho-tex/atveryend/issues}}}
174 %
175 % \maketitle
176 %
177 % \begin{abstract}
178 % This \LaTeX\ package is a small wrapper around standard \LaTeX{} hooks at the end
179 % of a document.
180 %
181 % \end{abstract}
182 %
183 %
184 % \section{Documentation}
185 %
186 % In the past this package patched the command \cs{enddocument} to
187 % provided two additional hooks for \verb|\end{document}|
188 % that were executed after the hook of \cs{AtEndDocument}.
189 %
190 % Since 2020 this patching is no longer needed as the
191 % hooks are provided by \LaTeX{} directly. Since this time the code of the package
192 % was no longer used as \LaTeX{} suppressed the loading of the package
193 % and replaced the commands by commands based on the new hooks. In version 1.12
194 % this new code was moved into \texttt{atveryend} directly.
195 %
196 % The package defines the following user commands and maps them
197 % to \cs{AddToHook} calls. A description of the used
198 % hooks can be found in \texttt{lhooks-doc.pdf}.
199 %
200 % \begin{declcs}{AfterLastShipout} \M{code}
201 % \end{declcs}
202 % This adds the code to the \texttt{enddocument/afterlastpage} hook.
203 %
204 % \begin{declcs}{AtVeryEndDocument} \M{code}
205 % \end{declcs}
206 % This adds the code to the \texttt{enddocument/afteraux} hook.
207 %
208 % \begin{declcs}{AtEndAfterFileList} \M{code}
209 % \end{declcs}
210 % This adds the code to the \texttt{enddocument/info} hook.%
211 %
212 % \begin{declcs}{AtVeryVeryEnd} \M{code}
213 % \end{declcs}
214 % This adds the code to the \texttt{enddocument/end} hook.
215 %
216 % \begin{declcs}{BeforeClearDocument} \M{code}
217 % \end{declcs}
218 % This adds the code to the \texttt{enddocument} hook.
219 % It is recommended to use \cs{AtEndDocument} instead.
220 %
221 % \StopEventually{
222 % }
223 %
224 % \section{Implementation}
225 % \begin{macrocode}
226 %<*package>
227 % \end{macrocode}
228 %
229 % Package identification.
230 % \begin{macrocode}
231 \NeedsTeXFormat{LaTeX2e}
232 \ProvidesPackage{atveryend}%
233 [2024-08-06 v1.12 Hooks at the very end of document (HO)]
234 % \end{macrocode}
235 %
236 % \subsection{Tools}
237 %
238 % \begin{macro}{\AfterLastShipout}
239 % \begin{macrocode}
240 \newcommand\AfterLastShipout {\AddToHook{enddocument/afterlastpage}}
241 % \end{macrocode}
242 % \end{macro}
243 % \begin{macro}{\AtVeryEndDocument}
244 % \begin{macrocode}
245 \newcommand\AtVeryEndDocument {\AddToHook{enddocument/afteraux}}
246 % \end{macrocode}
247 % \end{macro}
248 % \begin{macro}{\AtEndAfterFileList}
249 % \begin{macrocode}
250 \newcommand\AtEndAfterFileList{\AddToHook{enddocument/info}}
251 % \end{macrocode}
252 % \end{macro}
253 % \begin{macro}{\AtVeryVeryEnd}
254 % \begin{macrocode}
255 \newcommand\AtVeryVeryEnd {\AddToHook{enddocument/end}}
256 % \end{macrocode}
257 % \end{macro}
258 % \begin{macro}{\BeforeClearDocument}
259 % \begin{macrocode}
260 \newcommand\BeforeClearDocument{\AddToHook{enddocument}}
261 % \end{macrocode}
262 % \end{macro}
263 %
264 % \begin{macrocode}
265 %</package>
266 % \end{macrocode}
267 % \section{Installation}
268 %
269 % \subsection{Download}
270 %
271 % \paragraph{Package.} This package is available on
272 % CTAN\footnote{\CTANpkg{atveryend}}:
273 % \begin{description}
274 % \item[\CTAN{macros/latex/contrib/atveryend/atveryend.dtx}] The source file.
275 % \item[\CTAN{macros/latex/contrib/atveryend/atveryend.pdf}] Documentation.
276 % \end{description}
277 %
278 % \subsection{Package installation}
279 %
280 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
281 % \docstrip\ archive. The files are extracted by running the
282 % \xfile{.dtx} through \plainTeX:
283 % \begin{quote}
284 % \verb|tex atveryend.dtx|
285 % \end{quote}
286 %
287 % \paragraph{TDS.} Now the different files must be moved into
288 % the different directories in your installation TDS tree
289 % (also known as \xfile{texmf} tree):
290 % \begin{quote}
291 % \def\t{^^A
292 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
293 % atveryend.sty & tex/latex/atveryend/atveryend.sty\\
294 % atveryend.pdf & doc/latex/atveryend/atveryend.pdf\\
295 % atveryend.dtx & source/latex/atveryend/atveryend.dtx\\
296 % \end{tabular}^^A
297 % }^^A
298 % \sbox0{\t}^^A
299 % \ifdim\wd0>\linewidth
300 % \begingroup
301 % \advance\linewidth by\leftmargin
302 % \advance\linewidth by\rightmargin
303 % \edef\x{\endgroup
304 % \def\noexpand\lw{\the\linewidth}^^A
305 % }\x
306 % \def\lwbox{^^A
307 % \leavevmode
308 % \hbox to \linewidth{^^A
309 % \kern-\leftmargin\relax
310 % \hss
311 % \usebox0
312 % \hss
313 % \kern-\rightmargin\relax
314 % }^^A
315 % }^^A
316 % \ifdim\wd0>\lw
317 % \sbox0{\small\t}^^A
318 % \ifdim\wd0>\linewidth
319 % \ifdim\wd0>\lw
320 % \sbox0{\footnotesize\t}^^A
321 % \ifdim\wd0>\linewidth
322 % \ifdim\wd0>\lw
323 % \sbox0{\scriptsize\t}^^A
324 % \ifdim\wd0>\linewidth
325 % \ifdim\wd0>\lw
326 % \sbox0{\tiny\t}^^A
327 % \ifdim\wd0>\linewidth
328 % \lwbox
329 % \else
330 % \usebox0
331 % \fi
332 % \else
333 % \lwbox
334 % \fi
335 % \else
336 % \usebox0
337 % \fi
338 % \else
339 % \lwbox
340 % \fi
341 % \else
342 % \usebox0
343 % \fi
344 % \else
345 % \lwbox
346 % \fi
347 % \else
348 % \usebox0
349 % \fi
350 % \else
351 % \lwbox
352 % \fi
353 % \else
354 % \usebox0
355 % \fi
356 % \end{quote}
357 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
358 % TDS installing feature, then some files can already be in the right
359 % place, see the documentation of \docstrip.
360 %
361 % \subsection{Refresh file name databases}
362 %
363 % If your \TeX~distribution
364 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
365 % these. For example, \TeX\,Live\ users run \verb|texhash| or
366 % \verb|mktexlsr|.
367 %
368 % \subsection{Some details for the interested}
369 %
370 % \paragraph{Unpacking with \LaTeX.}
371 % The \xfile{.dtx} chooses its action depending on the format:
372 % \begin{description}
373 % \item[\plainTeX:] Run \docstrip\ and extract the files.
374 % \item[\LaTeX:] Generate the documentation.
375 % \end{description}
376 % If you insist on using \LaTeX\ for \docstrip\ (really,
377 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
378 % about your intention:
379 % \begin{quote}
380 % \verb|latex \let\install=y\input{atveryend.dtx}|
381 % \end{quote}
382 % Do not forget to quote the argument according to the demands
383 % of your shell.
384 %
385 % \paragraph{Generating the documentation.}
386 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
387 % the documentation. The process can be configured by the
388 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
389 % line into this file, if you want to have A4 as paper format:
390 % \begin{quote}
391 % \verb|\PassOptionsToClass{a4paper}{article}|
392 % \end{quote}
393 % An example follows how to generate the
394 % documentation with pdf\LaTeX:
395 % \begin{quote}
396 %\begin{verbatim}
397 %pdflatex atveryend.dtx
398 %makeindex -s gind.ist atveryend.idx
399 %pdflatex atveryend.dtx
400 %makeindex -s gind.ist atveryend.idx
401 %pdflatex atveryend.dtx
402 %\end{verbatim}
403 % \end{quote}
404 %
405 % \section{Acknowledgement}
406 %
407 % \begin{description}
408 % \item[Arthur Ogawa:] He proposed the new API with \cs{AfterLastShipout}
409 % and gave me much feedback, comprehensive class/package lists, many
410 % suggestions and comments.
411 % \end{description}
412 %
413 %
414 % \begin{History}
415 % \begin{Version}{2009/12/06 v1.0}
416 % \item
417 % The first version.
418 % \end{Version}
419 % \begin{Version}{2009/12/07 v1.1}
420 % \item
421 % Bug fixes.
422 % \end{Version}
423 % \begin{Version}{2009/12/09 v1.2}
424 % \item
425 % Additional support of classes and packages.
426 % \end{Version}
427 % \begin{Version}{2009/12/11 v1.3}
428 % \item
429 % Patch for letter like classes that puts label into the `.aux' file.
430 % \item
431 % Hook \cs{BeforeClearDocument} added (request from Arthur Ogawa).
432 % \item
433 % Patch of \cs{clear@document} removed (Arthur Ogawa).
434 % \item
435 % A nested \cs{AtBeginDocument} removed.
436 % \end{Version}
437 % \begin{Version}{2010/01/25 v1.4}
438 % \item
439 % Moved from \texttt{TDS:*/generic/*} to \texttt{TDS:*/latex/*}.
440 % \end{Version}
441 % \begin{Version}{2010/03/24 v1.5}
442 % \item
443 % \cs{Call@BeforeClearDocument} fixed (Ahmed Musa).
444 % \end{Version}
445 % \begin{Version}{2011/04/15 v1.6}
446 % \item
447 % \cs{Call@AtEndAfterFileList} and \cs{Call@AtVeryVeryEnd} added.
448 % \end{Version}
449 % \begin{Version}{2011/04/23 v1.7}
450 % \item
451 % Some fix for \cs{AtVeryEnd@RedefCheckEnd}
452 % to avoid error because of undefined control sequence
453 % in some circumstances (thanks to D.P. Story for bug report).
454 % \end{Version}
455 % \begin{Version}{2011/06/30 v1.8}
456 % \item
457 % Support of changed \cs{enddocument} of \hologo{LaTeX2e} 2011/06/27.
458 % \end{Version}
459 % \begin{Version}{2016/05/16 v1.9}
460 % \item
461 % Documentation updates.
462 % \end{Version}
463 % \begin{Version}{2019/12/05 v1.10}
464 % \item
465 % Documentation updates.
466 % \end{Version}
467 % \begin{Version}{2019-12-11 v1.11}
468 % \item Updated
469 % \end{Version}
470 %
471 % \begin{Version}{2024-08-06 v1.12}
472 % \item Switch to kernel hooks
473 % \end{Version}
474 % \end{History}
475 %
476 % \PrintIndex
477 %
478 % \Finale
479 \endinput