Bytefield: How to add multiple underbrace below bits diagram












1















I am new to LaTeX and I am trying to put multiple underbrace under a package using bytefield package. I want to have 4 underbrace consecutive to each other, but I am only able to put 2 and the other 2 appear with a space in between.



First I define the bitbox of the packet, then I put the underbrace below them.
I have review the bytefield documentation and there is no underbrace example. I found this question Bytefield: Word Group below blocks but it only puts one underbrace. With that answer I was able to put 2 together and 2 together but not consecutive to each other. The code I have is the following:



documentclass[border=10pt,png]{standalone}
usepackage{amsmath}
usepackage[endianness=big]{bytefield}
bytefieldsetup{boxformatting={centeringfootnotesize}}
begin{document}

begin{bytefield}[bitwidth=1.1em]{21}
bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
bitbox{1}{...}\

bitbox{0}{$underbrace{hspace{6.7em}}_{text{normalsize $A_0$}}$} &
bitbox{15}{$underbrace{hspace{6.7em}}_{text{normalsize $A_1$}}$} &
bitbox{0}{$underbrace{hspace{6.7em}}_{text{normalsize $A_2$}}$} &
bitbox{15}{$underbrace{hspace{6.7em}}_{text{normalsize $A_3$}}$} \
end{bytefield}
end{document}


The result I obtain is:
enter image description here
And what I wish to obtain is this:



enter image description here



I am not sure why this space appears between the first 2 underbrace and the third one. I have change the hspace, the value inside the bitbox{}, put the bitbox inside the underbrace, but nothing seems to do the trick.



Thanks in advance for all your help.










share|improve this question





























    1















    I am new to LaTeX and I am trying to put multiple underbrace under a package using bytefield package. I want to have 4 underbrace consecutive to each other, but I am only able to put 2 and the other 2 appear with a space in between.



    First I define the bitbox of the packet, then I put the underbrace below them.
    I have review the bytefield documentation and there is no underbrace example. I found this question Bytefield: Word Group below blocks but it only puts one underbrace. With that answer I was able to put 2 together and 2 together but not consecutive to each other. The code I have is the following:



    documentclass[border=10pt,png]{standalone}
    usepackage{amsmath}
    usepackage[endianness=big]{bytefield}
    bytefieldsetup{boxformatting={centeringfootnotesize}}
    begin{document}

    begin{bytefield}[bitwidth=1.1em]{21}
    bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
    bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
    bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
    bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
    bitbox{1}{...}\

    bitbox{0}{$underbrace{hspace{6.7em}}_{text{normalsize $A_0$}}$} &
    bitbox{15}{$underbrace{hspace{6.7em}}_{text{normalsize $A_1$}}$} &
    bitbox{0}{$underbrace{hspace{6.7em}}_{text{normalsize $A_2$}}$} &
    bitbox{15}{$underbrace{hspace{6.7em}}_{text{normalsize $A_3$}}$} \
    end{bytefield}
    end{document}


    The result I obtain is:
    enter image description here
    And what I wish to obtain is this:



    enter image description here



    I am not sure why this space appears between the first 2 underbrace and the third one. I have change the hspace, the value inside the bitbox{}, put the bitbox inside the underbrace, but nothing seems to do the trick.



    Thanks in advance for all your help.










    share|improve this question



























      1












      1








      1


      0






      I am new to LaTeX and I am trying to put multiple underbrace under a package using bytefield package. I want to have 4 underbrace consecutive to each other, but I am only able to put 2 and the other 2 appear with a space in between.



      First I define the bitbox of the packet, then I put the underbrace below them.
      I have review the bytefield documentation and there is no underbrace example. I found this question Bytefield: Word Group below blocks but it only puts one underbrace. With that answer I was able to put 2 together and 2 together but not consecutive to each other. The code I have is the following:



      documentclass[border=10pt,png]{standalone}
      usepackage{amsmath}
      usepackage[endianness=big]{bytefield}
      bytefieldsetup{boxformatting={centeringfootnotesize}}
      begin{document}

      begin{bytefield}[bitwidth=1.1em]{21}
      bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
      bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
      bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
      bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
      bitbox{1}{...}\

      bitbox{0}{$underbrace{hspace{6.7em}}_{text{normalsize $A_0$}}$} &
      bitbox{15}{$underbrace{hspace{6.7em}}_{text{normalsize $A_1$}}$} &
      bitbox{0}{$underbrace{hspace{6.7em}}_{text{normalsize $A_2$}}$} &
      bitbox{15}{$underbrace{hspace{6.7em}}_{text{normalsize $A_3$}}$} \
      end{bytefield}
      end{document}


      The result I obtain is:
      enter image description here
      And what I wish to obtain is this:



      enter image description here



      I am not sure why this space appears between the first 2 underbrace and the third one. I have change the hspace, the value inside the bitbox{}, put the bitbox inside the underbrace, but nothing seems to do the trick.



      Thanks in advance for all your help.










      share|improve this question
















      I am new to LaTeX and I am trying to put multiple underbrace under a package using bytefield package. I want to have 4 underbrace consecutive to each other, but I am only able to put 2 and the other 2 appear with a space in between.



      First I define the bitbox of the packet, then I put the underbrace below them.
      I have review the bytefield documentation and there is no underbrace example. I found this question Bytefield: Word Group below blocks but it only puts one underbrace. With that answer I was able to put 2 together and 2 together but not consecutive to each other. The code I have is the following:



      documentclass[border=10pt,png]{standalone}
      usepackage{amsmath}
      usepackage[endianness=big]{bytefield}
      bytefieldsetup{boxformatting={centeringfootnotesize}}
      begin{document}

      begin{bytefield}[bitwidth=1.1em]{21}
      bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
      bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
      bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
      bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
      bitbox{1}{...}\

      bitbox{0}{$underbrace{hspace{6.7em}}_{text{normalsize $A_0$}}$} &
      bitbox{15}{$underbrace{hspace{6.7em}}_{text{normalsize $A_1$}}$} &
      bitbox{0}{$underbrace{hspace{6.7em}}_{text{normalsize $A_2$}}$} &
      bitbox{15}{$underbrace{hspace{6.7em}}_{text{normalsize $A_3$}}$} \
      end{bytefield}
      end{document}


      The result I obtain is:
      enter image description here
      And what I wish to obtain is this:



      enter image description here



      I am not sure why this space appears between the first 2 underbrace and the third one. I have change the hspace, the value inside the bitbox{}, put the bitbox inside the underbrace, but nothing seems to do the trick.



      Thanks in advance for all your help.







      underbrace bytefield






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 7 at 21:15









      egreg

      719k8719083206




      719k8719083206










      asked Feb 7 at 10:50









      farahfarah

      83




      83






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Don't alternate between 0 and 15:



          documentclass{article}
          usepackage{amsmath}
          usepackage[endianness=big]{bytefield}

          bytefieldsetup{boxformatting={centeringfootnotesize}}

          begin{document}

          begin{bytefield}[bitwidth=1.1em]{21}
          bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
          bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
          bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
          bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
          bitbox{1}{...vphantom{1}}\

          bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_0$}}$} &
          bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_1$}}$} &
          bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_2$}}$} &
          bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_3$}}$} \
          end{bytefield}

          end{document}


          The 6.2 em has been computed by trial and error. Note the phantom in the last cell in order to set the dots at the right height.



          enter image description here






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "85"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f473740%2fbytefield-how-to-add-multiple-underbrace-below-bits-diagram%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Don't alternate between 0 and 15:



            documentclass{article}
            usepackage{amsmath}
            usepackage[endianness=big]{bytefield}

            bytefieldsetup{boxformatting={centeringfootnotesize}}

            begin{document}

            begin{bytefield}[bitwidth=1.1em]{21}
            bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
            bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
            bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
            bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
            bitbox{1}{...vphantom{1}}\

            bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_0$}}$} &
            bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_1$}}$} &
            bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_2$}}$} &
            bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_3$}}$} \
            end{bytefield}

            end{document}


            The 6.2 em has been computed by trial and error. Note the phantom in the last cell in order to set the dots at the right height.



            enter image description here






            share|improve this answer




























              1














              Don't alternate between 0 and 15:



              documentclass{article}
              usepackage{amsmath}
              usepackage[endianness=big]{bytefield}

              bytefieldsetup{boxformatting={centeringfootnotesize}}

              begin{document}

              begin{bytefield}[bitwidth=1.1em]{21}
              bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
              bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
              bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
              bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
              bitbox{1}{...vphantom{1}}\

              bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_0$}}$} &
              bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_1$}}$} &
              bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_2$}}$} &
              bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_3$}}$} \
              end{bytefield}

              end{document}


              The 6.2 em has been computed by trial and error. Note the phantom in the last cell in order to set the dots at the right height.



              enter image description here






              share|improve this answer


























                1












                1








                1







                Don't alternate between 0 and 15:



                documentclass{article}
                usepackage{amsmath}
                usepackage[endianness=big]{bytefield}

                bytefieldsetup{boxformatting={centeringfootnotesize}}

                begin{document}

                begin{bytefield}[bitwidth=1.1em]{21}
                bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
                bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
                bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
                bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
                bitbox{1}{...vphantom{1}}\

                bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_0$}}$} &
                bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_1$}}$} &
                bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_2$}}$} &
                bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_3$}}$} \
                end{bytefield}

                end{document}


                The 6.2 em has been computed by trial and error. Note the phantom in the last cell in order to set the dots at the right height.



                enter image description here






                share|improve this answer













                Don't alternate between 0 and 15:



                documentclass{article}
                usepackage{amsmath}
                usepackage[endianness=big]{bytefield}

                bytefieldsetup{boxformatting={centeringfootnotesize}}

                begin{document}

                begin{bytefield}[bitwidth=1.1em]{21}
                bitbox{1}{1} & bitbox{1}{2} & bitbox{1}{3} & bitbox{1}{4} & bitbox{1}{5} &
                bitbox{1}{6} & bitbox{1}{7} & bitbox{1}{8} & bitbox{1}{9} & bitbox{1}{10} &
                bitbox{1}{11} & bitbox{1}{12} & bitbox{1}{13} & bitbox{1}{14} & bitbox{1}{15} &
                bitbox{1}{16} & bitbox{1}{17} & bitbox{1}{18} & bitbox{1}{19} & bitbox{1}{20} &
                bitbox{1}{...vphantom{1}}\

                bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_0$}}$} &
                bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_1$}}$} &
                bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_2$}}$} &
                bitbox{5}{$underbrace{hspace{6.2em}}_{text{normalsize $A_3$}}$} \
                end{bytefield}

                end{document}


                The 6.2 em has been computed by trial and error. Note the phantom in the last cell in order to set the dots at the right height.



                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 7 at 21:31









                egregegreg

                719k8719083206




                719k8719083206






























                    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%2f473740%2fbytefield-how-to-add-multiple-underbrace-below-bits-diagram%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to send String Array data to Server using php in android

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                    Is anime1.com a legal site for watching anime?