I think I have seen some command like this before. Using +
and ++
we can define coordinates relative to previous points on the path. I'm wondering whether --
also has alternative versions that allow me to draw a line starting from a previous point rather than the current one. For example, consider this MWE:
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (0.5,0) -- +(0,1) --++ (0.5,0);
\end{tikzpicture}
\end{document}
which yields
What is the simplest way in which I could modify the MWE to get
instead?
Ideally, I would like to do it with a single \draw
command and without doing stuff such as \draw (0,0) -- (0.5,0) -- +(0.5,0) (0.5,0) -- (0.5,1);
, where the problem is solved by repeating one of the points. I would like to write each of the four points only once.
The reason is I'm working on an illustration which uses some random points, and I might not be able to get their coordinates again without considerably changing the implementation. Hence, in my goal each of the four points is sorted at random, and I will not be able to write them twice.
coordinate
command?