summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fileinfo/myfilist.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-10-15 17:39:58 +0000
committerKarl Berry <karl@freefriends.org>2012-10-15 17:39:58 +0000
commit194dbf928abdd659520679ca4c448b78c0f94c4b (patch)
tree32bf7ad3e30c47514238b6a791dddcd08bc69d9d /Master/texmf-dist/tex/latex/fileinfo/myfilist.sty
parent37aa0ee26efa7d88f12c32ebfcae8b1078dfc9f5 (diff)
fileinfo 0.6a (15oct12
git-svn-id: svn://tug.org/texlive/trunk@27973 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fileinfo/myfilist.sty')
-rw-r--r--Master/texmf-dist/tex/latex/fileinfo/myfilist.sty127
1 files changed, 121 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/fileinfo/myfilist.sty b/Master/texmf-dist/tex/latex/fileinfo/myfilist.sty
index 07e6f74b285..355bb29d1cf 100644
--- a/Master/texmf-dist/tex/latex/fileinfo/myfilist.sty
+++ b/Master/texmf-dist/tex/latex/fileinfo/myfilist.sty
@@ -3,7 +3,7 @@
%% modifies \listfiles to choose files to be listed and
%% list them in a chosen file.
-\def \fileversion {0.4} \def \filedate {2012/05/26}
+\def \fileversion {0.6a} \def \filedate {2012/10/12}
%% copyright (C) 2008, 2010, 2011, 2012 Uwe Lueck,
%% http://www.contact-ednotes.sty.de.vu
@@ -81,8 +81,66 @@
% informations, but quits them as soon as it has found one of these
% LaTeX2e commands.
%
+% VARIANTS:
+%
+% v0.5 provides different interfaces to reduce (shared) TeX code
+% when (similar) shell or batch scripts generate that gather.tex.
+%
+% \ReadListFileInfos[<txt-file>]{<tex-files>}
+%
+% is a shorthand for
+%
+% \ReadFileInfos{<tex-files>}
+% \ListInfos[<txt-file>]
+%
+% \emph{Without} the optional argument, the screen output is \emph{not}
+% written to disk---by default. However, preceding \ReadListFileInfos
+% by
+%
+% \WriteFileInfosTo{<txt-file>}
+%
+% is an alternative way to get the list in the plain text file.
+%
+% \FindReadListFileInfos[<txt-file>]{<tex-files>}
+%
+% must be used rather than \ReadListFileInfos\ when the comma-separated
+% list (generated by the "find" utility) \emph{starts} with a comma.
+% Alternatively,
+%
+% \UseFindUtility
+%
+% preceding \ReadListFileInfos deals with the leading comma.
+%
+% TRICKS:
+%
+% v0.6 first provides (e.g.)
+%
+% \FileListRemark[----]{---DOC.---}
+%
+% in order to insert `---DOC.--- ----' in the list. This writes
+% funny files that may be somewhat dangerous ...
+% I have used a bash script version of this for structuring
+% large file lists.
+%
+% v0.6 moreover provides two hooks and a package option
+% useful for the adhocfilelist package,
+% or perhaps even otherwise.
+%
+% \ListGenerator
+%
+% is a hook for the final lines in the plain text output file (see implementation).
+%
+% \NoBottomLines
+%
+% suppresses final messages of the LaTeX run, which may be nicer and
+% more informative on the screen. Package Option
+%
+% [no-bot]
+%
+% is a kind of shorthand to issue \NoBottomLines.
+%
% IMPLEMENTATION:
-
+%
\NeedsTeXFormat{LaTeX2e}[1994/12/01] %% \newcommand* etc.
\ProvidesPackage{myfilist}
[\filedate\space v\fileversion \space
@@ -102,7 +160,7 @@
% |\ListInfos[<external output file>]|
\newcommand*{\ListInfos}[1][]{%
\ifx$#1$\@dofilelist\else
- \newwrite\file@of@filelist
+ % \newwrite\file@of@filelist %% mv. v0.6
\immediate\openout\file@of@filelist=#1\relax
\def\typeout##1{%
\read@@typeout{##1}%
@@ -114,14 +172,65 @@
\multiply\count@ 60 \advance\@tempcntb -\count@
\typeout{ List made at
\the\year/\two@digits{\the\month}/\two@digits{\the\day},
- \two@digits{\the\@tempcnta}:\two@digits{\the\@tempcntb}^^J
- from script file \jobname.tex^^J}%% TODO ".tex"!? 2008/03/19
+ \two@digits{\the\@tempcnta}:\two@digits{\the\@tempcntb}%
+% v0.6 becomes more flexible here:
+ \ListGenerator}
\immediate\closeout\file@of@filelist
\fi
\stop}
%% <- TODO how to suppress first empty line? 2008/03/16
- %% -> TODO more general style of output file 2008/03/19
+\newwrite\file@of@filelist %% mv. v0.6
+% emulating versions before v0.6:
+\providecommand*{\ListGenerator}{%
+ ^^J from script file \jobname.tex^^J}
\let\read@@typeout\typeout
+% v0.5:
+%
+% There is a little (design) bug in \ListInfos:
+% When gather.tex's last line is \ListInfos without optional
+% argument or anything, LaTeX prompts for further input.
+% This might be fixed using ifnextok.sty, but I am not sure
+% right now. In |\VarListInfos|, \relax stops waiting for
+% input. \providecommand means that the default can be
+% overridden before loading myfilist.sty:
+\providecommand*{\VarListInfos}{\ListInfos\relax}
+% |\WriteFileInfosTo{<txt-file>}| overrides the previous default:
+\newcommand*{\WriteFileInfosTo}[1]{%
+ \renewcommand\VarListInfos{\ListInfos[#1]}}
+% |\ReadListFileInfos[<txt-file>]{<tex-files>}|
+\newcommand*{\ReadListFileInfos}[2][]{%
+ \ifx$#1$\else\WriteFileInfosTo{#1}\fi
+ \read@comma@guard\read@list@file@infos#2\stop}
+\let\read@comma@guard\@empty
+\def\read@list@file@infos#1\stop{%
+% Here |\VarListInfos| is used finally:
+ \ReadFileInfos{#1}\VarListInfos}
+% |\UseFindUtility| activates \read@comma@guard in order
+% to kill a leading comma:
+\newcommand*{\UseFindUtility}{%
+ \let\read@comma@guard\@firstoftwo}
+% |\FindReadListFileInfos[<txt-file>]{<tex-files>}|
+\newcommand*{\FindReadListFileInfos}{%
+ \UseFindUtility\ReadListFileInfos}
+% v0.6:
+%
+% |\FileListRemark[<info>]{<filename>}| \
+% writes and reads a dummy file <filename> with \Provides...
+% content <info> which is empty by default:
+\newcommand*\FileListRemark[2][]{%
+ \immediate\openout\file@of@filelist#2
+ \immediate\write\file@of@filelist{%
+ \string\ProvidesFile{#2}[#1]}%
+ \immediate\closeout\file@of@filelist
+ \ReadFileInfos{#2}}
+%
+% |\NoBottomLines|
+\newcommand*{\NoBottomLines}{%
+ \let\STOP\stop \def\stop{\batchmode\STOP}}
+% Package option |[no-bot]|:
+\DeclareOption{no-bot}{\NoBottomLines}
+\ProcessOptions
+% Finally issuing |\listfiles| (already before v0.5):
\listfiles
\endinput
@@ -140,3 +249,9 @@ v0.3 2010/11/26 split off from "myfiles.sty", opt. arg. for
v0.3a 2011/01/29 two empty lines commented out
2011/01/30 copyright updated
v0.4 2012/05/26 \EmptyFileList clears options
+v0.5 2012/09/27 \ReadListFileInfos, \WriteFileList,
+ \FindReadListInfos, \UseFindUtility
+v0.6 2012/10/11 \FileListRemark, \ListGenerator,
+ \NoBottomLines, [no-bot]
+v0.6a 2012/10/12 adding \UseFindUtility and \FindReadListInfos
+ in the history for v0.5