How to add multiple differently colored borders around a node?LaTeX equivalent of ConTeXt buffersTikZ:...

Where is this triangular-shaped space station from?

How to roast potatoes in the oven to make them crispy?

ip vs ifconfig commands pros and cons

Do authors have to be politically correct in article-writing?

LTSpice: When running a linear AC simulation, how to view the voltage ratio between two voltages?

When does coming up with an idea constitute sufficient contribution for authorship?

Two functions in the same line

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Does this pattern of summing polygonal numbers to get a square repeat indefinitely?

Is my plan for fixing my water heater leak bad?

Overfitting and Underfitting

How should I state my MS degree in my CV when it was in practice a joint-program?

Why is this code uniquely decodable?

Which branches of mathematics can be done just in terms of morphisms and composition?

Why zero tolerance on nudity in space?

Am I using the wrong word all along?

Am I a Rude Number?

Is 45 min enough time to catch my next flight

Activating a Alphanet Faucet Wallet Remotely (without tezos-client)

How to push a box with physics engine by another object?

Find the number of ways to express 1050 as sum of consecutive integers

Why can I easily sing or whistle a tune I've just heard, but not as easily reproduce it on an instrument?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

What to do when being responsible for data protection in your lab, yet advice is ignored?



How to add multiple differently colored borders around a node?


LaTeX equivalent of ConTeXt buffersTikZ: Cropping the Bounding BoxRotate a node but not its content: the case of the ellipse decorationTikZ, node with multiple lines aroundHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionLine up nested tikz enviroments or how to get rid of themProblems with nested TikZpictures













6















I want to draw a node to be filled with a table containing data, and it should have (three) differently colored adjacent borders around it. Couldn't find anything in the PGF manual, on the Net, nor on this forum, so I came up with this MWE...



Nesting three tikzpicture environments feels like a BIG amateuristic kludge to me, and if not, how do I get rid of the white space in between the borders?



documentclass[pdftex,dutch]{article}
usepackage{babel}
usepackage{tikz}

begin{document}

definecolor{lichtgrijs}{RGB}{232,232,232}
definecolor{DE.rood}{RGB}{222,0,0}
definecolor{DE.geel}{RGB}{255,207,0}

begin{tikzpicture}
node[rectangle,line width=0.5mm,draw=black] at (0,0)
{begin{tikzpicture}
node[rectangle,line width=0.5mm,draw=DE.rood] at (0,0)
{begin{tikzpicture}
node[rectangle,line width=0.5mm,draw=DE.geel,fill=lichtgrijs] at (0,0) {Vliegtuig};
end{tikzpicture}};
end{tikzpicture}};
end{tikzpicture}

end{document}


My kludge










share|improve this question



























    6















    I want to draw a node to be filled with a table containing data, and it should have (three) differently colored adjacent borders around it. Couldn't find anything in the PGF manual, on the Net, nor on this forum, so I came up with this MWE...



    Nesting three tikzpicture environments feels like a BIG amateuristic kludge to me, and if not, how do I get rid of the white space in between the borders?



    documentclass[pdftex,dutch]{article}
    usepackage{babel}
    usepackage{tikz}

    begin{document}

    definecolor{lichtgrijs}{RGB}{232,232,232}
    definecolor{DE.rood}{RGB}{222,0,0}
    definecolor{DE.geel}{RGB}{255,207,0}

    begin{tikzpicture}
    node[rectangle,line width=0.5mm,draw=black] at (0,0)
    {begin{tikzpicture}
    node[rectangle,line width=0.5mm,draw=DE.rood] at (0,0)
    {begin{tikzpicture}
    node[rectangle,line width=0.5mm,draw=DE.geel,fill=lichtgrijs] at (0,0) {Vliegtuig};
    end{tikzpicture}};
    end{tikzpicture}};
    end{tikzpicture}

    end{document}


    My kludge










    share|improve this question

























      6












      6








      6


      1






      I want to draw a node to be filled with a table containing data, and it should have (three) differently colored adjacent borders around it. Couldn't find anything in the PGF manual, on the Net, nor on this forum, so I came up with this MWE...



      Nesting three tikzpicture environments feels like a BIG amateuristic kludge to me, and if not, how do I get rid of the white space in between the borders?



      documentclass[pdftex,dutch]{article}
      usepackage{babel}
      usepackage{tikz}

      begin{document}

      definecolor{lichtgrijs}{RGB}{232,232,232}
      definecolor{DE.rood}{RGB}{222,0,0}
      definecolor{DE.geel}{RGB}{255,207,0}

      begin{tikzpicture}
      node[rectangle,line width=0.5mm,draw=black] at (0,0)
      {begin{tikzpicture}
      node[rectangle,line width=0.5mm,draw=DE.rood] at (0,0)
      {begin{tikzpicture}
      node[rectangle,line width=0.5mm,draw=DE.geel,fill=lichtgrijs] at (0,0) {Vliegtuig};
      end{tikzpicture}};
      end{tikzpicture}};
      end{tikzpicture}

      end{document}


      My kludge










      share|improve this question














      I want to draw a node to be filled with a table containing data, and it should have (three) differently colored adjacent borders around it. Couldn't find anything in the PGF manual, on the Net, nor on this forum, so I came up with this MWE...



      Nesting three tikzpicture environments feels like a BIG amateuristic kludge to me, and if not, how do I get rid of the white space in between the borders?



      documentclass[pdftex,dutch]{article}
      usepackage{babel}
      usepackage{tikz}

      begin{document}

      definecolor{lichtgrijs}{RGB}{232,232,232}
      definecolor{DE.rood}{RGB}{222,0,0}
      definecolor{DE.geel}{RGB}{255,207,0}

      begin{tikzpicture}
      node[rectangle,line width=0.5mm,draw=black] at (0,0)
      {begin{tikzpicture}
      node[rectangle,line width=0.5mm,draw=DE.rood] at (0,0)
      {begin{tikzpicture}
      node[rectangle,line width=0.5mm,draw=DE.geel,fill=lichtgrijs] at (0,0) {Vliegtuig};
      end{tikzpicture}};
      end{tikzpicture}};
      end{tikzpicture}

      end{document}


      My kludge







      tikz-pgf nodes border






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 3 hours ago









      Petoetje59Petoetje59

      4391615




      4391615






















          4 Answers
          4






          active

          oldest

          votes


















          8














          Like this?



          enter image description here



          documentclass[dutch]{article}
          usepackage{babel}
          usepackage{tikz}
          usetikzlibrary{fit}

          definecolor{lichtgrijs}{RGB}{232,232,232}
          definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
          definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

          begin{document}
          begin{tikzpicture}[
          box/.style = {draw=#1, line width=0.5mm,inner sep=0.25mm}
          ]
          node (n1) [box=DE.geel,
          fill=lichtgrijs, inner sep=2mm] at (0,0) {Vliegtuig};
          node (n2) [box=DE.rood, fit=(n1)] {};
          node (n3) [box=black, fit=(n2)] {};
          end{tikzpicture}
          end{document}


          Some Notes:




          • never nest tikzpicture in tikzpicture, which may raise unexpected side effects;

          • the fit library of tikz is used to get what you want;

          • you can define node style, which merges all nodes in one, but I'd like first to know whether the illustrated result is what you're looking for :-)


          addendum:
          here is a three-color node variation. In particular, append after command= option in a node style is used for the middle and the outer colors:



          documentclass[dutch]{article}
          usepackage{babel}
          usepackage{tikz}
          usetikzlibrary{fit}

          definecolor{lichtgrijs}{RGB}{232,232,232}
          definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
          definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

          begin{document}

          begin{tikzpicture}[
          tcb/.style = {% tree color box
          draw=DE.geel, fill=lichtgrijs,
          line width=0.5mm,inner sep=2mm,
          append after command={pgfextra{letLNtikzlastnode
          node [draw=DE.rood, line width=0.5mm,
          inner sep=0.25mm,fit=(LN)] {};
          node [draw, line width=0.5mm,
          inner sep=0.75mm,fit=(LN)] {};
          }}}
          ]
          node (n1) [tcb] {Vliegtuig};
          end{tikzpicture}
          end{document}


          The result is the same as before.






          share|improve this answer


























          • Yep, that's it! What an incredibly fast reply...

            – Petoetje59
            3 hours ago






          • 2





            @Roboticist, thank you very much!

            – Zarko
            1 hour ago






          • 1





            @Zarko: Any time, Sir! ;)

            – Roboticist
            1 hour ago





















          5














          Just for fun:



          documentclass{standalone}% to avoid cropping
          usepackage{babel}% not needed for MWE
          usepackage{tikz}
          usetikzlibrary{calc}

          definecolor{lichtgrijs}{RGB}{232,232,232}
          definecolor{DE.rood}{RGB}{222,0,0}
          definecolor{DE.geel}{RGB}{255,207,0}

          begin{document}
          begin{tikzpicture}
          begin{scope}[line width=0.5mm]
          node[draw=black,inner sep = 1.5mm] (n1) at (0,0) {Vliegtuig};
          draw[DE.rood] ($(n1.south west)+(0.75mm,0.75mm)$) rectangle ($(n1.north east)+(-0.75mm,-0.75mm)$);
          draw[DE.geel] ($(n1.south west)+(1.25mm,1.25mm)$) rectangle ($(n1.north east)+(-1.25mm,-1.25mm)$);
          end{scope}
          end{tikzpicture}
          end{document}


          demo






          share|improve this answer
























          • Did you use another text font? P.S. Good job!

            – manooooh
            43 mins ago



















          5














          Without TikZ, only colorboxes:



          documentclass[pdftex,dutch]{article}
          usepackage{babel}
          usepackage{xcolor}

          definecolor{lichtgrijs}{RGB}{232,232,232}
          definecolor{DE.rood}{RGB}{222,0,0}
          definecolor{DE.geel}{RGB}{255,207,0}

          begin{document}

          colorbox{black}{%
          colorbox{DE.rood}{%
          colorbox{DE.geel}{%
          colorbox{lichtgrijs}{Vliegtuig}}}}

          end{document}


          enter image description here






          share|improve this answer
























          • Would've been the best solution... but unfortunately there appears to be no option to set the border width.

            – Petoetje59
            1 hour ago






          • 1





            @Petoetje59 You can set the dimensions of the colorboxes. But I have no time now, I'll update my answer asap.

            – CarLaTeX
            1 hour ago





















          0














          You do not need a library for that, and you can make things much more automatic by just supplying the list of colors. Then it boils down to saying



          node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};


          This strategy can be applied to other node shapes, too, if needed.



          Here is the code.



          documentclass[pdftex,dutch]{article}
          usepackage{babel}
          usepackage{tikz}

          begin{document}

          definecolor{lichtgrijs}{RGB}{232,232,232}
          definecolor{DE.rood}{RGB}{222,0,0}
          definecolor{DE.geel}{RGB}{255,207,0}

          begin{tikzpicture}[multicolor rectangle/.style={draw,path picture={
          foreach CPP [count=YPP] in {#1}
          {draw[CPP] ([xshift=YPP*pgflinewidth,yshift=YPP*pgflinewidth]path picture bounding box.south west)
          rectangle ([xshift=-YPP*pgflinewidth,yshift=-YPP*pgflinewidth]path picture bounding box.north east); }}}]
          node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};
          end{tikzpicture}

          end{document}


          enter image description here



          In case it bugs you that you have to set the inner sep by hand, this can be taken care of at the expense of a slightly longer code.






          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%2f477589%2fhow-to-add-multiple-differently-colored-borders-around-a-node%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            8














            Like this?



            enter image description here



            documentclass[dutch]{article}
            usepackage{babel}
            usepackage{tikz}
            usetikzlibrary{fit}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
            definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

            begin{document}
            begin{tikzpicture}[
            box/.style = {draw=#1, line width=0.5mm,inner sep=0.25mm}
            ]
            node (n1) [box=DE.geel,
            fill=lichtgrijs, inner sep=2mm] at (0,0) {Vliegtuig};
            node (n2) [box=DE.rood, fit=(n1)] {};
            node (n3) [box=black, fit=(n2)] {};
            end{tikzpicture}
            end{document}


            Some Notes:




            • never nest tikzpicture in tikzpicture, which may raise unexpected side effects;

            • the fit library of tikz is used to get what you want;

            • you can define node style, which merges all nodes in one, but I'd like first to know whether the illustrated result is what you're looking for :-)


            addendum:
            here is a three-color node variation. In particular, append after command= option in a node style is used for the middle and the outer colors:



            documentclass[dutch]{article}
            usepackage{babel}
            usepackage{tikz}
            usetikzlibrary{fit}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
            definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

            begin{document}

            begin{tikzpicture}[
            tcb/.style = {% tree color box
            draw=DE.geel, fill=lichtgrijs,
            line width=0.5mm,inner sep=2mm,
            append after command={pgfextra{letLNtikzlastnode
            node [draw=DE.rood, line width=0.5mm,
            inner sep=0.25mm,fit=(LN)] {};
            node [draw, line width=0.5mm,
            inner sep=0.75mm,fit=(LN)] {};
            }}}
            ]
            node (n1) [tcb] {Vliegtuig};
            end{tikzpicture}
            end{document}


            The result is the same as before.






            share|improve this answer


























            • Yep, that's it! What an incredibly fast reply...

              – Petoetje59
              3 hours ago






            • 2





              @Roboticist, thank you very much!

              – Zarko
              1 hour ago






            • 1





              @Zarko: Any time, Sir! ;)

              – Roboticist
              1 hour ago


















            8














            Like this?



            enter image description here



            documentclass[dutch]{article}
            usepackage{babel}
            usepackage{tikz}
            usetikzlibrary{fit}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
            definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

            begin{document}
            begin{tikzpicture}[
            box/.style = {draw=#1, line width=0.5mm,inner sep=0.25mm}
            ]
            node (n1) [box=DE.geel,
            fill=lichtgrijs, inner sep=2mm] at (0,0) {Vliegtuig};
            node (n2) [box=DE.rood, fit=(n1)] {};
            node (n3) [box=black, fit=(n2)] {};
            end{tikzpicture}
            end{document}


            Some Notes:




            • never nest tikzpicture in tikzpicture, which may raise unexpected side effects;

            • the fit library of tikz is used to get what you want;

            • you can define node style, which merges all nodes in one, but I'd like first to know whether the illustrated result is what you're looking for :-)


            addendum:
            here is a three-color node variation. In particular, append after command= option in a node style is used for the middle and the outer colors:



            documentclass[dutch]{article}
            usepackage{babel}
            usepackage{tikz}
            usetikzlibrary{fit}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
            definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

            begin{document}

            begin{tikzpicture}[
            tcb/.style = {% tree color box
            draw=DE.geel, fill=lichtgrijs,
            line width=0.5mm,inner sep=2mm,
            append after command={pgfextra{letLNtikzlastnode
            node [draw=DE.rood, line width=0.5mm,
            inner sep=0.25mm,fit=(LN)] {};
            node [draw, line width=0.5mm,
            inner sep=0.75mm,fit=(LN)] {};
            }}}
            ]
            node (n1) [tcb] {Vliegtuig};
            end{tikzpicture}
            end{document}


            The result is the same as before.






            share|improve this answer


























            • Yep, that's it! What an incredibly fast reply...

              – Petoetje59
              3 hours ago






            • 2





              @Roboticist, thank you very much!

              – Zarko
              1 hour ago






            • 1





              @Zarko: Any time, Sir! ;)

              – Roboticist
              1 hour ago
















            8












            8








            8







            Like this?



            enter image description here



            documentclass[dutch]{article}
            usepackage{babel}
            usepackage{tikz}
            usetikzlibrary{fit}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
            definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

            begin{document}
            begin{tikzpicture}[
            box/.style = {draw=#1, line width=0.5mm,inner sep=0.25mm}
            ]
            node (n1) [box=DE.geel,
            fill=lichtgrijs, inner sep=2mm] at (0,0) {Vliegtuig};
            node (n2) [box=DE.rood, fit=(n1)] {};
            node (n3) [box=black, fit=(n2)] {};
            end{tikzpicture}
            end{document}


            Some Notes:




            • never nest tikzpicture in tikzpicture, which may raise unexpected side effects;

            • the fit library of tikz is used to get what you want;

            • you can define node style, which merges all nodes in one, but I'd like first to know whether the illustrated result is what you're looking for :-)


            addendum:
            here is a three-color node variation. In particular, append after command= option in a node style is used for the middle and the outer colors:



            documentclass[dutch]{article}
            usepackage{babel}
            usepackage{tikz}
            usetikzlibrary{fit}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
            definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

            begin{document}

            begin{tikzpicture}[
            tcb/.style = {% tree color box
            draw=DE.geel, fill=lichtgrijs,
            line width=0.5mm,inner sep=2mm,
            append after command={pgfextra{letLNtikzlastnode
            node [draw=DE.rood, line width=0.5mm,
            inner sep=0.25mm,fit=(LN)] {};
            node [draw, line width=0.5mm,
            inner sep=0.75mm,fit=(LN)] {};
            }}}
            ]
            node (n1) [tcb] {Vliegtuig};
            end{tikzpicture}
            end{document}


            The result is the same as before.






            share|improve this answer















            Like this?



            enter image description here



            documentclass[dutch]{article}
            usepackage{babel}
            usepackage{tikz}
            usetikzlibrary{fit}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
            definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

            begin{document}
            begin{tikzpicture}[
            box/.style = {draw=#1, line width=0.5mm,inner sep=0.25mm}
            ]
            node (n1) [box=DE.geel,
            fill=lichtgrijs, inner sep=2mm] at (0,0) {Vliegtuig};
            node (n2) [box=DE.rood, fit=(n1)] {};
            node (n3) [box=black, fit=(n2)] {};
            end{tikzpicture}
            end{document}


            Some Notes:




            • never nest tikzpicture in tikzpicture, which may raise unexpected side effects;

            • the fit library of tikz is used to get what you want;

            • you can define node style, which merges all nodes in one, but I'd like first to know whether the illustrated result is what you're looking for :-)


            addendum:
            here is a three-color node variation. In particular, append after command= option in a node style is used for the middle and the outer colors:



            documentclass[dutch]{article}
            usepackage{babel}
            usepackage{tikz}
            usetikzlibrary{fit}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0} % Rood in Duitse vlag
            definecolor{DE.geel}{RGB}{255,207,0} % Geel in Duitse vlag

            begin{document}

            begin{tikzpicture}[
            tcb/.style = {% tree color box
            draw=DE.geel, fill=lichtgrijs,
            line width=0.5mm,inner sep=2mm,
            append after command={pgfextra{letLNtikzlastnode
            node [draw=DE.rood, line width=0.5mm,
            inner sep=0.25mm,fit=(LN)] {};
            node [draw, line width=0.5mm,
            inner sep=0.75mm,fit=(LN)] {};
            }}}
            ]
            node (n1) [tcb] {Vliegtuig};
            end{tikzpicture}
            end{document}


            The result is the same as before.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 1 hour ago









            Roboticist

            1,65721231




            1,65721231










            answered 3 hours ago









            ZarkoZarko

            126k867164




            126k867164













            • Yep, that's it! What an incredibly fast reply...

              – Petoetje59
              3 hours ago






            • 2





              @Roboticist, thank you very much!

              – Zarko
              1 hour ago






            • 1





              @Zarko: Any time, Sir! ;)

              – Roboticist
              1 hour ago





















            • Yep, that's it! What an incredibly fast reply...

              – Petoetje59
              3 hours ago






            • 2





              @Roboticist, thank you very much!

              – Zarko
              1 hour ago






            • 1





              @Zarko: Any time, Sir! ;)

              – Roboticist
              1 hour ago



















            Yep, that's it! What an incredibly fast reply...

            – Petoetje59
            3 hours ago





            Yep, that's it! What an incredibly fast reply...

            – Petoetje59
            3 hours ago




            2




            2





            @Roboticist, thank you very much!

            – Zarko
            1 hour ago





            @Roboticist, thank you very much!

            – Zarko
            1 hour ago




            1




            1





            @Zarko: Any time, Sir! ;)

            – Roboticist
            1 hour ago







            @Zarko: Any time, Sir! ;)

            – Roboticist
            1 hour ago













            5














            Just for fun:



            documentclass{standalone}% to avoid cropping
            usepackage{babel}% not needed for MWE
            usepackage{tikz}
            usetikzlibrary{calc}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{document}
            begin{tikzpicture}
            begin{scope}[line width=0.5mm]
            node[draw=black,inner sep = 1.5mm] (n1) at (0,0) {Vliegtuig};
            draw[DE.rood] ($(n1.south west)+(0.75mm,0.75mm)$) rectangle ($(n1.north east)+(-0.75mm,-0.75mm)$);
            draw[DE.geel] ($(n1.south west)+(1.25mm,1.25mm)$) rectangle ($(n1.north east)+(-1.25mm,-1.25mm)$);
            end{scope}
            end{tikzpicture}
            end{document}


            demo






            share|improve this answer
























            • Did you use another text font? P.S. Good job!

              – manooooh
              43 mins ago
















            5














            Just for fun:



            documentclass{standalone}% to avoid cropping
            usepackage{babel}% not needed for MWE
            usepackage{tikz}
            usetikzlibrary{calc}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{document}
            begin{tikzpicture}
            begin{scope}[line width=0.5mm]
            node[draw=black,inner sep = 1.5mm] (n1) at (0,0) {Vliegtuig};
            draw[DE.rood] ($(n1.south west)+(0.75mm,0.75mm)$) rectangle ($(n1.north east)+(-0.75mm,-0.75mm)$);
            draw[DE.geel] ($(n1.south west)+(1.25mm,1.25mm)$) rectangle ($(n1.north east)+(-1.25mm,-1.25mm)$);
            end{scope}
            end{tikzpicture}
            end{document}


            demo






            share|improve this answer
























            • Did you use another text font? P.S. Good job!

              – manooooh
              43 mins ago














            5












            5








            5







            Just for fun:



            documentclass{standalone}% to avoid cropping
            usepackage{babel}% not needed for MWE
            usepackage{tikz}
            usetikzlibrary{calc}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{document}
            begin{tikzpicture}
            begin{scope}[line width=0.5mm]
            node[draw=black,inner sep = 1.5mm] (n1) at (0,0) {Vliegtuig};
            draw[DE.rood] ($(n1.south west)+(0.75mm,0.75mm)$) rectangle ($(n1.north east)+(-0.75mm,-0.75mm)$);
            draw[DE.geel] ($(n1.south west)+(1.25mm,1.25mm)$) rectangle ($(n1.north east)+(-1.25mm,-1.25mm)$);
            end{scope}
            end{tikzpicture}
            end{document}


            demo






            share|improve this answer













            Just for fun:



            documentclass{standalone}% to avoid cropping
            usepackage{babel}% not needed for MWE
            usepackage{tikz}
            usetikzlibrary{calc}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{document}
            begin{tikzpicture}
            begin{scope}[line width=0.5mm]
            node[draw=black,inner sep = 1.5mm] (n1) at (0,0) {Vliegtuig};
            draw[DE.rood] ($(n1.south west)+(0.75mm,0.75mm)$) rectangle ($(n1.north east)+(-0.75mm,-0.75mm)$);
            draw[DE.geel] ($(n1.south west)+(1.25mm,1.25mm)$) rectangle ($(n1.north east)+(-1.25mm,-1.25mm)$);
            end{scope}
            end{tikzpicture}
            end{document}


            demo







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 2 hours ago









            John KormyloJohn Kormylo

            44.8k12569




            44.8k12569













            • Did you use another text font? P.S. Good job!

              – manooooh
              43 mins ago



















            • Did you use another text font? P.S. Good job!

              – manooooh
              43 mins ago

















            Did you use another text font? P.S. Good job!

            – manooooh
            43 mins ago





            Did you use another text font? P.S. Good job!

            – manooooh
            43 mins ago











            5














            Without TikZ, only colorboxes:



            documentclass[pdftex,dutch]{article}
            usepackage{babel}
            usepackage{xcolor}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{document}

            colorbox{black}{%
            colorbox{DE.rood}{%
            colorbox{DE.geel}{%
            colorbox{lichtgrijs}{Vliegtuig}}}}

            end{document}


            enter image description here






            share|improve this answer
























            • Would've been the best solution... but unfortunately there appears to be no option to set the border width.

              – Petoetje59
              1 hour ago






            • 1





              @Petoetje59 You can set the dimensions of the colorboxes. But I have no time now, I'll update my answer asap.

              – CarLaTeX
              1 hour ago


















            5














            Without TikZ, only colorboxes:



            documentclass[pdftex,dutch]{article}
            usepackage{babel}
            usepackage{xcolor}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{document}

            colorbox{black}{%
            colorbox{DE.rood}{%
            colorbox{DE.geel}{%
            colorbox{lichtgrijs}{Vliegtuig}}}}

            end{document}


            enter image description here






            share|improve this answer
























            • Would've been the best solution... but unfortunately there appears to be no option to set the border width.

              – Petoetje59
              1 hour ago






            • 1





              @Petoetje59 You can set the dimensions of the colorboxes. But I have no time now, I'll update my answer asap.

              – CarLaTeX
              1 hour ago
















            5












            5








            5







            Without TikZ, only colorboxes:



            documentclass[pdftex,dutch]{article}
            usepackage{babel}
            usepackage{xcolor}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{document}

            colorbox{black}{%
            colorbox{DE.rood}{%
            colorbox{DE.geel}{%
            colorbox{lichtgrijs}{Vliegtuig}}}}

            end{document}


            enter image description here






            share|improve this answer













            Without TikZ, only colorboxes:



            documentclass[pdftex,dutch]{article}
            usepackage{babel}
            usepackage{xcolor}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{document}

            colorbox{black}{%
            colorbox{DE.rood}{%
            colorbox{DE.geel}{%
            colorbox{lichtgrijs}{Vliegtuig}}}}

            end{document}


            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 2 hours ago









            CarLaTeXCarLaTeX

            32.4k551134




            32.4k551134













            • Would've been the best solution... but unfortunately there appears to be no option to set the border width.

              – Petoetje59
              1 hour ago






            • 1





              @Petoetje59 You can set the dimensions of the colorboxes. But I have no time now, I'll update my answer asap.

              – CarLaTeX
              1 hour ago





















            • Would've been the best solution... but unfortunately there appears to be no option to set the border width.

              – Petoetje59
              1 hour ago






            • 1





              @Petoetje59 You can set the dimensions of the colorboxes. But I have no time now, I'll update my answer asap.

              – CarLaTeX
              1 hour ago



















            Would've been the best solution... but unfortunately there appears to be no option to set the border width.

            – Petoetje59
            1 hour ago





            Would've been the best solution... but unfortunately there appears to be no option to set the border width.

            – Petoetje59
            1 hour ago




            1




            1





            @Petoetje59 You can set the dimensions of the colorboxes. But I have no time now, I'll update my answer asap.

            – CarLaTeX
            1 hour ago







            @Petoetje59 You can set the dimensions of the colorboxes. But I have no time now, I'll update my answer asap.

            – CarLaTeX
            1 hour ago













            0














            You do not need a library for that, and you can make things much more automatic by just supplying the list of colors. Then it boils down to saying



            node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};


            This strategy can be applied to other node shapes, too, if needed.



            Here is the code.



            documentclass[pdftex,dutch]{article}
            usepackage{babel}
            usepackage{tikz}

            begin{document}

            definecolor{lichtgrijs}{RGB}{232,232,232}
            definecolor{DE.rood}{RGB}{222,0,0}
            definecolor{DE.geel}{RGB}{255,207,0}

            begin{tikzpicture}[multicolor rectangle/.style={draw,path picture={
            foreach CPP [count=YPP] in {#1}
            {draw[CPP] ([xshift=YPP*pgflinewidth,yshift=YPP*pgflinewidth]path picture bounding box.south west)
            rectangle ([xshift=-YPP*pgflinewidth,yshift=-YPP*pgflinewidth]path picture bounding box.north east); }}}]
            node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};
            end{tikzpicture}

            end{document}


            enter image description here



            In case it bugs you that you have to set the inner sep by hand, this can be taken care of at the expense of a slightly longer code.






            share|improve this answer




























              0














              You do not need a library for that, and you can make things much more automatic by just supplying the list of colors. Then it boils down to saying



              node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};


              This strategy can be applied to other node shapes, too, if needed.



              Here is the code.



              documentclass[pdftex,dutch]{article}
              usepackage{babel}
              usepackage{tikz}

              begin{document}

              definecolor{lichtgrijs}{RGB}{232,232,232}
              definecolor{DE.rood}{RGB}{222,0,0}
              definecolor{DE.geel}{RGB}{255,207,0}

              begin{tikzpicture}[multicolor rectangle/.style={draw,path picture={
              foreach CPP [count=YPP] in {#1}
              {draw[CPP] ([xshift=YPP*pgflinewidth,yshift=YPP*pgflinewidth]path picture bounding box.south west)
              rectangle ([xshift=-YPP*pgflinewidth,yshift=-YPP*pgflinewidth]path picture bounding box.north east); }}}]
              node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};
              end{tikzpicture}

              end{document}


              enter image description here



              In case it bugs you that you have to set the inner sep by hand, this can be taken care of at the expense of a slightly longer code.






              share|improve this answer


























                0












                0








                0







                You do not need a library for that, and you can make things much more automatic by just supplying the list of colors. Then it boils down to saying



                node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};


                This strategy can be applied to other node shapes, too, if needed.



                Here is the code.



                documentclass[pdftex,dutch]{article}
                usepackage{babel}
                usepackage{tikz}

                begin{document}

                definecolor{lichtgrijs}{RGB}{232,232,232}
                definecolor{DE.rood}{RGB}{222,0,0}
                definecolor{DE.geel}{RGB}{255,207,0}

                begin{tikzpicture}[multicolor rectangle/.style={draw,path picture={
                foreach CPP [count=YPP] in {#1}
                {draw[CPP] ([xshift=YPP*pgflinewidth,yshift=YPP*pgflinewidth]path picture bounding box.south west)
                rectangle ([xshift=-YPP*pgflinewidth,yshift=-YPP*pgflinewidth]path picture bounding box.north east); }}}]
                node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};
                end{tikzpicture}

                end{document}


                enter image description here



                In case it bugs you that you have to set the inner sep by hand, this can be taken care of at the expense of a slightly longer code.






                share|improve this answer













                You do not need a library for that, and you can make things much more automatic by just supplying the list of colors. Then it boils down to saying



                node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};


                This strategy can be applied to other node shapes, too, if needed.



                Here is the code.



                documentclass[pdftex,dutch]{article}
                usepackage{babel}
                usepackage{tikz}

                begin{document}

                definecolor{lichtgrijs}{RGB}{232,232,232}
                definecolor{DE.rood}{RGB}{222,0,0}
                definecolor{DE.geel}{RGB}{255,207,0}

                begin{tikzpicture}[multicolor rectangle/.style={draw,path picture={
                foreach CPP [count=YPP] in {#1}
                {draw[CPP] ([xshift=YPP*pgflinewidth,yshift=YPP*pgflinewidth]path picture bounding box.south west)
                rectangle ([xshift=-YPP*pgflinewidth,yshift=-YPP*pgflinewidth]path picture bounding box.north east); }}}]
                node[inner sep=8pt,line width=2pt,multicolor rectangle={DE.rood,DE.geel}] {Vliegtuig};
                end{tikzpicture}

                end{document}


                enter image description here



                In case it bugs you that you have to set the inner sep by hand, this can be taken care of at the expense of a slightly longer code.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 10 mins ago









                marmotmarmot

                105k4126241




                105k4126241






























                    draft saved

                    draft discarded




















































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


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

                    But avoid



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

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


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




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477589%2fhow-to-add-multiple-differently-colored-borders-around-a-node%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

                    (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

                    Щит и меч (фильм) Содержание Названия серий | Сюжет |...

                    Энтрерриос (город) Содержание История | Географическое...