The question is in the title: What is the difference between the commands \path
and \draw
in Tikz? The PGF and TikZ manual by Till Tantau tells me (on page 26 of the current version) that “\draw
is just a shorthand for \path[draw]
”.
In some of the answers I got to previous questions on how to draw certain figures using Tikz
, some users have used a mixture of \path
and\draw
in their code, while others only seemed to use \draw
.
The very helpful slides Marc van Dongen has on his website explaining the basic features of Tikz also contain a mixture of both, whilst mostly relying on the \draw
command.
To remedy this confusion, I have as of now switched to using exclusivley \draw
, but I find it very confusing.
What is the difference between the two commands? Should I be using both? When is it better to use \path
instead of \draw
and vice versa? When is it all the same? Are there things \path
can do that \draw
cannot?
Best Answer
Sometimes we only need a virtual path, or a totally transparent path just to compute some coordinates, intersections, and so on.
To do an invisible path we use
\path
and if you want to put some ink on it you use\draw
.Example: Here is an example where I used some paths to compute the intersections.