diff options
author | Karl Berry <karl@freefriends.org> | 2015-11-16 22:22:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-11-16 22:22:53 +0000 |
commit | d8258d9565c2f3e2c0e2a4d6f71099f8f604bbed (patch) | |
tree | d383ef5805c5e290869af382ce31d47b12292447 /Master/texmf-dist/source/generic/commado | |
parent | 46ee5d1eeb4e4c40471c0fae622e8fcc810a8261 (diff) |
commado (16nov15)
git-svn-id: svn://tug.org/texlive/trunk@38875 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic/commado')
-rw-r--r-- | Master/texmf-dist/source/generic/commado/commado.tex | 86 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/commado/srcfiles.tex | 8 |
2 files changed, 85 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/generic/commado/commado.tex b/Master/texmf-dist/source/generic/commado/commado.tex index b0e7935502a..e7ba43d9d83 100644 --- a/Master/texmf-dist/source/generic/commado/commado.tex +++ b/Master/texmf-dist/source/generic/commado/commado.tex @@ -1,4 +1,4 @@ -\ProvidesFile{commado.tex}[2012/11/30 documenting commado.sty] +\ProvidesFile{commado.tex}[2015/11/16 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\\ @@ -11,10 +11,12 @@ \RequirePackage{makedoc} \ProcessLineMessage{} \renewcommand*{\mdSectionLevelOne}{\string\subsection} \MakeJobDoc{19}{\SectionLevelOneParseInput} %% 2012/11/26 -% \documentclass[fleqn]{article}%% TODO paper dimensions!? -\documentclass{article} %% TODO paper dimensions!? +\documentclass[fleqn]{article}%% TODO paper dimensions!? +% \documentclass{article} %% TODO paper dimensions!? \usepackage{catchdq} %% TODO earlier than `langcode' \input{makedoc.cfg} %% shared formatting settings +\ifpdf\else \errhelp{hyperref v6.83m option [draft] bad with \begin{equation}} + \errmessage{run this with pdflatex only}\fi \ReadPackageInfos{commado,filesdo} % \usepackage{commado} \MDkeywords{macro programming, programming structures, loops, lists} @@ -69,17 +71,84 @@ So roughly, % \pagebreak \section{Syntax and Relation to the 'dowith' Package} -In <list> with `\DoWithCSL{<cmd>}{<list>}', blank spaces +In <list> with |\DoWithCSL{<cmd>}{<list>}|, blank spaces %% boxed 2015/11/15 before entries or after commas as well as preceding the closing brace are ignored. So \[`\DoWithCSL{<cmd>}{ cfg, sty, tex }'\] works like -\[`\DoWith{<cmd>}{{cfg}{sty}{tex}}'\] +\[`\DoWithAllOf{<cmd>}{{cfg}{sty}{tex}}'\] %% added `AllOf' 2015/11/15 from \ctanpkgstyref{dowith}.\urlfoot{CtanPkgRef}{dowith} %% foot 2012/11/30 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'. +Empty or blank items can be handled by `\DoWith'\-`AllOf'. +%% <- was not wrong without `AllOf', however ... 2015/11/15 +%% ... hyphenation is a great compromise! without hyphen? +\par %% 2015/11/15 +\begingroup \footnotesize +As to \strong{relevance}, the previous remark addresses those +who want to understand what I am doing, such as me. +The two commands provide a rather obvious ``link'' between the 'commado' +and the 'dowith' bundle. But neither of them is a command that +``you shouldn't miss.'' 'commado.sty' is mainly a programming tool +(and I isolate it as an object of study). +% similar to a chess diagram to demonstrate how to trap a lonely king +% with king and rook only, the actual task being expandability, +% in my case to generate \acro{HTML} with \TeX's `\write' primitive). + \par\strong{Choosing between 'dowith' and 'commado'.}\quad What I +\strong{really use} in the case of comma-separated lists is +\strong{'filesdo.sty'} as described in the next section. %% TODO really? +It is great to keep certain files or file sections small (\strong{readability}), +actually in describing package bundles, on \acro{CTAN} as well as +with a complex book at which I am working. However, +the comma feature is a little more complex than the 'dowith' way, +and I like to avoid unnecessarily complex things. +The real advantage of 'filesdo', as I feel it, +is the readability of the code with combinations of file \emph{basenames} +and \emph{extensions}, similar to \emph{brace expansion} in the +\Wikidisambref{Bash}{Unix shell} shell. +The braces make obvious which are the basenames and which are the +extensions, and the commas structure each of these two lists. + +In applications of \strong{'dowith'}, saving \strong{tokens} and +\strong{expansion} steps is more important to me (a kind of sports). +\emph{Tokens} actually are saved with 'dowith' when <list> consists of +single tokens rather than ``\strong{brace groups},'' +and the former is the application of 'dowith' in my \ctanpkgdref{langcode} package +(in the 'dowith' discussion, I compare this with the \ctanpkgdref{xspace} package). +On the other hand, a <list> of brace groups even needs more tokens than a comma-separated list. +% (Due to \TeX's tokenization, readability and parsimony are opposite and +% incompatible goals.) +The number of tokens or expansion steps is relevant when a list is stored +as a macro or in a token register. It is less relevant when a list +is processed once only at the moment the input file is read +and then is not stored any longer. + +There is a situation where I prefer lists of \emph{brace groups} +to comma-separated lists although the former need more tokens +and their readablility is worse: I use something like +\begin{equation} + `\autrefs{{apples}{oranges}{pears}}' +\end{equation} +to generate a list of internal links in a \acro{HTML} file. +`\autrefs' this way rests on `\DoSeparateWith' from 'domore.sty'. +`\DoSeparateWith' is based on `\DoWith'. Sometimes I use the former +one directly as an \emph{author}. The alternative +\begin{equation} + `\autrefs{apples,oranges,pears}' +\end{equation} +would need less tokens (which is absolutely irrelevant in this case +because the line is in \TeX's memory for a moment only) +and may be easier to read. However, often I want to change the order +of the items. When I try this by cut\&paste in a comma-separated list, +I always wonder whether I should cut/copy the right-hand comma +of a list item or the left-hand comma; and at the next moment, +I have forgotten whether I cut the right-hand comma +or the other one. With the 'dowith' approach, I just cut\&paste +a brace group. A function key opens an empty brace group in my +favorite editor. + +\par \endgroup \section{Example for 'filesdo.sty'} In the file `srcfiles.tex' for the \ctanpkgdref{nicetext} bundle, @@ -129,3 +198,8 @@ VERSION HISTORY 2012/11/24 for v0.1 very first 2012/11/30 for v0.11 \ctanpkgdref moves to `makedoc.cfg', 2 more link footnotes +2015/11/15f. `AllOf' was missing in the description of + the relation to the `dowith' bundle -- + added an "essay" +2015/11/15 error message to deal with hyperref's + draft/equation problem as in dowith.tex diff --git a/Master/texmf-dist/source/generic/commado/srcfiles.tex b/Master/texmf-dist/source/generic/commado/srcfiles.tex index 5bc54458bef..1bffd266637 100644 --- a/Master/texmf-dist/source/generic/commado/srcfiles.tex +++ b/Master/texmf-dist/source/generic/commado/srcfiles.tex @@ -1,10 +1,10 @@ -\ProvidesFile{srcfiles.tex}[2012/11/27 file infos -> SrcFILEs.txt] +\ProvidesFile{srcfiles.tex}[2015/11/16 file infos -> SrcFILEs.txt] \RequirePackage[r,wrap]{nicefilelist} \RequirePackage{stacklet,filedate} \MaxBaseEmptyList* -\ModDates \FileDateAutoChecks %% release: -\ReadFileInfos{commado.RLS} +\ReadFileInfos{commado.RLS} %% tested below +\ModDates \FileDateAutoChecks %% packages: \ReadPackageInfos{commado,filesdo} %% documentation: @@ -13,5 +13,7 @@ \FileListRemark[ ----]{---USED.---} \ReadPackageInfos{fifinddo,makedoc,niceverb,texlinks} \ReadFileInfos{makedoc.cfg,mdoccorr.cfg} +\DatesDiffWarnings +\CheckDateOfToday{commado.RLS} \ListInfos[SrcFILEs.txt] |