How to line up adjacent nodes in tikz that share a border












2















Here is how I'm drawing it currently:



documentclass{article}
usepackage{tikz}
usepackage[paperwidth=15cm]{geometry}

begin{document}
noindent

begin{tikzpicture}
node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
node[label={footnotesize{63}}] (top) at (-4,0) {} ;
node[label={footnotesize{31}}] (low32) at (0,0) {} ;
node[label={footnotesize{15}}] (low16) at (2,0) {} ;
node[label={footnotesize{7}}] (low8) at (3,0) {} ;
node[label={footnotesize{0}}] (bot) at (4,0) {} ;
node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
end{tikzpicture}

end{document}


It looks like this:



current image



Everything is fine except for the final row, where the two rectangles appear to be overlapping. There should only ve one line in between ah and al—exactly in the middle. How do I fix this?










share|improve this question




















  • 1





    Maybe you want to use a dedicated package for such diagrams: ctan.org/pkg/bytefield

    – Henri Menke
    3 hours ago











  • While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries.

    – Peter Grill
    3 hours ago











  • @HenriMenke thanks! I'll give that a shot!

    – Dan
    2 hours ago











  • @PeterGrill sorry - fixed

    – Dan
    2 hours ago
















2















Here is how I'm drawing it currently:



documentclass{article}
usepackage{tikz}
usepackage[paperwidth=15cm]{geometry}

begin{document}
noindent

begin{tikzpicture}
node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
node[label={footnotesize{63}}] (top) at (-4,0) {} ;
node[label={footnotesize{31}}] (low32) at (0,0) {} ;
node[label={footnotesize{15}}] (low16) at (2,0) {} ;
node[label={footnotesize{7}}] (low8) at (3,0) {} ;
node[label={footnotesize{0}}] (bot) at (4,0) {} ;
node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
end{tikzpicture}

end{document}


It looks like this:



current image



Everything is fine except for the final row, where the two rectangles appear to be overlapping. There should only ve one line in between ah and al—exactly in the middle. How do I fix this?










share|improve this question




















  • 1





    Maybe you want to use a dedicated package for such diagrams: ctan.org/pkg/bytefield

    – Henri Menke
    3 hours ago











  • While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries.

    – Peter Grill
    3 hours ago











  • @HenriMenke thanks! I'll give that a shot!

    – Dan
    2 hours ago











  • @PeterGrill sorry - fixed

    – Dan
    2 hours ago














2












2








2








Here is how I'm drawing it currently:



documentclass{article}
usepackage{tikz}
usepackage[paperwidth=15cm]{geometry}

begin{document}
noindent

begin{tikzpicture}
node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
node[label={footnotesize{63}}] (top) at (-4,0) {} ;
node[label={footnotesize{31}}] (low32) at (0,0) {} ;
node[label={footnotesize{15}}] (low16) at (2,0) {} ;
node[label={footnotesize{7}}] (low8) at (3,0) {} ;
node[label={footnotesize{0}}] (bot) at (4,0) {} ;
node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
end{tikzpicture}

end{document}


It looks like this:



current image



Everything is fine except for the final row, where the two rectangles appear to be overlapping. There should only ve one line in between ah and al—exactly in the middle. How do I fix this?










share|improve this question
















Here is how I'm drawing it currently:



documentclass{article}
usepackage{tikz}
usepackage[paperwidth=15cm]{geometry}

begin{document}
noindent

begin{tikzpicture}
node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
node[label={footnotesize{63}}] (top) at (-4,0) {} ;
node[label={footnotesize{31}}] (low32) at (0,0) {} ;
node[label={footnotesize{15}}] (low16) at (2,0) {} ;
node[label={footnotesize{7}}] (low8) at (3,0) {} ;
node[label={footnotesize{0}}] (bot) at (4,0) {} ;
node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
end{tikzpicture}

end{document}


It looks like this:



current image



Everything is fine except for the final row, where the two rectangles appear to be overlapping. There should only ve one line in between ah and al—exactly in the middle. How do I fix this?







tikz-pgf tikz-node






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago







Dan

















asked 3 hours ago









DanDan

4621520




4621520








  • 1





    Maybe you want to use a dedicated package for such diagrams: ctan.org/pkg/bytefield

    – Henri Menke
    3 hours ago











  • While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries.

    – Peter Grill
    3 hours ago











  • @HenriMenke thanks! I'll give that a shot!

    – Dan
    2 hours ago











  • @PeterGrill sorry - fixed

    – Dan
    2 hours ago














  • 1





    Maybe you want to use a dedicated package for such diagrams: ctan.org/pkg/bytefield

    – Henri Menke
    3 hours ago











  • While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries.

    – Peter Grill
    3 hours ago











  • @HenriMenke thanks! I'll give that a shot!

    – Dan
    2 hours ago











  • @PeterGrill sorry - fixed

    – Dan
    2 hours ago








1




1





Maybe you want to use a dedicated package for such diagrams: ctan.org/pkg/bytefield

– Henri Menke
3 hours ago





Maybe you want to use a dedicated package for such diagrams: ctan.org/pkg/bytefield

– Henri Menke
3 hours ago













While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries.

– Peter Grill
3 hours ago





While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries.

– Peter Grill
3 hours ago













@HenriMenke thanks! I'll give that a shot!

– Dan
2 hours ago





@HenriMenke thanks! I'll give that a shot!

– Dan
2 hours ago













@PeterGrill sorry - fixed

– Dan
2 hours ago





@PeterGrill sorry - fixed

– Dan
2 hours ago










2 Answers
2






active

oldest

votes


















2














You can set inner xsep=0pt:



enter image description here



Code:



documentclass{article}
usepackage{tikz}
usepackage[paperwidth=15cm]{geometry}


begin{document}
noindent
begin{tikzpicture}[inner xsep=0pt]
node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
node[label={footnotesize{63}}] (top) at (-4,0) {} ;
node[label={footnotesize{31}}] (low32) at (0,0) {} ;
node[label={footnotesize{15}}] (low16) at (2,0) {} ;
node[label={footnotesize{7}}] (low8) at (3,0) {} ;
node[label={footnotesize{0}}] (bot) at (4,0) {} ;
node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
end{tikzpicture}
end {document}





share|improve this answer































    1














    off-topic, for fun and exercises:



    documentclass{article}
    usepackage[paperwidth=15cm]{geometry}
    usepackage{tikz}
    usetikzlibrary{positioning}

    begin{document}
    noindent%
    begin{tikzpicture}[
    node distance = 3mm and 0mm,
    box/.style = {draw, text width=#1, align=center,minimum height=5mm,
    inner sep=0pt, outer sep=0pt, font=ttfamily},
    lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
    ]
    node[box=8cm,right=of {(0,0)}] (qw) {rax};
    node[lbl] at (0,0) {63};
    node[lbl] at (4,0) {31};
    node[lbl] at (6,0) {15};
    node[lbl] at (7,0) {7} ;
    node[lbl] at (8,0) {0} ;
    node[box=4cm,below left=of qw.south east] (dw) {eax};
    node[box=2cm,below left=of dw.south east] (w) {ax} ;
    node[box=1cm,below left=of w.south east] (hb) {ah} ;
    node[box=1cm,left=of hb] (lb) {al} ;
    end{tikzpicture}
    end {document}


    result:



    enter image description here



    addendum:
    one ore solution, using chains library:



    documentclass{article}
    usepackage[paperwidth=15cm]{geometry}
    usepackage{tikz}
    usetikzlibrary{chains,positioning}

    begin{document}
    noindent%
    begin{tikzpicture}[
    node distance = 3mm and 0mm,
    start chain= going below,
    box/.style = {draw, text width=#1, align=center,minimum height=5mm,
    inner sep=0pt, outer sep=0pt, font=ttfamily,
    on chain,anchor=north west},
    lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
    ]
    node[box=8cm,right=of {(0,0)}] (qw) {rax};
    node[lbl] at (0,0) {63};
    node[lbl] at (4,0) {31};
    node[lbl] at (6,0) {15};
    node[lbl] at (7,0) {7} ;
    node[lbl] at (8,0) {0} ;
    node[box=4cm] (dw) {eax};
    node[box=2cm] (w) {ax} ;
    node[box=1cm] (hb) {ah} ;
    node[box=1cm,left=of hb] (lb) {al} ;
    end{tikzpicture}
    end {document}


    the result is the same as before.






    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%2f470005%2fhow-to-line-up-adjacent-nodes-in-tikz-that-share-a-border%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      You can set inner xsep=0pt:



      enter image description here



      Code:



      documentclass{article}
      usepackage{tikz}
      usepackage[paperwidth=15cm]{geometry}


      begin{document}
      noindent
      begin{tikzpicture}[inner xsep=0pt]
      node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
      node[label={footnotesize{63}}] (top) at (-4,0) {} ;
      node[label={footnotesize{31}}] (low32) at (0,0) {} ;
      node[label={footnotesize{15}}] (low16) at (2,0) {} ;
      node[label={footnotesize{7}}] (low8) at (3,0) {} ;
      node[label={footnotesize{0}}] (bot) at (4,0) {} ;
      node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
      node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
      node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
      node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
      end{tikzpicture}
      end {document}





      share|improve this answer




























        2














        You can set inner xsep=0pt:



        enter image description here



        Code:



        documentclass{article}
        usepackage{tikz}
        usepackage[paperwidth=15cm]{geometry}


        begin{document}
        noindent
        begin{tikzpicture}[inner xsep=0pt]
        node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
        node[label={footnotesize{63}}] (top) at (-4,0) {} ;
        node[label={footnotesize{31}}] (low32) at (0,0) {} ;
        node[label={footnotesize{15}}] (low16) at (2,0) {} ;
        node[label={footnotesize{7}}] (low8) at (3,0) {} ;
        node[label={footnotesize{0}}] (bot) at (4,0) {} ;
        node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
        node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
        node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
        node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
        end{tikzpicture}
        end {document}





        share|improve this answer


























          2












          2








          2







          You can set inner xsep=0pt:



          enter image description here



          Code:



          documentclass{article}
          usepackage{tikz}
          usepackage[paperwidth=15cm]{geometry}


          begin{document}
          noindent
          begin{tikzpicture}[inner xsep=0pt]
          node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
          node[label={footnotesize{63}}] (top) at (-4,0) {} ;
          node[label={footnotesize{31}}] (low32) at (0,0) {} ;
          node[label={footnotesize{15}}] (low16) at (2,0) {} ;
          node[label={footnotesize{7}}] (low8) at (3,0) {} ;
          node[label={footnotesize{0}}] (bot) at (4,0) {} ;
          node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
          node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
          node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
          node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
          end{tikzpicture}
          end {document}





          share|improve this answer













          You can set inner xsep=0pt:



          enter image description here



          Code:



          documentclass{article}
          usepackage{tikz}
          usepackage[paperwidth=15cm]{geometry}


          begin{document}
          noindent
          begin{tikzpicture}[inner xsep=0pt]
          node[draw,rectangle,text width=8cm,align=center] (qw) at (0,0) {texttt{rax}} ;
          node[label={footnotesize{63}}] (top) at (-4,0) {} ;
          node[label={footnotesize{31}}] (low32) at (0,0) {} ;
          node[label={footnotesize{15}}] (low16) at (2,0) {} ;
          node[label={footnotesize{7}}] (low8) at (3,0) {} ;
          node[label={footnotesize{0}}] (bot) at (4,0) {} ;
          node[draw,rectangle,text width=4cm,align=center,xshift=2cm,yshift=-0.7cm] (dw) {texttt{eax}} ;
          node[draw,rectangle,text width=2cm,align=center,xshift=3cm,yshift=-1.4cm] (w) {texttt{ax}} ;
          node[draw,rectangle,text width=1cm,align=center,xshift=2.5cm,yshift=-2.1cm] (hb) {texttt{ah}} ;
          node[draw,rectangle,text width=1cm,align=center,xshift=3.5cm,yshift=-2.1cm] (lb) {texttt{al}} ;
          end{tikzpicture}
          end {document}






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 3 hours ago









          Peter GrillPeter Grill

          164k25437749




          164k25437749























              1














              off-topic, for fun and exercises:



              documentclass{article}
              usepackage[paperwidth=15cm]{geometry}
              usepackage{tikz}
              usetikzlibrary{positioning}

              begin{document}
              noindent%
              begin{tikzpicture}[
              node distance = 3mm and 0mm,
              box/.style = {draw, text width=#1, align=center,minimum height=5mm,
              inner sep=0pt, outer sep=0pt, font=ttfamily},
              lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
              ]
              node[box=8cm,right=of {(0,0)}] (qw) {rax};
              node[lbl] at (0,0) {63};
              node[lbl] at (4,0) {31};
              node[lbl] at (6,0) {15};
              node[lbl] at (7,0) {7} ;
              node[lbl] at (8,0) {0} ;
              node[box=4cm,below left=of qw.south east] (dw) {eax};
              node[box=2cm,below left=of dw.south east] (w) {ax} ;
              node[box=1cm,below left=of w.south east] (hb) {ah} ;
              node[box=1cm,left=of hb] (lb) {al} ;
              end{tikzpicture}
              end {document}


              result:



              enter image description here



              addendum:
              one ore solution, using chains library:



              documentclass{article}
              usepackage[paperwidth=15cm]{geometry}
              usepackage{tikz}
              usetikzlibrary{chains,positioning}

              begin{document}
              noindent%
              begin{tikzpicture}[
              node distance = 3mm and 0mm,
              start chain= going below,
              box/.style = {draw, text width=#1, align=center,minimum height=5mm,
              inner sep=0pt, outer sep=0pt, font=ttfamily,
              on chain,anchor=north west},
              lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
              ]
              node[box=8cm,right=of {(0,0)}] (qw) {rax};
              node[lbl] at (0,0) {63};
              node[lbl] at (4,0) {31};
              node[lbl] at (6,0) {15};
              node[lbl] at (7,0) {7} ;
              node[lbl] at (8,0) {0} ;
              node[box=4cm] (dw) {eax};
              node[box=2cm] (w) {ax} ;
              node[box=1cm] (hb) {ah} ;
              node[box=1cm,left=of hb] (lb) {al} ;
              end{tikzpicture}
              end {document}


              the result is the same as before.






              share|improve this answer






























                1














                off-topic, for fun and exercises:



                documentclass{article}
                usepackage[paperwidth=15cm]{geometry}
                usepackage{tikz}
                usetikzlibrary{positioning}

                begin{document}
                noindent%
                begin{tikzpicture}[
                node distance = 3mm and 0mm,
                box/.style = {draw, text width=#1, align=center,minimum height=5mm,
                inner sep=0pt, outer sep=0pt, font=ttfamily},
                lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
                ]
                node[box=8cm,right=of {(0,0)}] (qw) {rax};
                node[lbl] at (0,0) {63};
                node[lbl] at (4,0) {31};
                node[lbl] at (6,0) {15};
                node[lbl] at (7,0) {7} ;
                node[lbl] at (8,0) {0} ;
                node[box=4cm,below left=of qw.south east] (dw) {eax};
                node[box=2cm,below left=of dw.south east] (w) {ax} ;
                node[box=1cm,below left=of w.south east] (hb) {ah} ;
                node[box=1cm,left=of hb] (lb) {al} ;
                end{tikzpicture}
                end {document}


                result:



                enter image description here



                addendum:
                one ore solution, using chains library:



                documentclass{article}
                usepackage[paperwidth=15cm]{geometry}
                usepackage{tikz}
                usetikzlibrary{chains,positioning}

                begin{document}
                noindent%
                begin{tikzpicture}[
                node distance = 3mm and 0mm,
                start chain= going below,
                box/.style = {draw, text width=#1, align=center,minimum height=5mm,
                inner sep=0pt, outer sep=0pt, font=ttfamily,
                on chain,anchor=north west},
                lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
                ]
                node[box=8cm,right=of {(0,0)}] (qw) {rax};
                node[lbl] at (0,0) {63};
                node[lbl] at (4,0) {31};
                node[lbl] at (6,0) {15};
                node[lbl] at (7,0) {7} ;
                node[lbl] at (8,0) {0} ;
                node[box=4cm] (dw) {eax};
                node[box=2cm] (w) {ax} ;
                node[box=1cm] (hb) {ah} ;
                node[box=1cm,left=of hb] (lb) {al} ;
                end{tikzpicture}
                end {document}


                the result is the same as before.






                share|improve this answer




























                  1












                  1








                  1







                  off-topic, for fun and exercises:



                  documentclass{article}
                  usepackage[paperwidth=15cm]{geometry}
                  usepackage{tikz}
                  usetikzlibrary{positioning}

                  begin{document}
                  noindent%
                  begin{tikzpicture}[
                  node distance = 3mm and 0mm,
                  box/.style = {draw, text width=#1, align=center,minimum height=5mm,
                  inner sep=0pt, outer sep=0pt, font=ttfamily},
                  lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
                  ]
                  node[box=8cm,right=of {(0,0)}] (qw) {rax};
                  node[lbl] at (0,0) {63};
                  node[lbl] at (4,0) {31};
                  node[lbl] at (6,0) {15};
                  node[lbl] at (7,0) {7} ;
                  node[lbl] at (8,0) {0} ;
                  node[box=4cm,below left=of qw.south east] (dw) {eax};
                  node[box=2cm,below left=of dw.south east] (w) {ax} ;
                  node[box=1cm,below left=of w.south east] (hb) {ah} ;
                  node[box=1cm,left=of hb] (lb) {al} ;
                  end{tikzpicture}
                  end {document}


                  result:



                  enter image description here



                  addendum:
                  one ore solution, using chains library:



                  documentclass{article}
                  usepackage[paperwidth=15cm]{geometry}
                  usepackage{tikz}
                  usetikzlibrary{chains,positioning}

                  begin{document}
                  noindent%
                  begin{tikzpicture}[
                  node distance = 3mm and 0mm,
                  start chain= going below,
                  box/.style = {draw, text width=#1, align=center,minimum height=5mm,
                  inner sep=0pt, outer sep=0pt, font=ttfamily,
                  on chain,anchor=north west},
                  lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
                  ]
                  node[box=8cm,right=of {(0,0)}] (qw) {rax};
                  node[lbl] at (0,0) {63};
                  node[lbl] at (4,0) {31};
                  node[lbl] at (6,0) {15};
                  node[lbl] at (7,0) {7} ;
                  node[lbl] at (8,0) {0} ;
                  node[box=4cm] (dw) {eax};
                  node[box=2cm] (w) {ax} ;
                  node[box=1cm] (hb) {ah} ;
                  node[box=1cm,left=of hb] (lb) {al} ;
                  end{tikzpicture}
                  end {document}


                  the result is the same as before.






                  share|improve this answer















                  off-topic, for fun and exercises:



                  documentclass{article}
                  usepackage[paperwidth=15cm]{geometry}
                  usepackage{tikz}
                  usetikzlibrary{positioning}

                  begin{document}
                  noindent%
                  begin{tikzpicture}[
                  node distance = 3mm and 0mm,
                  box/.style = {draw, text width=#1, align=center,minimum height=5mm,
                  inner sep=0pt, outer sep=0pt, font=ttfamily},
                  lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
                  ]
                  node[box=8cm,right=of {(0,0)}] (qw) {rax};
                  node[lbl] at (0,0) {63};
                  node[lbl] at (4,0) {31};
                  node[lbl] at (6,0) {15};
                  node[lbl] at (7,0) {7} ;
                  node[lbl] at (8,0) {0} ;
                  node[box=4cm,below left=of qw.south east] (dw) {eax};
                  node[box=2cm,below left=of dw.south east] (w) {ax} ;
                  node[box=1cm,below left=of w.south east] (hb) {ah} ;
                  node[box=1cm,left=of hb] (lb) {al} ;
                  end{tikzpicture}
                  end {document}


                  result:



                  enter image description here



                  addendum:
                  one ore solution, using chains library:



                  documentclass{article}
                  usepackage[paperwidth=15cm]{geometry}
                  usepackage{tikz}
                  usetikzlibrary{chains,positioning}

                  begin{document}
                  noindent%
                  begin{tikzpicture}[
                  node distance = 3mm and 0mm,
                  start chain= going below,
                  box/.style = {draw, text width=#1, align=center,minimum height=5mm,
                  inner sep=0pt, outer sep=0pt, font=ttfamily,
                  on chain,anchor=north west},
                  lbl/.style = {font=footnotesize, inner sep=0pt, above=3mm}
                  ]
                  node[box=8cm,right=of {(0,0)}] (qw) {rax};
                  node[lbl] at (0,0) {63};
                  node[lbl] at (4,0) {31};
                  node[lbl] at (6,0) {15};
                  node[lbl] at (7,0) {7} ;
                  node[lbl] at (8,0) {0} ;
                  node[box=4cm] (dw) {eax};
                  node[box=2cm] (w) {ax} ;
                  node[box=1cm] (hb) {ah} ;
                  node[box=1cm,left=of hb] (lb) {al} ;
                  end{tikzpicture}
                  end {document}


                  the result is the same as before.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 20 mins ago

























                  answered 2 hours ago









                  ZarkoZarko

                  122k865158




                  122k865158






























                      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%2f470005%2fhow-to-line-up-adjacent-nodes-in-tikz-that-share-a-border%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

                      Willebadessen

                      Ida-Boy-Ed-Garten

                      Residenzschloss Arolsen