How to write mathematics with boxes?












12















I want to write the mathematics inside the box as written below.



enter image description here



See my code given below:



documentclass{article}

begin{document}
\fbox{text}
framebox[width][pos]{text}

makebox[textwidth]{X_1 X_2} par
makebox[textwidth]{X_3 X_4} par
cdots
makebox[textwidth]{X_4 X_6} par

end{document}


Question: I want to write the above maths, How to write it properly?










share|improve this question

























  • Before asking a new question, if you think the answers useful (incl. answers to your past questions), then consider accepting it by clicking the tick mark below the voting mark.

    – Raaja
    Feb 2 at 8:37
















12















I want to write the mathematics inside the box as written below.



enter image description here



See my code given below:



documentclass{article}

begin{document}
\fbox{text}
framebox[width][pos]{text}

makebox[textwidth]{X_1 X_2} par
makebox[textwidth]{X_3 X_4} par
cdots
makebox[textwidth]{X_4 X_6} par

end{document}


Question: I want to write the above maths, How to write it properly?










share|improve this question

























  • Before asking a new question, if you think the answers useful (incl. answers to your past questions), then consider accepting it by clicking the tick mark below the voting mark.

    – Raaja
    Feb 2 at 8:37














12












12








12


5






I want to write the mathematics inside the box as written below.



enter image description here



See my code given below:



documentclass{article}

begin{document}
\fbox{text}
framebox[width][pos]{text}

makebox[textwidth]{X_1 X_2} par
makebox[textwidth]{X_3 X_4} par
cdots
makebox[textwidth]{X_4 X_6} par

end{document}


Question: I want to write the above maths, How to write it properly?










share|improve this question
















I want to write the mathematics inside the box as written below.



enter image description here



See my code given below:



documentclass{article}

begin{document}
\fbox{text}
framebox[width][pos]{text}

makebox[textwidth]{X_1 X_2} par
makebox[textwidth]{X_3 X_4} par
cdots
makebox[textwidth]{X_4 X_6} par

end{document}


Question: I want to write the above maths, How to write it properly?







boxes






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 31 at 6:34









marmot

108k5132250




108k5132250










asked Jan 31 at 6:33









Isla_BonitaIsla_Bonita

26119




26119













  • Before asking a new question, if you think the answers useful (incl. answers to your past questions), then consider accepting it by clicking the tick mark below the voting mark.

    – Raaja
    Feb 2 at 8:37



















  • Before asking a new question, if you think the answers useful (incl. answers to your past questions), then consider accepting it by clicking the tick mark below the voting mark.

    – Raaja
    Feb 2 at 8:37

















Before asking a new question, if you think the answers useful (incl. answers to your past questions), then consider accepting it by clicking the tick mark below the voting mark.

– Raaja
Feb 2 at 8:37





Before asking a new question, if you think the answers useful (incl. answers to your past questions), then consider accepting it by clicking the tick mark below the voting mark.

– Raaja
Feb 2 at 8:37










3 Answers
3






active

oldest

votes


















20














You can use boxed command from amsmath package



documentclass{article}
usepackage{amsmath}
begin{document}

begin{equation*}
X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
end{equation*}



end{document}


enter image description here



To add colors and labels below boxes



documentclass{article}
usepackage{amsmath,tcolorbox}
tcbuselibrary{theorems,skins}
usetikzlibrary{arrows.meta}

newlengthmylabelshift
setlengthmylabelshift{3mm} % to be adjusted if needed

newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
newtcbox{mymathbox}[1][l]{
enhanced,
nobeforeafter,
math upper,
tcbox raise base,
colback=blue!30, % to set background color
size=small,
geometry nodes,
overlay={drawlabel{#1}},
tcbox width=minimum center,
width= 2 cm ,% to be adjusted if needed
}
begin{document}

begin{equation*}
X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4 X_5}cdotsmymathbox{X_5 X_6}
end{equation*}
vspace{1cm}
begin{equation*}
X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
end{equation*}


end{document}


enter image description here






share|improve this answer


























  • I would like to change the color of each box

    – Isla_Bonita
    Jan 31 at 7:46











  • One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.

    – Isla_Bonita
    Jan 31 at 7:49











  • I think you misunderstood me, I mean to say in the second box put three symbols and then see

    – Isla_Bonita
    Jan 31 at 7:52











  • Lets say I want five symbol maximum in the box

    – Isla_Bonita
    Jan 31 at 7:56











  • @Isla_Bonita So you want all the three boxes with the same size irrespective of their contents?

    – Hafid Boukhoulda
    Jan 31 at 7:59



















11














Depends on how fancy you want to go. In principle you do not need any packages for that.



documentclass{article}
begin{document}
[
X=
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_1 X_2}\
hline
leftarrowellrightarrow\
end{array}$}~
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_3 X_4}\
hline
leftarrowellrightarrow\
end{array}$}cdots
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_5 X_6}\
hline
leftarrowellrightarrow\
end{array}$}
]

end{document}


enter image description here






share|improve this answer































    3














    Here's a package-free version (amsmath is always needed if one does math).



    documentclass{article}
    usepackage{amsmath}

    newcommand{block}[2]{%
    begin{array}[t]{@{}c@{}}
    boxed{mathstrut #1}\
    scriptstyleblockleftarrowfill,#2,blockrightarrowfill
    end{array}%
    }
    newcommand{blockleftarrowfill}{%
    mathordleftarrow
    mkern -7mu
    cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
    mkern -7musmash-%
    }
    newcommand{blockrightarrowfill}{%
    smash-%
    mkern -7mu
    cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
    mkern -7mu
    mathordrightarrow
    }

    begin{document}

    [
    X= block{x_1 x_2quad}{l}quad
    block{x_3 x_4quad}{l}quad
    cdotsquad
    block{x_5 x_6quad}{l}
    ]

    end{document}


    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%2f472679%2fhow-to-write-mathematics-with-boxes%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









      20














      You can use boxed command from amsmath package



      documentclass{article}
      usepackage{amsmath}
      begin{document}

      begin{equation*}
      X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
      end{equation*}



      end{document}


      enter image description here



      To add colors and labels below boxes



      documentclass{article}
      usepackage{amsmath,tcolorbox}
      tcbuselibrary{theorems,skins}
      usetikzlibrary{arrows.meta}

      newlengthmylabelshift
      setlengthmylabelshift{3mm} % to be adjusted if needed

      newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
      newtcbox{mymathbox}[1][l]{
      enhanced,
      nobeforeafter,
      math upper,
      tcbox raise base,
      colback=blue!30, % to set background color
      size=small,
      geometry nodes,
      overlay={drawlabel{#1}},
      tcbox width=minimum center,
      width= 2 cm ,% to be adjusted if needed
      }
      begin{document}

      begin{equation*}
      X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4 X_5}cdotsmymathbox{X_5 X_6}
      end{equation*}
      vspace{1cm}
      begin{equation*}
      X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
      end{equation*}


      end{document}


      enter image description here






      share|improve this answer


























      • I would like to change the color of each box

        – Isla_Bonita
        Jan 31 at 7:46











      • One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.

        – Isla_Bonita
        Jan 31 at 7:49











      • I think you misunderstood me, I mean to say in the second box put three symbols and then see

        – Isla_Bonita
        Jan 31 at 7:52











      • Lets say I want five symbol maximum in the box

        – Isla_Bonita
        Jan 31 at 7:56











      • @Isla_Bonita So you want all the three boxes with the same size irrespective of their contents?

        – Hafid Boukhoulda
        Jan 31 at 7:59
















      20














      You can use boxed command from amsmath package



      documentclass{article}
      usepackage{amsmath}
      begin{document}

      begin{equation*}
      X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
      end{equation*}



      end{document}


      enter image description here



      To add colors and labels below boxes



      documentclass{article}
      usepackage{amsmath,tcolorbox}
      tcbuselibrary{theorems,skins}
      usetikzlibrary{arrows.meta}

      newlengthmylabelshift
      setlengthmylabelshift{3mm} % to be adjusted if needed

      newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
      newtcbox{mymathbox}[1][l]{
      enhanced,
      nobeforeafter,
      math upper,
      tcbox raise base,
      colback=blue!30, % to set background color
      size=small,
      geometry nodes,
      overlay={drawlabel{#1}},
      tcbox width=minimum center,
      width= 2 cm ,% to be adjusted if needed
      }
      begin{document}

      begin{equation*}
      X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4 X_5}cdotsmymathbox{X_5 X_6}
      end{equation*}
      vspace{1cm}
      begin{equation*}
      X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
      end{equation*}


      end{document}


      enter image description here






      share|improve this answer


























      • I would like to change the color of each box

        – Isla_Bonita
        Jan 31 at 7:46











      • One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.

        – Isla_Bonita
        Jan 31 at 7:49











      • I think you misunderstood me, I mean to say in the second box put three symbols and then see

        – Isla_Bonita
        Jan 31 at 7:52











      • Lets say I want five symbol maximum in the box

        – Isla_Bonita
        Jan 31 at 7:56











      • @Isla_Bonita So you want all the three boxes with the same size irrespective of their contents?

        – Hafid Boukhoulda
        Jan 31 at 7:59














      20












      20








      20







      You can use boxed command from amsmath package



      documentclass{article}
      usepackage{amsmath}
      begin{document}

      begin{equation*}
      X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
      end{equation*}



      end{document}


      enter image description here



      To add colors and labels below boxes



      documentclass{article}
      usepackage{amsmath,tcolorbox}
      tcbuselibrary{theorems,skins}
      usetikzlibrary{arrows.meta}

      newlengthmylabelshift
      setlengthmylabelshift{3mm} % to be adjusted if needed

      newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
      newtcbox{mymathbox}[1][l]{
      enhanced,
      nobeforeafter,
      math upper,
      tcbox raise base,
      colback=blue!30, % to set background color
      size=small,
      geometry nodes,
      overlay={drawlabel{#1}},
      tcbox width=minimum center,
      width= 2 cm ,% to be adjusted if needed
      }
      begin{document}

      begin{equation*}
      X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4 X_5}cdotsmymathbox{X_5 X_6}
      end{equation*}
      vspace{1cm}
      begin{equation*}
      X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
      end{equation*}


      end{document}


      enter image description here






      share|improve this answer















      You can use boxed command from amsmath package



      documentclass{article}
      usepackage{amsmath}
      begin{document}

      begin{equation*}
      X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
      end{equation*}



      end{document}


      enter image description here



      To add colors and labels below boxes



      documentclass{article}
      usepackage{amsmath,tcolorbox}
      tcbuselibrary{theorems,skins}
      usetikzlibrary{arrows.meta}

      newlengthmylabelshift
      setlengthmylabelshift{3mm} % to be adjusted if needed

      newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
      newtcbox{mymathbox}[1][l]{
      enhanced,
      nobeforeafter,
      math upper,
      tcbox raise base,
      colback=blue!30, % to set background color
      size=small,
      geometry nodes,
      overlay={drawlabel{#1}},
      tcbox width=minimum center,
      width= 2 cm ,% to be adjusted if needed
      }
      begin{document}

      begin{equation*}
      X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4 X_5}cdotsmymathbox{X_5 X_6}
      end{equation*}
      vspace{1cm}
      begin{equation*}
      X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
      end{equation*}


      end{document}


      enter image description here







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jan 31 at 9:40

























      answered Jan 31 at 6:42









      Hafid BoukhouldaHafid Boukhoulda

      4,5741625




      4,5741625













      • I would like to change the color of each box

        – Isla_Bonita
        Jan 31 at 7:46











      • One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.

        – Isla_Bonita
        Jan 31 at 7:49











      • I think you misunderstood me, I mean to say in the second box put three symbols and then see

        – Isla_Bonita
        Jan 31 at 7:52











      • Lets say I want five symbol maximum in the box

        – Isla_Bonita
        Jan 31 at 7:56











      • @Isla_Bonita So you want all the three boxes with the same size irrespective of their contents?

        – Hafid Boukhoulda
        Jan 31 at 7:59



















      • I would like to change the color of each box

        – Isla_Bonita
        Jan 31 at 7:46











      • One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.

        – Isla_Bonita
        Jan 31 at 7:49











      • I think you misunderstood me, I mean to say in the second box put three symbols and then see

        – Isla_Bonita
        Jan 31 at 7:52











      • Lets say I want five symbol maximum in the box

        – Isla_Bonita
        Jan 31 at 7:56











      • @Isla_Bonita So you want all the three boxes with the same size irrespective of their contents?

        – Hafid Boukhoulda
        Jan 31 at 7:59

















      I would like to change the color of each box

      – Isla_Bonita
      Jan 31 at 7:46





      I would like to change the color of each box

      – Isla_Bonita
      Jan 31 at 7:46













      One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.

      – Isla_Bonita
      Jan 31 at 7:49





      One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.

      – Isla_Bonita
      Jan 31 at 7:49













      I think you misunderstood me, I mean to say in the second box put three symbols and then see

      – Isla_Bonita
      Jan 31 at 7:52





      I think you misunderstood me, I mean to say in the second box put three symbols and then see

      – Isla_Bonita
      Jan 31 at 7:52













      Lets say I want five symbol maximum in the box

      – Isla_Bonita
      Jan 31 at 7:56





      Lets say I want five symbol maximum in the box

      – Isla_Bonita
      Jan 31 at 7:56













      @Isla_Bonita So you want all the three boxes with the same size irrespective of their contents?

      – Hafid Boukhoulda
      Jan 31 at 7:59





      @Isla_Bonita So you want all the three boxes with the same size irrespective of their contents?

      – Hafid Boukhoulda
      Jan 31 at 7:59











      11














      Depends on how fancy you want to go. In principle you do not need any packages for that.



      documentclass{article}
      begin{document}
      [
      X=
      raisebox{-1.5ex}{$begin{array}{c}
      hline
      multicolumn{1}{|c|}{X_1 X_2}\
      hline
      leftarrowellrightarrow\
      end{array}$}~
      raisebox{-1.5ex}{$begin{array}{c}
      hline
      multicolumn{1}{|c|}{X_3 X_4}\
      hline
      leftarrowellrightarrow\
      end{array}$}cdots
      raisebox{-1.5ex}{$begin{array}{c}
      hline
      multicolumn{1}{|c|}{X_5 X_6}\
      hline
      leftarrowellrightarrow\
      end{array}$}
      ]

      end{document}


      enter image description here






      share|improve this answer




























        11














        Depends on how fancy you want to go. In principle you do not need any packages for that.



        documentclass{article}
        begin{document}
        [
        X=
        raisebox{-1.5ex}{$begin{array}{c}
        hline
        multicolumn{1}{|c|}{X_1 X_2}\
        hline
        leftarrowellrightarrow\
        end{array}$}~
        raisebox{-1.5ex}{$begin{array}{c}
        hline
        multicolumn{1}{|c|}{X_3 X_4}\
        hline
        leftarrowellrightarrow\
        end{array}$}cdots
        raisebox{-1.5ex}{$begin{array}{c}
        hline
        multicolumn{1}{|c|}{X_5 X_6}\
        hline
        leftarrowellrightarrow\
        end{array}$}
        ]

        end{document}


        enter image description here






        share|improve this answer


























          11












          11








          11







          Depends on how fancy you want to go. In principle you do not need any packages for that.



          documentclass{article}
          begin{document}
          [
          X=
          raisebox{-1.5ex}{$begin{array}{c}
          hline
          multicolumn{1}{|c|}{X_1 X_2}\
          hline
          leftarrowellrightarrow\
          end{array}$}~
          raisebox{-1.5ex}{$begin{array}{c}
          hline
          multicolumn{1}{|c|}{X_3 X_4}\
          hline
          leftarrowellrightarrow\
          end{array}$}cdots
          raisebox{-1.5ex}{$begin{array}{c}
          hline
          multicolumn{1}{|c|}{X_5 X_6}\
          hline
          leftarrowellrightarrow\
          end{array}$}
          ]

          end{document}


          enter image description here






          share|improve this answer













          Depends on how fancy you want to go. In principle you do not need any packages for that.



          documentclass{article}
          begin{document}
          [
          X=
          raisebox{-1.5ex}{$begin{array}{c}
          hline
          multicolumn{1}{|c|}{X_1 X_2}\
          hline
          leftarrowellrightarrow\
          end{array}$}~
          raisebox{-1.5ex}{$begin{array}{c}
          hline
          multicolumn{1}{|c|}{X_3 X_4}\
          hline
          leftarrowellrightarrow\
          end{array}$}cdots
          raisebox{-1.5ex}{$begin{array}{c}
          hline
          multicolumn{1}{|c|}{X_5 X_6}\
          hline
          leftarrowellrightarrow\
          end{array}$}
          ]

          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 31 at 6:48









          marmotmarmot

          108k5132250




          108k5132250























              3














              Here's a package-free version (amsmath is always needed if one does math).



              documentclass{article}
              usepackage{amsmath}

              newcommand{block}[2]{%
              begin{array}[t]{@{}c@{}}
              boxed{mathstrut #1}\
              scriptstyleblockleftarrowfill,#2,blockrightarrowfill
              end{array}%
              }
              newcommand{blockleftarrowfill}{%
              mathordleftarrow
              mkern -7mu
              cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
              mkern -7musmash-%
              }
              newcommand{blockrightarrowfill}{%
              smash-%
              mkern -7mu
              cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
              mkern -7mu
              mathordrightarrow
              }

              begin{document}

              [
              X= block{x_1 x_2quad}{l}quad
              block{x_3 x_4quad}{l}quad
              cdotsquad
              block{x_5 x_6quad}{l}
              ]

              end{document}


              enter image description here






              share|improve this answer




























                3














                Here's a package-free version (amsmath is always needed if one does math).



                documentclass{article}
                usepackage{amsmath}

                newcommand{block}[2]{%
                begin{array}[t]{@{}c@{}}
                boxed{mathstrut #1}\
                scriptstyleblockleftarrowfill,#2,blockrightarrowfill
                end{array}%
                }
                newcommand{blockleftarrowfill}{%
                mathordleftarrow
                mkern -7mu
                cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
                mkern -7musmash-%
                }
                newcommand{blockrightarrowfill}{%
                smash-%
                mkern -7mu
                cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
                mkern -7mu
                mathordrightarrow
                }

                begin{document}

                [
                X= block{x_1 x_2quad}{l}quad
                block{x_3 x_4quad}{l}quad
                cdotsquad
                block{x_5 x_6quad}{l}
                ]

                end{document}


                enter image description here






                share|improve this answer


























                  3












                  3








                  3







                  Here's a package-free version (amsmath is always needed if one does math).



                  documentclass{article}
                  usepackage{amsmath}

                  newcommand{block}[2]{%
                  begin{array}[t]{@{}c@{}}
                  boxed{mathstrut #1}\
                  scriptstyleblockleftarrowfill,#2,blockrightarrowfill
                  end{array}%
                  }
                  newcommand{blockleftarrowfill}{%
                  mathordleftarrow
                  mkern -7mu
                  cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
                  mkern -7musmash-%
                  }
                  newcommand{blockrightarrowfill}{%
                  smash-%
                  mkern -7mu
                  cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
                  mkern -7mu
                  mathordrightarrow
                  }

                  begin{document}

                  [
                  X= block{x_1 x_2quad}{l}quad
                  block{x_3 x_4quad}{l}quad
                  cdotsquad
                  block{x_5 x_6quad}{l}
                  ]

                  end{document}


                  enter image description here






                  share|improve this answer













                  Here's a package-free version (amsmath is always needed if one does math).



                  documentclass{article}
                  usepackage{amsmath}

                  newcommand{block}[2]{%
                  begin{array}[t]{@{}c@{}}
                  boxed{mathstrut #1}\
                  scriptstyleblockleftarrowfill,#2,blockrightarrowfill
                  end{array}%
                  }
                  newcommand{blockleftarrowfill}{%
                  mathordleftarrow
                  mkern -7mu
                  cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
                  mkern -7musmash-%
                  }
                  newcommand{blockrightarrowfill}{%
                  smash-%
                  mkern -7mu
                  cleadershbox{$scriptstylemkern -2musmash-mkern -2mu$}hfill
                  mkern -7mu
                  mathordrightarrow
                  }

                  begin{document}

                  [
                  X= block{x_1 x_2quad}{l}quad
                  block{x_3 x_4quad}{l}quad
                  cdotsquad
                  block{x_5 x_6quad}{l}
                  ]

                  end{document}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 31 at 10:32









                  egregegreg

                  726k8819213228




                  726k8819213228






























                      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%2f472679%2fhow-to-write-mathematics-with-boxes%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

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      File:DeusFollowingSea.jpg