Arrows along path in TikZ flowchart
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
add a comment |
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
path
anddraw
are two different things.path
does not draw unless you saypath[draw,...]
. Also consider usingtikzset{blabla/.style={...}
instead oftikzstyle{blabla}=[...]
.
– marmot
Jan 22 at 18:07
add a comment |
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
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
tikz-pgf tikz-arrows
asked Jan 22 at 18:02
thymarothymaro
802523
802523
path
anddraw
are two different things.path
does not draw unless you saypath[draw,...]
. Also consider usingtikzset{blabla/.style={...}
instead oftikzstyle{blabla}=[...]
.
– marmot
Jan 22 at 18:07
add a comment |
path
anddraw
are two different things.path
does not draw unless you saypath[draw,...]
. Also consider usingtikzset{blabla/.style={...}
instead oftikzstyle{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
add a comment |
2 Answers
2
active
oldest
votes
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}
add a comment |
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);
By using thequotes
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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}
add a comment |
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}
add a comment |
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}
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}
edited Jan 22 at 18:32
answered Jan 22 at 18:18
marmotmarmot
102k4121231
102k4121231
add a comment |
add a comment |
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);
By using thequotes
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
add a comment |
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);
By using thequotes
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
add a comment |
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);
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);
answered Jan 22 at 18:18
Torbjørn T.Torbjørn T.
157k13253442
157k13253442
By using thequotes
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
add a comment |
By using thequotes
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
path
anddraw
are two different things.path
does not draw unless you saypath[draw,...]
. Also consider usingtikzset{blabla/.style={...}
instead oftikzstyle{blabla}=[...]
.– marmot
Jan 22 at 18:07