I have standalone figures that I include in my document. These figures use statements like \providecommand{\HypotenuseLabel}{$h$} which allows the figure to have a default label, and which can be over written via \newcommand{\HypotenuseLabel}{$x^2+y^2$} in the main file that includes this figure to customise this diagram for that particular application.
This figure also has statements like \tikzstyle{HypotenuseLineStyle}=[red, very thick, opacity=0.5] which are used to draw this particular line. I would like to change this to something of the nature \providetikzstyle so that this style only gets defined in the figure if it is not already defined. Is there an easy way to do this?
\tikzstyleis used 8 times in v2.10 manual ({every node}=[...]on pages 177, 178, 178, 422, 430, 432, 441 and{every picture}+=[...]on page 199). I agree that using undocumented macro is a bit dangerous, but in this case its intent is clearly readable. I may also add that I like it for its conciseness. – przemoc Jul 08 '11 at 20:57\tikzstyleis that it is not easily parseable and adding new handlers likecode(/.code),style 2 args, etc. etc. would be difficult. Using the key=value system itself is much more flexible. Personally I find\tikzset{foo/.append style={bar}}much nicer looking than\tikzstyle{foo}+=[bar]– Martin Scharrer Jul 08 '11 at 21:02\tikzsetis more robust. – przemoc Jul 08 '11 at 21:12\tikzstyleis an early macro which is deprecated in favor of the official\tikzset. – Martin Scharrer Jul 08 '11 at 21:17\tikzoptionis deprecated but there's no such notice for\tikzstyleand, indeed,\tikzstyleis used extensively in the main code (59 times). – Andrew Stacey Sep 02 '11 at 19:12