How to create a rectangle tikzstyle with arrows as edges/borders?
up vote
4
down vote
favorite
is it possible to create a new rectangle tikzstyle with arrows arround it? Like this...
Thank you
tikz-styles
New contributor
add a comment |
up vote
4
down vote
favorite
is it possible to create a new rectangle tikzstyle with arrows arround it? Like this...
Thank you
tikz-styles
New contributor
Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
– Stefan Pinnow
16 hours ago
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
is it possible to create a new rectangle tikzstyle with arrows arround it? Like this...
Thank you
tikz-styles
New contributor
is it possible to create a new rectangle tikzstyle with arrows arround it? Like this...
Thank you
tikz-styles
tikz-styles
New contributor
New contributor
New contributor
asked 17 hours ago
Pereira
232
232
New contributor
New contributor
Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
– Stefan Pinnow
16 hours ago
add a comment |
Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
– Stefan Pinnow
16 hours ago
Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
– Stefan Pinnow
16 hours ago
Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
– Stefan Pinnow
16 hours ago
add a comment |
3 Answers
3
active
oldest
votes
up vote
5
down vote
accepted
with append after command
you can define "new" box shape with arrow:
documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[
arrowsbox/.style = {text width=#1, align=center, inner sep=2mm,
append after command={pgfextra{letLNtikzlastnode
draw[thick, -Triangle, shorten >=2mm, shorten <=1mm]
(LN.north west) edge (LN.north east)
(LN.north east) edge (LN.south east)
(LN.south east) edge (LN.south west)
(LN.south west) to (LN.north west);}
}
}% end of arrowsbox style
]
node[arrowsbox=44mm] {some text\some text\[1ex] some test\some text};
end{tikzpicture}
end{document}
On p. 162 the pgfmanual says aboutpgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." Indeed, I have seen it gone wrong. So please try to write a solution that does not make use of it.
– marmot
17 hours ago
Dear @marmot, thank you very much for warning. So far i haven't any bad experiences with similar solutions. So i will be very glad if you show me (maybe in chat room), when in where i will be in trouble with my solution. this is good to know. btw, i know for warning in manual which you cite :-)
– Zarko
13 hours ago
Isn't this here an example of this sort?
– marmot
8 hours ago
@marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
– Zarko
8 hours ago
It really is not tied to rotations. Rather, it is a problem with pgfkeys. As you know, they are local and inherited by the full path. However, with your construction you precisely undermine the whole structure. To see what I mean, try e.g.node[arrowsbox=44mm,red] ...
. If that was an "ordinary" style, the arrows would turn red. With your style they don't. Yes, you can fix this by passing an argument to the arrows. However, this would make this style very different in behavior than any of the standard styles.
– marmot
8 hours ago
add a comment |
up vote
4
down vote
One way is to use arrows to draw around a rectangular node.
documentclass[border=3mm]{standalone}
usepackage{tikz}
usetikzlibrary{arrows}
tikzset{arw/.style={-triangle 60,line width=1pt,shorten <= 4pt}}
begin{document}
begin{tikzpicture}
node[text width=3cm,align=center,name=rect] at (0,0) {textbf{For each design} \ this.. \ $alpha=beta$};
draw[arw] (rect.south west) -- (rect.north west);
draw[arw] (rect.north west) -- (rect.north east);
draw[arw] (rect.north east) -- (rect.south east);
draw[arw] (rect.south east) -- (rect.south west);
end{tikzpicture}
end{document}
2
Your answer is OK, but I would create apic
with your arrowed rectangle, in order not to have to re-write all thedraw
s every time.
– CarLaTeX
17 hours ago
add a comment |
up vote
3
down vote
A node style arrowed
which uses path picture
to draw the arrows.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[arrowed/.style={inner sep=6pt,path picture={
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east)
-- ([xshift=-2pt,yshift=2pt]path picture bounding box.south east);
draw[-latex,#1] ([xshift=-2pt,yshift=2pt]path picture bounding box.south east)
-- ([xshift=2pt,yshift=2pt]path picture bounding box.south west);
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=2pt,yshift=2pt]path picture bounding box.south west)
-- ([xshift=2pt,yshift=-2pt]path picture bounding box.north west);
}}]
node[arrowed] at (0,0) {some text};
node[arrowed={thick,-stealth}] at (3,0) {some more text};
node[arrowed={thick,stealth-,shorten >=1pt}] at (6,0) {even more text};
node[anchor=north,arrowed={thick,-stealth,shorten >=1pt},inner sep=10pt,
align=center] at (3,-1)
{textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over
};
end{tikzpicture}
end{document}
Just for fun: a version of Zarko's answer but without pgfextra
. Why do I care about pgfextra
? Because on p. 162 the pgfmanual says about pgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." It is really easy to get rid of the pgfextra
. It is certainly not needed for append after command
.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[my arrow/.style={thick, -latex, shorten >=2mm,
shorten <=1mm},
arrowsbox/.style = { align=center, inner sep=2mm,
append after command={[every edge/.append style={my arrow,#1}]
(tikzlastnode.north west) edge (tikzlastnode.north east)
(tikzlastnode.north east) edge (tikzlastnode.south east)
(tikzlastnode.south east) edge (tikzlastnode.south west)
(tikzlastnode.south west) edge (tikzlastnode.north west)
}
}
]
node[arrowsbox={red},inner sep=10pt,blue] {textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over};
end{tikzpicture}
end{document}
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
with append after command
you can define "new" box shape with arrow:
documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[
arrowsbox/.style = {text width=#1, align=center, inner sep=2mm,
append after command={pgfextra{letLNtikzlastnode
draw[thick, -Triangle, shorten >=2mm, shorten <=1mm]
(LN.north west) edge (LN.north east)
(LN.north east) edge (LN.south east)
(LN.south east) edge (LN.south west)
(LN.south west) to (LN.north west);}
}
}% end of arrowsbox style
]
node[arrowsbox=44mm] {some text\some text\[1ex] some test\some text};
end{tikzpicture}
end{document}
On p. 162 the pgfmanual says aboutpgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." Indeed, I have seen it gone wrong. So please try to write a solution that does not make use of it.
– marmot
17 hours ago
Dear @marmot, thank you very much for warning. So far i haven't any bad experiences with similar solutions. So i will be very glad if you show me (maybe in chat room), when in where i will be in trouble with my solution. this is good to know. btw, i know for warning in manual which you cite :-)
– Zarko
13 hours ago
Isn't this here an example of this sort?
– marmot
8 hours ago
@marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
– Zarko
8 hours ago
It really is not tied to rotations. Rather, it is a problem with pgfkeys. As you know, they are local and inherited by the full path. However, with your construction you precisely undermine the whole structure. To see what I mean, try e.g.node[arrowsbox=44mm,red] ...
. If that was an "ordinary" style, the arrows would turn red. With your style they don't. Yes, you can fix this by passing an argument to the arrows. However, this would make this style very different in behavior than any of the standard styles.
– marmot
8 hours ago
add a comment |
up vote
5
down vote
accepted
with append after command
you can define "new" box shape with arrow:
documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[
arrowsbox/.style = {text width=#1, align=center, inner sep=2mm,
append after command={pgfextra{letLNtikzlastnode
draw[thick, -Triangle, shorten >=2mm, shorten <=1mm]
(LN.north west) edge (LN.north east)
(LN.north east) edge (LN.south east)
(LN.south east) edge (LN.south west)
(LN.south west) to (LN.north west);}
}
}% end of arrowsbox style
]
node[arrowsbox=44mm] {some text\some text\[1ex] some test\some text};
end{tikzpicture}
end{document}
On p. 162 the pgfmanual says aboutpgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." Indeed, I have seen it gone wrong. So please try to write a solution that does not make use of it.
– marmot
17 hours ago
Dear @marmot, thank you very much for warning. So far i haven't any bad experiences with similar solutions. So i will be very glad if you show me (maybe in chat room), when in where i will be in trouble with my solution. this is good to know. btw, i know for warning in manual which you cite :-)
– Zarko
13 hours ago
Isn't this here an example of this sort?
– marmot
8 hours ago
@marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
– Zarko
8 hours ago
It really is not tied to rotations. Rather, it is a problem with pgfkeys. As you know, they are local and inherited by the full path. However, with your construction you precisely undermine the whole structure. To see what I mean, try e.g.node[arrowsbox=44mm,red] ...
. If that was an "ordinary" style, the arrows would turn red. With your style they don't. Yes, you can fix this by passing an argument to the arrows. However, this would make this style very different in behavior than any of the standard styles.
– marmot
8 hours ago
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
with append after command
you can define "new" box shape with arrow:
documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[
arrowsbox/.style = {text width=#1, align=center, inner sep=2mm,
append after command={pgfextra{letLNtikzlastnode
draw[thick, -Triangle, shorten >=2mm, shorten <=1mm]
(LN.north west) edge (LN.north east)
(LN.north east) edge (LN.south east)
(LN.south east) edge (LN.south west)
(LN.south west) to (LN.north west);}
}
}% end of arrowsbox style
]
node[arrowsbox=44mm] {some text\some text\[1ex] some test\some text};
end{tikzpicture}
end{document}
with append after command
you can define "new" box shape with arrow:
documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[
arrowsbox/.style = {text width=#1, align=center, inner sep=2mm,
append after command={pgfextra{letLNtikzlastnode
draw[thick, -Triangle, shorten >=2mm, shorten <=1mm]
(LN.north west) edge (LN.north east)
(LN.north east) edge (LN.south east)
(LN.south east) edge (LN.south west)
(LN.south west) to (LN.north west);}
}
}% end of arrowsbox style
]
node[arrowsbox=44mm] {some text\some text\[1ex] some test\some text};
end{tikzpicture}
end{document}
edited 11 hours ago
answered 17 hours ago
Zarko
118k865155
118k865155
On p. 162 the pgfmanual says aboutpgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." Indeed, I have seen it gone wrong. So please try to write a solution that does not make use of it.
– marmot
17 hours ago
Dear @marmot, thank you very much for warning. So far i haven't any bad experiences with similar solutions. So i will be very glad if you show me (maybe in chat room), when in where i will be in trouble with my solution. this is good to know. btw, i know for warning in manual which you cite :-)
– Zarko
13 hours ago
Isn't this here an example of this sort?
– marmot
8 hours ago
@marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
– Zarko
8 hours ago
It really is not tied to rotations. Rather, it is a problem with pgfkeys. As you know, they are local and inherited by the full path. However, with your construction you precisely undermine the whole structure. To see what I mean, try e.g.node[arrowsbox=44mm,red] ...
. If that was an "ordinary" style, the arrows would turn red. With your style they don't. Yes, you can fix this by passing an argument to the arrows. However, this would make this style very different in behavior than any of the standard styles.
– marmot
8 hours ago
add a comment |
On p. 162 the pgfmanual says aboutpgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." Indeed, I have seen it gone wrong. So please try to write a solution that does not make use of it.
– marmot
17 hours ago
Dear @marmot, thank you very much for warning. So far i haven't any bad experiences with similar solutions. So i will be very glad if you show me (maybe in chat room), when in where i will be in trouble with my solution. this is good to know. btw, i know for warning in manual which you cite :-)
– Zarko
13 hours ago
Isn't this here an example of this sort?
– marmot
8 hours ago
@marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
– Zarko
8 hours ago
It really is not tied to rotations. Rather, it is a problem with pgfkeys. As you know, they are local and inherited by the full path. However, with your construction you precisely undermine the whole structure. To see what I mean, try e.g.node[arrowsbox=44mm,red] ...
. If that was an "ordinary" style, the arrows would turn red. With your style they don't. Yes, you can fix this by passing an argument to the arrows. However, this would make this style very different in behavior than any of the standard styles.
– marmot
8 hours ago
On p. 162 the pgfmanual says about
pgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." Indeed, I have seen it gone wrong. So please try to write a solution that does not make use of it.– marmot
17 hours ago
On p. 162 the pgfmanual says about
pgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." Indeed, I have seen it gone wrong. So please try to write a solution that does not make use of it.– marmot
17 hours ago
Dear @marmot, thank you very much for warning. So far i haven't any bad experiences with similar solutions. So i will be very glad if you show me (maybe in chat room), when in where i will be in trouble with my solution. this is good to know. btw, i know for warning in manual which you cite :-)
– Zarko
13 hours ago
Dear @marmot, thank you very much for warning. So far i haven't any bad experiences with similar solutions. So i will be very glad if you show me (maybe in chat room), when in where i will be in trouble with my solution. this is good to know. btw, i know for warning in manual which you cite :-)
– Zarko
13 hours ago
Isn't this here an example of this sort?
– marmot
8 hours ago
Isn't this here an example of this sort?
– marmot
8 hours ago
@marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
– Zarko
8 hours ago
@marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
– Zarko
8 hours ago
It really is not tied to rotations. Rather, it is a problem with pgfkeys. As you know, they are local and inherited by the full path. However, with your construction you precisely undermine the whole structure. To see what I mean, try e.g.
node[arrowsbox=44mm,red] ...
. If that was an "ordinary" style, the arrows would turn red. With your style they don't. Yes, you can fix this by passing an argument to the arrows. However, this would make this style very different in behavior than any of the standard styles.– marmot
8 hours ago
It really is not tied to rotations. Rather, it is a problem with pgfkeys. As you know, they are local and inherited by the full path. However, with your construction you precisely undermine the whole structure. To see what I mean, try e.g.
node[arrowsbox=44mm,red] ...
. If that was an "ordinary" style, the arrows would turn red. With your style they don't. Yes, you can fix this by passing an argument to the arrows. However, this would make this style very different in behavior than any of the standard styles.– marmot
8 hours ago
add a comment |
up vote
4
down vote
One way is to use arrows to draw around a rectangular node.
documentclass[border=3mm]{standalone}
usepackage{tikz}
usetikzlibrary{arrows}
tikzset{arw/.style={-triangle 60,line width=1pt,shorten <= 4pt}}
begin{document}
begin{tikzpicture}
node[text width=3cm,align=center,name=rect] at (0,0) {textbf{For each design} \ this.. \ $alpha=beta$};
draw[arw] (rect.south west) -- (rect.north west);
draw[arw] (rect.north west) -- (rect.north east);
draw[arw] (rect.north east) -- (rect.south east);
draw[arw] (rect.south east) -- (rect.south west);
end{tikzpicture}
end{document}
2
Your answer is OK, but I would create apic
with your arrowed rectangle, in order not to have to re-write all thedraw
s every time.
– CarLaTeX
17 hours ago
add a comment |
up vote
4
down vote
One way is to use arrows to draw around a rectangular node.
documentclass[border=3mm]{standalone}
usepackage{tikz}
usetikzlibrary{arrows}
tikzset{arw/.style={-triangle 60,line width=1pt,shorten <= 4pt}}
begin{document}
begin{tikzpicture}
node[text width=3cm,align=center,name=rect] at (0,0) {textbf{For each design} \ this.. \ $alpha=beta$};
draw[arw] (rect.south west) -- (rect.north west);
draw[arw] (rect.north west) -- (rect.north east);
draw[arw] (rect.north east) -- (rect.south east);
draw[arw] (rect.south east) -- (rect.south west);
end{tikzpicture}
end{document}
2
Your answer is OK, but I would create apic
with your arrowed rectangle, in order not to have to re-write all thedraw
s every time.
– CarLaTeX
17 hours ago
add a comment |
up vote
4
down vote
up vote
4
down vote
One way is to use arrows to draw around a rectangular node.
documentclass[border=3mm]{standalone}
usepackage{tikz}
usetikzlibrary{arrows}
tikzset{arw/.style={-triangle 60,line width=1pt,shorten <= 4pt}}
begin{document}
begin{tikzpicture}
node[text width=3cm,align=center,name=rect] at (0,0) {textbf{For each design} \ this.. \ $alpha=beta$};
draw[arw] (rect.south west) -- (rect.north west);
draw[arw] (rect.north west) -- (rect.north east);
draw[arw] (rect.north east) -- (rect.south east);
draw[arw] (rect.south east) -- (rect.south west);
end{tikzpicture}
end{document}
One way is to use arrows to draw around a rectangular node.
documentclass[border=3mm]{standalone}
usepackage{tikz}
usetikzlibrary{arrows}
tikzset{arw/.style={-triangle 60,line width=1pt,shorten <= 4pt}}
begin{document}
begin{tikzpicture}
node[text width=3cm,align=center,name=rect] at (0,0) {textbf{For each design} \ this.. \ $alpha=beta$};
draw[arw] (rect.south west) -- (rect.north west);
draw[arw] (rect.north west) -- (rect.north east);
draw[arw] (rect.north east) -- (rect.south east);
draw[arw] (rect.south east) -- (rect.south west);
end{tikzpicture}
end{document}
answered 17 hours ago
nidhin
2,669926
2,669926
2
Your answer is OK, but I would create apic
with your arrowed rectangle, in order not to have to re-write all thedraw
s every time.
– CarLaTeX
17 hours ago
add a comment |
2
Your answer is OK, but I would create apic
with your arrowed rectangle, in order not to have to re-write all thedraw
s every time.
– CarLaTeX
17 hours ago
2
2
Your answer is OK, but I would create a
pic
with your arrowed rectangle, in order not to have to re-write all the draw
s every time.– CarLaTeX
17 hours ago
Your answer is OK, but I would create a
pic
with your arrowed rectangle, in order not to have to re-write all the draw
s every time.– CarLaTeX
17 hours ago
add a comment |
up vote
3
down vote
A node style arrowed
which uses path picture
to draw the arrows.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[arrowed/.style={inner sep=6pt,path picture={
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east)
-- ([xshift=-2pt,yshift=2pt]path picture bounding box.south east);
draw[-latex,#1] ([xshift=-2pt,yshift=2pt]path picture bounding box.south east)
-- ([xshift=2pt,yshift=2pt]path picture bounding box.south west);
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=2pt,yshift=2pt]path picture bounding box.south west)
-- ([xshift=2pt,yshift=-2pt]path picture bounding box.north west);
}}]
node[arrowed] at (0,0) {some text};
node[arrowed={thick,-stealth}] at (3,0) {some more text};
node[arrowed={thick,stealth-,shorten >=1pt}] at (6,0) {even more text};
node[anchor=north,arrowed={thick,-stealth,shorten >=1pt},inner sep=10pt,
align=center] at (3,-1)
{textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over
};
end{tikzpicture}
end{document}
Just for fun: a version of Zarko's answer but without pgfextra
. Why do I care about pgfextra
? Because on p. 162 the pgfmanual says about pgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." It is really easy to get rid of the pgfextra
. It is certainly not needed for append after command
.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[my arrow/.style={thick, -latex, shorten >=2mm,
shorten <=1mm},
arrowsbox/.style = { align=center, inner sep=2mm,
append after command={[every edge/.append style={my arrow,#1}]
(tikzlastnode.north west) edge (tikzlastnode.north east)
(tikzlastnode.north east) edge (tikzlastnode.south east)
(tikzlastnode.south east) edge (tikzlastnode.south west)
(tikzlastnode.south west) edge (tikzlastnode.north west)
}
}
]
node[arrowsbox={red},inner sep=10pt,blue] {textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over};
end{tikzpicture}
end{document}
add a comment |
up vote
3
down vote
A node style arrowed
which uses path picture
to draw the arrows.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[arrowed/.style={inner sep=6pt,path picture={
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east)
-- ([xshift=-2pt,yshift=2pt]path picture bounding box.south east);
draw[-latex,#1] ([xshift=-2pt,yshift=2pt]path picture bounding box.south east)
-- ([xshift=2pt,yshift=2pt]path picture bounding box.south west);
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=2pt,yshift=2pt]path picture bounding box.south west)
-- ([xshift=2pt,yshift=-2pt]path picture bounding box.north west);
}}]
node[arrowed] at (0,0) {some text};
node[arrowed={thick,-stealth}] at (3,0) {some more text};
node[arrowed={thick,stealth-,shorten >=1pt}] at (6,0) {even more text};
node[anchor=north,arrowed={thick,-stealth,shorten >=1pt},inner sep=10pt,
align=center] at (3,-1)
{textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over
};
end{tikzpicture}
end{document}
Just for fun: a version of Zarko's answer but without pgfextra
. Why do I care about pgfextra
? Because on p. 162 the pgfmanual says about pgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." It is really easy to get rid of the pgfextra
. It is certainly not needed for append after command
.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[my arrow/.style={thick, -latex, shorten >=2mm,
shorten <=1mm},
arrowsbox/.style = { align=center, inner sep=2mm,
append after command={[every edge/.append style={my arrow,#1}]
(tikzlastnode.north west) edge (tikzlastnode.north east)
(tikzlastnode.north east) edge (tikzlastnode.south east)
(tikzlastnode.south east) edge (tikzlastnode.south west)
(tikzlastnode.south west) edge (tikzlastnode.north west)
}
}
]
node[arrowsbox={red},inner sep=10pt,blue] {textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over};
end{tikzpicture}
end{document}
add a comment |
up vote
3
down vote
up vote
3
down vote
A node style arrowed
which uses path picture
to draw the arrows.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[arrowed/.style={inner sep=6pt,path picture={
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east)
-- ([xshift=-2pt,yshift=2pt]path picture bounding box.south east);
draw[-latex,#1] ([xshift=-2pt,yshift=2pt]path picture bounding box.south east)
-- ([xshift=2pt,yshift=2pt]path picture bounding box.south west);
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=2pt,yshift=2pt]path picture bounding box.south west)
-- ([xshift=2pt,yshift=-2pt]path picture bounding box.north west);
}}]
node[arrowed] at (0,0) {some text};
node[arrowed={thick,-stealth}] at (3,0) {some more text};
node[arrowed={thick,stealth-,shorten >=1pt}] at (6,0) {even more text};
node[anchor=north,arrowed={thick,-stealth,shorten >=1pt},inner sep=10pt,
align=center] at (3,-1)
{textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over
};
end{tikzpicture}
end{document}
Just for fun: a version of Zarko's answer but without pgfextra
. Why do I care about pgfextra
? Because on p. 162 the pgfmanual says about pgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." It is really easy to get rid of the pgfextra
. It is certainly not needed for append after command
.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[my arrow/.style={thick, -latex, shorten >=2mm,
shorten <=1mm},
arrowsbox/.style = { align=center, inner sep=2mm,
append after command={[every edge/.append style={my arrow,#1}]
(tikzlastnode.north west) edge (tikzlastnode.north east)
(tikzlastnode.north east) edge (tikzlastnode.south east)
(tikzlastnode.south east) edge (tikzlastnode.south west)
(tikzlastnode.south west) edge (tikzlastnode.north west)
}
}
]
node[arrowsbox={red},inner sep=10pt,blue] {textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over};
end{tikzpicture}
end{document}
A node style arrowed
which uses path picture
to draw the arrows.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[arrowed/.style={inner sep=6pt,path picture={
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east)
-- ([xshift=-2pt,yshift=2pt]path picture bounding box.south east);
draw[-latex,#1] ([xshift=-2pt,yshift=2pt]path picture bounding box.south east)
-- ([xshift=2pt,yshift=2pt]path picture bounding box.south west);
draw[-latex,#1] ([xshift=2pt,yshift=-2pt]path picture bounding box.north west)
-- ([xshift=-2pt,yshift=-2pt]path picture bounding box.north east);
draw[-latex,#1] ([xshift=2pt,yshift=2pt]path picture bounding box.south west)
-- ([xshift=2pt,yshift=-2pt]path picture bounding box.north west);
}}]
node[arrowed] at (0,0) {some text};
node[arrowed={thick,-stealth}] at (3,0) {some more text};
node[arrowed={thick,stealth-,shorten >=1pt}] at (6,0) {even more text};
node[anchor=north,arrowed={thick,-stealth,shorten >=1pt},inner sep=10pt,
align=center] at (3,-1)
{textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over
};
end{tikzpicture}
end{document}
Just for fun: a version of Zarko's answer but without pgfextra
. Why do I care about pgfextra
? Because on p. 162 the pgfmanual says about pgfextra
: "Note that this operation should only be used by real experts and should only be used deep inside clever macros, not on normal paths." It is really easy to get rid of the pgfextra
. It is certainly not needed for append after command
.
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[my arrow/.style={thick, -latex, shorten >=2mm,
shorten <=1mm},
arrowsbox/.style = { align=center, inner sep=2mm,
append after command={[every edge/.append style={my arrow,#1}]
(tikzlastnode.north west) edge (tikzlastnode.north east)
(tikzlastnode.north east) edge (tikzlastnode.south east)
(tikzlastnode.south east) edge (tikzlastnode.south west)
(tikzlastnode.south west) edge (tikzlastnode.north west)
}
}
]
node[arrowsbox={red},inner sep=10pt,blue] {textbf{emph{For each design choice:}}\[2mm]
1 -- do something\ really cool and\ smart\[1mm]
2 -- make sure that\ hibernation time\ is over};
end{tikzpicture}
end{document}
edited 7 hours ago
answered 17 hours ago
marmot
81.8k491174
81.8k491174
add a comment |
add a comment |
Pereira is a new contributor. Be nice, and check out our Code of Conduct.
Pereira is a new contributor. Be nice, and check out our Code of Conduct.
Pereira is a new contributor. Be nice, and check out our Code of Conduct.
Pereira is a new contributor. Be nice, and check out our Code of Conduct.
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f463935%2fhow-to-create-a-rectangle-tikzstyle-with-arrows-as-edges-borders%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
Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
– Stefan Pinnow
16 hours ago