From 1940e85fb00c285d08ff92d6f58559f87aba6cd6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 30 Nov 2012 23:32:29 +0000 Subject: new latex package commado (29nov12) git-svn-id: svn://tug.org/texlive/trunk@28396 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/commado/README | 67 +++++++++++ Master/texmf-dist/doc/generic/commado/SrcFILEs.txt | 19 +++ Master/texmf-dist/doc/generic/commado/commado.pdf | Bin 0 -> 568138 bytes .../texmf-dist/source/generic/commado/commado.tex | 131 +++++++++++++++++++++ .../texmf-dist/source/generic/commado/srcfiles.tex | 17 +++ Master/texmf-dist/tex/generic/commado/commado.RLS | 2 + Master/texmf-dist/tex/generic/commado/commado.sty | 87 ++++++++++++++ Master/texmf-dist/tex/generic/commado/filesdo.sty | 55 +++++++++ 8 files changed, 378 insertions(+) create mode 100644 Master/texmf-dist/doc/generic/commado/README create mode 100644 Master/texmf-dist/doc/generic/commado/SrcFILEs.txt create mode 100644 Master/texmf-dist/doc/generic/commado/commado.pdf create mode 100644 Master/texmf-dist/source/generic/commado/commado.tex create mode 100644 Master/texmf-dist/source/generic/commado/srcfiles.tex create mode 100644 Master/texmf-dist/tex/generic/commado/commado.RLS create mode 100644 Master/texmf-dist/tex/generic/commado/commado.sty create mode 100644 Master/texmf-dist/tex/generic/commado/filesdo.sty (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/generic/commado/README b/Master/texmf-dist/doc/generic/commado/README new file mode 100644 index 00000000000..b512833a30b --- /dev/null +++ b/Master/texmf-dist/doc/generic/commado/README @@ -0,0 +1,67 @@ + + README for the `commado' bundle + + Iterate on comma-separated and filename lists + + (C) Uwe Lueck 2012/11/27 + + +`commado.sty' provides + + \DoWithCSL{}{} + +to apply an existing one-parameter macro to each item +in a list in which items are separated by commas. + +`filesdo.sty' provides + + \DoWithBasesExts{}{}{} + +to run {.} for some (at most) one-parameter +macro , each base filename in the comma-separated +list and each extension in the comma-separated list +. + +As opposed to LaTeX’s internal \@for, no assignments are +involved (unless uses assignments, "expandability" in +"TeX’s gullet"). + +Both packages are "generic," i.e., should work with Plain +TeX, LaTeX or even other formats, relying on the `plainpkg' +package for some minimal LaTeX-like behaviour. + +RELATED PACKAGES: `loops' and others mentioned in the + `dowith' package documentation. + +KEYWORDS: macro programming, programming structures, loops, + lists + +REQUIRED PACKAGES: `plainpkg', `stacklet' + +LICENSE: The package files `commado.sty', `filesdo.sty' and + the files `commado.pdf' and `commado.tex' documenting + both package files 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, indeed this still is somewhat + experimental. + + The `commado' package is author-maintained in the sense + of the license. + +The latest public version of the package is available at + + http://mirror.ctan.org/macros/latex/contrib/commado/ + +A TDS version of the package is available as + + http://mirror.ctan.org/install/macros/latex/contrib/commado.tds.zip + +Please report bugs, problems, suggestions, and bad English via + + http://www.contact-ednotes.sty.de.vu + diff --git a/Master/texmf-dist/doc/generic/commado/SrcFILEs.txt b/Master/texmf-dist/doc/generic/commado/SrcFILEs.txt new file mode 100644 index 00000000000..8a9adf692bc --- /dev/null +++ b/Master/texmf-dist/doc/generic/commado/SrcFILEs.txt @@ -0,0 +1,19 @@ + + *File List* + commado.RLS 2012/11/27 v0.1 initial + commado.sty 2012/11/27 v0.1 iterate on CSL (UL) + filesdo.sty 2012/11/27 v0.1 iterate on files (UL) + commado.tex 2012/11/27 -- documenting commado.sty +srcfiles.tex 2012/11/27 -- file infos -> SrcFILEs.txt + ---USED.--- -- -- -- -- ---- +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) +texlinks.sty 2012/11/27 v0.61 TeX-related links (UL) + makedoc.cfg 2012/11/26 -- documentation settings +mdoccorr.cfg 2012/11/13 -- `makedoc' local typographical corrections + *********** + + List made at 2012/11/27, 17:30 + from script file srcfiles.tex + diff --git a/Master/texmf-dist/doc/generic/commado/commado.pdf b/Master/texmf-dist/doc/generic/commado/commado.pdf new file mode 100644 index 00000000000..39feafc8434 Binary files /dev/null and b/Master/texmf-dist/doc/generic/commado/commado.pdf differ diff --git a/Master/texmf-dist/source/generic/commado/commado.tex b/Master/texmf-dist/source/generic/commado/commado.tex new file mode 100644 index 00000000000..bc9707e8e97 --- /dev/null +++ b/Master/texmf-dist/source/generic/commado/commado.tex @@ -0,0 +1,131 @@ +\ProvidesFile{commado.tex}[2012/11/27 documenting commado.sty] +\title{\pkg{\huge commado.sty} and \pkg{\huge filesdo.sty}\\---\\% + Immediately Extend a One-Argument Macro\\ + to Comma-Separated Lists and Combinations\\ + of Filename Bases and Extensions\thanks{This document describes + \textcolor{blue}{\UseVersionOf{\jobname.sty}} + of \textsf{\jobname.sty} as of \UseDateOf{\jobname.sty} + and version \textcolor{blue}{\UseVersionOf{filesdo.sty}} + as of \UseDateOf{filesdo.sty} of \pkg{filesdo.sty}..}} +% \RequirePackage[wrap]{nicefilelist} \listfiles +\RequirePackage{makedoc} \ProcessLineMessage{} +\renewcommand*{\mdSectionLevelOne}{\string\subsection} +\MakeJobDoc{19}{\SectionLevelOneParseInput} %% 2012/11/26 +% \documentclass[fleqn]{article}%% TODO paper dimensions!? +\documentclass{article} %% TODO paper dimensions!? +\usepackage{catchdq} %% TODO earlier than `langcode' +\input{makedoc.cfg} %% shared formatting settings +\newcommand*{\ctanpkgdref}[1]{% %% 2012/11/19 2012/11/27 + \ctanpkgref{#1}\,\urlfoot{CtanPkgRef}{#1}} +\ReadPackageInfos{commado,filesdo} +% \usepackage{commado} +\MDkeywords{macro programming, programming structures, loops, lists} +\sloppy \catchdqs +\begin{document} +\maketitle +\begin{MDabstract} +'commado.sty' provides \[`\DoWithCSL{}{}'\] +in order to apply an existing one-parameter macro +to each item in a list in which items are +\wikienref{comma-separated list}{separated by commas.} +'filesdo.sty' provides \[`\DoWithBasesExts{}{}{}'\] +in order to run `{.}' for some (at most) +one-parameter macro , each base filename in the +comma-separated list and each filename extension +in the comma-separated list . +As opposed to \LaTeX's internal `\@for', no assignments are involved +(unless uses assignments---"expandability" in "\TeX's gullet"). + +Both packages are "generic," i.e., should work with Plain \TeX, +\LaTeX\ or even other formats, relying on the \ctanpkgref{plainpkg} +package for some minimal \LaTeX-like behaviour. + +\MDaddtoabstract{Related packages} \ctanpkgref{loops} and others +mentioned in the \ctanpkgref{dowith} package documentation. +\end{MDabstract} +\newpage +\tableofcontents +% \newpage +\section{Installing and Calling} +The files 'commado.sty' and 'filesdo.sty' +are provided ready, installation just requires +putting them somewhere where \TeX\ finds them +(which may need updating the filename data + base).\urlfoot{ukfaqref}{inst-wlcf} +However, installation of the package \ctanpkgdref{plainpkg} +and the package 'stacklet.sty' (\ctanpkgdref{catcodes} bundle) +is required additionally. + +As to calling (loading): 'commado.sty' and 'filesdo.sty' are +"\pkg{plainpkg} packages" in the sense of the 'plainpkg' +documentation that you may consult for details. +So roughly, +\begin{itemize} + \item load it by \ |\usepackage{}| \ if you can, + \item otherwise by \ |\RequirePackage{}| \\ + (perhaps from within another "\pkg{plainpkg} package"), + \item or by \ |\input .sty| + \item or even by \ |\input{.sty}|~\dots +\end{itemize} +---where is \qtdcode{commado} or \qtdcode{filesdo}. + +% \pagebreak +\section{Syntax and Relation to the 'dowith' Package} +In with `\DoWithCSL{}{}', blank spaces +before entries or after commas as well as preceding the +closing brace are ignored. So +\[`\DoWithCSL{}{ cfg, sty, tex }'\] +works like +\[`\DoWith{}{{cfg}{sty}{tex}}'\] +from \ctanpkgstyref{dowith}. With `\DoWithCSL' +(at present), %% 2012/11/27 +an item cannot be empty or consist of blank spaces only. +Empty or blank items can be handled by `\DoWith'. + +\section{Example for 'filesdo.sty'} +In the file `srcfiles.tex' for the \ctanpkgdref{nicetext} bundle, +there is a line +\begin{quote} +`\DoWithBasesExts\ReadFileInfos{fifinddo,niceverb}{sty,tex}'\kern-10pt +\end{quote} +This works like +\begin{quote} +`\ReadFileInfos{fifinddo.sty}'\\ +`\ReadFileInfos{niceverb.sty}'\\ +`\ReadFileInfos{fifinddo.tex}'\\ +`\ReadFileInfos{niceverb.tex}' +\end{quote} +or actually +(a special feature of \ctanpkgref{readprov}'s + `\ReadFileInfos' is that its argument may be + a comma-separated list already) +\begin{quote} +`\ReadFileInfos{fifinddo.sty,niceverb.sty,'\\ +\null\texttt{ ~ ~ ~ ~ ~ ~ ~ }`fifinddo.tex,niceverb.tex}' +\end{quote} +I ponder providing a shorthand `\ReadBaseExtInfos' for +\begin{quote} +`\DoWithBasesExts\ReadFileInfos' +\end{quote} +and reimplementing `\ReadFileInfos' using `\DoWithCLS' in 'myfilist.sty' +(2012-11-27). + +\pagebreak +\section{The File 'commado.sty'} +\subsection{Package File Header (Legalese and 'plainpkg')} +\input{commado.doc} + +\newpage + +\section{The File 'filesdo.sty'} +\subsection{Package File Header (Legalese and 'plainpkg')} +\ResetCodeLineNumbers +\renewcommand*{\mdJobName}{filesdo} +\MakeInputJobDoc{19}{\SectionLevelOneParseInput} +\end{document} + +VERSION HISTORY + +2012/11/24 for v0.1 very first + + diff --git a/Master/texmf-dist/source/generic/commado/srcfiles.tex b/Master/texmf-dist/source/generic/commado/srcfiles.tex new file mode 100644 index 00000000000..5bc54458bef --- /dev/null +++ b/Master/texmf-dist/source/generic/commado/srcfiles.tex @@ -0,0 +1,17 @@ +\ProvidesFile{srcfiles.tex}[2012/11/27 file infos -> SrcFILEs.txt] +\RequirePackage[r,wrap]{nicefilelist} +\RequirePackage{stacklet,filedate} +\MaxBaseEmptyList* +\ModDates \FileDateAutoChecks +%% release: +\ReadFileInfos{commado.RLS} +%% packages: +\ReadPackageInfos{commado,filesdo} +%% documentation: +\ReadFileInfos{commado,srcfiles} +%% documentation settings and auxiliaries: +\FileListRemark[ ----]{---USED.---} +\ReadPackageInfos{fifinddo,makedoc,niceverb,texlinks} +\ReadFileInfos{makedoc.cfg,mdoccorr.cfg} +\ListInfos[SrcFILEs.txt] + diff --git a/Master/texmf-dist/tex/generic/commado/commado.RLS b/Master/texmf-dist/tex/generic/commado/commado.RLS new file mode 100644 index 00000000000..ac78cd6a6e2 --- /dev/null +++ b/Master/texmf-dist/tex/generic/commado/commado.RLS @@ -0,0 +1,2 @@ +\ProvidesFile{commado.RLS} %% RELEASE INFO + [2012/11/27 v0.1 initial] diff --git a/Master/texmf-dist/tex/generic/commado/commado.sty b/Master/texmf-dist/tex/generic/commado/commado.sty new file mode 100644 index 00000000000..6bdc458a35c --- /dev/null +++ b/Master/texmf-dist/tex/generic/commado/commado.sty @@ -0,0 +1,87 @@ + \input plainpkg +% \NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{commado}[2012/11/27 v0.1 iterate on CSL (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 +%% +\PushCatMakeLetterAt +%% == Auxiliaries == +\ifltx \else %% unless provided by LaTeX already + \long\def\@firstoftwo#1#2{#1} + \long\def\@secondoftwo#1#2{#1} +\fi +%% ... 4 less than +% \long\def\@firstsecondofthree#1#2#3{#1#2} +% \long\def\@firstthirdofthree#1#2#3{#1#3} +%% +%% == Processing a Comma-Separated List == +%% Most of the following code aims at removing the final +%% space in the comma-separated list. +%% % `\' usually may either refer to a string starting +%% % with a backslash or to the \emph{token} with the name +%% % \qtdcode{} +%% % (cf. "\TeX's Tokens" in the \ctanpkgref{dowith} documentation). +%% A variant of parsing as in 'fifinddo.sty' +%% (\ctanpkgdref{nicetext} bundle) and +%% \ctanpkgstyref{bitelist} package is employed +%% (while I am about to use different approaches there, +%% one may see here how, inspired by `\@ifblank' in +%% \ctanpkgstyref{url}). +%% The purpose of the following `\edef' of +%% |\DoWithCSL{}{}| +%% is to get a space token after `\@firstoftwo' in the parameter text. +%% \pagebreak[3] +\let\CD@final@comma\relax +\edef\DoWithCSL#1#2{% + \CD@final@comma#2CD@final@comma + \noexpand\@firstoftwo +% \noexpand\@firstsecondofthree + \space\CD@final@comma + \noexpand\@secondoftwo +% \noexpand\@firstthirdofthree + \noexpand\end{#1}{#2}} +\def\CD@final@comma#1 \CD@final@comma#2#3\end#4#5{% +% \expandafter\@secondfirstoftwo\expandafter{% +% #2{#1}#5}{\do@with@csl#4}% + #2{\do@with@csl{#4}#1}{\do@with@csl{#4}#5}% +%% ... 15 vs.\ 13: +% #2{\do@with@csl{#4}}{#1}{#5}% + ,\StopDoing,} +\catcode`\Q=3 %% not in #1 +\def\do@with@csl#1#2#3,{% +%% #1 is . #2 takes the first token from (remaining) +%% that is not a space token. Trying to enter a blank +%% list item would result in using the +%% \emph{next comma as a list item!}---The following +%% is an alternative to the analogue in 'domore.sty': + \unless@stop@doing#2#3\StopDoing + #1{#2#3}\do@with@csl{#1}\StopDoing Q} +\def\unless@stop@doing#1\StopDoing#2\StopDoing#3Q{#2} +%% ... somewhat replaces `\@secondfirstoftwo'---but will the +%% latter be dropped? `\unless@stop@doing' is specific +%% for `\StopDoing'---but can be used with `\DoWith' too. +%% TODO %% 2012/11/24 +\catcode`\Q=11 +%% +%% == Leaving the Package File == +\PopLetterCatAt +\endinput +%% +%% == \acro{VERSION HISTORY} == + +v0.1 2012/11/24f. started + 2012/11/26 code ready + 2012/11/27 documented diff --git a/Master/texmf-dist/tex/generic/commado/filesdo.sty b/Master/texmf-dist/tex/generic/commado/filesdo.sty new file mode 100644 index 00000000000..728334419a4 --- /dev/null +++ b/Master/texmf-dist/tex/generic/commado/filesdo.sty @@ -0,0 +1,55 @@ + \input plainpkg +% \NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{filesdo}[2012/11/27 v0.1 iterate on files (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 +%% +%% == Documentation == +%% For documentation in \acro{PDF} format, see `commado.pdf'. +%% +%% == 'commado' Required == +%% 'filesdo' is based on 'commado': +\RequirePackage{commado} +%% +%% == Category Code == +%% Use `@' as part of ``command names'' ('plainpkg', 'stacklet'): +\PushCatMakeLetterAt +%% +%% == User Commands == +%% |\DoWithExtBases{}{}{}| \ +%% runs `{.}' for all items +%% in and a single filename extension : +\def\DoWithExtBases#1#2{\DoWithCSL{\do@with@ext@base{#1}{#2}}} +\def\do@with@ext@base#1#2#3{#1{#3.#2}} +%% |\DoWithBasesExts{}{}{}| \ +%% runs `{.}' for all items +%% in and all items in : +\def\DoWithBasesExts#1#2{\DoWithCSL{\distrib@basenames@do{#1}{#2}}} +%% `\distrib@basenames@do' exchanges arguments in order to reduce +%% the task to `\DoWithCSL' and `\DoWithCSL': +\def\distrib@basenames@do#1#2#3{% + \DoWithCSL{\DoWithExtBases{#1}{#3}}{#2}} +%% +%% == Leaving the Package File == +\PopLetterCatAt +\endinput +%% +%% == \acro{VERSION HISTORY} == + +v0.1 2012/11/24f. started + 2012/11/26 code ready + 2012/11/27 documented, + \DoWithBaseExts -> \DoWithBasesExts -- cgit v1.2.3