How to create a rectangle tikzstyle with arrows as edges/borders?












4














is it possible to create a new rectangle tikzstyle with arrows arround it? Like this...



enter image description here



Thank you










share|improve this question






















  • 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
    Dec 9 at 14:32
















4














is it possible to create a new rectangle tikzstyle with arrows arround it? Like this...



enter image description here



Thank you










share|improve this question






















  • 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
    Dec 9 at 14:32














4












4








4


0





is it possible to create a new rectangle tikzstyle with arrows arround it? Like this...



enter image description here



Thank you










share|improve this question













is it possible to create a new rectangle tikzstyle with arrows arround it? Like this...



enter image description here



Thank you







tikz-styles






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 9 at 13:29









Pereira

232




232












  • 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
    Dec 9 at 14:32


















  • 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
    Dec 9 at 14:32
















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
Dec 9 at 14:32




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
Dec 9 at 14:32










3 Answers
3






active

oldest

votes


















5














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}


enter image description here






share|improve this answer























  • 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
    Dec 9 at 14:01










  • 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
    Dec 9 at 18:14












  • Isn't this here an example of this sort?
    – marmot
    Dec 9 at 22:46










  • @marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
    – Zarko
    Dec 9 at 22:51










  • 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
    Dec 9 at 22:57





















4














One way is to use arrows to draw around a rectangular node.



enter image description here



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}





share|improve this answer

















  • 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 draws every time.
    – CarLaTeX
    Dec 9 at 13:52



















3














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}


enter image description here



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}


enter image description here






share|improve this answer























    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%2f463935%2fhow-to-create-a-rectangle-tikzstyle-with-arrows-as-edges-borders%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5














    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}


    enter image description here






    share|improve this answer























    • 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
      Dec 9 at 14:01










    • 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
      Dec 9 at 18:14












    • Isn't this here an example of this sort?
      – marmot
      Dec 9 at 22:46










    • @marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
      – Zarko
      Dec 9 at 22:51










    • 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
      Dec 9 at 22:57


















    5














    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}


    enter image description here






    share|improve this answer























    • 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
      Dec 9 at 14:01










    • 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
      Dec 9 at 18:14












    • Isn't this here an example of this sort?
      – marmot
      Dec 9 at 22:46










    • @marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
      – Zarko
      Dec 9 at 22:51










    • 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
      Dec 9 at 22:57
















    5












    5








    5






    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}


    enter image description here






    share|improve this answer














    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}


    enter image description here







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 9 at 20:06

























    answered Dec 9 at 13:53









    Zarko

    120k865156




    120k865156












    • 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
      Dec 9 at 14:01










    • 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
      Dec 9 at 18:14












    • Isn't this here an example of this sort?
      – marmot
      Dec 9 at 22:46










    • @marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
      – Zarko
      Dec 9 at 22:51










    • 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
      Dec 9 at 22:57




















    • 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
      Dec 9 at 14:01










    • 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
      Dec 9 at 18:14












    • Isn't this here an example of this sort?
      – marmot
      Dec 9 at 22:46










    • @marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
      – Zarko
      Dec 9 at 22:51










    • 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
      Dec 9 at 22:57


















    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
    Dec 9 at 14:01




    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
    Dec 9 at 14:01












    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
    Dec 9 at 18:14






    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
    Dec 9 at 18:14














    Isn't this here an example of this sort?
    – marmot
    Dec 9 at 22:46




    Isn't this here an example of this sort?
    – marmot
    Dec 9 at 22:46












    @marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
    – Zarko
    Dec 9 at 22:51




    @marmot, thank you very much. but in this particular case there is no rotating (around of center of node). hopefully ...
    – Zarko
    Dec 9 at 22:51












    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
    Dec 9 at 22:57






    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
    Dec 9 at 22:57













    4














    One way is to use arrows to draw around a rectangular node.



    enter image description here



    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}





    share|improve this answer

















    • 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 draws every time.
      – CarLaTeX
      Dec 9 at 13:52
















    4














    One way is to use arrows to draw around a rectangular node.



    enter image description here



    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}





    share|improve this answer

















    • 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 draws every time.
      – CarLaTeX
      Dec 9 at 13:52














    4












    4








    4






    One way is to use arrows to draw around a rectangular node.



    enter image description here



    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}





    share|improve this answer












    One way is to use arrows to draw around a rectangular node.



    enter image description here



    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}






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 9 at 13:48









    nidhin

    3,342927




    3,342927








    • 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 draws every time.
      – CarLaTeX
      Dec 9 at 13:52














    • 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 draws every time.
      – CarLaTeX
      Dec 9 at 13:52








    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 draws every time.
    – CarLaTeX
    Dec 9 at 13:52




    Your answer is OK, but I would create a pic with your arrowed rectangle, in order not to have to re-write all the draws every time.
    – CarLaTeX
    Dec 9 at 13:52











    3














    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}


    enter image description here



    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}


    enter image description here






    share|improve this answer




























      3














      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}


      enter image description here



      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}


      enter image description here






      share|improve this answer


























        3












        3








        3






        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}


        enter image description here



        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}


        enter image description here






        share|improve this answer














        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}


        enter image description here



        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}


        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 9 at 23:45

























        answered Dec 9 at 14:09









        marmot

        86.6k499185




        86.6k499185






























            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.





            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.




            draft saved


            draft discarded














            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





















































            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

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents