Dagnat Fabien | 8 Mar 14:02
Picon
Favicon

Re: pgf and xstring package

Hello,
Yes indeed, I think you should look either at the package keyval (or its extension xkeyval) or the package
pgfkeys which is heavily used by pgf....

Fabien
Le 7 mars 2010 à 21:17, Hugues Vermeiren a écrit :

> The number of argument of a macro is limited to 9, I think.
> I wanted to pass a long series of parameters to a macro.
> Using the xstring package I parse a chain ("12,13,14" in the example below).
> It works ok as long as I don't use pgf commands in the macro.
> Is there another way to proceed?
> 
> \documentclass{article}
> \usepackage[utf8]{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage[english]{babel}
> \usepackage{xstring}
> \usepackage{tikz}
> \newcommand{\mymacro}[1]{
> \def\a{\StrBefore[1]{#1}{,}} % 1st param
> \def\b{\StrBetween[1,2]{#1}{,}{,}} % 2nd param
> \def\c{\StrBehind[2]{#1}{,}} % 3rd param
> param 1 = #1 \\
> a=\a \\
> b=\b \\
> c=\c \\
> %\pgfmathparse{\a} % Problems if you de-comment this line
> }
> 
(Continue reading)


Gmane