17 Dec
2007
17 Dec
'07
10:33 a.m.
Peter Rolf wrote:
I have written such a macro, but sadly it crashes when used inside \color or \definecolor. Tried to debug it, but this is my first experience with the trace commands (probably not the best example to start with). Sigh, still so much to learn.. :)
The problem is that it defines things, and you can't do that inside an argument. Solution: rewrite the macro to define a new macro (like \def\currentStateDependentColor{green}) instead of expanding on the fly. Then you have to do something like this: \StateDependentColor[stateA=green,stateC=blue,whatever=yellow,...] \ color[\currentStateDependentColor] And that should work. Best wishes, Taco