diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/fileinfo |
Initial commit
Diffstat (limited to 'macros/latex/contrib/fileinfo')
-rw-r--r-- | macros/latex/contrib/fileinfo/README | 56 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/README.pdf | bin | 0 -> 15774 bytes | |||
-rw-r--r-- | macros/latex/contrib/fileinfo/doc/RELEASEs.txt | 97 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/doc/SrcFILEs.txt | 23 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/doc/fileinfo.RLS | 10 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/doc/myfilist.pdf | bin | 0 -> 559310 bytes | |||
-rw-r--r-- | macros/latex/contrib/fileinfo/doc/readprov.pdf | bin | 0 -> 489557 bytes | |||
-rw-r--r-- | macros/latex/contrib/fileinfo/docsrc/README.tex | 12 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/docsrc/fdatechk.tex | 11 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/docsrc/gather.tex | 20 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/docsrc/myfilist.tex | 166 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/docsrc/readprov.tex | 125 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/myfilist.sty | 277 | ||||
-rw-r--r-- | macros/latex/contrib/fileinfo/readprov.sty | 205 |
14 files changed, 1002 insertions, 0 deletions
diff --git a/macros/latex/contrib/fileinfo/README b/macros/latex/contrib/fileinfo/README new file mode 100644 index 0000000000..56272c284a --- /dev/null +++ b/macros/latex/contrib/fileinfo/README @@ -0,0 +1,56 @@ + + == README for the `fileinfo' bundle == + +This bundle has packages `readprov.sty' and `myfilist.sty'. + +`readprov.sty' + + renders \GetFileInfo from LaTeX's `doc.sty' (without the + latter being required), as well as new robust (expandable) + variants of it, usable with files that are not really + loaded (they are quit when their file info is found, + cf. the `zwgetfdate' package). So, e.g., you can describe + packages that are incompatible with each other or with + packages that your document uses. You even can report about + various class files. + + Such packages then also appear with LaTeX's \listfiles. + You may consider this a bug ... + +`myfilist.sty' + + makes this "bug" a feature. In a "TeX script," you can + choose some files and their order. Their names can be + output into a plain text file with their dates, version + ids, and one-line descriptions, formatted in the way + \listfiles does it after a LaTeX run. This way you can get + an overview of, e.g., some package bundle ... + +The two packages are described in more detail in `readprov.pdf' +and `myfilist.pdf'. These documentation files also serve to +demonstrate some .txt->.tex functionality of the `nicetext' +bundle. + +Both packages evaluate the \Provides... commands that should +identify a LaTeX file. They are described in the context of +other packages evaluating the \Provides... entries by the +`info' package `latexfileinfo-pkgs', + + http://ctan.org/pkg/latexfileinfo-pkgs + +The file `fileinfo.RLS', when installed just like +`myfilist.sty' and `readprov.sty' (in the `tex' tree of a TDS), +provides a summary of the currently installed release of the +`fileinfo' bundle, accessible as LaTeX file info by all of +these packages. + +`readprov' and `myfilist' are LICENSEd according to the LaTeX +Project Public License (see files; NO WARRANTY!). They are +author-maintained. + +A TDS version is available as + + CTAN:/install/macros/contrib/fileinfo.tds.zip + +2012/05/26, Uwe Lueck, http://contact-ednotes.sty.de.vu + diff --git a/macros/latex/contrib/fileinfo/README.pdf b/macros/latex/contrib/fileinfo/README.pdf Binary files differnew file mode 100644 index 0000000000..1c5cfcab89 --- /dev/null +++ b/macros/latex/contrib/fileinfo/README.pdf diff --git a/macros/latex/contrib/fileinfo/doc/RELEASEs.txt b/macros/latex/contrib/fileinfo/doc/RELEASEs.txt new file mode 100644 index 0000000000..4fa3a45d4d --- /dev/null +++ b/macros/latex/contrib/fileinfo/doc/RELEASEs.txt @@ -0,0 +1,97 @@ + +First upload of the `fileinfo' bundle to CTAN probably was 2010/11/27, +followed by tries at encoding the README, so README.pdf was available +2010/11/28. Both `myfilist.sty' and `readprov.sty' were v0.3. + +2011/01/30 uses a fix of `makedoc.sty' and the new `texlinks.sty' for +documentation. `myfilist.sty' v0.3a has 2 lines less than v0.3 and an +updated copyright, `readprov.sty' didn't change. The .tds gets a +`source' directory. + +For r0.3b 2012/03/18, we write "elegantly" in place of "elegant" in +`readprov.sty' v0.3a and update its copyright. We also hardwrap the +present file (2012/03/16). Resuming work 2012/03/18, we use +\MakeCloseDoc* from `makedoc.sty' v0.5 in `myfilist.tex' and +`readprov.tex', add TDS-info to README, remove outdated `makedoc.cfg', +and move `gather.tex' to `docsrc'. + +r0.4 (2012/05/26) provides `myfilist.sty' v0.4 that allows reentering +a package after \EmptyFileList, even when it has been loaded with an +option before; mainly for the `nicefilelist' package: + + \RequirePackage[r]{nicefilelist} + \RequirePackage{myfilist} + \EmptyFileList[nicefilelist.sty] + +r0.5 (2012/10/11) provided `myfilist.sty' v0.6 with a trick +\FileListRemark to insert "comments" in the file list, a hook +\ListGenerator to support `adhocfilelist', and +\NoBottomLines to suppress final messages, +also issued by the new package option [no-bot] + +But moreover, it provided `myfilist.sty' v0.5 as of 2012/09/27 +which I failed to upload. v0.5 brought \ReadListFileInfos, +\WriteFileList, \ReadListFileInfos, and \UseFindUtility for +the `adhocfilelist' package, or something else like that. +I had thought that \WriteFileList could be useful, and it +could perhaps with the -i option of `adhocfilelist'. +r0.5 did announce `v0.5' literally, but described v0.6. +Good that it hasn't been processed ... + +r0.6 (2012/10/12) corrects this, i.e., the present file is +corrected and updated, and the announcement is corrected. +And `myfilist' v0.6a is provided where \UseFindUtility is +added to the version history. Moreover, `readprov.pdf' has +been typeset anew just to apply changes in `nicetext' and +to avoid worrying in the future when I would not remember +the problem (.aux files need to be removed, that's it). +-- Actually, I have modified `gather.tex' finally in order +to have the *.sty's and `fileinfo.RLS' in adjacent lines. + +r0.7 (2012/10/25) adds \NoStopListInfos in `myfilist.sty' v0.7 +so the script (`gather.tex') can continue with `filedate' +consistency checks and their messages are the last lines +you see on screen. + +r0.8 (2012/11/11) keeps `myfilist' v0.7 while the new +`readprov' v0.4 is a reimplementation sensible of +\[No]FileDateAutoChecks from `filedate' v0.4. + +r0.8a (2012/11/13) + * provides the proper `fileinfo.RLS' ... + * applies more `filedate' tricks in `gather.tex' and new + `fdatechk.tex' (see `Example' in `myfilist.pdf'), + `myfilist.tex', and `readprov.tex', supported by new + `makedoc.cfg' from `nicetext'. + +r0.81 (2012/11/22): + + * `myfilist.sty' v0.71 has a reimplementation of + \FileListRemark that works with `filedate.sty''s + \FileDateAutoChecks. + + * This is exemplified in `gather.tex' that generates the + list of LaTeX source files in the `fileinfo' bundle. + + * `readprov.sty' v0.5 provides \ReadShInfos to process + + # \ProvidesFile{<file>}[<info>] + + in shell script files <file>. This is exemplified in a + parallel upload of the shell script package + `adhocfilelist'. + + * The documentation inside both `.sty' files as well as + some settings in the documentation generators + `myfilist.tex' and `readprov.tex' have some adjustments/ + corrections. + + * While `myfilist' originally was made for use /without/ + typesetting (with "TeX scripts"), the documentation now + notes that `\ListFileInfos[<txt-file>]' can also be used + /with/ typesetting in order to get \listfiles output + in a separate plain text file `<txt-file>' (/without/ + remaining `.log' content). + +r0.81a (2012/11/30) PDFs typeset with fixed `makedoc.cfg' + diff --git a/macros/latex/contrib/fileinfo/doc/SrcFILEs.txt b/macros/latex/contrib/fileinfo/doc/SrcFILEs.txt new file mode 100644 index 0000000000..0d37c4872d --- /dev/null +++ b/macros/latex/contrib/fileinfo/doc/SrcFILEs.txt @@ -0,0 +1,23 @@ + + *File List* +-RELEASE.--- ---------- +fileinfo.RLS 2012/11/30 r0.81a PDFs with fixed `makedoc.cfg' +-----USE.--- ---------- +myfilist.sty 2012/11/22 v0.71 \listfiles -- mine only (UL) +readprov.sty 2012/11/22 v0.5 file infos without loading (UL) +-----DOC.--- ---------- +myfilist.tex 2012/11/30 documenting myfilist.sty +readprov.tex 2012/11/22 documenting readprov.sty +----USED.--- ---------- + makedoc.cfg 2012/11/30 documentation settings +fifinddo.sty 2012/11/17 v0.61 filtering TeX(t) files by TeX (UL) + makedoc.sty 2012/08/28 v0.52 TeX input from *.sty (UL) +niceverb.sty 2012/11/27 v0.51 minimize doc markup (UL) + README.tex 2012/03/18 make README.pdf +fdatechk.tex 2012/11/13 filedate checks + gather.tex 2012/11/22 collect file infos + *********** + + List made at 2012/11/30, 16:41 + from script file gather.tex + diff --git a/macros/latex/contrib/fileinfo/doc/fileinfo.RLS b/macros/latex/contrib/fileinfo/doc/fileinfo.RLS new file mode 100644 index 0000000000..4621131d1e --- /dev/null +++ b/macros/latex/contrib/fileinfo/doc/fileinfo.RLS @@ -0,0 +1,10 @@ +\ProvidesFile{fileinfo.RLS} %% RELEASE INFO + [2012/11/30 r0.81a PDFs with fixed `makedoc.cfg'] + [2012/11/22 r0.81 \string\FileDateAutoChecks, \string\ReadShInfos] + [2012/11/13 r0.8a readprov v0.4 sensible of \string\FileDateAutoChecks] + [2012/10/25 r0.7 myfilist v0.7 \string\NoStopListInfos] + [2012/10/12 r0.6 myfilist v0.6a, correcting r0.5] + [{2012/10/11 r0.5 myfilist v0.5f.: fake entries, [no-bot]}] + [2012/05/26 r0.4 myfilist v0.4: options] + [2012/03/18/20 r0.3b+ internal!?] %% 2012/05/26 + [2012/03/18/18 r0.3b doc. (generation) mod.s] %% 2012/05/26 diff --git a/macros/latex/contrib/fileinfo/doc/myfilist.pdf b/macros/latex/contrib/fileinfo/doc/myfilist.pdf Binary files differnew file mode 100644 index 0000000000..439503d228 --- /dev/null +++ b/macros/latex/contrib/fileinfo/doc/myfilist.pdf diff --git a/macros/latex/contrib/fileinfo/doc/readprov.pdf b/macros/latex/contrib/fileinfo/doc/readprov.pdf Binary files differnew file mode 100644 index 0000000000..a35a09227d --- /dev/null +++ b/macros/latex/contrib/fileinfo/doc/readprov.pdf diff --git a/macros/latex/contrib/fileinfo/docsrc/README.tex b/macros/latex/contrib/fileinfo/docsrc/README.tex new file mode 100644 index 0000000000..a4bf82368f --- /dev/null +++ b/macros/latex/contrib/fileinfo/docsrc/README.tex @@ -0,0 +1,12 @@ +\ProvidesFile{README.tex}[2012/03/18 make README.pdf] +\listfiles + +\documentclass[12pt]{article} +\usepackage{verbatim} +\pagestyle{empty} +\begin{document} +\vspace*{-3\baselineskip} +\enlargethispage{2\baselineskip} +% \small %% 2011/02/14 +\verbatiminput{README.txt} +\end{document} diff --git a/macros/latex/contrib/fileinfo/docsrc/fdatechk.tex b/macros/latex/contrib/fileinfo/docsrc/fdatechk.tex new file mode 100644 index 0000000000..f150161a1e --- /dev/null +++ b/macros/latex/contrib/fileinfo/docsrc/fdatechk.tex @@ -0,0 +1,11 @@ +\ProvidesFile{fdatechk.tex}[2012/11/13 filedate checks] +%% TODO shorter notation +\ModDates +%\EqualityMessages +\FileDateAutoChecks +\ReadFileInfos{fileinfo.RLS, + readprov.sty,myfilist.sty, + readprov,myfilist, + gather,fdatechk} +\DatesDiffWarnings +\CheckDateOfToday{fileinfo.RLS} diff --git a/macros/latex/contrib/fileinfo/docsrc/gather.tex b/macros/latex/contrib/fileinfo/docsrc/gather.tex new file mode 100644 index 0000000000..2cdbd9f23c --- /dev/null +++ b/macros/latex/contrib/fileinfo/docsrc/gather.tex @@ -0,0 +1,20 @@ +\ProvidesFile{gather.tex}[2012/11/22 collect file infos] +\RequirePackage[no-bot]{myfilist} +\RequirePackage{dowith,filedate} +\EqualityMessages \FileDateAutoChecks %% works 2012/11/22 +\EmptyFileList[readprov.sty,myfilist.sty] +\FileListRemark[----------]{-RELEASE.---} +\ReadFileInfos{fileinfo.RLS} +\FileListRemark[----------]{-----USE.---} +\ReadPackageInfos{myfilist,readprov} +\FileListRemark[----------]{-----DOC.---} +\ReadFileInfos{myfilist,readprov} +\FileListRemark[----------]{----USED.---} +\ReadFileInfos{makedoc.cfg} +\ReadPackageInfos{fifinddo,makedoc,niceverb} +\ReadFileInfos{README,fdatechk,gather} +\NoStopListInfos[SrcFILEs.txt] +% \input{fdatechk.tex} +%% <- 2012/11/22 -> +\DatesDiffWarnings \CheckDateOfToday{fileinfo.RLS} +\stop diff --git a/macros/latex/contrib/fileinfo/docsrc/myfilist.tex b/macros/latex/contrib/fileinfo/docsrc/myfilist.tex new file mode 100644 index 0000000000..4cb47374cc --- /dev/null +++ b/macros/latex/contrib/fileinfo/docsrc/myfilist.tex @@ -0,0 +1,166 @@ +\ProvidesFile{myfilist.tex}[2012/11/30 documenting myfilist.sty] +\title{\textsf{myfilist}\\---\\ + List Infos on just the Files\\You Want to Know About% + \GetFileInfo{myfilist.sty}\thanks{% + This file describes version + \textcolor{blue}{\fileversion} % \textbf{\fileversion} + of \textsf{\filename} as of \filedate.}} +% \listfiles + +%% Preprocessing: +\RequirePackage{makedoc} +\CopyFDconditionFromTo{PScomment}{comment} +% \MainDocParser{\ProcessInputWith{PScomment}} +%% Replacements: +\SetPatternCodes{\MakeOther\\\MakeOther\ } %% CARE! +\MakeExpandableAllReplacer{TeX}{TeX }{\TeX{} }{LEAVE} %% 2012/09/28 +% \let\do\PrependExpandableAllReplacer %% 2012/09/28 +\renewcommand*{\do}{\PrependExpandableAllReplacer*} %% re 2012/11/22 +\do{LaTeX }{\LaTeX{} } +\do{LaTeX2e }{\LaTeXe{} } +\do{ .log}{ `.log'} +\do{ .tex}{ `.tex'} +\do{ .cls}{ `.cls'} +\do{ .sty}{ `.sty'} +\do{NOTE: }{\textbf{Note: }} +\SetPatternCodes{\MakeOther\\} %% less care needed +\do{...}{$\dots$} +\do{\ProvidesFile}{`\ProvidesFile'} +\do{"loads"}{``loads''} +\do{USAGE:}{\section{Usage}} +\do{TRICKS:}{\section{Tricks, Package Option}} +%% 2012/09/28 for v0.5, generation support: +\do{VARIANTS:}{\section{Variants}} +% \do{<txt-file>}{\MetaVar{txt-file}} %% 2012/09/28 +\do{IMPLEMENTATION:}{\section{Implementation}} +\do{gather.tex}{`gather.tex'} +\do{readprov.pdf}{`readprov.pdf'} +\do{readprov-.sty}{readprov.sty} %% 2010/11/26 +\do{readprov.sty}{'readprov.sty'} +\do{myfilist-.sty}{myfilist.sty} %% 2010/11/26 +\do{myfilist.sty}{'myfilist.sty'} %% 2012/09/28 +\do{ifnextok.sty}{'ifnextok.sty'} +\do{adhocfilelist}{'adhocfilelist'} +\do{filedate.sty}{'filedate.sty'} %% 2012/10/25 +\do[\MakeOther\ ]% +{run gather.tex}{\emph{run} gather.tex} + %% <- TODO \PrependStandardEnhancement... +\SetCorrectHookJobLast +\ResetPatternCodes + +\MainDocParser{\ProcessInputWith{PScomment}} +\LaTeXresultFile{myfilist.doc} +\MakeCloseDoc*{myfilist.sty} %% 2012/03/18 + %% <- we must NOT read mdoccorr.cfg here! + %% (or put the above setup into a new one!) -> +% \MakeJobDoc{0}{\ProcessInputWith{PScomment}} + +%% Typesetting: +\documentclass{article} +\usepackage{color} %% for highlighting package version!? TODO +\input{makedoc.cfg} +\ReadPackageInfos{myfilist} +\usepackage{wiki} +%% TeX markup inserted by the txt-to-TeX function must be +%% declared here for using 'niceverb''s ``auto mode.'' +\AddToNoVerbList{\LaTeXe\dots\textbf\emph\ + %% <- at end of line! 2012/11/22 TODO not working!?! + \\ %% 2012/11/22 + \TeX\LaTeX} %% 2012/09/28 +\begingroup \MakeActive\" + \gdef\fineDQ{``\begingroup + \let\do\MakeOther \dospecials \tt + \def"{\endgroup''}}% +\endgroup + +\pagestyle{headings} +\usepackage{parskip} + +\MDfinaldatechecks +\begin{document} + +\maketitle + +\begin{abstract}\sloppy\noindent + 'myfilist' addresses lazy file versions management, + when you move your package or chapter files through + various computers and various directories and after a while + wonder where the most recent versions are. + + Like Paul Ebermann's + 'dateiliste',\urlfoot{CtanPkgRef}{dateiliste} + 'myfilist' varies \LaTeX's `\listfiles' + for listing file (especially version) informations. + Differences to 'dateiliste' and \LaTeX\ are: + \begin{enumerate} + \item You choose the files (and their order) to be listed; + \item indeed (according to original intention): + this has very little to do with files used in + typesetting some document; + \item output is just screen, `.log', or a `.txt'-type file + that you choose. + \end{enumerate} + %% 2012/11/22 while mentioning 'nicetext' moves to final section: + However, `\ListFileInfos[<txt-file>]' from here can also be used + to \emph{with} typesetting in order to get `\listfiles' output + in a separate plain text file `<txt-file>' + (\emph{without} remaining `.log' content). + +\end{abstract} + +% \pagebreak +\tableofcontents + +\section{Installing} +The file '\jobname.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} + +\section{File Info Header} +\sloppy +\let\\\MDdocnewline %% 2012/11/22 +\setlength\topsep{\smallskipamount} %% 2012/11/22 +\enlargethispage{2\baselineskip} %% 2012/11/22 +\wikiEnvironments %% TODO fails with "or" 2010/03/31 +\MakeActiveLetHere\"\fineDQ %% fails with "loads" +\AutoCmdInput{myfilist.doc} +\nowikiEnvironments + +\section{Example} +% \setlength{\parskip}{0pt} %% 2012/11/13 +\AddQuotes +`gather.tex' for the present bundle has been as follows. +% %% TODO 2010/11/27: +% (added development versions of 'fifinddo.sty' etc.): +%% 2012/11/12: +`filedate' and `fdatechk' refer to checking ``date consistency'' +with the \ctanpkgref{filedate} package, at the same time +as updating the ``source file list'' `SrcFILEs.txt' +which is generated by +\[`\NoStopListInfos[SrcFILEs.txt]'\] +Some entries refer to the \ctanpkgref{nicetext} bundle +that has been used (``\code{----USED.---}'') +to generate the documentation file `myfilist.pdf'. +\setlength{\topsep}{.5\bigskipamount} %% 2012/11/30 +\MDsamplecodeinput{gather} %% 2010/11/27 2012/11/13 +As to `fdatechk.tex': +\MDsamplecodeinput{fdatechk} + +\section{Relation to 'nicetext' bundle.} +%% 2012/11/22 moves from abstract +The code of this package was ready in spring 2008; +in spring 2010 I presented it as a kind of study on improving +'nicetext''s\urlfoot{CtanPkgRef}{nicetext} +`txt'-to-\LaTeX\ processing after 'nicetext v0.4' +(aim was to do this without modifying the documented file, + yet I did not obey this rule strictly here). +The new idea is adding 'wiki.sty''s ``environments'' +feature to 'makedoc' and 'niceverb''s ``auto mode'' %% was " 2012/11/22 +in order to interprete `txt' comment indents in the package file, +while 'wiki.sty''s \emph{font} switching +still is not compatible with 'niceverb''s. Easy script +commands for achieving this are still missing (sorry; see the code +in 'myfilist.tex' that achieved the present formatting.) + +\end{document} diff --git a/macros/latex/contrib/fileinfo/docsrc/readprov.tex b/macros/latex/contrib/fileinfo/docsrc/readprov.tex new file mode 100644 index 0000000000..1ee52288a7 --- /dev/null +++ b/macros/latex/contrib/fileinfo/docsrc/readprov.tex @@ -0,0 +1,125 @@ +\ProvidesFile{readprov.tex}[2012/11/22 documenting readprov.sty] +% \ProvidesFile{readprov.tex}[2012/03/18 documenting readprov.sty] +% \ProvidesFile{readprov.tex}[2011/01/29 documenting readprov.sty] + +\title{\textsf{readprov}\\---\\Get File Info without Loading% +% \GetFileInfo{readprov.sty}% +% \ReadFileInfos{readprov.sty}% %% \NeedsTeXFormat + \thanks{% + This file describes +% \protect\GetFileInfo{readprov.sty}% %% FAILS! + version +% \textbf{\fileversion} of \textsf{\filename} as of \filedate.}% + \textcolor{blue}{\UseVersionOf{readprov.sty}} + of \textsf{readprov.sty} as of \UseDateOf{readprov.sty}.}% +} %% <- TODO macro in makedoc.cfg +% \listfiles + +%% Preprocessing: +\RequirePackage{makedoc} +\CopyFDconditionFromTo{PScomment}{comment} +\MainDocParser{\ProcessInputWith{PScomment}} +%% Replacements: +\StartPrependingChain +\SetPatternCodes{\MakeOther\\\MakeOther\ } %% CARE! +% \PrependExpandableAllReplacer{tex}{ .tex}{ `.tex'} +\renewcommand*{\do}{\PrependExpandableAllReplacer} %% 2012/11/22 +\do{sty}{ .sty}{ `.sty'} +\do{cls}{.cls}{`.cls'} +\do{etc}{etc. }{etc.\ } +% \PrependExpandableAllReplacer{etc...}{etc. ...}{etc.\ $\dots$} +\SetPatternCodes{\MakeOther\\} %% less care needed +\do{LaTeX}{LaTeX}{\LaTeX} +\do{xpbl}{expandable}{\emph{expandable}} +\do{rob}{robust}{\emph{robust}} +\do{frag}{fragile}{\emph{fragile}} +\do{doc}{doc.sty}{'doc.sty'} +\do{myfilist}{myfilist.sty}{'myfilist.sty'} +\do{readprov}{readprov.sty}{'readprov.sty'} +% \do{provf}{\ProvidesFile}{`\ProvidesFile'} %% rm. 2012/11/22 +\do{NOTE}{NOTE:}{\paragraph{Note:}} +% \PrependExpandableAllReplacer{Note}{Note:}{\emph{Note:} } +\do{prov}{provided}{\emph{provided}} +\do{*fail*}{*fail*}{\emph{fail}} +\do{INSTALL}{INSTALL:}{\section{Installation}} +\do{USAGE}{USAGE:}{\section{Usage}} +\do{IMPLEM}{IMPLEMENTATION:}{\section{Implementation}} +\do{LOAD}{LOADING:}{\paragraph{Loading:}} +\do{INS}{INSERTING:}{\paragraph{Inserting:}} +\do{READ}{EXTRACTING:}{\paragraph{Extracting:}} +\do{TODO}{TODO}{\textcolor{blue}{TODO}} +\SetPatternCodes{\MakeOther\\\MakeOther\$} +\do{dots}{...}{$\dots$} +\SetCorrectHookJobLast +\ResetPatternCodes + +\LaTeXresultFile{readprov.doc} +\MakeCloseDoc*{readprov.sty} %% star 2012/03/18 + %% <- we must NOT read mdoccorr.cfg here! + %% (or put the above setup into a new one!) -> +% \MakeJobDoc{0}{\ProcessInputWith{PScomment}} + +%% Typesetting: +\documentclass{article} +\usepackage{color} %% for highlighting package version!? TODO +\input{makedoc.cfg} +\usepackage{readprov} +% \ReadFileInfos{report.cls} %% WORKS! 2010/11/27 +\usepackage{wiki} +\begingroup \MakeActive\" + \gdef\fineDQ{``\begingroup + \let\do\MakeOther \dospecials \tt + \def"{\endgroup''}}% +\endgroup +% \makeatletter \MakeLetter\_ + +\pagestyle{headings} +% \usepackage{parskip} + +\MDfinaldatechecks +\begin{document} + +\maketitle + +\begin{abstract}\sloppy\noindent + 'readprov.sty' + renders `\GetFileInfo' from \LaTeX's + 'doc.sty'\urlfoot{CtanPkgRef}{doc} + (without the latter being required) + and new robust (expandable) variants of it, + usable with files that are not really loaded + (they are quit when their file info is found, cf. the 'zwgetfdate' + package\urlfoot{CtanPkgRef}{zwgetfdate}). + So, e.g., you can describe packages that are incompatible + with each other or with packages that your document uses. + You even can report about various class files. + + Such packages then also appear with \LaTeX's `\listfiles'. + You may consider this a bug $\dots$ +'myfilist.sty' + makes it a feature (see `myfilist.pdf'). +\end{abstract} + +% \pagebreak +\tableofcontents + +\section{Installing} +The file '\jobname.sty' is provided ready, installation only requires +putting it somewhere where \TeX\ finds it +(which may need updating the filename data + base).\footnote{\url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=inst-wlcf}} + +\section{File Info Header} + +\sloppy +\AddToNoVerbList{% + \LaTeX\emph\dots\quad\paragraph\texttt\textcolor\\% + \-} %% 2012/11/11 +\MakeActiveLetHere\"\fineDQ +\let\\\MDdocnewline %% MD 2012/11/12 +%% CARE! from next line on, code line indents are special! +\wikiEnvironments %% TODO fails with "or" 2010/03/31 +\AutoCmdInput{readprov.doc} +\nowikiEnvironments %% 2012/11/12 + +\end{document} diff --git a/macros/latex/contrib/fileinfo/myfilist.sty b/macros/latex/contrib/fileinfo/myfilist.sty new file mode 100644 index 0000000000..c3fd202e32 --- /dev/null +++ b/macros/latex/contrib/fileinfo/myfilist.sty @@ -0,0 +1,277 @@ +\def \filename {myfilist.sty} %% macro package for LaTeX, + +%% modifies \listfiles to choose files to be listed and +%% list them in a chosen file. + +\def \fileversion {0.71} \def \filedate {2012/11/22} + +%% copyright (C) 2008, 2010, 2011, 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.3a 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 +%% +% USAGE: +% +% Write a script file like gather.tex which you should have received +% together with myfilist.sty. We use LaTeX2e (required!), yet (in +% general) not for typesetting a document, therefore the script file +% needn't contain \documentclass. myfilist.sty is loaded by +% +% \RequirePackage{myfilist} +% +% instead of \usepackage{myfilist}. Usually you don't want to have +% myfilist.sty in the list, so type +% +% \EmptyFileList +% +% next; or type it after some additional \RequirePackage... for +% packages you want to use but not list. +% +% Next list the names of the files +% whose informations you want to get as arguments of +% +% \ReadFileInfos or \ReadPackageInfos or \ReadClassInfo +% +% With the latter two, you can omit ".sty" or ".cls" as with +% \usepackage and \documentclass. With the first one, the file name +% extension ".tex" may be omitted. The two first commands accept lists +% with commas as separators almost like with \usepackage (currently we +% must use "%" to hide a line break in the script, and there must be +% no spaces in the list).---For more details on these commands, +% please see readprov.pdf. +% +% The list of files is actually printed in the transcript .log +% and on screen on +% +% \ListInfos +% +% The list can additionally be written into a plain text file, +% +% \ListInfos[filelist.txt] +% +% as an example; i.e., you can use the brackets to tell which file is +% to contain your list of files. The file informations appear in the +% order of their names in your script file. +% +% \ListInfos concludes, ends the job, anything following in the +% script file will be ignored.---All of this requires %% 2010/04/02 +% that you run gather.tex or your other script file, about as +% +% latex gather +% +% To list files that were loaded earlier in a different order, +% list them in an \emph{optional argument} of \EmptyFileList, e.g., +% % trick avoiding main replacement 2010/11/26: +% +% \EmptyFileList[myfilist-.sty,readprov-.sty] +% +% NOTE: myfilist.sty (in its present state) is unable to list files +% that don't contain \ProvidesPackage, \ProvidesClass, or +% \ProvidesFile. myfilist.sty "loads" files to extract version +% 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. +% +% v0.7 adds +% +% \NoStopListInfos[filelist.txt] +% +% after which the script can continue until \stop, e.g., for checks +% with filedate.sty so that the latter's messages are the final lines +% you see on screen. +% +% 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 + \string\listfiles\space-- mine only (UL)] +% +% |\ReadFileInfos|, |\ReadPackageInfos|, and |\ReadClassInfo| +% are implemented in readprov.sty: +\RequirePackage{readprov}[2010/11/26] +% +% |\EmptyFileList[<read-again-files>]| %% opt. arg. 2010/11/26 +\newcommand{\EmptyFileList}[1][]{% + \let\@filelist\@gobble + \@for\@tempa:=#1\do{% + \global \expandafter \let \csname ver@\@tempa\endcsname \relax + %% v0.4: + \global \expandafter \let \csname opt@\@tempa\endcsname \relax}} +% |\ListInfos[<output-file>]| %% was `external output file' 2012/10/25 +\newcommand*{\ListInfos}[1][]{% + \ifx$#1$\@dofilelist\else + % \newwrite\file@of@filelist %% mv. v0.6 + \immediate\openout\file@of@filelist=#1\relax + \def\typeout##1{% + \read@@typeout{##1}% + \immediate\write\file@of@filelist{##1}}% + \@dofilelist + %% made at: + \@tempcnta\time \@tempcntb\@tempcnta + \divide\@tempcnta 60 \count@\@tempcnta + \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}% +% v0.6 becomes more flexible here: + \ListGenerator} + \immediate\closeout\file@of@filelist + \fi + \stop} + %% <- TODO how to suppress first empty line? 2008/03/16 +\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 +% |\NoStopListInfos[<output-file>]| (v0.7) +\newcommand*{\NoStopListInfos}[1][]{{\let\stop\relax \ListInfos[#1]}} +% 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 +% v0.71 allows using \FileListRemark with 'filedate''s +% \FileDateAutoChecks: + {\ifx\@providesfile\FD@provfile + \let\@pr@videpackage\FD@@provpkg + \let\@providesfile \FD@@provfile + \fi + \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 + +%% VERSION HISTORY +v0.1 2008/03/19 created file "readprov.sty" + 2008/03/23 smart file name separation, \ifx$ for \ifcat$ + 2008/05/22 typo ist -> it +v0.2 2010/04/03 renamed "myfiles.sty"; + broke long lines etc. for doc +SENT TO CTAN -- declined +v0.2a 2010/04/08 undoubled \NeedsTeXFormat, copyright updated +v0.3 2010/11/26 split off from "myfiles.sty", opt. arg. for + \EmptyFileList, doc. reworked + 2010/11/27 some USAGE clarifications +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 +v0.7 2012/10/25 \NoStopListInfos +v0.71 2012/11/22 \FileListRemark works with \FileDateAutoChecks + from `readprov.sty' v0.5; + doc. \FileListRemark: `\ ' -> `\\' diff --git a/macros/latex/contrib/fileinfo/readprov.sty b/macros/latex/contrib/fileinfo/readprov.sty new file mode 100644 index 0000000000..d9bf84252c --- /dev/null +++ b/macros/latex/contrib/fileinfo/readprov.sty @@ -0,0 +1,205 @@ +%% readprov.sty +%% -- +%% get file infos without reading the entire file + +\def \fileversion {0.5} \def \filedate {2012/11/22} + +%% copyright (C) 2008, 2010, 2011, 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 +%% +% USAGE: +% +% LOADING: The functionality of readprov.sty is activated by +% \usepackage{readprov} +% or +% \RequirePackage{readprov} +% (this one may precede \documentclass) in the document preamble. +% 'readprov' does not have any package options. +% +% INSERTING: Recall that \\ +% % +% |\GetFileInfo{<filename>}| (including extension)\\ +% % +% from LaTeX's doc.sty sets macro \filename to <filename> +% (including extension) and furthermore sets macros +% \filedate, \fileversion, and \fileinfo +% to the \emph{date}, \emph{version}, and further \emph{info} +% associated with <filename> earlier ``some way'' ... +% \ This means that file <filename> has been \input before +% and identified itself by \ProvidesFile, \ProvidesPackage, +% or \ProvidesClass. +% +% 'readprov' simply copies \GetFileInfo from doc.sty +% so the same functionality is provided independently of +% other doc.sty features---without loading LaTeX's doc.sty. +% +% % new 2010/11/27: +% Unfortunately, \GetFileInfo is fragile, it is especially +% unhelpful for referring to \emph{two} packages in the same +% \thanks footnote. So we introduce (do compare 'zwgetfdate'!)\\ +% |\UseDateOf{<filename>}|\quad |\UseVersionOf{<filename>}|\quad +% (with extension)\\ +% These commands are robust (even expandable). Instead of +% $$\GetFileInfo{<filename>}\fileversion{}\texttt{ as of }\filedate$$ +% you can type +% $$\UseFileVersionOf{<filename>}\texttt{ as of }\UseFileDateOf{<filename>}$$ +% +% EXTRACTING: \GetFileInfo, \UseDateOf, and \UseVersionOf need the data +% from \ProvidesPackage, \ProvidesClass, or \ProvidesFile. +% Instead of getting them by \usepackage, \documentclass, or \input, +% they can be obtained with the following commands. +% \\ +% |\ReadFileInfos{<list-of-filenames>}| (with extensions)\\ +% applies to all kinds of files---provided such a file contains +% such a \Provide... command. +% \\ +% |\ReadPackageInfos{<list-of-filenames>}| (without extensions)\\ +% searches .sty files from <list-of-filenames> for \ProvidesPackage. +% +% The two former commands accept lists with commas as separators +% almost like with \usepackage (currently we must use "%" +% to hide a line break in the script, +% and there must be no spaces in the list). +% \\ +% |\ReadClassInfo{<filename>}| (without extension)\\ +% searches <filename>.cls for \ProvidesClass. +% At present [TODO] it can be used once only, +% and only for use with myfilist.sty. +% But you can use \ReadFileInfos for reporting on \emph{various} +% classes, even in a document! +% \\ +% |\ReadShInfos{<list-of-filenames>}| (with extensions)\\ +% is a variant of \ReadFileInfos{<list-of-filenames>} that for each +% <file> in <list-of-filenames> processes +% # \ProvidesFile{<file>}[<info>] +% in <file> (new with v0.5). +% +% NOTE: (i)~So far, [TODO] the \Read... commands explained before +% do not work after `\begin{document}' +% (with rare exceptions, \NeedTeXFormat is one +% obstacle---may be 'zwgetfdate' really is better). +% (ii)~Those \Read... commands execute \GetFileInfo +% (with the final file from the list). So you may be lucky to get +% the intended \filename, \filedate, \fileversion, and \fileinfo +% without using \GetFileInfo. The chance is the better the +% later the \Read... command is used, best right before +% `\begin{document}'. Even then it may *fail*---when the latter +% command loads a package redefining \filedate etc. ... +% +% IMPLEMENTATION: + +\NeedsTeXFormat{LaTeX2e}[1994/12/01] %% \newcommand* etc. +\ProvidesPackage{readprov} + [\filedate\space v\fileversion \space + file infos without loading (UL)] +% INSERTING: \\ +% |\GetFileInfo{<filename>}| (with extension)\\ % \ % +% just was stolen from Standard LaTeX's doc.sty +% (before I varied it). +% It is fragile. +\def\GetFileInfo#1{% + \def\filename{#1}% + \def\@tempb##1 ##2 ##3\relax##4\relax{% + \def\filedate{##1}% + \def\fileversion{##2}% + \def\fileinfo{##3}}% +% Here was: +% \edef\@tempa{\csname ver@#1\endcsname}% +% \expandafter\@tempb\@tempa\relax? ? \relax\relax} +% We can do it a little more elegantly with the internals %% ly 2012/03/16 +% (that vary the original \GetFileInfo) +% for our new \UseDateOf and \UseVersionOf: + \read@file@info\@tempb{#1}} +% (Will be overwritten without warning +% when doc.sty is loaded afterwards.) +\newcommand*{\read@file@info}[2]{% new 2010/11/27 + \expandafter \expandafter \expandafter + #1\csname ver@#2\endcsname \relax? ? \relax\relax} +% |\UseDateOf{<filename>}| is robust (expandable): %% O 2012/03/20 +\newcommand*{\UseDateOf}{\read@file@info\read@file@date} +% The internal reading commands vary `\@tempb' +% from the original \GetFileInfo: +\def\read@file@date #1 #2\relax#3\relax{#1} +% |\UseVersionOf{<filename>}| is robust (expandable) as well: +\newcommand*{\UseVersionOf}{\read@file@info\read@file@version} +\def\read@file@version#1 #2 #3\relax#4\relax{#2} +% EXTRACTING: \\ +% |\ReadPackageInfos{<list-of-filenames>}| without extensions: +\newcommand*{\ReadPackageInfos}{% + \read@package@infos\RequirePackage{sty}} +% `\@pkgextension' and `\@clsextension' are bad +% for using `\filename' in the document (`\@onlypreamble'). +% \\ +% |\ReadClassInfo{<filename>}| without extension (v0.5): +\newcommand*{\ReadClassInfo}{% + \read@package@infos\LoadClass{cls}} +% Before v0.4, the modified ultimate expansion of \@pr@videpackage +% was fixed or ``static.'' Now \@pr@videpackage is modified +% at each call of \ReadClassInfo or `\Read'\-`PackageInfos' +% in such a way that the \emph{current} meaning of +% `\@pr@vide'\-`package' is used by the modified one---\emph{another} +% package ('filedate') may have modified +% \@pr@videpackage before, and the latter's meaning may +% change several times during a \TeX\ run: +\newcommand*{\read@package@infos}[3]{% + %% #1 \Req.../Load..., #2 extension, #3 name list + \begingroup %% 2010/11/26 + \let\RP@@provpkg\@pr@videpackage + \def\@pr@videpackage[##1]{\RP@@provpkg[{##1}]\endinput}% + #1{#3}% + \endgroup \GetFileInfo{#3.#2}% %% 2010/11/26 +} + %% <- TODO more classes 2008/03/16 +% |\ReadFileInfos{<list-of-filenames>}| with extensions: +\newcommand*{\ReadFileInfos}[1]{% + \begingroup +% v0.4 treats \@providesfile by analogy to \@pr@videpackage above: + \let\RP@@provfile\@providesfile + \def\@providesfile##1[##2]{\RP@@provfile{##1}[{##2}]\endinput}% + %% 2008/03/19: + \def\ProvidesClass ##1{\ProvidesFile{##1.\@clsextension}}% + \def\ProvidesPackage##1{\ProvidesFile{##1.\@pkgextension}}% + \@for\@tempa:=#1\do{% + \edef\@tempa{\expandafter\read@no@spaces\@tempa\@nil}% + \input{\@tempa}% + \global\let\@gtempa\@tempa} %% 2010/11/26 + \endgroup + \GetFileInfo\@gtempa %% 2010/11/26 +} +\def\read@no@spaces#1#2\@nil{#1#2} %% 2008/03/23 +% |\ReadShInfos{<list-of-filenames>}| with extensions: +\newcommand*{\ReadShInfos}[1]{% %% 2012/11/22 + {\catcode`\#9 % ignore .sh comment characters + \catcode`\!14 % ignore content of shebang line + \ReadFileInfos{#1}}} +\endinput + +%% VERSION HISTORY +v0.1 2008/03/19 created file "readprov.sty" + 2008/03/23 smart file name separation, \ifx$ for \ifcat$ + 2008/05/22 typo ist -> it +v0.2 2010/04/03 renamed "myfiles.sty"; + broke long lines etc. for doc +v0.3 2010/11/25 split off from former "myfiles.sty", + added \GetFileInfo + 2010/11/26 automatic \GetFileInfo + 2010/11/27 new/real documentation; more \newcommand*s; + \GetFileInfo redefined, \Use...; + \docnewline -> \\; NOTE etc. +v0.3a 2012/03/16 doc.: grammar fix +v0.3b 2012/03/20 typo fix "Of" +v0.4 2012/11/10 reimplementation for `filedate' + (\@pr@videpackage, \@providefile) +v0.5 2012/11/22 \ReadShInfos |