# TikZ: Can one combine two draw commands (one with options, the other without) into on statement?

My code:

\documentclass{scrartcl}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\draw
[->] (0, 0) |- (1, 0);
\draw
(1, 0) |- (2, 1);

\end{tikzpicture}

\end{document}


It is possible to use a single draw command to achieve the same result (arrow tip appears only at point (1, 0))?

First, draw the lines without arrow and the line with arrow comes last:

\documentclass{scrartcl}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\draw[->]
(1, 0) |- (2, 1)
(0, 0) -- (1, 0);

\end{tikzpicture}

\end{document}


• Hello @Heiko Oberdiek! Thank you for your answer! I like it most. One thing: The |- operation between (0, 0) and (1, 0) isn't needed, right? -- is enough? – Su-47 Apr 17 '18 at 21:51
• @Su-47 Yes, (0, 0) -- (1, 0) works. Answer updated. – Heiko Oberdiek Apr 18 '18 at 4:34

it is possible, but code is not (much) shorter than with two \draw commands:

\documentclass[tikz,margin=3mm]{standalone}

\begin{document}
%%% first case
\begin{tikzpicture}
\draw (0,0) edge[->] (1,0) (1,0) |- (2,1);
\end{tikzpicture}
%%% second case
\begin{tikzpicture}
\draw   (1,0) edge[<-] (0,0) |- (2,1);
\end{tikzpicture}
\end{document}


in the both cases the result is the same:

• Hello @Zarko! Thank you for your answer! That's an easy one! I don't have the experience with the edge command. I will read about it in the manual. – Su-47 Apr 17 '18 at 21:42