# print \filelist to pdf

I know that there are many packages to modify the output of \listfiles. However, I would like to print this list not to the log file but in a nice way to the pdf.

This makes sence for my template documentation where I want to add a list of all files used in the template in the order of loading.

-

Just pointing you to a package, but dateiliste may be suitable:

The command \printFileList has an optional sectioning argument that specifies what type of document block you would like the file list to appear in, e.g. \printFileList[\section]. It also has some parameters that you can set:

  \fileListName     - title ("List of Files")
\fileListPreamble - preamble (typeset before the table)
\fileNameName     - table header "file name"


Minimal example (if you don't want the page numbers, call the package with the optional \usepackage[noshowpage]{dateiliste}):

\documentclass{article}
\usepackage{mathtools}
\usepackage{dateiliste}
% \usepackage[noshowpage]{dateiliste}
\listfiles
\begin{document}
\printFileList
\end{document}


Edit: If the noshowpage option doesn't quite solve the problem, you have a couple of other options:

(1) You could shorten the "version" column heading by \def\verName{ver.} (2) You could edit lines 172-173 of dateiliste.sty. Line 173 specifies the format for the description column. You could change it from the current

\string\raggedright\string\arraybackslash}X}


to,

\string\small\string\raggedright\string\arraybackslash}X}


in order to reduce the size of the text in that column. In addition, if you don't mind breaking the long file names in column 1, you could edit line 172 from

\string\begin{longtable}{\@tempa>{%


where \@tempa contains either lrll or lll to specify column justification (depending on whether you have invoked noshowpages, to

\string\begin{longtable}{p{3cm}ll>{%


where the p{3cm} could be adjusted to break just the longest file names.

-
It works, but in my file (code.google.com/p/latexthesistemplate/downloads/…) the output of the table is rather bad, due to very large column widths. This leads to a complete size of this list of 60 pages! –  Matthias Pospiech Oct 2 '12 at 21:36
Looking in the source of dateiliste it's using LTXtable to generate the list of files. Possibly there is some interaction somewhere between that and another package. –  Scott H. Oct 2 '12 at 21:54
Scratch that, the problem is on page 150 of your document: translator-months-dictionary-english.dict is forcing the first column to be excessively wide and pushing the remaining columns to the right. –  Scott H. Oct 2 '12 at 23:01
One thing you can do to help mitigate that (if those packages are necessary) is to use: \usepackage[noshowpages]{dateiliste} and to define \def\verName{ver.} –  Scott H. Oct 2 '12 at 23:09
Unfortunately I can not modify dateiliste.sty because it would mean that I must ship a modified dateiliste.sty file with my template. I contacted the author and hope he is willing to work with me on modification or futher options. –  Matthias Pospiech Oct 3 '12 at 9:40

This is literally stripped from latex.ltx and wrapped in \printfiles:

\listfiles
\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\usepackage{geometry}% http://ctan.org/pkg/geometry
\makeatletter
\def\printfilelist{%
\begingroup
\ttfamily%
\par*File List* \par
\@for\@currname:=\@filelist\do{%
\filename@parse\@currname
\edef\reserved@a{%
\filename@base.%
\ifx\filename@ext\relax tex\else\filename@ext\fi}
\expandafter\let\expandafter\reserved@b
\csname ver@\reserved@a\endcsname
\expandafter\expandafter\expandafter\@listfiles\expandafter
\filename@area\filename@base\\\\\\\\\\\\\\\\\\\@@
\filename@area\reserved@a
\ifx\reserved@b\relax\else\@spaces\reserved@b\fi\par}
***********\par
\endgroup%
}
\makeatother
\begin{document}
abc

\printfilelist
\end{document}


The file list represents that current on ScribTeX (under TeX Live 2009).

-