How to add multiple differently colored borders around a node?












4















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



























    4















    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

























      4












      4








      4


      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 2 hours ago









      Petoetje59Petoetje59

      4291615




      4291615






















          3 Answers
          3






          active

          oldest

          votes


















          7














          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
            2 hours ago






          • 1





            @Roboticist, thank you very much!

            – Zarko
            45 mins ago











          • @Zarko: Any time, Sir! ;)

            – Roboticist
            44 mins ago





















          4














          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































            4














            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
              48 mins ago











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

              – CarLaTeX
              45 mins ago













            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

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            7














            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
              2 hours ago






            • 1





              @Roboticist, thank you very much!

              – Zarko
              45 mins ago











            • @Zarko: Any time, Sir! ;)

              – Roboticist
              44 mins ago


















            7














            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
              2 hours ago






            • 1





              @Roboticist, thank you very much!

              – Zarko
              45 mins ago











            • @Zarko: Any time, Sir! ;)

              – Roboticist
              44 mins ago
















            7












            7








            7







            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 46 mins ago









            Roboticist

            1,65721231




            1,65721231










            answered 2 hours ago









            ZarkoZarko

            126k867164




            126k867164













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

              – Petoetje59
              2 hours ago






            • 1





              @Roboticist, thank you very much!

              – Zarko
              45 mins ago











            • @Zarko: Any time, Sir! ;)

              – Roboticist
              44 mins ago





















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

              – Petoetje59
              2 hours ago






            • 1





              @Roboticist, thank you very much!

              – Zarko
              45 mins ago











            • @Zarko: Any time, Sir! ;)

              – Roboticist
              44 mins ago



















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

            – Petoetje59
            2 hours ago





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

            – Petoetje59
            2 hours ago




            1




            1





            @Roboticist, thank you very much!

            – Zarko
            45 mins ago





            @Roboticist, thank you very much!

            – Zarko
            45 mins ago













            @Zarko: Any time, Sir! ;)

            – Roboticist
            44 mins ago







            @Zarko: Any time, Sir! ;)

            – Roboticist
            44 mins ago













            4














            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




























              4














              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


























                4












                4








                4







                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 1 hour ago









                John KormyloJohn Kormylo

                44.7k12569




                44.7k12569























                    4














                    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
                      48 mins ago











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

                      – CarLaTeX
                      45 mins ago


















                    4














                    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
                      48 mins ago











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

                      – CarLaTeX
                      45 mins ago
















                    4












                    4








                    4







                    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 1 hour 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
                      48 mins ago











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

                      – CarLaTeX
                      45 mins ago





















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

                      – Petoetje59
                      48 mins ago











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

                      – CarLaTeX
                      45 mins ago



















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

                    – Petoetje59
                    48 mins ago





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

                    – Petoetje59
                    48 mins ago













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

                    – CarLaTeX
                    45 mins ago







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

                    – CarLaTeX
                    45 mins ago




















                    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

                    Callistus I

                    Tabula Rosettana

                    How to label and detect the document text images