Two adjoining rectangles tikz in matrix

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I'm using a matrix to put the nodes in a Tikz diagram:



documentclass[border=0pt 0pt 0pt 0pt]standalone
usepackagetikz, calc
usepackagearray


begindocument
begintikzpicture [
auto,
fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
%ffblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
]

matrix [column sep=2.3em, row sep=1.em]
node[fblk](f1)FBLK1; && node[fblk](f2)FBLK2;\
& node[fblk](f3)FBLK3; \
% node[ffblk](f4)FBLK1FBLK2; \
;
endtikzpicture
enddocument


Now, I want define a new node style, ffblk that has 2 adjoing rectangles. This node style takes two arguments, each for each rectangles. See the image.





I tried to manage this by adding xshift=-... to the next node; and by making column sep=0em. But I could not create what I wanted.







share|improve this question
























    up vote
    4
    down vote

    favorite












    I'm using a matrix to put the nodes in a Tikz diagram:



    documentclass[border=0pt 0pt 0pt 0pt]standalone
    usepackagetikz, calc
    usepackagearray


    begindocument
    begintikzpicture [
    auto,
    fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
    %ffblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
    ]

    matrix [column sep=2.3em, row sep=1.em]
    node[fblk](f1)FBLK1; && node[fblk](f2)FBLK2;\
    & node[fblk](f3)FBLK3; \
    % node[ffblk](f4)FBLK1FBLK2; \
    ;
    endtikzpicture
    enddocument


    Now, I want define a new node style, ffblk that has 2 adjoing rectangles. This node style takes two arguments, each for each rectangles. See the image.





    I tried to manage this by adding xshift=-... to the next node; and by making column sep=0em. But I could not create what I wanted.







    share|improve this question






















      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I'm using a matrix to put the nodes in a Tikz diagram:



      documentclass[border=0pt 0pt 0pt 0pt]standalone
      usepackagetikz, calc
      usepackagearray


      begindocument
      begintikzpicture [
      auto,
      fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
      %ffblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
      ]

      matrix [column sep=2.3em, row sep=1.em]
      node[fblk](f1)FBLK1; && node[fblk](f2)FBLK2;\
      & node[fblk](f3)FBLK3; \
      % node[ffblk](f4)FBLK1FBLK2; \
      ;
      endtikzpicture
      enddocument


      Now, I want define a new node style, ffblk that has 2 adjoing rectangles. This node style takes two arguments, each for each rectangles. See the image.





      I tried to manage this by adding xshift=-... to the next node; and by making column sep=0em. But I could not create what I wanted.







      share|improve this question












      I'm using a matrix to put the nodes in a Tikz diagram:



      documentclass[border=0pt 0pt 0pt 0pt]standalone
      usepackagetikz, calc
      usepackagearray


      begindocument
      begintikzpicture [
      auto,
      fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
      %ffblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
      ]

      matrix [column sep=2.3em, row sep=1.em]
      node[fblk](f1)FBLK1; && node[fblk](f2)FBLK2;\
      & node[fblk](f3)FBLK3; \
      % node[ffblk](f4)FBLK1FBLK2; \
      ;
      endtikzpicture
      enddocument


      Now, I want define a new node style, ffblk that has 2 adjoing rectangles. This node style takes two arguments, each for each rectangles. See the image.





      I tried to manage this by adding xshift=-... to the next node; and by making column sep=0em. But I could not create what I wanted.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 8 at 8:55









      pushpen.paul

      1,5681340




      1,5681340




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          Maybe something like this, using the shapes.multipart library ?



          documentclass[tikz,border=1mm]standalone
          usetikzlibraryshapes.multipart
          begindocument
          begintikzpicture[fblk/.style=rectangle split, rectangle split horizontal, rectangle split parts=2, draw, anchor=center, draw=gray, fill=pink!30]
          node [fblk] FBLK1nodeparttwoFBLK2;
          endtikzpicture
          enddocument


          Output



          enter image description here






          share|improve this answer



























            up vote
            6
            down vote













            When two adjacents nodes in a matrix should share a border line, row sep and|or column sep should be fixed to -pgflinewidth:



            documentclass[border=0pt 0pt 0pt 0pt]standalone
            usepackagetikz, calc
            usepackagearray


            begindocument
            begintikzpicture [
            auto,
            fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
            ]

            matrix [column sep=-pgflinewidth, row sep=-pgflinewidth]
            node[fblk](f1)FBLK1; & node[fblk](f2)FBLK2;\
            & node[fblk](f3)FBLK3; \
            % node[ffblk](f4)FBLK1FBLK2; \
            ;
            endtikzpicture
            enddocument


            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',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              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%2f445106%2ftwo-adjoining-rectangles-tikz-in-matrix%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              4
              down vote



              accepted










              Maybe something like this, using the shapes.multipart library ?



              documentclass[tikz,border=1mm]standalone
              usetikzlibraryshapes.multipart
              begindocument
              begintikzpicture[fblk/.style=rectangle split, rectangle split horizontal, rectangle split parts=2, draw, anchor=center, draw=gray, fill=pink!30]
              node [fblk] FBLK1nodeparttwoFBLK2;
              endtikzpicture
              enddocument


              Output



              enter image description here






              share|improve this answer
























                up vote
                4
                down vote



                accepted










                Maybe something like this, using the shapes.multipart library ?



                documentclass[tikz,border=1mm]standalone
                usetikzlibraryshapes.multipart
                begindocument
                begintikzpicture[fblk/.style=rectangle split, rectangle split horizontal, rectangle split parts=2, draw, anchor=center, draw=gray, fill=pink!30]
                node [fblk] FBLK1nodeparttwoFBLK2;
                endtikzpicture
                enddocument


                Output



                enter image description here






                share|improve this answer






















                  up vote
                  4
                  down vote



                  accepted







                  up vote
                  4
                  down vote



                  accepted






                  Maybe something like this, using the shapes.multipart library ?



                  documentclass[tikz,border=1mm]standalone
                  usetikzlibraryshapes.multipart
                  begindocument
                  begintikzpicture[fblk/.style=rectangle split, rectangle split horizontal, rectangle split parts=2, draw, anchor=center, draw=gray, fill=pink!30]
                  node [fblk] FBLK1nodeparttwoFBLK2;
                  endtikzpicture
                  enddocument


                  Output



                  enter image description here






                  share|improve this answer












                  Maybe something like this, using the shapes.multipart library ?



                  documentclass[tikz,border=1mm]standalone
                  usetikzlibraryshapes.multipart
                  begindocument
                  begintikzpicture[fblk/.style=rectangle split, rectangle split horizontal, rectangle split parts=2, draw, anchor=center, draw=gray, fill=pink!30]
                  node [fblk] FBLK1nodeparttwoFBLK2;
                  endtikzpicture
                  enddocument


                  Output



                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 8 at 9:15









                  BambOo

                  2,355323




                  2,355323




















                      up vote
                      6
                      down vote













                      When two adjacents nodes in a matrix should share a border line, row sep and|or column sep should be fixed to -pgflinewidth:



                      documentclass[border=0pt 0pt 0pt 0pt]standalone
                      usepackagetikz, calc
                      usepackagearray


                      begindocument
                      begintikzpicture [
                      auto,
                      fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
                      ]

                      matrix [column sep=-pgflinewidth, row sep=-pgflinewidth]
                      node[fblk](f1)FBLK1; & node[fblk](f2)FBLK2;\
                      & node[fblk](f3)FBLK3; \
                      % node[ffblk](f4)FBLK1FBLK2; \
                      ;
                      endtikzpicture
                      enddocument


                      enter image description here






                      share|improve this answer
























                        up vote
                        6
                        down vote













                        When two adjacents nodes in a matrix should share a border line, row sep and|or column sep should be fixed to -pgflinewidth:



                        documentclass[border=0pt 0pt 0pt 0pt]standalone
                        usepackagetikz, calc
                        usepackagearray


                        begindocument
                        begintikzpicture [
                        auto,
                        fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
                        ]

                        matrix [column sep=-pgflinewidth, row sep=-pgflinewidth]
                        node[fblk](f1)FBLK1; & node[fblk](f2)FBLK2;\
                        & node[fblk](f3)FBLK3; \
                        % node[ffblk](f4)FBLK1FBLK2; \
                        ;
                        endtikzpicture
                        enddocument


                        enter image description here






                        share|improve this answer






















                          up vote
                          6
                          down vote










                          up vote
                          6
                          down vote









                          When two adjacents nodes in a matrix should share a border line, row sep and|or column sep should be fixed to -pgflinewidth:



                          documentclass[border=0pt 0pt 0pt 0pt]standalone
                          usepackagetikz, calc
                          usepackagearray


                          begindocument
                          begintikzpicture [
                          auto,
                          fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
                          ]

                          matrix [column sep=-pgflinewidth, row sep=-pgflinewidth]
                          node[fblk](f1)FBLK1; & node[fblk](f2)FBLK2;\
                          & node[fblk](f3)FBLK3; \
                          % node[ffblk](f4)FBLK1FBLK2; \
                          ;
                          endtikzpicture
                          enddocument


                          enter image description here






                          share|improve this answer












                          When two adjacents nodes in a matrix should share a border line, row sep and|or column sep should be fixed to -pgflinewidth:



                          documentclass[border=0pt 0pt 0pt 0pt]standalone
                          usepackagetikz, calc
                          usepackagearray


                          begindocument
                          begintikzpicture [
                          auto,
                          fblk/.style = rectangle, draw=gray, fill=pink!30, text width=4.5em, text centered, minimum height=1em ,
                          ]

                          matrix [column sep=-pgflinewidth, row sep=-pgflinewidth]
                          node[fblk](f1)FBLK1; & node[fblk](f2)FBLK2;\
                          & node[fblk](f3)FBLK3; \
                          % node[ffblk](f4)FBLK1FBLK2; \
                          ;
                          endtikzpicture
                          enddocument


                          enter image description here







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Aug 8 at 10:01









                          Ignasi

                          86.6k4153287




                          86.6k4153287



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f445106%2ftwo-adjoining-rectangles-tikz-in-matrix%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              Confectionery