From be6233465c6f7578e79a4471d725b79bf0678996 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 26 Mar 2012 23:18:55 +0000 Subject: new latex package nicefilelist (26mar12) git-svn-id: svn://tug.org/texlive/trunk@25746 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/nicefilelist/README | 45 +++++ .../texmf-dist/doc/latex/nicefilelist/SrcFILEs.txt | 16 ++ .../doc/latex/nicefilelist/nicefilelist.pdf | Bin 0 -> 320905 bytes .../texmf-dist/source/latex/nicefilelist/empty.f | 0 .../source/latex/nicefilelist/nicefilelist.tex | 161 ++++++++++++++++ .../source/latex/nicefilelist/provonly.fd | 2 + .../source/latex/nicefilelist/srcfiles.tex | 17 ++ .../texmf-dist/source/latex/nicefilelist/wrong.prv | 1 + .../tex/latex/nicefilelist/nicefilelist.sty | 210 +++++++++++++++++++++ 9 files changed, 452 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/nicefilelist/README create mode 100644 Master/texmf-dist/doc/latex/nicefilelist/SrcFILEs.txt create mode 100644 Master/texmf-dist/doc/latex/nicefilelist/nicefilelist.pdf create mode 100644 Master/texmf-dist/source/latex/nicefilelist/empty.f create mode 100644 Master/texmf-dist/source/latex/nicefilelist/nicefilelist.tex create mode 100644 Master/texmf-dist/source/latex/nicefilelist/provonly.fd create mode 100644 Master/texmf-dist/source/latex/nicefilelist/srcfiles.tex create mode 100644 Master/texmf-dist/source/latex/nicefilelist/wrong.prv create mode 100644 Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/nicefilelist/README b/Master/texmf-dist/doc/latex/nicefilelist/README new file mode 100644 index 00000000000..e24f80cddb8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/nicefilelist/README @@ -0,0 +1,45 @@ + + README for the `nicefilelist' package + "\listfiles Alignment for Connoisseurs" + (C) Uwe Lueck 2012/03/23 + + +While `longnamefilelist.sty' improves LaTeX's \listfiles with respect +to long base filenames only, the present `nicefilelist.sty' +'nicefilelist.sty' can keep separate columns for +(i) date (ii) version, and (iii) "caption" +(don't write caption text in date column), +their alignment not being disturbed by short filename extensions +such as `.fd'. This is achieved basing on the `monofill' package. + +Thus `nicefilelist' is more "powerful" than `longnamefilelist', the +former however is an "extension" of the latter neither with respect +to implementation nor with respect to user interface. + +LICENSE: + +The package file `nicefilelist.sty' and the documentation files +`nicefilelist.pdf' and `nicefilelist.tex' can be redistributed and/or +modified under the terms of the LaTeX Project Public License; +either version 1.3c of the License, or any later version, see + + http://www.latex-project.org/lppl.txt + +There is NO WARRANTY (it's rather experimental development). + +The `nicefilelist' package is author-maintained in the sense of +this license. + +The latest public version of the package is available at + + http://mirror.ctan.org/macros/latex/contrib/nicefilelist/ + +A TDS version of the package is available as + + http://mirror.ctan.org/install/macros/latex/contrib/nicefilelist.tds.zip + +Please report bugs, problems, and suggestions via + + http://www.contact-ednotes.sty.de.vu + + diff --git a/Master/texmf-dist/doc/latex/nicefilelist/SrcFILEs.txt b/Master/texmf-dist/doc/latex/nicefilelist/SrcFILEs.txt new file mode 100644 index 00000000000..59eceb0667d --- /dev/null +++ b/Master/texmf-dist/doc/latex/nicefilelist/SrcFILEs.txt @@ -0,0 +1,16 @@ + + *File List* +nicefilelist.sty 2012/03/23 v0.1 more file list alignment (UL) + monofill.sty 2012/03/19 v0.1a monospace alignment (UL) + myfilist.sty 2011/01/30 v0.3a \listfiles -- mine only (UL) + readprov.sty 2010/11/27 v0.3 file infos without loading (UL) +nicefilelist.tex 2012/03/23 -- documenting nicefilelist.sty + provonly.fd -- -- -- -- such + wrong.prv * NOT FOUND * + empty.f * NOT FOUND * + srcfiles.tex 2012/03/23 -- file infos -> SrcFILEs.txt + *********** + + List made at 2012/03/23, 10:31 + from script file srcfiles.tex + diff --git a/Master/texmf-dist/doc/latex/nicefilelist/nicefilelist.pdf b/Master/texmf-dist/doc/latex/nicefilelist/nicefilelist.pdf new file mode 100644 index 00000000000..f786a029384 Binary files /dev/null and b/Master/texmf-dist/doc/latex/nicefilelist/nicefilelist.pdf differ diff --git a/Master/texmf-dist/source/latex/nicefilelist/empty.f b/Master/texmf-dist/source/latex/nicefilelist/empty.f new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Master/texmf-dist/source/latex/nicefilelist/nicefilelist.tex b/Master/texmf-dist/source/latex/nicefilelist/nicefilelist.tex new file mode 100644 index 00000000000..1673621ac95 --- /dev/null +++ b/Master/texmf-dist/source/latex/nicefilelist/nicefilelist.tex @@ -0,0 +1,161 @@ +\ProvidesFile{nicefilelist.tex}[2012/03/23 documenting nicefilelist.sty] +\title{\pkg{\huge nicefilelist.sty + }\\---\\\cs{listfiles} Alignment for Connoisseurs\thanks{This + document describes version + \textcolor{blue}{\UseVersionOf{\jobname.sty}} + of \pkg{\jobname.sty} as of \UseDateOf{\jobname.sty}.}} +% \listfiles +{ \RequirePackage{makedoc} \ProcessLineMessage{} + \MakeJobDoc{19}%% 2012/03/21 + {\SectionLevelTwoParseInput} } +\documentclass[fleqn]{article}%% TODO paper dimensions!? +\input{makedoc.cfg} %% shared formatting settings +% \ReadPackageInfos{nicefilelist} +\usepackage{nicefilelist} +\sloppy +\begin{document} +\maketitle +\begin{abstract}\noindent +While \CtanPkgRef{longnamefilelist}{longnamefilelist.sty} +improves \LaTeX's \cs{listfiles} with respect to long base filenames only, +'nicefilelist.sty' can keep separate columns for +(i)~date (ii)~version, and (iii)~``caption" +(don't write caption text in date column), +their alignment not being disturbed by short filename extensions such as `.fd'. +This is achieved basing on the \ctanpkgref{monofill} package. + +Thus 'nicefilelist' is more ``powerful" than 'longnamefilelist', +the former however is an ``extension" of the latter +neither with respect to implementation nor with respect to user interface. +\end{abstract} +\tableofcontents +\section{Features and Usage} +\subsection{Relation to 'longnamefilelist.sty'} +\CtanPkgRef{longnamefilelist}{longnamefilelist.sty} equips +\cs{listfiles} with an optional argument for the maximum number of characters +in the base filename. By contrast, 'nicefilelist' does not provide +arguments for \cs{listfiles}, rather column widths for basename, extension, +and version number are determined by \emph{templates} using +\CtanPkgRef{monofill}{monofill.sty}. As a ``template" for doing this, +see the initial settings in Sec.~\ref{sec:templates}. +(Such settings must precede the \cs{listfiles command}) +So 'nicefilelist''s \emph{user interface} (at present) does not \emph{extend} +'longnamefilelist''s user interface. + +Using 'monofill' is a very different approach than the one of 'longnamefilelist'. +'nicefilelist' is more powerful than 'longnamefilelist', but is not based on it +in any way. It does not make sense to load both packages, they just overwrite +each other's behaviour of \cs{listfiles}. + +'longnamefilelist' may become ``obsolete" by the present package, +unless one finds that its version of \cs{listfiles} looks fine enough +and it is easier to understand and to use than 'nicefilelist'. + +\subsection{Installing and Calling} +The file 'nicefilelist.sty' is provided ready, installation only requires +putting it somewhere where \TeX\ finds it +(which may need updating the filename data + base).\urlfoot{ukfaqref}{inst-wlcf} + +Below the `\documentclass' line(s) and above `\begin{document}', +you load 'nicefilelist.sty' (as usually) by +\begin{verbatim} + \usepackage{nicefilelist} +\end{verbatim} +Alternatively---e.g., for use with \ctanpkgref{myfilist} from the +\ctanpkgref{fileinfo} bundle, see~Sec.~\ref{sec:myfilist}, +or in order to include the `.cls' file in the list---you may load it by +\begin{verbatim} + \RequirePackage{nicefilelist} +\end{verbatim} +before `\documentclass' or when you don't use `\documentclass'. + +\subsection{Usage and Sample with 'myfilist.sty'} +\label{sec:myfilist} +In order to get a reduced and/or rearranged list of used files +with the \ctanpkgref{myfilist} package, +`nicefilelist.sty' must be loaded earlier than +`myfilist.sty'. This is due to a kind of limitation of the latter, + it \emph{issues} `\listfiles' (TODO). +Therefore \cs{listfiles} must be modified earlier---or \emph{issued} earlier, +in this case the \cs{listfiles} in `myfilist.sty' does nothing. +The file `SrcFILEs.txt' accompanying the distribution of 'longnamefilelist', +e.g., can be generated by running the following file `srcfiles.tex' +with \LaTeX: +\begin{quotation}\tt\small +\expandafter\def\expandafter\{\expandafter{\string{} +\expandafter\def\expandafter\}\expandafter{\string}} +\obeyspaces\obeylines +\cs{ProvidesFile}\{srcfiles.tex\}[2012/03/23 + ~ file infos -\empty> SrcFILEs.txt] +\cs{RequirePackage}\{nicefilelist\} +\%\% INSERT MODIFICATIONS OF INITIAL +\%\% \verb+`nicefilelist'/`monofill'+ SETTINGS HERE! +\cs{RequirePackage}\{myfilist\} +\%\% documentation: +\cs{ReadFileInfos}\{nicefilelist\} +\%\% demonstration: +\cs{ReadFileInfos}\{provonly.fd,wrong.prv,empty.f\} +\% \cs{ReadFileInfos}\{utopia.xyz\} +\%\% present file: +\cs{ReadFileInfos}\{nicefilelist\} +\cs{ReadFileInfos}\{srcfiles\} +\cs{ListInfos}[SrcFILEs.txt] +\end{quotation} +Note the lines where to place \strong{custom} modifications of settings +for alignment (Sec.~\ref{sec:templates}) or failure displays (Sec.~\ref{sec:failure}). + +The previous code mentions the following files: +\begin{description} + \item[`provonly.fd'] has a proper `\ProvidesFile' line without date, + for seeing what happens in the date and version columns. + It also was a test for the case that there are fewer + characters than a date has, and there is no blank space. + \item[`wrong.prv'] has a `\ProvidesFile' line with wrong file name. + \item[`empty.f'] just is an empty file. + \item[`utopia.xyz'] is not present at all, you get an error when you remove + the comment mark. +\end{description} +Moreover, my `.tex' files have dates, but not version numbers, +so you see what happens then: +\vskip\topsep +\begin{small}\tt +\obeyspaces\obeylines +~ *File List* +nicefilelist.sty 2012/03/23 v0.1 \rlap{more file list alignment (UL)} +~ monofill.sty 2012/03/19 v0.1a monospace alignment (UL) +~ myfilist.sty 2011/01/30 v0.3a \rlap{\cs{listfiles} -- mine only (UL)} +~ readprov.sty 2010/11/27 v0.3 \rlap{file infos without loading (UL)} +nicefilelist.tex 2012/03/23 -- \rlap{documenting nicefilelist.sty} +~ provonly.fd -- -- -- -- such +~ wrong.prv * NOT FOUND * +~ empty.f * NOT FOUND * +~ srcfiles.tex 2012/03/23 -- file infos -> SrcFILEs.txt +~ *********** +~ +~List made at 2012/03/23, 10:31 +~from script file srcfiles.tex +\end{small} + + +% \section{Example} +% TODO +\section{Implementation} +\subsection{Package File Header (Legalize)} +\input{nicefilelist.doc} + +\section{Credit} +It was \textsc{Martin Muench} who pointed out the shortcomings of 'longnamefilelist' +that the present package addresses---thanks! + +\section{Missing} +The package once might provide \ctanpkgref{keyval}-style optional arguments for \cs{listfiles} +or even call \cs{listfiles} automatically with 'keyval' package options. + +\end{document} + +VERSION HISTORY + +2012/03/20 for v0.1 started +2012/03/22 trying something +2012/03/23 for v0.1a without "aligning the dots" etc. diff --git a/Master/texmf-dist/source/latex/nicefilelist/provonly.fd b/Master/texmf-dist/source/latex/nicefilelist/provonly.fd new file mode 100644 index 00000000000..2b07688d8dc --- /dev/null +++ b/Master/texmf-dist/source/latex/nicefilelist/provonly.fd @@ -0,0 +1,2 @@ +% \ProvidesFile{provonly.fd}[2012/03/22 v0.11a such] +\ProvidesFile{provonly.fd}[such] diff --git a/Master/texmf-dist/source/latex/nicefilelist/srcfiles.tex b/Master/texmf-dist/source/latex/nicefilelist/srcfiles.tex new file mode 100644 index 00000000000..fe4d6d2b878 --- /dev/null +++ b/Master/texmf-dist/source/latex/nicefilelist/srcfiles.tex @@ -0,0 +1,17 @@ +\ProvidesFile{srcfiles.tex}[2012/03/23 file infos -> SrcFILEs.txt] +\RequirePackage{nicefilelist} +\RequirePackage{myfilist} +% \EmptyFileList[nicefilelist.sty] %%% [readprov.sty,myfilist.sty] +%% packages: +% \ReadPackageInfos{nicefilelist} +%% documentation: +\ReadFileInfos{nicefilelist} +%% Test: +\ReadFileInfos{provonly.fd,wrong.prv,empty.f} +% \ReadFileInfos{utopia.xxx} +%% documentation settings and auxiliaries: +% \ReadPackageInfos{fifinddo,makedoc,niceverb} +% \ReadFileInfos{makedoc.cfg,mdoccorr.cfg} +\ReadFileInfos{srcfiles} +\ListInfos[SrcFILEs.txt] + diff --git a/Master/texmf-dist/source/latex/nicefilelist/wrong.prv b/Master/texmf-dist/source/latex/nicefilelist/wrong.prv new file mode 100644 index 00000000000..166454f5c82 --- /dev/null +++ b/Master/texmf-dist/source/latex/nicefilelist/wrong.prv @@ -0,0 +1 @@ +\ProvidesFile{diffname.prv}[2012/03/23 v0.1 wrong] diff --git a/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty b/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty new file mode 100644 index 00000000000..79d3ad0fafd --- /dev/null +++ b/Master/texmf-dist/tex/latex/nicefilelist/nicefilelist.sty @@ -0,0 +1,210 @@ +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{nicefilelist}[2012/03/23 v0.1 + more file list alignment (UL)] + +%% Copyright (C) 2012 Uwe Lueck, +%% http://www.contact-ednotes.sty.de.vu +%% -- author-maintained in the sense of LPPL below -- +%% +%% This file can be redistributed and/or modified under +%% the terms of the LaTeX Project Public License; either +%% version 1.3c of the License, or any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% We did our best to help you, but there is NO WARRANTY. +%% +%% Please report bugs, problems, and suggestions via +%% +%% http://www.contact-ednotes.sty.de.vu +%% +%% === Alignment Settings === +%% \label{sec:templates} +%% We use the \ctanpkgref{monofill} package for alignment of plain text: +\RequirePackage{monofill} +%% See its documentation for details. +%% +%% We support three alignment ``fields" according to the terminology of \pkg{monofill}. +%% Their ids are |f-base| for base filenames, |f-ext| for filename extensions, +%% % |f-date| for the revision date, +%% and |f-version| for the revision version id of a file %%% , +%% % the latter two +%% as read from `\ProvidesFile', `\ProvidesPackage', +%% or `\ProvidesClass' command in the file. +%% Initial settings for them are following. +%% For modifying them, load 'nicefilelist.sty', +%% then type your own settings, then issue `\listfiles' +%% or load 'myfilist.sty'. +\MFfieldtemplate{f-base}{nicefilelist} +\MFfieldtemplate{f-ext}{tex} +\MFfieldtemplate{f-version}{v0.11a} +%% We are not supporting version numbers greater than 9 at present---sorry! (TODO) +%% +%% |\NFLspaceI|, |\NFLspaceII|, and |\NFLspaceIII| +%% determine the space between the four +%% columns for names, dates, versions, and ``captions": +\newcommand*{\NFLspaceI} { \space} +\newcommand*{\NFLspaceII} { \space} +\newcommand*{\NFLspaceIII}{ } +%% +%% === Failure Displays === +%% \label{sec:failure} +%% |\NFLnodate| is displayed in place of a file date if it seems +%% not to be given (configurable): +\newcommand*{\NFLnodate}{ -- \space-- --} +%% |\NFLnoversion| likewise---however, for alignment, +%% each wanted space must be specified as `\space' +%% (not just a code blank space). +%% It may need adjustment (by `\renewcommand') when +%% `\MFfieldtemplate{f-version}' is modified: +\newcommand*{\NFLnoversion}{\space--} +%% |\NFLnotfound| is for files with wrong or no +%% \cs{Provides.\empty..} command: +\newcommand*{\NFLnotfound}{ * NOT FOUND *} +%% +%% === Redefining \cs{listfiles} === +%% Similarly to original \LaTeX, |\listfiles| carries almost everything +%% that is needed for the file list only: +\renewcommand*{\listfiles}{% + \let\listfiles\relax +%% ---this clears memory. Now \LaTeX\ requires that `\@listfiles' +%% is defined, although we don't use it +%% (TODO use it in place of some `\NFL@'...?): + \let\@listfiles\relax +%% |\@dofilelist| is executed by the standard \LaTeX\ `\enddocument' +%% macro or by `\ListInfos' from the \ctanpkgref{myfilist} package. + \def\@dofilelist{% +%% ``Title:" + \typeout{^^J \space\space + \MFrightinfield{*File List*}{f-base}}% + \@for\@currname:=\@filelist\do{% +%% This starts the loop through the list of files + \filename@parse\@currname + \edef\filename@ext{% + \ifx\filename@ext\relax tex\else\filename@ext\fi}% + \expandafter\let\expandafter\NFL@ver + \csname ver@\filename@base.\filename@ext\endcsname +%% Some assignments for parsing file info, resembling \LaTeX's +%% `\GetFileInfo', to make life within `\typout{}' easier: + \ifx\NFL@ver\relax \else +%% We assume that no date is given, until we find it; +%% likewise for version: + \let\NFL@date \NFLnodate + \let\NFL@version\NFLnoversion + \ifx\NFL@ver\@empty \else + \ifx\NFL@ver\space +% \let\NFL@ver\@empty + \else +%% `\NFL@words' aims to be more careful than \LaTeX's `\GetFileInfo': + \expandafter \NFL@words \NFL@ver + \@gobble? \@gobble? \@gobble?\@gobble?% +%% \cs{filedate} is not empty at the present condition, +%% let's see if it starts with a date: + \expandafter\NFL@test@date\filedate +%% Dummies in case \cs{filedate} has less elements than +%% \cs{NFL@test@date} tries to read: + \@empty\@empty\@empty\@empty\@empty + \@empty\@empty\@empty\@empty + \@nil + \if@tempswa + \let\NFL@date\filedate +%% Is \cs{fileversion} a version id? + \ifx\fileversion\@empty \else + \expandafter\NFL@test@version\fileversion\@empty\@nil + \fi +%% Otherwise, the first word could be a version number---we +%% ignore such awkward files in this package version (TODO) +%% and even assume that no version is indicated. +% \else + \fi + \fi + \fi +%% When \cs{filedate} is not a file date, it is considered part of +%% the file ``caption," likewise for version: + \edef\fileinfo{% + \ifx\NFL@date\NFLnodate \filedate \space \fi + \ifx\NFL@version\NFLnoversion \fileversion \space \fi + \fileinfo}% + \fi + \typeout{% +%% Now all parsing and checking must be expandable. + \NFL@make@macro@arg\MFrightinfield\filename@base{f-base}.% + \NFL@make@macro@arg\MFleftinfield \filename@ext {f-ext}% + \NFLspaceI + \ifx\NFL@ver\relax + \NFLnotfound + \else + \NFL@date + \NFLspaceII %% TODO conditionally? + \NFL@make@macro@arg\MFleftinfield\NFL@version {f-version}% + \NFLspaceIII %% TODO conditionally? + \fileinfo + \fi + }% + }% +%% The line of stars: + \typeout{ \space\space\space + \MFrightinfield{***********}{f-base}^^J}% +%% TODO or more stars as with 'longnamefilelist'? + }% +%% This finishes the definition of `\@dofilelist'. +%% The definitions of macros called from `\@dofilelist' are following. +%% |\NFL@words| tries to get the first three ``words": + \def\NFL@words##1 ##2 ##3\@gobble?{% + \edef\filedate{##1}\edef\fileversion{##2}\edef\fileinfo{##3}% +%% When the result of ```\csname ver@\endcsname'" +%% contains a single space token only, +%% \cs{fileinfo} contains the result of expanding ```\@gobble? '", +%% as opposed to ```\@gobble?"' in other cases. Thus this ``normalization": + \ifx\fileinfo\space \let\fileinfo\@empty \fi }% +%% |\NFL@test@date| checks whether the first ``word" is a date: + \def\NFL@test@date##1##2##3##4##5##6##7##8##9{% + \@tempswatrue +%% Are there slashes at the correct positions? + \if/##5\else\@tempswafalse\fi + \if/##8\else\@tempswafalse\fi +%% Now we test the eight positions of expected digits: + \NFL@test@digits{##1##2##3##4##6##7##9}}% + \def\NFL@test@digits##1##2##3\@nil{% +%% It's not a date if it has more than 10 characters (TODO?). +%% If it \emph{is} a date, #2 is the last digit, +%% and #3 contains the dummies, and then? + \edef\@tempa{##3}% +% \typein{##1}% + \ifx\@tempa\@empty \NFL@test@digit ##1##2\@nnil + \else \@tempswafalse \fi }% + \def\NFL@test@digit##1{% + \ifx##1\@nnil \else + \ifnum`##1<48 \@tempswafalse + \else \ifnum`##1>57 \@tempswafalse \fi + \fi +% \typein{code of ##1 is \number`##1.}% + \if@tempswa + \expandafter\expandafter\expandafter \NFL@test@digit + \else + \expandafter\expandafter\expandafter\NFL@kill + \fi + \fi + }% + \def\NFL@kill##1\@nnil{}% +%% TODO or use \ctanpkgref{coolstr}? +%% or there may be \emph{some} package that offers a test +%% whether something is a date. +%% \vskip\smallskipamount\noindent +%% |\NFL@test@version| checks whether the second ``word" is a version id: + \def\NFL@test@version##1##2##3\@nil{% + \if v##1\NFL@test@digit##2\@nnil \else \@tempswafalse \fi + \if@tempswa \let\NFL@version\fileversion \fi + }% +%% |\NFL@make@macro@arg| expands a macro storing a list inside braces +%% (perhaps 'monofill' should offer such a thing TODO): + \def\NFL@make@macro@arg##1##2{\expandafter##1\expandafter{##2}}% +} +%% === Leaving the Package File === +\endinput +%% +%% === VERSION HISTORY === + +v0.1 2012/03/20 started + 2012/03/22 almost ready + 2012/03/23 debugging; \NFLspaceI etc.; + documentation completed -- cgit v1.2.3