Debian Codegraph @

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

raw
1 % \iffalse meta-comment
2 %
3 % File: rerunfilecheck.dtx
4 % Version: 2025-06-21 v1.11
5 % Info: Rerun checks for auxiliary files
6 %
7 % Copyright (C)
8 % 2009-2011 Heiko Oberdiek
9 % 2016-2025 Oberdiek Package Support Group
10 % https://github.com/ho-tex/rerunfilecheck/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/rerunfilecheck/issues
27 %
28 % This work consists of the main source file rerunfilecheck.dtx
29 % and the derived files
30 % rerunfilecheck.sty, rerunfilecheck.pdf, rerunfilecheck.ins,
31 % rerunfilecheck.drv, rerunfilecheck-example.cfg,
32 % rerunfilecheck-test1.tex.
33 %
34 % Distribution:
35 % CTAN:macros/latex/contrib/rerunfilecheck/rerunfilecheck.dtx
36 % CTAN:macros/latex/contrib/rerunfilecheck/rerunfilecheck.pdf
37 %
38 % Unpacking:
39 % (a) If rerunfilecheck.ins is present:
40 % tex rerunfilecheck.ins
41 % (b) Without rerunfilecheck.ins:
42 % tex rerunfilecheck.dtx
43 % (c) If you insist on using LaTeX
44 % latex \let\install=y\input{rerunfilecheck.dtx}
45 % (quote the arguments according to the demands of your shell)
46 %
47 % Documentation:
48 % (a) If rerunfilecheck.drv is present:
49 % latex rerunfilecheck.drv
50 % (b) Without rerunfilecheck.drv:
51 % latex rerunfilecheck.dtx; ...
52 % The class ltxdoc loads the configuration file ltxdoc.cfg
53 % if available. Here you can specify further options, e.g.
54 % use A4 as paper format:
55 % \PassOptionsToClass{a4paper}{article}
56 %
57 % Programm calls to get the documentation (example):
58 % pdflatex rerunfilecheck.dtx
59 % makeindex -s gind.ist rerunfilecheck.idx
60 % pdflatex rerunfilecheck.dtx
61 % makeindex -s gind.ist rerunfilecheck.idx
62 % pdflatex rerunfilecheck.dtx
63 %
64 % Installation:
65 % TDS:tex/latex/rerunfilecheck/rerunfilecheck.sty
66 % TDS:doc/latex/rerunfilecheck/rerunfilecheck.pdf
67 % TDS:doc/latex/rerunfilecheck/rerunfilecheck-example.cfg
68 % TDS:source/latex/rerunfilecheck/rerunfilecheck.dtx
69 %
70 %<*ignore>
71 \begingroup
72 \catcode123=1 %
73 \catcode125=2 %
74 \def\x{LaTeX2e}%
75 \expandafter\endgroup
76 \ifcase 0\ifx\install y1\fi\expandafter
77 \ifx\csname processbatchFile\endcsname\relax\else1\fi
78 \ifx\fmtname\x\else 1\fi\relax
79 \else\csname fi\endcsname
80 %</ignore>
81 %<*install>
82 \input docstrip.tex
83 \Msg{************************************************************************}
84 \Msg{* Installation}
85 \Msg{* Package: rerunfilecheck 2025-06-21 v1.11 Rerun checks for auxiliary files (HO)}
86 \Msg{************************************************************************}
87
88 \keepsilent
89 \askforoverwritefalse
90
91 \let\MetaPrefix\relax
92 \preamble
93
94 This is a generated file.
95
96 Project: rerunfilecheck
97 Version: 2025-06-21 v1.11
98
99 Copyright (C)
100 2009-2011 Heiko Oberdiek
101 2016-2025 Oberdiek Package Support Group
102
103 This work may be distributed and/or modified under the
104 conditions of the LaTeX Project Public License, either
105 version 1.3c of this license or (at your option) any later
106 version. This version of this license is in
107 https://www.latex-project.org/lppl/lppl-1-3c.txt
108 and the latest version of this license is in
109 https://www.latex-project.org/lppl.txt
110 and version 1.3 or later is part of all distributions of
111 LaTeX version 2005/12/01 or later.
112
113 This work has the LPPL maintenance status "maintained".
114
115 The Current Maintainers of this work are
116 Heiko Oberdiek and the Oberdiek Package Support Group
117 https://github.com/ho-tex/rerunfilecheck/issues
118
119
120 This work consists of the main source file rerunfilecheck.dtx
121 and the derived files
122 rerunfilecheck.sty, rerunfilecheck.pdf, rerunfilecheck.ins,
123 rerunfilecheck.drv, rerunfilecheck-example.cfg,
124 rerunfilecheck-test1.tex.
125
126 \endpreamble
127 \let\MetaPrefix\DoubleperCent
128
129 \generate{%
130 \file{rerunfilecheck.ins}{\from{rerunfilecheck.dtx}{install}}%
131 \file{rerunfilecheck.drv}{\from{rerunfilecheck.dtx}{driver}}%
132 \usedir{tex/latex/rerunfilecheck}%
133 \file{rerunfilecheck.sty}{\from{rerunfilecheck.dtx}{package}}%
134 \nopreamble
135 \nopostamble
136 \usedir{doc/latex/rerunfilecheck}%
137 \file{rerunfilecheck-example.cfg}{\from{rerunfilecheck.dtx}{cfg}}%
138 }
139
140 \catcode32=13\relax% active space
141 \let =\space%
142 \Msg{************************************************************************}
143 \Msg{*}
144 \Msg{* To finish the installation you have to move the following}
145 \Msg{* file into a directory searched by TeX:}
146 \Msg{*}
147 \Msg{* rerunfilecheck.sty}
148 \Msg{*}
149 \Msg{* To produce the documentation run the file `rerunfilecheck.drv'}
150 \Msg{* through LaTeX.}
151 \Msg{*}
152 \Msg{* Happy TeXing!}
153 \Msg{*}
154 \Msg{************************************************************************}
155
156 \endbatchfile
157 %</install>
158 %<*ignore>
159 \fi
160 %</ignore>
161 %<*driver>
162 \NeedsTeXFormat{LaTeX2e}
163 \ProvidesFile{rerunfilecheck.drv}%
164 [2025-06-21 v1.11 Rerun checks for auxiliary files (HO)]%
165 \documentclass{ltxdoc}
166 \usepackage{holtxdoc}[2011/11/22]
167 \begin{document}
168 \DocInput{rerunfilecheck.dtx}%
169 \end{document}
170 %</driver>
171 % \fi
172 %
173 %
174 %
175 % \GetFileInfo{rerunfilecheck.drv}
176 %
177 % \title{The \xpackage{rerunfilecheck} package}
178 % \date{2025-06-21 v1.11}
179 % \author{Heiko Oberdiek\thanks
180 % {Please report any issues at \url{https://github.com/ho-tex/rerunfilecheck/issues}}}
181 %
182 % \maketitle
183 %
184 % \begin{abstract}
185 % The package provides additional rerun warnings if some
186 % auxiliary files have changed. It is based on MD5 checksum,
187 % provided by \pdfTeX.
188 % \end{abstract}
189 %
190 % \tableofcontents
191 %
192 % \section{Documentation}
193 %
194 % \LaTeX\ informs the user, when to run \LaTeX\ again, if the
195 % references have changed. It has the old references from the
196 % first reading of the \xext{aux} files already in memory, thus
197 % it compares them with the new version of the \xext{aux} file
198 % at the end of the document. However this rerun warnings are
199 % not given for the table of contents and other data stored
200 % in the \xext{aux} files or other auxiliary files.
201 % Usually many of these data as the table of contents is not keep
202 % in memory. If someone wants to detect changes, he has either
203 % to keep the data in memory. This does not scale well with huge
204 % documents. Or he copies the file before they are changed. Slow
205 % I/O operations cost time.
206 %
207 % Since version 1.30.0 \pdfTeX\ provides \cs{pdfmdfivesum}
208 % and \cs{pdffilesize}.
209 % These features are also available in \LuaTeX, provided by package
210 % \xpackage{pdftexcmds}.
211 % Thus this package \xpackage{rerunfilecheck} uses these features to
212 % detect file changes. This saves the packages from keeping
213 % the whole files in memory or in file copies.
214 % The drawback are different files with the same size and the
215 % same MD5 checksum (seldom, hopefully).
216 %
217 % \subsection{Options}
218 %
219 % All options are key value options of boolean type.
220 % No option or |true| turns an option on, |false| disables
221 % an option.
222 % \begin{description}
223 % \item[\xoption{mainaux}:]
224 % Check the main \xext{aux} file.
225 % \item[\xoption{partaux}:]
226 % Check the \xext{aux} files from \cs{include} files.
227 % \item[\xoption{starttoc}:]
228 % Add the rerun checks in \cs{@starttoc} that is called by
229 % \cs{tableofcontents}, \cs{listoffigures}, \dots
230 % \item[\xoption{index}, \xoption{glossary}:]
231 % \LaTeX's original \cs{makeindex} and \cs{makeglossary} are
232 % redefined to add the rerun checks. The options do not have
233 % an effect, if \cs{makeindex}/\cs{makeglossary} are already
234 % called or if a package or class had redefined or will
235 % redefine them.
236 % \item[\xoption{aux}:]
237 % This option turns all previous options on or off.
238 % ``aux'' means auxiliary file.
239 % \end{description}
240 % The default for the options is |false|, because
241 % some internals must be redefined to insert the
242 % rerun checks.
243 % The options can be set in \cs{usepackage} or
244 % the configuration file \xfile{rerunfilecheck.cfg}.
245 % Global options are ignored (since 1.4).
246 %
247 % \begin{declcs}{RerunFileCheckSetup} \M{key value list}
248 % \end{declcs}
249 % Options can also be set using \cs{RerunFileCheckSetup}.
250 % Currently all options are disabled after the package
251 % is loaded. Thus \cs{RerunFileCheckSetup} makes sense in
252 % the configuration file only.
253 %
254 % Example for the configuration file:
255 % \begin{macrocode}
256 %<*cfg>
257 \ProvidesFile{rerunfilecheck.cfg}[2019/12/05 Default configuration]%
258 \RerunFileCheckSetup{aux}
259 %</cfg>
260 % \end{macrocode}
261 %
262 % \subsection{Interface for class/package authors}
263 %
264 % \begin{declcs}{RerunFileCheck} \M{file} \M{file closing action} \M{rerun warning}
265 % \end{declcs}
266 % If you want to add a rerun check, call \cs{RerunFileCheck} right before
267 % an output file is opened for writing. The macro first remembers
268 % the current checksum of \meta{file}.
269 % The file is checked again right before the end of the job.
270 % The LaTeX hook \texttt{enddocument/info}
271 % is used to place the check after the main aux file is closed
272 % in |\end{document}|. Before reading the file again, it must be
273 % closed. Provide the code for closing in argument \meta{file closing action}.
274 % Do not forget \cs{immediate} before \cs{openout}. Otherwise the
275 % closing action would be delayed to the next shipout that never happens
276 % (the last page is already shipped out).
277 % If the file has changed, \cs{RerunFileCheck} informs the user with
278 % a warning that the file has changed and says the magic word ``Rerun''.
279 % If the last argument \meta{rerun warning} is not empty, then
280 % the rerun sentence is replaced by it. Usually the phrase
281 % ``to get something right'' is added.
282 % As example the relevant part of the redefined \cs{makeindex}
283 % is shown, see package code:
284 %\begin{quote}
285 %\begin{verbatim}
286 %\newwrite\@indexfile
287 %\RerunFileCheck{\jobname.idx}{%
288 % \immediate\closeout\@indexfile
289 %}{%
290 % Rerun LaTeX/makeindex to get index right%
291 %}%
292 %\immediate\openout\@indexfile=\jobname.idx %
293 %\end{verbatim}
294 %\end{quote}
295 %
296 % \StopEventually{
297 % }
298 %
299 % \section{Implementation}
300 % \begin{macrocode}
301 %<*package>
302 % \end{macrocode}
303 %
304 % \begin{macrocode}
305 \begingroup\catcode61\catcode48\catcode32=10\relax%
306 \catcode13=5 % ^^M
307 \endlinechar=13 %
308 \catcode123=1 % {
309 \catcode125=2 % }
310 \catcode64=11 % @
311 \def\x{\endgroup
312 \expandafter\edef\csname ReFiCh@AtEnd\endcsname{%
313 \endlinechar=\the\endlinechar\relax
314 \catcode13=\the\catcode13\relax
315 \catcode32=\the\catcode32\relax
316 \catcode35=\the\catcode35\relax
317 \catcode61=\the\catcode61\relax
318 \catcode64=\the\catcode64\relax
319 \catcode123=\the\catcode123\relax
320 \catcode125=\the\catcode125\relax
321 }%
322 }%
323 \x\catcode61\catcode48\catcode32=10\relax%
324 \catcode13=5 % ^^M
325 \endlinechar=13 %
326 \catcode35=6 % #
327 \catcode64=11 % @
328 \catcode123=1 % {
329 \catcode125=2 % }
330 \def\TMP@EnsureCode#1#2{%
331 \edef\ReFiCh@AtEnd{%
332 \ReFiCh@AtEnd
333 \catcode#1=\the\catcode#1\relax
334 }%
335 \catcode#1=#2\relax
336 }
337 \TMP@EnsureCode{39}{12}% '
338 \TMP@EnsureCode{40}{12}% (
339 \TMP@EnsureCode{41}{12}% )
340 \TMP@EnsureCode{42}{12}% *
341 \TMP@EnsureCode{44}{12}% ,
342 \TMP@EnsureCode{46}{12}% .
343 \TMP@EnsureCode{47}{12}% /
344 \TMP@EnsureCode{58}{12}% :
345 \TMP@EnsureCode{59}{12}% ;
346 \TMP@EnsureCode{60}{12}% <
347 \TMP@EnsureCode{62}{12}% >
348 \TMP@EnsureCode{91}{12}% [
349 \TMP@EnsureCode{93}{12}% ]
350 \TMP@EnsureCode{96}{12}% `
351 \edef\ReFiCh@AtEnd{\ReFiCh@AtEnd\noexpand\endinput}
352 % \end{macrocode}
353 %
354 % Package identification.
355 % \begin{macrocode}
356 \NeedsTeXFormat{LaTeX2e}
357 \ProvidesPackage{rerunfilecheck}%
358 [2025-06-21 v1.11 Rerun checks for auxiliary files (HO)]
359 % \end{macrocode}
360 %
361 % \subsection{Options}
362 %
363 % \begin{macrocode}
364 \RequirePackage{kvoptions}[2010/02/22]
365 \SetupKeyvalOptions{%
366 family=rerunfilecheck,%
367 prefix=ReFiCh@%
368 }
369 % \end{macrocode}
370 % \begin{macro}{\RerunFileCheckSetup}
371 % \begin{macrocode}
372 \newcommand*{\RerunFileCheckSetup}{%
373 \setkeys{rerunfilecheck}%
374 }
375 % \end{macrocode}
376 % \end{macro}
377 % \begin{macrocode}
378 \DeclareBoolOption{mainaux}
379 \DeclareBoolOption{partaux}
380 \DeclareBoolOption{starttoc}
381 \DeclareBoolOption{index}
382 \DeclareBoolOption{glossary}
383 \define@key{rerunfilecheck}{aux}[true]{%
384 \RerunFileCheckSetup{%
385 mainaux={#1},%
386 partaux={#1},%
387 starttoc={#1},%
388 index={#1},%
389 glossary={#1}%
390 }%
391 }
392 % \end{macrocode}
393 % \begin{macrocode}
394 \InputIfFileExists{rerunfilecheck.cfg}{}{}
395 \ProcessLocalKeyvalOptions*
396 % \end{macrocode}
397 %
398 % \begin{macro}{\ReFiCh@DisableOption}
399 % \begin{macrocode}
400 \def\ReFiCh@DisableOption{%
401 \DisableKeyvalOption[%
402 action=warning,%
403 package=rerunfilecheck%
404 ]{rerunfilecheck}%
405 }
406 % \end{macrocode}
407 % \end{macro}
408 %
409 % \subsection{Check for checksum feature}
410 %
411 % \begin{macrocode}
412 \RequirePackage{infwarerr}[2007/09/09]
413 \RequirePackage{pdftexcmds}[2009/04/10]
414 % \end{macrocode}
415 % \begin{macrocode}
416 \begingroup\expandafter\expandafter\expandafter\endgroup
417 \expandafter\ifx\csname pdf@filemdfivesum\endcsname\relax
418 \@PackageInfoNoLine{rerunfilecheck}{%
419 Feature \string\pdfmdfivesum\space is not available\MessageBreak
420 (e.g. pdfTeX or LuaTeX with package `pdftexcmds').\MessageBreak
421 Therefore file contents cannot be checked efficiently\MessageBreak
422 and the loading of the package is aborted%
423 }%
424 \newcommand*{\RerunFileCheck}[3]{}%
425 \renewcommand*{\RerunFileCheckSetup}[1]{}%
426 \expandafter\ReFiCh@AtEnd
427 \fi%
428 % \end{macrocode}
429 %
430 % \subsection{Standard \xext{aux} files}
431 %
432 % \begin{macrocode}
433 \ifReFiCh@partaux
434 \let\ReFiCh@org@include\@include
435 \def\@include#1 {%
436 \if@filesw
437 \RerunFileCheck{#1.aux}{}{}%
438 \fi
439 \ReFiCh@org@include{#1} %
440 }%
441 \fi
442 \ifReFiCh@mainaux
443 \AtBeginDocument{%
444 \ReFiCh@mainauxfalse
445 }%
446 \ifReFiCh@mainaux
447 \AtEndOfPackage{%
448 \RerunFileCheck{\jobname.aux}{}{}%
449 }%
450 \else
451 \if@filesw
452 \@PackageWarningNoLine{rerunfilecheck}{%
453 Main aux file check is disabled,\MessageBreak
454 because the file is already opened.\MessageBreak
455 Load the package before \string\begin{document}%
456 }%
457 \fi
458 \fi
459 \fi
460 \ifReFiCh@starttoc
461 \let\ReFiCh@org@starttoc\@starttoc
462 \def\@starttoc#1{%
463 \if@filesw
464 \RerunFileCheck{\jobname.#1}{%
465 \@ifundefined{tf@#1}{%
466 }{%
467 \immediate\closeout\csname tf@#1\endcsname
468 }%
469 }{}%
470 \fi
471 \ReFiCh@org@starttoc{#1}%
472 }%
473 \fi
474 \ifReFiCh@index
475 \ifx\makeindex\@empty
476 \@PackageWarningNoLine{rerunfilecheck}{%
477 Option `index' ignored,\MessageBreak
478 because \string\makeindex\space has already been called%
479 }%
480 \else
481 \def\ReFiCh@temp{%
482 \newwrite\@indexfile
483 \immediate\openout\@indexfile=\jobname.idx %
484 \def\index{%
485 \@bsphack
486 \begingroup
487 \@sanitize
488 \@wrindex
489 }%
490 \typeout{Writing index file \jobname.idx}%
491 \let\makeindex\@empty
492 }%
493 \ifx\ReFiCh@temp\makeindex
494 \def\makeindex{%
495 \newwrite\@indexfile
496 \RerunFileCheck{\jobname.idx}{%
497 \immediate\closeout\@indexfile
498 }{%
499 Rerun LaTeX/makeindex to get index right%
500 }%
501 \immediate\openout\@indexfile=\jobname.idx %
502 \def\index{%
503 \@bsphack
504 \begingroup
505 \@sanitize
506 \@wrindex
507 }%
508 \typeout{Writing index file \jobname.idx}%
509 \let\makeindex\@empty
510 }%
511 \else
512 \@PackageInfoNoLine{rerunfilecheck}{%
513 Option `index': unsupported version of \string\makeindex
514 }%
515 \fi
516 \fi
517 \fi
518 \ifReFiCh@glossary
519 \ifx\makeglossary\@empty
520 \@PackageWarningNoLine{rerunfilecheck}{%
521 Option `glossary' ignored,\MessageBreak
522 because \string\makeglossary\space has already been called%
523 }%
524 \else
525 \def\ReFiCh@temp{%
526 \newwrite\@glossaryfile
527 \immediate\openout\@glossaryfile=\jobname.glo %
528 \def\glossary{%
529 \@bsphack
530 \begingroup
531 \@sanitize
532 \@wrglossary
533 }%
534 \typeout{Writing glossary file \jobname.glo }%
535 \let\makeglossary\@empty
536 }%
537 \ifx\ReFiCh@temp\makeglossary
538 \def\makeglossary{%
539 \newwrite\@glossaryfile
540 \RerunFileCheck{\jobname.glo}{%
541 \immediate\closeout\@glossaryfile
542 }{%
543 Rerun LaTeX/makeindex to get glossary right%
544 }%
545 \immediate\openout\@glossaryfile=\jobname.glo %
546 \def\glossary{%
547 \@bsphack
548 \begingroup
549 \@sanitize
550 \@wrglossary
551 }%
552 \typeout{Writing glossary file \jobname.glo}%
553 \let\makeglossary\@empty
554 }%
555 \else
556 \@PackageInfoNoLine{rerunfilecheck}{%
557 Option `glossary': unsupported version of \string\makeglossary
558 }%
559 \fi
560 \fi
561 \fi
562 \ReFiCh@DisableOption{mainaux}
563 \ReFiCh@DisableOption{partaux}
564 \ReFiCh@DisableOption{starttoc}
565 \ReFiCh@DisableOption{index}
566 \ReFiCh@DisableOption{glossary}
567 \ReFiCh@DisableOption{aux}
568 % \end{macrocode}
569 %
570 % \subsection{Rerun check}
571 %
572 % \begin{macrocode}
573 \RequirePackage{uniquecounter}[2009/12/18]
574 % \end{macrocode}
575 %
576 % \begin{macro}{\ReFiCh@CheckSum}
577 % \begin{macrocode}
578 \begingroup\expandafter\expandafter\expandafter\endgroup
579 \expandafter\ifx\csname pdf@filesize\endcsname\relax
580 \def\ReFiCh@CheckSum{%
581 \pdf@filemdfivesum
582 }%
583 \else
584 \def\ReFiCh@CheckSum#1{%
585 \pdf@filemdfivesum{#1}%
586 \ReFiCh@Separator
587 \pdf@filesize{#1}%
588 }%
589 \fi
590 % \end{macrocode}
591 % \end{macro}
592 % \begin{macro}{\ReFiCh@NoFile}
593 % \begin{macrocode}
594 \def\ReFiCh@Separator{;}
595 % \end{macrocode}
596 % \end{macro}
597 % \begin{macro}{\ReFiCh@NoFile}
598 % \begin{macrocode}
599 \def\ReFiCh@NoFile{<no file>}
600 % \end{macrocode}
601 % \end{macro}
602 %
603 % \begin{macrocode}
604 \UniqueCounterNew{rerunfilecheck}
605 % \end{macrocode}
606 %
607 % \begin{macro}{\RerunFileCheck}
608 % \begin{macrocode}
609 \newcommand*{\RerunFileCheck}{%
610 \UniqueCounterCall{rerunfilecheck}\ReFiCh@RerunFileCheck
611 }
612 % \end{macrocode}
613 % \end{macro}
614 % \begin{macro}{\ReFiCh@RerunFileCheck}
615 % \begin{macrocode}
616 \def\ReFiCh@RerunFileCheck#1{%
617 \expandafter\ReFiCh@@RerunFileCheck\csname ReFiCh@#1\endcsname
618 }
619 % \end{macrocode}
620 % \end{macro}
621 % \begin{macro}{\ReFiCh@Check}
622 % \begin{macrocode}
623 \def\ReFiCh@Check#1#2#3{%
624 % \IfFileExists{#3}{%
625 #1\edef#2{\ReFiCh@CheckSum{#3}}%
626 \ifx#2\ReFiCh@Separator
627 #1\let#2\ReFiCh@NoFile
628 \fi
629 % }{%
630 % #1\let#2\ReFiCh@NoFile
631 % }%
632 }
633 % \end{macrocode}
634 % \end{macro}
635 % \begin{macro}{\ReFiCh@@RerunFileCheck}
636 % \begin{macrocode}
637 \def\ReFiCh@@RerunFileCheck#1#2#3#4{%
638 \ReFiCh@Check\global#1{#2}%
639 \AddToHook{enddocument/info}{%
640 \begingroup
641 #3%
642 \ReFiCh@Check{}\x{#2}%
643 \ifx#1\x
644 \@PackageInfoNoLine{rerunfilecheck}{%
645 File `#2' has not changed.\MessageBreak
646 Checksum: \x
647 }%
648 \else
649 \ifnum
650 \ReFiCh@IsAux#2\relax.aux\relax\@nil
651 \ifx#1\ReFiCh@NoFile 1\else 0\fi
652 \ifx\x\ReFiCh@AuxEmptyUnix 1%
653 \else
654 \ifx\x\ReFiCh@AuxEmptyDos 1\fi
655 \fi
656 =111 %
657 \@PackageInfoNoLine{rerunfilecheck}{%
658 File `#2' is empty .aux file.\MessageBreak
659 Before: #1\MessageBreak
660 After: \space\x
661 }%
662 \else
663 \@PackageWarningNoLine{rerunfilecheck}{%
664 File `#2' has changed.%
665 \ifx\\#4\\%
666 \space Rerun%
667 \else
668 \MessageBreak
669 #4%
670 \fi
671 }%
672 \@PackageInfoNoLine{rerunfilecheck}{%
673 Checksums for `#2':\MessageBreak
674 Before: #1\MessageBreak
675 After: \space\x
676 }%
677 \fi
678 \fi
679 \endgroup
680 }%
681 }
682 % \end{macrocode}
683 % \end{macro}
684 % \begin{macrocode}
685 \def\ReFiCh@IsAux#1.aux\relax#2\@nil{%
686 \ifx\hbox#2\hbox
687 0%
688 \else
689 1%
690 \fi
691 }
692 % \end{macrocode}
693 % \begin{macrocode}
694 \def\ReFiCh@AuxEmptyUnix{A94A2480D3289E625EEA47CD1B285758;8}%
695 \@onelevel@sanitize\ReFiCh@AuxEmptyUnix
696 % \end{macrocode}
697 % \begin{macrocode}
698 \def\ReFiCh@AuxEmptyDos{A62A15ECE803E2EBE94952FCC9933BC0;9}%
699 \@onelevel@sanitize\ReFiCh@AuxEmptyDos
700 % \end{macrocode}
701 %
702 % \begin{macrocode}
703 \ReFiCh@AtEnd%
704 %</package>
705 % \end{macrocode}
706 %% \section{Installation}
707 %
708 % \subsection{Download}
709 %
710 % \paragraph{Package.} This package is available on
711 % CTAN\footnote{\CTANpkg{rerunfilecheck}}:
712 % \begin{description}
713 % \item[\CTAN{macros/latex/contrib/rerunfilecheck/rerunfilecheck.dtx}] The source file.
714 % \item[\CTAN{macros/latex/contrib/rerunfilecheck/rerunfilecheck.pdf}] Documentation.
715 % \end{description}
716 %
717 %
718 % \subsection{Package installation}
719 % Typically the package should be installed with the package manager of your \TeX-system.
720 % A manual installation as described below is needed only very rarely and is described
721 % only for historical reasons.
722 %
723 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
724 % \docstrip\ archive. The files are extracted by running the
725 % \xfile{.dtx} through \plainTeX:
726 % \begin{quote}
727 % \verb|tex rerunfilecheck.dtx|
728 % \end{quote}
729 %
730 % \paragraph{TDS.} Now the different files must be moved into
731 % the different directories in your installation TDS tree
732 % (also known as \xfile{texmf} tree):
733 % \begin{quote}
734 % \def\t{^^A
735 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
736 % rerunfilecheck.sty & tex/latex/rerunfilecheck/rerunfilecheck.sty\\
737 % rerunfilecheck.pdf & doc/latex/rerunfilecheck/rerunfilecheck.pdf\\
738 % rerunfilecheck-example.cfg & doc/latex/rerunfilecheck/rerunfilecheck-example.cfg\\
739 % rerunfilecheck.dtx & source/latex/rerunfilecheck/rerunfilecheck.dtx\\
740 % \end{tabular}^^A
741 % }^^A
742 % \sbox0{\t}^^A
743 % \ifdim\wd0>\linewidth
744 % \begingroup
745 % \advance\linewidth by\leftmargin
746 % \advance\linewidth by\rightmargin
747 % \edef\x{\endgroup
748 % \def\noexpand\lw{\the\linewidth}^^A
749 % }\x
750 % \def\lwbox{^^A
751 % \leavevmode
752 % \hbox to \linewidth{^^A
753 % \kern-\leftmargin\relax
754 % \hss
755 % \usebox0
756 % \hss
757 % \kern-\rightmargin\relax
758 % }^^A
759 % }^^A
760 % \ifdim\wd0>\lw
761 % \sbox0{\small\t}^^A
762 % \ifdim\wd0>\linewidth
763 % \ifdim\wd0>\lw
764 % \sbox0{\footnotesize\t}^^A
765 % \ifdim\wd0>\linewidth
766 % \ifdim\wd0>\lw
767 % \sbox0{\scriptsize\t}^^A
768 % \ifdim\wd0>\linewidth
769 % \ifdim\wd0>\lw
770 % \sbox0{\tiny\t}^^A
771 % \ifdim\wd0>\linewidth
772 % \lwbox
773 % \else
774 % \usebox0
775 % \fi
776 % \else
777 % \lwbox
778 % \fi
779 % \else
780 % \usebox0
781 % \fi
782 % \else
783 % \lwbox
784 % \fi
785 % \else
786 % \usebox0
787 % \fi
788 % \else
789 % \lwbox
790 % \fi
791 % \else
792 % \usebox0
793 % \fi
794 % \else
795 % \lwbox
796 % \fi
797 % \else
798 % \usebox0
799 % \fi
800 % \end{quote}
801 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
802 % TDS installing feature, then some files can already be in the right
803 % place, see the documentation of \docstrip.
804 %
805 % \subsection{Refresh file name databases}
806 %
807 % If your \TeX~distribution
808 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
809 % these. For example, \TeX\,Live\ users run \verb|texhash| or
810 % \verb|mktexlsr|.
811 %
812 % \subsection{Some details for the interested}
813 %
814 % \paragraph{Unpacking with \LaTeX.}
815 % The \xfile{.dtx} chooses its action depending on the format:
816 % \begin{description}
817 % \item[\plainTeX:] Run \docstrip\ and extract the files.
818 % \item[\LaTeX:] Generate the documentation.
819 % \end{description}
820 % If you insist on using \LaTeX\ for \docstrip\ (really,
821 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
822 % about your intention:
823 % \begin{quote}
824 % \verb|latex \let\install=y\input{rerunfilecheck.dtx}|
825 % \end{quote}
826 % Do not forget to quote the argument according to the demands
827 % of your shell.
828 %
829 % \paragraph{Generating the documentation.}
830 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
831 % the documentation. The process can be configured by the
832 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
833 % line into this file, if you want to have A4 as paper format:
834 % \begin{quote}
835 % \verb|\PassOptionsToClass{a4paper}{article}|
836 % \end{quote}
837 % An example follows how to generate the
838 % documentation with pdf\LaTeX:
839 % \begin{quote}
840 %\begin{verbatim}
841 %pdflatex rerunfilecheck.dtx
842 %makeindex -s gind.ist rerunfilecheck.idx
843 %pdflatex rerunfilecheck.dtx
844 %makeindex -s gind.ist rerunfilecheck.idx
845 %pdflatex rerunfilecheck.dtx
846 %\end{verbatim}
847 % \end{quote}
848 %
849 % \begin{History}
850 % \begin{Version}{2009/12/10 v1.0}
851 % \item
852 % The first version.
853 % \end{Version}
854 % \begin{Version}{2009/12/12 v1.1}
855 % \item
856 % Short info shortened.
857 % \end{Version}
858 % \begin{Version}{2009/12/18 v1.2}
859 % \item
860 % Required date for package \xpackage{uniquecounter} updated
861 % because of bug in this package.
862 % \end{Version}
863 % \begin{Version}{2010/01/25 v1.3}
864 % \item
865 % Moved from \texttt{TDS:*/generic/*} to \texttt{TDS:*/latex/*}.
866 % \end{Version}
867 % \begin{Version}{2010/02/22 v1.4}
868 % \item
869 % The options of this package are recognized only if they are
870 % package options. Global options are ignored. This avoids
871 % name clashes with class and other package options
872 % (for example, class option `index=totoc').
873 % \end{Version}
874 % \begin{Version}{2010/03/15 v1.5}
875 % \item
876 % Call of \cs{pdffivesum} is wrapped in \cs{IfFileExists} to avoid
877 % calls of \textsf{mktextex} if this feature is enabled.
878 % However \cs{IfFileExists} has file name limitations.
879 % \end{Version}
880 % \begin{Version}{2010/03/16 v1.6}
881 % \item
882 % Reverted to version 1.4 and \cs{IfFileExists} wrapper of
883 % version 1.5 is removed.
884 % \end{Version}
885 % \begin{Version}{2011/04/15 v1.7}
886 % \item
887 % Using \cs{AtEndAfterFileList} of package \xpackage{atveryend}
888 % 2011/04/15 v1.6 instead of \cs{AtVeryEndDocument}.
889 % \end{Version}
890 % \begin{Version}{2016/05/16 v1.8}
891 % \item
892 % Documentation updates.
893 % \end{Version}
894 % \begin{Version}{2019/12/05 v1.9}
895 % \item
896 % Documentation updates.
897 % \end{Version}
898 % \begin{Version}{2022-07-10 v1.10}
899 % \item Correct glossary option, see github issue \#1
900 % \end{Version}
901 % \begin{Version}{2025-06-21 v1.11}
902 % \item Remove dependency from atveryend package and use LaTeX hooks instead.
903 % \end{Version}
904 % \end{History}
905 %
906 % \PrintIndex
907 %
908 % \Finale
909 \endinput