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
Prochaine révision Les deux révisions suivantes
2_programmation:macros:definir_une_macro_a_plus_de_9_arguments [2018/05/22 13:41]
joseph.wright
2_programmation:macros:definir_une_macro_a_plus_de_9_arguments [2018/12/04 00:26]
jejust
Ligne 1: Ligne 1:
-How to break the 9-argument limit+====== ​How to break the 9-argument limit ====== 
  
 If you think about it, you will realise that Knuth'​s command If you think about it, you will realise that Knuth'​s command
 definition syntax: definition syntax:
-```latex+ 
 +<​code ​latex>
 \def\blah#​1#​2 ... #​9{<​macro body>} \def\blah#​1#​2 ... #​9{<​macro body>}
-```+</​code>​
 is intrinsically limited to just 9 arguments. ​ There'​s no direct way is intrinsically limited to just 9 arguments. ​ There'​s no direct way
-round this: how would you express a 10th argument?&​nbsp;&​mdash; ​and ensure that+round this: how would you express a 10th argument? ​--- and ensure that
 the syntax didn't gobble some other valid usage? the syntax didn't gobble some other valid usage?
  
 If you really must have more than 9 arguments, the way to go is: If you really must have more than 9 arguments, the way to go is:
-<!-- {% raw %} --> + 
-```latex+ 
 +<​code ​latex>
 \def\blah#​1#​2 ... #9{% \def\blah#​1#​2 ... #9{%
   \def\ArgI{{#​1}}%   \def\ArgI{{#​1}}%
Ligne 27: Ligne 30:
   <macro body>%   <macro body>%
 } }
-``` +</code> 
-<!-- {% endraw %} -->+
 This technique is easily extendible by concert pianists of the TeX This technique is easily extendible by concert pianists of the TeX
 keyboard, but is really hard to recommend. keyboard, but is really hard to recommend.
  
 LaTeX users have the small convenience of merely giving a number of LaTeX users have the small convenience of merely giving a number of
-arguments in the `\newcommandthat defines each part of the +arguments in the ''​\newcommand'' ​that defines each part of the 
-relaying mechanism: Knuth'​s restriction applies to `\newcommand` +relaying mechanism: Knuth'​s restriction applies to ''​\newcommand''​ 
-just as it does to `\def`.  However, LaTeX users also have the +just as it does to ''​\def''​.  However, LaTeX users also have the 
-way out of such barbarous command syntax: the [`keyval`](http://​ctan.org/​pkg/​keyval) +way out of such barbarous command syntax: the [[ctanpkg>​keyval|keyval]] 
-package. ​ With [`keyval`](http://​ctan.org/​pkg/​keyval), and a bit of programming,​ one can+package. ​ With [[ctanpkg>​keyval|keyval]], and a bit of programming,​ one can
 write really quite sophisticated commands, whose invocation might look write really quite sophisticated commands, whose invocation might look
 like: like:
-<!-- {% raw %} --> + 
-```latex+ 
 +<​code ​latex>
 \flowerinstance{species=Primula veris, \flowerinstance{species=Primula veris,
   family=Primulaceae,​   family=Primulaceae,​
Ligne 50: Ligne 54:
   soiltype=alkaline   soiltype=alkaline
 } }
-``` +</code> 
-<!-- {% endraw %} -->+
 The merit of such verbosity is that it is self-explanatory:​ the typist The merit of such verbosity is that it is self-explanatory:​ the typist
-doesn'​t have to remember that argument twelve is `soiltype`, and so+doesn'​t have to remember that argument twelve is ''​soiltype''​, and so
 on: the commands may be copied from field notes quickly and on: the commands may be copied from field notes quickly and
 accurately. accurately.
  
-        * faq-mac-prog.tex (q-keyval): tweak words about getoptk 
  
 +
 +-----
 +
 +//Source:// [[faquk>​FAQ-moren9|How to break the 9-argument limit]]
 +
 +{{htmlmetatags>​metatag-keywords=(LaTeX,​programming)
 +metatag-og:​title=(How to break the 9-argument limit)
 +metatag-og:​site_name=(FAQ LaTeX francophone)
 +}}
  
2_programmation/macros/definir_une_macro_a_plus_de_9_arguments.txt · Dernière modification: 2021/10/21 14:01 par bdumont
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0