summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltfiles.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/base/ltfiles.dtx')
-rw-r--r--macros/latex-dev/base/ltfiles.dtx59
1 files changed, 54 insertions, 5 deletions
diff --git a/macros/latex-dev/base/ltfiles.dtx b/macros/latex-dev/base/ltfiles.dtx
index f079c2cf5b..2e2a8884a0 100644
--- a/macros/latex-dev/base/ltfiles.dtx
+++ b/macros/latex-dev/base/ltfiles.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2023
+% Copyright (C) 1993-2024
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltfiles.dtx}
- [2023/06/17 v1.2u LaTeX Kernel (File Handling)]
+ [2024/02/08 v1.2v LaTeX Kernel (File Handling)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltfiles.dtx}
@@ -1087,7 +1087,7 @@
% \texttt{-1} we ensure that we don't get a backslash in front. As a
% result we end up with all characters as catcode 12 (plus
% spaces). We then sometimes add quotes around the construct
-% (removing any existing inner quotes. Sometimes we only remove the
+% (removing any existing inner quotes). Sometimes we only remove the
% quotes if they have been supplied by the user. There is clearly
% some room for improvement.
%
@@ -1682,6 +1682,22 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\if@listfiles@hashes}
+% \changes{v1.2v}{2023/11/15}{Extend file list information}
+% \begin{macro}{\if@listfiles@sizes}
+% \changes{v1.2v}{2023/11/15}{Extend file list information}
+% \begin{macrocode}
+\ExplSyntaxOn
+\keys_define:nn { __kernel / listfiles }
+ {
+ hashes .legacy_if_set:n = @listfiles@hashes ,
+ sizes .legacy_if_set:n = @listfiles@sizes
+ }
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\listfiles}
% A preamble command to cause |\end{document}| to list files input
% from the main file.
@@ -1693,8 +1709,10 @@
% {Stop \cs{listfiles} being run twice}
% \changes{v1.0i}{1994/10/18}
% {code moved here from ltclass}
+% \changes{v1.2v}{2023/11/15}{Extend file list information}
% \begin{macrocode}
-\def\listfiles{%
+\NewDocumentCommand\listfiles{O{}}{%
+ \SetKeys[__kernel/listfiles]{#1}%
\let\listfiles\relax
\def\@listfiles##1##2##3##4##5##6##7##8##9\@@{%
\def\reserved@d{\\}%
@@ -1730,9 +1748,40 @@
\filename@area\filename@base\\\\\\\\\\\\\\\\\\\@@
\typeout{%
\filename@area\reserved@a
- \ifx\reserved@b\relax\else\@spaces\reserved@b\fi}}%
+ \ifx\reserved@b\relax\else\@spaces\reserved@b\fi
+% \end{macrocode}
+% Now we add the additional information if requested.
+% \begin{macrocode}
+ \ifnum0%
+ \if@listfiles@hashes1\fi
+ \if@listfiles@sizes1\fi
+ >0 %
+ ^^J\@spaces
+ (%
+ \if@listfiles@sizes
+ size \@dofilelist@size\@currname
+ \if@listfiles@hashes
+ , %
+ \fi
+ \fi
+ \if@listfiles@hashes
+ hash \@dofilelist@hash\@currname
+ \fi
+ )%
+ \fi
+ }}%
\typeout{ ***********^^J}}}
% \end{macrocode}
+% \begin{macro}{\@dofilelist@hash}
+% \begin{macro}{\@dofilelist@size}
+% \begin{macrocode}
+\ExplSyntaxOn
+\cs_new_eq:NN \@dofilelist@hash \file_mdfive_hash:n
+\cs_new_eq:NN \@dofilelist@size \file_size:n
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \changes{LaTeX2e}{1994/03/13}
% {Reset \cs{@addtofilelist} at begin document}