I'd like to know if somebody know a way to define a path in TikZ and reuse the path's definition several times. For example, consider the following:
code example with duplicate paths http://csweb.ucc.ie/~dongen/TeX-SX/11--12/path.png
If I wanted to change the path (0,2) -- (0,2) -- (5,3) -- (5,2) I'd have to make two changes to the code. How can I avoid this?
\defit?\def\mypath{ (0,0) -- (5,5)}and then using it\tikz \draw {\mypath};. Not so elegant though. – percusse Jan 19 '12 at 17:30defs local to atikzpicture. Interestingly, and this is one of the reasons why I never thought of using a\def, TikZ'sname pathonly seems to work for intersections but not for drawing.... – Jan 19 '12 at 17:49<replacement text>:\def\<cmd>{<replacement text>}. – Werner Jan 19 '12 at 19:55\def\A{(0,0) \B {hello}}\def\B{node}you cannot write\tikz\draw\A\B;. – Jan 19 '12 at 20:42spaththen you might get some idea of the sort of thing I do with my code. If it looks interesting, tell me and I'll try to see if it could do what you want. – Andrew Stacey Jan 19 '12 at 23:06