Arrows along path in TikZ flowchart












2















Instead of drawing each arrow separately, I am interested in a quicker way to draw arrows along a path in a flowchart.



Let's look at some code first, MWE:



documentclass{article}

usepackage[svgnames]{xcolor}
usepackage{pgf,tikz}
usetikzlibrary{chains,positioning,arrows,shapes.geometric,quotes,fit,calc}

tikzstyle{startstop} = [%
rectangle,
rounded corners,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
line width=1pt,
draw=DarkBlue,
fill=DarkBlue!30
]

tikzstyle{process} = [%
rectangle,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
draw=orange,
fill=orange!30
]

tikzstyle{arrow} = [%
thick,
->,
>=stealth,
]

tikzstyle{mainarrow} = [%
ultra thick,
->,
>=stealth,
]

begin{document}

begin{tikzpicture}
node (mycenternode) [startstop] {Isgrind};
node (mynorthnode) [process, above=of mycenternode] {Sami};
node (mysouthnode) [process, below=of mycenternode] {Romrike};
node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
node (myeastnode) [process, right=of mycenternode] {Lukinsola};

draw [mainarrow] (mynorthnode) -- (mycenternode);
draw [mainarrow] (mycenternode) -- node[anchor=west] {kuf} (mysouthnode);
draw [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode);
draw [arrow] (mycenternode) -- node[anchor=south] {olan} (myeastnode);

path [arrow] (mywestnode) |- node[anchor=south] {punrot} (mynorthnode) -| (myeastnode);
end{tikzpicture}

end{document}


Instead of having to say



    draw [mainarrow] (mynorthnode)  -- (mycenternode);
draw [mainarrow] (mycenternode) -- node[anchor=west] {kuf} (mysouthnode);
draw [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode);
draw [arrow] (mycenternode) -- node[anchor=south] {olan} (myeastnode);


I wonder how to shorten that to something like



path [mainarrow] (mynorthnode)  -- (mycenternode) -- node[anchor=west]  {kuf}  (mysouthnode);
path [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode) -- node[anchor=south] {olan} (myeastnode);


EXTRA:
In the last few lines, you can discern a path. I don't really understand why it's not drawing anything.










share|improve this question























  • path and draw are two different things. path does not draw unless you say path[draw,...]. Also consider using tikzset{blabla/.style={...} instead of tikzstyle{blabla}=[...].

    – marmot
    Jan 22 at 18:07


















2















Instead of drawing each arrow separately, I am interested in a quicker way to draw arrows along a path in a flowchart.



Let's look at some code first, MWE:



documentclass{article}

usepackage[svgnames]{xcolor}
usepackage{pgf,tikz}
usetikzlibrary{chains,positioning,arrows,shapes.geometric,quotes,fit,calc}

tikzstyle{startstop} = [%
rectangle,
rounded corners,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
line width=1pt,
draw=DarkBlue,
fill=DarkBlue!30
]

tikzstyle{process} = [%
rectangle,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
draw=orange,
fill=orange!30
]

tikzstyle{arrow} = [%
thick,
->,
>=stealth,
]

tikzstyle{mainarrow} = [%
ultra thick,
->,
>=stealth,
]

begin{document}

begin{tikzpicture}
node (mycenternode) [startstop] {Isgrind};
node (mynorthnode) [process, above=of mycenternode] {Sami};
node (mysouthnode) [process, below=of mycenternode] {Romrike};
node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
node (myeastnode) [process, right=of mycenternode] {Lukinsola};

draw [mainarrow] (mynorthnode) -- (mycenternode);
draw [mainarrow] (mycenternode) -- node[anchor=west] {kuf} (mysouthnode);
draw [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode);
draw [arrow] (mycenternode) -- node[anchor=south] {olan} (myeastnode);

path [arrow] (mywestnode) |- node[anchor=south] {punrot} (mynorthnode) -| (myeastnode);
end{tikzpicture}

end{document}


Instead of having to say



    draw [mainarrow] (mynorthnode)  -- (mycenternode);
draw [mainarrow] (mycenternode) -- node[anchor=west] {kuf} (mysouthnode);
draw [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode);
draw [arrow] (mycenternode) -- node[anchor=south] {olan} (myeastnode);


I wonder how to shorten that to something like



path [mainarrow] (mynorthnode)  -- (mycenternode) -- node[anchor=west]  {kuf}  (mysouthnode);
path [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode) -- node[anchor=south] {olan} (myeastnode);


EXTRA:
In the last few lines, you can discern a path. I don't really understand why it's not drawing anything.










share|improve this question























  • path and draw are two different things. path does not draw unless you say path[draw,...]. Also consider using tikzset{blabla/.style={...} instead of tikzstyle{blabla}=[...].

    – marmot
    Jan 22 at 18:07
















2












2








2








Instead of drawing each arrow separately, I am interested in a quicker way to draw arrows along a path in a flowchart.



Let's look at some code first, MWE:



documentclass{article}

usepackage[svgnames]{xcolor}
usepackage{pgf,tikz}
usetikzlibrary{chains,positioning,arrows,shapes.geometric,quotes,fit,calc}

tikzstyle{startstop} = [%
rectangle,
rounded corners,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
line width=1pt,
draw=DarkBlue,
fill=DarkBlue!30
]

tikzstyle{process} = [%
rectangle,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
draw=orange,
fill=orange!30
]

tikzstyle{arrow} = [%
thick,
->,
>=stealth,
]

tikzstyle{mainarrow} = [%
ultra thick,
->,
>=stealth,
]

begin{document}

begin{tikzpicture}
node (mycenternode) [startstop] {Isgrind};
node (mynorthnode) [process, above=of mycenternode] {Sami};
node (mysouthnode) [process, below=of mycenternode] {Romrike};
node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
node (myeastnode) [process, right=of mycenternode] {Lukinsola};

draw [mainarrow] (mynorthnode) -- (mycenternode);
draw [mainarrow] (mycenternode) -- node[anchor=west] {kuf} (mysouthnode);
draw [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode);
draw [arrow] (mycenternode) -- node[anchor=south] {olan} (myeastnode);

path [arrow] (mywestnode) |- node[anchor=south] {punrot} (mynorthnode) -| (myeastnode);
end{tikzpicture}

end{document}


Instead of having to say



    draw [mainarrow] (mynorthnode)  -- (mycenternode);
draw [mainarrow] (mycenternode) -- node[anchor=west] {kuf} (mysouthnode);
draw [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode);
draw [arrow] (mycenternode) -- node[anchor=south] {olan} (myeastnode);


I wonder how to shorten that to something like



path [mainarrow] (mynorthnode)  -- (mycenternode) -- node[anchor=west]  {kuf}  (mysouthnode);
path [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode) -- node[anchor=south] {olan} (myeastnode);


EXTRA:
In the last few lines, you can discern a path. I don't really understand why it's not drawing anything.










share|improve this question














Instead of drawing each arrow separately, I am interested in a quicker way to draw arrows along a path in a flowchart.



Let's look at some code first, MWE:



documentclass{article}

usepackage[svgnames]{xcolor}
usepackage{pgf,tikz}
usetikzlibrary{chains,positioning,arrows,shapes.geometric,quotes,fit,calc}

tikzstyle{startstop} = [%
rectangle,
rounded corners,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
line width=1pt,
draw=DarkBlue,
fill=DarkBlue!30
]

tikzstyle{process} = [%
rectangle,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
draw=orange,
fill=orange!30
]

tikzstyle{arrow} = [%
thick,
->,
>=stealth,
]

tikzstyle{mainarrow} = [%
ultra thick,
->,
>=stealth,
]

begin{document}

begin{tikzpicture}
node (mycenternode) [startstop] {Isgrind};
node (mynorthnode) [process, above=of mycenternode] {Sami};
node (mysouthnode) [process, below=of mycenternode] {Romrike};
node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
node (myeastnode) [process, right=of mycenternode] {Lukinsola};

draw [mainarrow] (mynorthnode) -- (mycenternode);
draw [mainarrow] (mycenternode) -- node[anchor=west] {kuf} (mysouthnode);
draw [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode);
draw [arrow] (mycenternode) -- node[anchor=south] {olan} (myeastnode);

path [arrow] (mywestnode) |- node[anchor=south] {punrot} (mynorthnode) -| (myeastnode);
end{tikzpicture}

end{document}


Instead of having to say



    draw [mainarrow] (mynorthnode)  -- (mycenternode);
draw [mainarrow] (mycenternode) -- node[anchor=west] {kuf} (mysouthnode);
draw [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode);
draw [arrow] (mycenternode) -- node[anchor=south] {olan} (myeastnode);


I wonder how to shorten that to something like



path [mainarrow] (mynorthnode)  -- (mycenternode) -- node[anchor=west]  {kuf}  (mysouthnode);
path [arrow] (mywestnode) -- node[anchor=south] {ders} (mycenternode) -- node[anchor=south] {olan} (myeastnode);


EXTRA:
In the last few lines, you can discern a path. I don't really understand why it's not drawing anything.







tikz-pgf tikz-arrows






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 22 at 18:02









thymarothymaro

807523




807523













  • path and draw are two different things. path does not draw unless you say path[draw,...]. Also consider using tikzset{blabla/.style={...} instead of tikzstyle{blabla}=[...].

    – marmot
    Jan 22 at 18:07





















  • path and draw are two different things. path does not draw unless you say path[draw,...]. Also consider using tikzset{blabla/.style={...} instead of tikzstyle{blabla}=[...].

    – marmot
    Jan 22 at 18:07



















path and draw are two different things. path does not draw unless you say path[draw,...]. Also consider using tikzset{blabla/.style={...} instead of tikzstyle{blabla}=[...].

– marmot
Jan 22 at 18:07







path and draw are two different things. path does not draw unless you say path[draw,...]. Also consider using tikzset{blabla/.style={...} instead of tikzstyle{blabla}=[...].

– marmot
Jan 22 at 18:07












2 Answers
2






active

oldest

votes


















3














I think you are looking for the edge operation. You were already loading quotes (and several packages that you do not use), which allows you to attach the labels to the arrows with a shorter syntax. The relevant piece of your code can thus be condensed to



draw  (mynorthnode)  edge[mainarrow]  (mycenternode) 
(mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
(mywestnode) edge[arrow,"ders"] (mycenternode)
(mycenternode) edge[arrow,"olan"] (myeastnode);


Note that path alone does not draw. This is the reason why the lines do not appear. I added two styles for edges with corners, BR and BL, such that the path in the end can be drawn with edges as well,



draw [arrow] (mywestnode)  edge[BR,"punrot"] (mynorthnode)
(mynorthnode) edge[BL] (myeastnode);


This is the MWE with some unused libraries removed and tikzset instead of tikzstyle.



documentclass{article}

usepackage[svgnames]{xcolor}
usepackage{pgf,tikz}
usetikzlibrary{positioning,quotes}

tikzset{startstop/.style={
rectangle,
rounded corners,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
line width=1pt,
draw=DarkBlue,
fill=DarkBlue!30},
process/.style={%
rectangle,
% minimum width=3cm,
% max width=2cm,
minimum height=1cm,
text centered,
text width=2cm,
draw=orange,
fill=orange!30},
arrow/.style={%
thick,
->,
>=stealth,
},
mainarrow/.style={%
ultra thick,
->,
>=stealth,
},
BR/.style={ to path={|- (tikztotarget) tikztonodes}},
BL/.style={ to path={-| (tikztotarget) tikztonodes}}}

begin{document}

begin{tikzpicture}
node (mycenternode) [startstop] {Isgrind};
node (mynorthnode) [process, above=of mycenternode] {Sami};
node (mysouthnode) [process, below=of mycenternode] {Romrike};
node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
node (myeastnode) [process, right=of mycenternode] {Lukinsola};

draw (mynorthnode) edge[mainarrow] (mycenternode)
(mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
(mywestnode) edge[arrow,"ders"] (mycenternode)
(mycenternode) edge[arrow,"olan"] (myeastnode);

draw [arrow] (mywestnode) edge[BR,"punrot"] (mynorthnode)
(mynorthnode) edge[BL] (myeastnode);
end{tikzpicture}
end{document}


enter image description here






share|improve this answer

































    2














    You will only get one arrow tip when you use --, but if you use edge instead, you'll get an arrow tip for each segment, as edge inserts a separate path (I think). Anyways, you can actually make do with specifying the center node only once:



    path [mainarrow]  (mycenternode) edge[<-]                          (mynorthnode)
    edge node[right] {kuf} (mysouthnode)
    edge[arrow,<-] node[above] {ders} (mywestnode)
    edge[arrow] node[above] {olan} (myeastnode);





    share|improve this answer
























    • By using the quotes syntax marmot demonstrates in his answer, you can shorten this a bit more.

      – Torbjørn T.
      Jan 22 at 18:20











    • I must deduce, that, as soon as the diagram is not a cross any more, but a longer chain, I won't get around repeating the nodes in the chain. This being the case, I take from both of your answers that a chain without repetition of the nodes involved is not possible. Then marmot's answer becomes more in-depth.

      – thymaro
      Jan 22 at 22:08











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f471336%2farrows-along-path-in-tikz-flowchart%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    I think you are looking for the edge operation. You were already loading quotes (and several packages that you do not use), which allows you to attach the labels to the arrows with a shorter syntax. The relevant piece of your code can thus be condensed to



    draw  (mynorthnode)  edge[mainarrow]  (mycenternode) 
    (mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
    (mywestnode) edge[arrow,"ders"] (mycenternode)
    (mycenternode) edge[arrow,"olan"] (myeastnode);


    Note that path alone does not draw. This is the reason why the lines do not appear. I added two styles for edges with corners, BR and BL, such that the path in the end can be drawn with edges as well,



    draw [arrow] (mywestnode)  edge[BR,"punrot"] (mynorthnode)
    (mynorthnode) edge[BL] (myeastnode);


    This is the MWE with some unused libraries removed and tikzset instead of tikzstyle.



    documentclass{article}

    usepackage[svgnames]{xcolor}
    usepackage{pgf,tikz}
    usetikzlibrary{positioning,quotes}

    tikzset{startstop/.style={
    rectangle,
    rounded corners,
    % minimum width=3cm,
    % max width=2cm,
    minimum height=1cm,
    text centered,
    text width=2cm,
    line width=1pt,
    draw=DarkBlue,
    fill=DarkBlue!30},
    process/.style={%
    rectangle,
    % minimum width=3cm,
    % max width=2cm,
    minimum height=1cm,
    text centered,
    text width=2cm,
    draw=orange,
    fill=orange!30},
    arrow/.style={%
    thick,
    ->,
    >=stealth,
    },
    mainarrow/.style={%
    ultra thick,
    ->,
    >=stealth,
    },
    BR/.style={ to path={|- (tikztotarget) tikztonodes}},
    BL/.style={ to path={-| (tikztotarget) tikztonodes}}}

    begin{document}

    begin{tikzpicture}
    node (mycenternode) [startstop] {Isgrind};
    node (mynorthnode) [process, above=of mycenternode] {Sami};
    node (mysouthnode) [process, below=of mycenternode] {Romrike};
    node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
    node (myeastnode) [process, right=of mycenternode] {Lukinsola};

    draw (mynorthnode) edge[mainarrow] (mycenternode)
    (mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
    (mywestnode) edge[arrow,"ders"] (mycenternode)
    (mycenternode) edge[arrow,"olan"] (myeastnode);

    draw [arrow] (mywestnode) edge[BR,"punrot"] (mynorthnode)
    (mynorthnode) edge[BL] (myeastnode);
    end{tikzpicture}
    end{document}


    enter image description here






    share|improve this answer






























      3














      I think you are looking for the edge operation. You were already loading quotes (and several packages that you do not use), which allows you to attach the labels to the arrows with a shorter syntax. The relevant piece of your code can thus be condensed to



      draw  (mynorthnode)  edge[mainarrow]  (mycenternode) 
      (mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
      (mywestnode) edge[arrow,"ders"] (mycenternode)
      (mycenternode) edge[arrow,"olan"] (myeastnode);


      Note that path alone does not draw. This is the reason why the lines do not appear. I added two styles for edges with corners, BR and BL, such that the path in the end can be drawn with edges as well,



      draw [arrow] (mywestnode)  edge[BR,"punrot"] (mynorthnode)
      (mynorthnode) edge[BL] (myeastnode);


      This is the MWE with some unused libraries removed and tikzset instead of tikzstyle.



      documentclass{article}

      usepackage[svgnames]{xcolor}
      usepackage{pgf,tikz}
      usetikzlibrary{positioning,quotes}

      tikzset{startstop/.style={
      rectangle,
      rounded corners,
      % minimum width=3cm,
      % max width=2cm,
      minimum height=1cm,
      text centered,
      text width=2cm,
      line width=1pt,
      draw=DarkBlue,
      fill=DarkBlue!30},
      process/.style={%
      rectangle,
      % minimum width=3cm,
      % max width=2cm,
      minimum height=1cm,
      text centered,
      text width=2cm,
      draw=orange,
      fill=orange!30},
      arrow/.style={%
      thick,
      ->,
      >=stealth,
      },
      mainarrow/.style={%
      ultra thick,
      ->,
      >=stealth,
      },
      BR/.style={ to path={|- (tikztotarget) tikztonodes}},
      BL/.style={ to path={-| (tikztotarget) tikztonodes}}}

      begin{document}

      begin{tikzpicture}
      node (mycenternode) [startstop] {Isgrind};
      node (mynorthnode) [process, above=of mycenternode] {Sami};
      node (mysouthnode) [process, below=of mycenternode] {Romrike};
      node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
      node (myeastnode) [process, right=of mycenternode] {Lukinsola};

      draw (mynorthnode) edge[mainarrow] (mycenternode)
      (mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
      (mywestnode) edge[arrow,"ders"] (mycenternode)
      (mycenternode) edge[arrow,"olan"] (myeastnode);

      draw [arrow] (mywestnode) edge[BR,"punrot"] (mynorthnode)
      (mynorthnode) edge[BL] (myeastnode);
      end{tikzpicture}
      end{document}


      enter image description here






      share|improve this answer




























        3












        3








        3







        I think you are looking for the edge operation. You were already loading quotes (and several packages that you do not use), which allows you to attach the labels to the arrows with a shorter syntax. The relevant piece of your code can thus be condensed to



        draw  (mynorthnode)  edge[mainarrow]  (mycenternode) 
        (mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
        (mywestnode) edge[arrow,"ders"] (mycenternode)
        (mycenternode) edge[arrow,"olan"] (myeastnode);


        Note that path alone does not draw. This is the reason why the lines do not appear. I added two styles for edges with corners, BR and BL, such that the path in the end can be drawn with edges as well,



        draw [arrow] (mywestnode)  edge[BR,"punrot"] (mynorthnode)
        (mynorthnode) edge[BL] (myeastnode);


        This is the MWE with some unused libraries removed and tikzset instead of tikzstyle.



        documentclass{article}

        usepackage[svgnames]{xcolor}
        usepackage{pgf,tikz}
        usetikzlibrary{positioning,quotes}

        tikzset{startstop/.style={
        rectangle,
        rounded corners,
        % minimum width=3cm,
        % max width=2cm,
        minimum height=1cm,
        text centered,
        text width=2cm,
        line width=1pt,
        draw=DarkBlue,
        fill=DarkBlue!30},
        process/.style={%
        rectangle,
        % minimum width=3cm,
        % max width=2cm,
        minimum height=1cm,
        text centered,
        text width=2cm,
        draw=orange,
        fill=orange!30},
        arrow/.style={%
        thick,
        ->,
        >=stealth,
        },
        mainarrow/.style={%
        ultra thick,
        ->,
        >=stealth,
        },
        BR/.style={ to path={|- (tikztotarget) tikztonodes}},
        BL/.style={ to path={-| (tikztotarget) tikztonodes}}}

        begin{document}

        begin{tikzpicture}
        node (mycenternode) [startstop] {Isgrind};
        node (mynorthnode) [process, above=of mycenternode] {Sami};
        node (mysouthnode) [process, below=of mycenternode] {Romrike};
        node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
        node (myeastnode) [process, right=of mycenternode] {Lukinsola};

        draw (mynorthnode) edge[mainarrow] (mycenternode)
        (mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
        (mywestnode) edge[arrow,"ders"] (mycenternode)
        (mycenternode) edge[arrow,"olan"] (myeastnode);

        draw [arrow] (mywestnode) edge[BR,"punrot"] (mynorthnode)
        (mynorthnode) edge[BL] (myeastnode);
        end{tikzpicture}
        end{document}


        enter image description here






        share|improve this answer















        I think you are looking for the edge operation. You were already loading quotes (and several packages that you do not use), which allows you to attach the labels to the arrows with a shorter syntax. The relevant piece of your code can thus be condensed to



        draw  (mynorthnode)  edge[mainarrow]  (mycenternode) 
        (mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
        (mywestnode) edge[arrow,"ders"] (mycenternode)
        (mycenternode) edge[arrow,"olan"] (myeastnode);


        Note that path alone does not draw. This is the reason why the lines do not appear. I added two styles for edges with corners, BR and BL, such that the path in the end can be drawn with edges as well,



        draw [arrow] (mywestnode)  edge[BR,"punrot"] (mynorthnode)
        (mynorthnode) edge[BL] (myeastnode);


        This is the MWE with some unused libraries removed and tikzset instead of tikzstyle.



        documentclass{article}

        usepackage[svgnames]{xcolor}
        usepackage{pgf,tikz}
        usetikzlibrary{positioning,quotes}

        tikzset{startstop/.style={
        rectangle,
        rounded corners,
        % minimum width=3cm,
        % max width=2cm,
        minimum height=1cm,
        text centered,
        text width=2cm,
        line width=1pt,
        draw=DarkBlue,
        fill=DarkBlue!30},
        process/.style={%
        rectangle,
        % minimum width=3cm,
        % max width=2cm,
        minimum height=1cm,
        text centered,
        text width=2cm,
        draw=orange,
        fill=orange!30},
        arrow/.style={%
        thick,
        ->,
        >=stealth,
        },
        mainarrow/.style={%
        ultra thick,
        ->,
        >=stealth,
        },
        BR/.style={ to path={|- (tikztotarget) tikztonodes}},
        BL/.style={ to path={-| (tikztotarget) tikztonodes}}}

        begin{document}

        begin{tikzpicture}
        node (mycenternode) [startstop] {Isgrind};
        node (mynorthnode) [process, above=of mycenternode] {Sami};
        node (mysouthnode) [process, below=of mycenternode] {Romrike};
        node (mywestnode) [process, left=of mycenternode] {Rykinmaa};
        node (myeastnode) [process, right=of mycenternode] {Lukinsola};

        draw (mynorthnode) edge[mainarrow] (mycenternode)
        (mycenternode) edge[mainarrow,"kuf"] (mysouthnode)
        (mywestnode) edge[arrow,"ders"] (mycenternode)
        (mycenternode) edge[arrow,"olan"] (myeastnode);

        draw [arrow] (mywestnode) edge[BR,"punrot"] (mynorthnode)
        (mynorthnode) edge[BL] (myeastnode);
        end{tikzpicture}
        end{document}


        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 22 at 18:32

























        answered Jan 22 at 18:18









        marmotmarmot

        107k5130244




        107k5130244























            2














            You will only get one arrow tip when you use --, but if you use edge instead, you'll get an arrow tip for each segment, as edge inserts a separate path (I think). Anyways, you can actually make do with specifying the center node only once:



            path [mainarrow]  (mycenternode) edge[<-]                          (mynorthnode)
            edge node[right] {kuf} (mysouthnode)
            edge[arrow,<-] node[above] {ders} (mywestnode)
            edge[arrow] node[above] {olan} (myeastnode);





            share|improve this answer
























            • By using the quotes syntax marmot demonstrates in his answer, you can shorten this a bit more.

              – Torbjørn T.
              Jan 22 at 18:20











            • I must deduce, that, as soon as the diagram is not a cross any more, but a longer chain, I won't get around repeating the nodes in the chain. This being the case, I take from both of your answers that a chain without repetition of the nodes involved is not possible. Then marmot's answer becomes more in-depth.

              – thymaro
              Jan 22 at 22:08
















            2














            You will only get one arrow tip when you use --, but if you use edge instead, you'll get an arrow tip for each segment, as edge inserts a separate path (I think). Anyways, you can actually make do with specifying the center node only once:



            path [mainarrow]  (mycenternode) edge[<-]                          (mynorthnode)
            edge node[right] {kuf} (mysouthnode)
            edge[arrow,<-] node[above] {ders} (mywestnode)
            edge[arrow] node[above] {olan} (myeastnode);





            share|improve this answer
























            • By using the quotes syntax marmot demonstrates in his answer, you can shorten this a bit more.

              – Torbjørn T.
              Jan 22 at 18:20











            • I must deduce, that, as soon as the diagram is not a cross any more, but a longer chain, I won't get around repeating the nodes in the chain. This being the case, I take from both of your answers that a chain without repetition of the nodes involved is not possible. Then marmot's answer becomes more in-depth.

              – thymaro
              Jan 22 at 22:08














            2












            2








            2







            You will only get one arrow tip when you use --, but if you use edge instead, you'll get an arrow tip for each segment, as edge inserts a separate path (I think). Anyways, you can actually make do with specifying the center node only once:



            path [mainarrow]  (mycenternode) edge[<-]                          (mynorthnode)
            edge node[right] {kuf} (mysouthnode)
            edge[arrow,<-] node[above] {ders} (mywestnode)
            edge[arrow] node[above] {olan} (myeastnode);





            share|improve this answer













            You will only get one arrow tip when you use --, but if you use edge instead, you'll get an arrow tip for each segment, as edge inserts a separate path (I think). Anyways, you can actually make do with specifying the center node only once:



            path [mainarrow]  (mycenternode) edge[<-]                          (mynorthnode)
            edge node[right] {kuf} (mysouthnode)
            edge[arrow,<-] node[above] {ders} (mywestnode)
            edge[arrow] node[above] {olan} (myeastnode);






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 22 at 18:18









            Torbjørn T.Torbjørn T.

            158k13255444




            158k13255444













            • By using the quotes syntax marmot demonstrates in his answer, you can shorten this a bit more.

              – Torbjørn T.
              Jan 22 at 18:20











            • I must deduce, that, as soon as the diagram is not a cross any more, but a longer chain, I won't get around repeating the nodes in the chain. This being the case, I take from both of your answers that a chain without repetition of the nodes involved is not possible. Then marmot's answer becomes more in-depth.

              – thymaro
              Jan 22 at 22:08



















            • By using the quotes syntax marmot demonstrates in his answer, you can shorten this a bit more.

              – Torbjørn T.
              Jan 22 at 18:20











            • I must deduce, that, as soon as the diagram is not a cross any more, but a longer chain, I won't get around repeating the nodes in the chain. This being the case, I take from both of your answers that a chain without repetition of the nodes involved is not possible. Then marmot's answer becomes more in-depth.

              – thymaro
              Jan 22 at 22:08

















            By using the quotes syntax marmot demonstrates in his answer, you can shorten this a bit more.

            – Torbjørn T.
            Jan 22 at 18:20





            By using the quotes syntax marmot demonstrates in his answer, you can shorten this a bit more.

            – Torbjørn T.
            Jan 22 at 18:20













            I must deduce, that, as soon as the diagram is not a cross any more, but a longer chain, I won't get around repeating the nodes in the chain. This being the case, I take from both of your answers that a chain without repetition of the nodes involved is not possible. Then marmot's answer becomes more in-depth.

            – thymaro
            Jan 22 at 22:08





            I must deduce, that, as soon as the diagram is not a cross any more, but a longer chain, I won't get around repeating the nodes in the chain. This being the case, I take from both of your answers that a chain without repetition of the nodes involved is not possible. Then marmot's answer becomes more in-depth.

            – thymaro
            Jan 22 at 22:08


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f471336%2farrows-along-path-in-tikz-flowchart%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

            SQL update select statement

            'app-layout' is not a known element: how to share Component with different Modules