Say I have 100 nodes that I want to draw with slight varations 100 times. I don't want to copy/paste all the code each time, that would be a lot of duplication and a lot of boilerplate. So instead I am considering making a compact data structure to hold the values.
The question is, what is a Latex-y way of accomplishing this without parsing. That is, how can this be accomplished without writing a custom parser for a custom data structure.
An example data structure that would require parsing would be something like:
\mynodes{1:red,2:blue,3:yellow,....}
That would give you a comma-separated list of id:color, which you could then parse.
I'm wondering though, if there is a way to do this without parsing. So something like (say there exist 100 properties 1-100):
\mynodes{1=red,2=yellow}
But this example is too simple, there could be several values per id. So more like:
\mynodes{1=\keys{color=red,size=1cm},2=\keys{color=yellow,size=1cm},...}
This could be shortened if you had a lookup table for the properties and values, such as:
\mynodes{1=\v{c=r,s=1},2=\v{c=y,s=1},...}
That would then give you an etoolbox list objects to iterate over. Wondering if something like that is possible, and shining some light on how one might go about accomplishing this.
The end result would be a more compact data structure without using any parsing.




