The macros I propose just show the information for the document class and the packages, so only those with extension .cls
or .sty
, discarding the other files.
\documentclass{article}
\usepackage{xparse,l3regex,longtable,array}
\listfiles % initialize
\AtEndDocument{\printfilelist}
\ExplSyntaxOn
\NewDocumentCommand{\printfilelist}{}
{
\cleardoublepage
\section*{Used ~ packages}
\setlength{\LTleft}{0pt}
\pagestyle{empty}
\footnotesize
\begin{longtable}{@{} >{\ttfamily}l >{\raggedright}p{.6\textwidth} @{}}
\nobbz_print_filelist:
\end{longtable}
}
\tl_new:N \l_nobbz_filelist_body_tl
\cs_new_protected:Npn \nobbz_print_filelist:
{
\clist_map_inline:cn { @filelist }
{
\nobbz_print_fileinfo:n { ##1 }
}
\tl_use:N \l_nobbz_filelist_body_tl
}
\cs_new_protected:Npn \nobbz_print_fileinfo:n #1
{
\regex_match:nnT { \.(sty|cls)\Z } { #1 }
{
\nobbz_print_pkginfo:n { #1 }
}
}
\cs_new_protected:Npn \nobbz_print_pkginfo:n #1
{
\tl_put_right:Nx \l_nobbz_filelist_body_tl
{
\exp_not:n { #1 }
&
\exp_not:v { ver@#1 }
\exp_not:N \tabularnewline
}
}
\ExplSyntaxOff
\begin{document}
Some text
\end{document}

A variation for separating the file date from the information:
\documentclass{article}
\usepackage{xparse,l3regex,longtable,array,booktabs}
\listfiles % initialize
\AtEndDocument{\printfilelist}
\ExplSyntaxOn
\NewDocumentCommand{\printfilelist}{}
{
\cleardoublepage
\section*{Used ~ packages}
\setlength{\LTleft}{0pt}
\footnotesize
\begin{longtable}{@{} >{\ttfamily}l l >{\raggedright}p{.6\textwidth} @{}}
\toprule
\multicolumn{1}{@{}l}{\bfseries File~name} &
\multicolumn{1}{c}{\bfseries Date} &
\bfseries File~info
\tabularnewline
\midrule
\endhead
\bottomrule
\endfoot
\nobbz_print_filelist:
\end{longtable}
}
\tl_new:N \l_nobbz_filelist_body_tl
\tl_new:N \l_nobbz_fileinfo_tl
\cs_new_protected:Npn \nobbz_print_filelist:
{
\clist_map_inline:cn { @filelist }
{
\nobbz_print_fileinfo:n { ##1 }
}
\tl_use:N \l_nobbz_filelist_body_tl
}
\cs_new_protected:Npn \nobbz_print_fileinfo:n #1
{
\regex_match:nnT { \.(sty|cls)\Z } { #1 }
{
\nobbz_print_pkginfo:n { #1 }
}
}
\cs_new_protected:Npn \nobbz_print_pkginfo:n #1
{
\tl_set_eq:Nc \l_nobbz_fileinfo_tl { ver@#1 }
\tl_replace_once:Nnn \l_nobbz_fileinfo_tl { ~ } { & }
\tl_put_right:Nx \l_nobbz_filelist_body_tl
{
\exp_not:n { #1 }
&
\exp_not:V \l_nobbz_fileinfo_tl
\exp_not:N \tabularnewline
}
}
\ExplSyntaxOff
\begin{document}
Some text
\end{document}
