Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
composition:macros:repeter_une_commande_pour_chaque_element_d_une_liste [2018/06/03 15:05]
samcarter
composition:macros:repeter_une_commande_pour_chaque_element_d_une_liste [2018/12/04 00:31] (Version actuelle)
jejust
Ligne 1: Ligne 1:
---- +====== ​Repeating something for each '​thing'​ in a set ====== 
-title: ​Repeating something for each '​thing'​ in a set +
-category: programming +
-permalink: /​FAQ-repeat-set +
-date: 2014-06-10 +
----+
  
 As another question ​ As another question ​
-([repeating something a given number of times](FAQ-repeat-num))+([[FAQ-repeat-num|repeating something a given number of times]])
 explains, TeX is not explicitly designed for '​regular'​ programming explains, TeX is not explicitly designed for '​regular'​ programming
 operations. As a result, we must resort to arcane tricks to do the operations. As a result, we must resort to arcane tricks to do the
Ligne 13: Ligne 9:
 with repeating an operation for each of a given set of objects. with repeating an operation for each of a given set of objects.
  
-The [`etoolbox`](https://​ctan.org/​pkg/​etoolboxpackage provides iteration over a +The [[ctanpkg>​etoolbox|etoolbox]] package provides iteration over a 
-comma-separated list of items, in its `\docsvlistand +comma-separated list of items, in its ''​\docsvlist'' ​and 
-`\forcsvlistcommands; they are well-described in the package +''​\forcsvlist'' ​commands; they are well-described in the package 
-documentation. ​ The [`datatool`](https://​ctan.org/​pkg/​datatoolpackage manages "​databases"​+documentation. ​ The [[ctanpkg>​datatool|datatool]] package manages "​databases"​
 (of its own definition) and you may iterate over entries in such a (of its own definition) and you may iterate over entries in such a
-database using the command ​`\DTLforeach`.+database using the command ​''​\DTLforeach''​.
  
-The [`forarray`](https://​ctan.org/​pkg/​forarraypackage defines its own "​list"​ and "​array"​ +The [[ctanpkg>​forarray|forarray]] package defines its own "​list"​ and "​array"​ 
-structures, together with commands ​`\ForEachand `\ForArray`+structures, together with commands ​''​\ForEach'' ​and ''​\ForArray''​
 which enable a command to be executed for each element in a list or which enable a command to be executed for each element in a list or
 array, respectively. array, respectively.
  
-The [`dowith`](https://​ctan.org/​pkg/​dowithdefines a pair of macros ​`\DoWithand +The [[ctanpkg>​dowith|dowith]] defines a pair of macros ​''​\DoWith'' ​and 
-`\StopDoingthat process each "​thing"​ between them; a trivial+''​\StopDoing'' ​that process each "​thing"​ between them; a trivial
 example of use is: example of use is:
-```latex+ 
 +<​code ​latex>
 \usepackage{dowith} \usepackage{dowith}
 ... ...
Ligne 34: Ligne 31:
 \newcommand{\foo}[1]{\message{#​1+} \newcommand{\foo}[1]{\message{#​1+}
 \DoWith\foo a{BBB}c\StopDoing \DoWith\foo a{BBB}c\StopDoing
-```+</​code>​
 which produces terminal output: which produces terminal output:
-```latex+ 
 +<​code ​latex>
 a+ BBB+ c+ a+ BBB+ c+
-```+</​code>​
 so, the macros have found 3 "​things",​ including one with braces so, the macros have found 3 "​things",​ including one with braces
 around it.  (The interpolated spaces come from the primitive around it.  (The interpolated spaces come from the primitive
-`\messagecommand.)+''​\message'' ​command.)
  
 The only constraint is that all commands in the enclosed stuff are The only constraint is that all commands in the enclosed stuff are
Ligne 47: Ligne 45:
 commands with optional arguments). commands with optional arguments).
  
-From the same stable (as [`dowith`](https://​ctan.org/​pkg/​dowith)) comes the package +From the same stable (as [[ctanpkg>​dowith|dowith]]) comes the package 
-[`commado`](https://​ctan.org/​pkg/​commado), that provides commands ​`\DoWithCSL(apply a+[[ctanpkg>​commado|commado]], that provides commands ​''​\DoWithCSL'' ​(apply a
 command to each element of a comma-separated-variable list) and command to each element of a comma-separated-variable list) and
-`\DoWithBasesExts(apply a command to each of a set of files, +''​\DoWithBasesExts'' ​(apply a command to each of a set of files, 
-defined by base name and "​extension"​). ​ Use of these `\DoWith*`+defined by base name and "​extension"​). ​ Use of these ''​\DoWith*''​
 macros is also expandable (if the command applied to the list elements macros is also expandable (if the command applied to the list elements
 is itself expandable). is itself expandable).
  
 +
 +-----
 +
 +//Source:// [[faquk>​FAQ-repeat-set|Repeating something for each '​thing'​ in a set]]
 +
 +{{htmlmetatags>​metatag-keywords=(LaTeX,​programming)
 +metatag-og:​title=(Repeating something for each '​thing'​ in a set)
 +metatag-og:​site_name=(FAQ LaTeX francophone)
 +}}
  
composition/macros/repeter_une_commande_pour_chaque_element_d_une_liste.1528031126.txt.gz · Dernière modification: 2018/06/03 15:05 par samcarter
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0