5

I am facing a problem I can't solve on my own. The goal is to draw an arrow with a "breaking" line like this (BUT with an arrow):

\documentclass[tikz,border=2mm]{standalone}
\tikzset{ext/.pic={
\path [fill=white] (-0.2,0)to[bend left](0,0.1)to[bend right](0.2,0.2)to(0.2,0)to[bend left](0,-0.1)to[bend right](-0.2,-0.2)--cycle;
\draw (-0.2,0)to[bend left](0,0.1)to[bend right](0.2,0.2) (0.2,0)to[bend left](0,-0.1)to[bend right](-0.2,-0.2);
}}
\begin{document}
\begin{tikzpicture}
\path [draw] (0,0)--pic {ext}(0,2);
\end{tikzpicture}
\end{document}

enter image description here

I prepared a mwe where this breaking arrow should be implemented:

\documentclass[tikz,
               border=5mm]{standalone}
\usetikzlibrary{arrows, chains, positioning, shapes.geometric, shapes.symbols}

\tikzset{%
     base/.style = {draw=black, minimum width=3cm, minimum height=1cm,
                    align=center, on chain},
 myarrows/.style = {-stealth, thick},% <-- added on request in comment
  process/.style = {rectangle, base},
startstop/.style = {rectangle, base, rounded corners, fill=red!30},
    }
\begin{document}
    \begin{tikzpicture}[
   node distance = 1cm and 2cm,
     start chain = going below,
                    ]
\node (start) [startstop]   {Start};
\node (pro1)  [process]     {Process};
\node (pro3)  [process]        {List};
%
\draw[myarrows] (start) edge (pro1)
                (pro1)  edge (pro3);

    \end{tikzpicture}
\end{document}

enter image description here

I'd like that breaking arrow as an edge between "Start" and "Process". Several approaches I did produced error because of pic.

2

You need to add your definition of pic to ˙\tikzset` in your picture and than use it as

\draw[myarrows] (start) edge pic {ext} (pro1);

and that is all!

Edit: I cant reproduce any error with your solution. It works but obtained result is ugly:

enter image description here

As you can see, to one line is added arrows. This is consequence of your definition of ext. So I change it into:

ext/.pic = {\draw[white,very thick,-]% <-- observe added - for line type
                                       (0,0) -- (0,0.1);
            \draw[-] (-0.2,0.0) % <-- observe added - for line type
            .. controls +(0.2,0.2) and +(-0.2,-0.2) .. (0.2,0.0)
                     (-0.2,0.1)
            .. controls +(0.2,0.2) and +(-0.2,-0.2) .. (0.2,0.1);
            },

which is not sensitive to shape of arrow anymore. With it I got expected result:

enter image description here

Complete MWE:

\documentclass[tikz,
               border=5mm]{standalone}
\usetikzlibrary{arrows, chains, positioning, shapes.geometric, shapes.symbols}

\tikzset{%
     base/.style = {draw=black, minimum width=3cm, minimum height=1cm,
                    align=center, on chain},
        ext/.pic = {\draw[white,very thick,-] (0,0) -- (0,0.1);
                    \draw[-] (-0.2,0.0)
                    .. controls +(0.2,0.2) and +(-0.2,-0.2) .. (0.2,0.0)
                             (-0.2,0.1)
                    .. controls +(0.2,0.2) and +(-0.2,-0.2) .. (0.2,0.1);                                                },
 myarrows/.style = {-stealth, thick},% <-- added on request in comment
  process/.style = {rectangle, base},
startstop/.style = {rectangle, base, rounded corners, fill=red!30},
    }
\begin{document}
    \begin{tikzpicture}[
   node distance = 1cm and 2cm,
     start chain = going below,
                    ]
\node (start) [startstop]   {Start};
\node (pro1)  [process]     {Process};
\node (pro3)  [process]        {List};
%
\draw[myarrows] (start) edge pic {ext} (pro1) % <-- it works!
                (pro1)  edge (pro3);
    \end{tikzpicture}
\end{document}
  • Dear Zarko, again you helped me out of this trouble. Thank you so much. Your solution is indeed beautiful :) – Christine Aug 28 '16 at 22:01
  • Dear @Christine, thank you for nice words, however police of SE is that instead words of thankfulness you up-vote answers (by clicking on upright pen at the top left side of answer) and by this show your thankfulness and accept (by clicking on check-mark below pens) those, which were the most help you. As far I see, till to now you didn't up-vote any received questions nor any of them accept. If you like to motivate people here to help you in future, do this now. At all already received answers as well as at all you will receive in future. Happy TeXing! – Zarko Aug 28 '16 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.