Background: I'be been reading the PGF manual (keys section) and today the TeX Book just arrived in the mail and just started reading chapter 7 (How TeX reads what you type) — feeling like Mickey Mouse in "The Sorcerers Apprentice".
I want (but this is not the question) to do a routine that does something like that:
input: a,b ; c,d ; e,f.
output: a\nodepart{b} && c\nodepart{d} && e\nodepart{f}\\
My idea was to use the PGF parser to read the input. If I were using the languages I know (old Basic, Python, Maple script) I would save intermediary results in a variable but for what I understood so far LaTeX/TeX/ and TikZ/PGF do not work in this way. There is no string manipulation routines. I know we can store stuff into pgf keys. Before you stop reading I better ask my questions:
- Are there any examples of (LaTeX/TeX/ and TikZ/PGF) code that reads some input of variable lenght possibly more than ten and spits some other code?
- With the example above in mind, which references should I read to be able to implement the routine in an efficient way?
Post-script:
- Reading the suggested tags, I just learn about the LaTeX parse package, will check it also.
- @egreg: The ultimate goal will be to define a bimatrix environment in TikZ to display two-player games in normal form. The idea is to create outputs similar to this http://www.maths.lse.ac.uk/Personal/stengel/bimatrixgame/example.pdf but with the intuitive and human-like language we see in TikZ constructs.
Best Answer
This is an adaptation of the second answer of the question How do I split a string? to your problem. It is not exactly what you want, but it can help to get you on the way.
This the pdf output: