Align horizontal cdots in an alignat environment












3















I am using alignat environment to align a set of equations which practically describe the same thing, but for different quantities. Therefore I decided to skip the common things and replace them with cdots, however I don't seem to be able to align them in the center.



enter image description here



Any idea to center the dots?



A sample code follows



documentclass{article}
usepackage{amsmath}

begin{document}

begin{alignat*}{4}
&sigma(E) &=& vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} &=& big{sigma_1, sigma_2, cdots, sigma_nbig}&\
&C(E) &=&{cdots}&=& big{C_1, C_2, cdots, C_nbig}&\
end{alignat*}

end{document}









share|improve this question























  • not directly releated, but don't use &=& in AMS environments, just &=

    – David Carlisle
    11 hours ago













  • @DavidCarlisle : Thank you very much for your comment and advice! But why not?

    – Thanos
    11 hours ago











  • it doesn't work, as you see in the image you posted the = has lost its relation spacing as the &=& has made it lose the expression on the right.

    – David Carlisle
    11 hours ago













  • @DavidCarlisle Oh, I see! Thank you very much for the explanation!

    – Thanos
    11 hours ago











  • Are you sure about vec{sigma(E)}?

    – egreg
    11 hours ago
















3















I am using alignat environment to align a set of equations which practically describe the same thing, but for different quantities. Therefore I decided to skip the common things and replace them with cdots, however I don't seem to be able to align them in the center.



enter image description here



Any idea to center the dots?



A sample code follows



documentclass{article}
usepackage{amsmath}

begin{document}

begin{alignat*}{4}
&sigma(E) &=& vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} &=& big{sigma_1, sigma_2, cdots, sigma_nbig}&\
&C(E) &=&{cdots}&=& big{C_1, C_2, cdots, C_nbig}&\
end{alignat*}

end{document}









share|improve this question























  • not directly releated, but don't use &=& in AMS environments, just &=

    – David Carlisle
    11 hours ago













  • @DavidCarlisle : Thank you very much for your comment and advice! But why not?

    – Thanos
    11 hours ago











  • it doesn't work, as you see in the image you posted the = has lost its relation spacing as the &=& has made it lose the expression on the right.

    – David Carlisle
    11 hours ago













  • @DavidCarlisle Oh, I see! Thank you very much for the explanation!

    – Thanos
    11 hours ago











  • Are you sure about vec{sigma(E)}?

    – egreg
    11 hours ago














3












3








3


0






I am using alignat environment to align a set of equations which practically describe the same thing, but for different quantities. Therefore I decided to skip the common things and replace them with cdots, however I don't seem to be able to align them in the center.



enter image description here



Any idea to center the dots?



A sample code follows



documentclass{article}
usepackage{amsmath}

begin{document}

begin{alignat*}{4}
&sigma(E) &=& vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} &=& big{sigma_1, sigma_2, cdots, sigma_nbig}&\
&C(E) &=&{cdots}&=& big{C_1, C_2, cdots, C_nbig}&\
end{alignat*}

end{document}









share|improve this question














I am using alignat environment to align a set of equations which practically describe the same thing, but for different quantities. Therefore I decided to skip the common things and replace them with cdots, however I don't seem to be able to align them in the center.



enter image description here



Any idea to center the dots?



A sample code follows



documentclass{article}
usepackage{amsmath}

begin{document}

begin{alignat*}{4}
&sigma(E) &=& vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} &=& big{sigma_1, sigma_2, cdots, sigma_nbig}&\
&C(E) &=&{cdots}&=& big{C_1, C_2, cdots, C_nbig}&\
end{alignat*}

end{document}






horizontal-alignment equations alignat






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 11 hours ago









ThanosThanos

6,1211454107




6,1211454107













  • not directly releated, but don't use &=& in AMS environments, just &=

    – David Carlisle
    11 hours ago













  • @DavidCarlisle : Thank you very much for your comment and advice! But why not?

    – Thanos
    11 hours ago











  • it doesn't work, as you see in the image you posted the = has lost its relation spacing as the &=& has made it lose the expression on the right.

    – David Carlisle
    11 hours ago













  • @DavidCarlisle Oh, I see! Thank you very much for the explanation!

    – Thanos
    11 hours ago











  • Are you sure about vec{sigma(E)}?

    – egreg
    11 hours ago



















  • not directly releated, but don't use &=& in AMS environments, just &=

    – David Carlisle
    11 hours ago













  • @DavidCarlisle : Thank you very much for your comment and advice! But why not?

    – Thanos
    11 hours ago











  • it doesn't work, as you see in the image you posted the = has lost its relation spacing as the &=& has made it lose the expression on the right.

    – David Carlisle
    11 hours ago













  • @DavidCarlisle Oh, I see! Thank you very much for the explanation!

    – Thanos
    11 hours ago











  • Are you sure about vec{sigma(E)}?

    – egreg
    11 hours ago

















not directly releated, but don't use &=& in AMS environments, just &=

– David Carlisle
11 hours ago







not directly releated, but don't use &=& in AMS environments, just &=

– David Carlisle
11 hours ago















@DavidCarlisle : Thank you very much for your comment and advice! But why not?

– Thanos
11 hours ago





@DavidCarlisle : Thank you very much for your comment and advice! But why not?

– Thanos
11 hours ago













it doesn't work, as you see in the image you posted the = has lost its relation spacing as the &=& has made it lose the expression on the right.

– David Carlisle
11 hours ago







it doesn't work, as you see in the image you posted the = has lost its relation spacing as the &=& has made it lose the expression on the right.

– David Carlisle
11 hours ago















@DavidCarlisle Oh, I see! Thank you very much for the explanation!

– Thanos
11 hours ago





@DavidCarlisle Oh, I see! Thank you very much for the explanation!

– Thanos
11 hours ago













Are you sure about vec{sigma(E)}?

– egreg
11 hours ago





Are you sure about vec{sigma(E)}?

– egreg
11 hours ago










3 Answers
3






active

oldest

votes


















2














You can result to low level TeX with the omit to break out of the current formatting:



Sample output



documentclass{article}

usepackage{amsmath}

begin{document}

begin{alignat*}{2}
sigma(E) &={}& vec{sigma(E)}
= bigl{sigma(E_1), sigma(E_2), dots, sigma(E_n)bigr}
&= bigl{sigma_1, sigma_2, dots, sigma_nbigr}\
C(E) &={}&omithfill$cdots$hfill
&= bigl{C_1, C_2, dots, C_nbigr}
end{alignat*}

end{document}


Note I have also added groups {} to get correct spacing at the equals signs, and use bigl...bigr instead of big. Also between commas you should just use dots (or dotsc).



Be careful here with the use of the ampersands &. In alignat, the alignment is implicitly rlrl... with the first group right aligned, the second left aligned, etc.






share|improve this answer


























  • Thank you very much for your help!

    – Thanos
    11 hours ago











  • omit doesn't take an argument

    – egreg
    11 hours ago



















3














A solution with the eqparbox package. Note that 2 alignment columns are enough.



documentclass{article}
usepackage{amsmath}
usepackage{eqparbox}
newcommand{eqmathbox}[2][M]{eqmakebox[#1]{$displaystyle#2$}}

begin{document}

begin{alignat*}{2}
sigma(E) &= {}& eqmathbox{vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big}} &= big{sigma_1, sigma_2, cdots, sigma_nbig}\
C(E) &= {}& eqmathbox{cdotscdots}&= big{C_1, C_2, cdots, C_nbig}\
end{alignat*}

end{document}


enter image description here






share|improve this answer































    2














    array is not made for aligning equations, but in this case, with a couple of tricks (@{} and {} where we want a correct spacing after/before the first/last equal sign), it may be convenient.



    documentclass{article}
    usepackage{amsmath}
    usepackage{array}
    begin{document}
    [
    begin{array}{r@{}c@{}l}
    sigma(E) ={} & vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} & {}= big{sigma_1, sigma_2, cdots, sigma_nbig}\
    C(E) ={} &cdots& {}= big{C_1, C_2, cdots, C_nbig}\
    end{array}
    ]
    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%2f478591%2falign-horizontal-cdots-in-an-alignat-environment%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









      2














      You can result to low level TeX with the omit to break out of the current formatting:



      Sample output



      documentclass{article}

      usepackage{amsmath}

      begin{document}

      begin{alignat*}{2}
      sigma(E) &={}& vec{sigma(E)}
      = bigl{sigma(E_1), sigma(E_2), dots, sigma(E_n)bigr}
      &= bigl{sigma_1, sigma_2, dots, sigma_nbigr}\
      C(E) &={}&omithfill$cdots$hfill
      &= bigl{C_1, C_2, dots, C_nbigr}
      end{alignat*}

      end{document}


      Note I have also added groups {} to get correct spacing at the equals signs, and use bigl...bigr instead of big. Also between commas you should just use dots (or dotsc).



      Be careful here with the use of the ampersands &. In alignat, the alignment is implicitly rlrl... with the first group right aligned, the second left aligned, etc.






      share|improve this answer


























      • Thank you very much for your help!

        – Thanos
        11 hours ago











      • omit doesn't take an argument

        – egreg
        11 hours ago
















      2














      You can result to low level TeX with the omit to break out of the current formatting:



      Sample output



      documentclass{article}

      usepackage{amsmath}

      begin{document}

      begin{alignat*}{2}
      sigma(E) &={}& vec{sigma(E)}
      = bigl{sigma(E_1), sigma(E_2), dots, sigma(E_n)bigr}
      &= bigl{sigma_1, sigma_2, dots, sigma_nbigr}\
      C(E) &={}&omithfill$cdots$hfill
      &= bigl{C_1, C_2, dots, C_nbigr}
      end{alignat*}

      end{document}


      Note I have also added groups {} to get correct spacing at the equals signs, and use bigl...bigr instead of big. Also between commas you should just use dots (or dotsc).



      Be careful here with the use of the ampersands &. In alignat, the alignment is implicitly rlrl... with the first group right aligned, the second left aligned, etc.






      share|improve this answer


























      • Thank you very much for your help!

        – Thanos
        11 hours ago











      • omit doesn't take an argument

        – egreg
        11 hours ago














      2












      2








      2







      You can result to low level TeX with the omit to break out of the current formatting:



      Sample output



      documentclass{article}

      usepackage{amsmath}

      begin{document}

      begin{alignat*}{2}
      sigma(E) &={}& vec{sigma(E)}
      = bigl{sigma(E_1), sigma(E_2), dots, sigma(E_n)bigr}
      &= bigl{sigma_1, sigma_2, dots, sigma_nbigr}\
      C(E) &={}&omithfill$cdots$hfill
      &= bigl{C_1, C_2, dots, C_nbigr}
      end{alignat*}

      end{document}


      Note I have also added groups {} to get correct spacing at the equals signs, and use bigl...bigr instead of big. Also between commas you should just use dots (or dotsc).



      Be careful here with the use of the ampersands &. In alignat, the alignment is implicitly rlrl... with the first group right aligned, the second left aligned, etc.






      share|improve this answer















      You can result to low level TeX with the omit to break out of the current formatting:



      Sample output



      documentclass{article}

      usepackage{amsmath}

      begin{document}

      begin{alignat*}{2}
      sigma(E) &={}& vec{sigma(E)}
      = bigl{sigma(E_1), sigma(E_2), dots, sigma(E_n)bigr}
      &= bigl{sigma_1, sigma_2, dots, sigma_nbigr}\
      C(E) &={}&omithfill$cdots$hfill
      &= bigl{C_1, C_2, dots, C_nbigr}
      end{alignat*}

      end{document}


      Note I have also added groups {} to get correct spacing at the equals signs, and use bigl...bigr instead of big. Also between commas you should just use dots (or dotsc).



      Be careful here with the use of the ampersands &. In alignat, the alignment is implicitly rlrl... with the first group right aligned, the second left aligned, etc.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited 10 hours ago

























      answered 11 hours ago









      Andrew SwannAndrew Swann

      77.4k9130330




      77.4k9130330













      • Thank you very much for your help!

        – Thanos
        11 hours ago











      • omit doesn't take an argument

        – egreg
        11 hours ago



















      • Thank you very much for your help!

        – Thanos
        11 hours ago











      • omit doesn't take an argument

        – egreg
        11 hours ago

















      Thank you very much for your help!

      – Thanos
      11 hours ago





      Thank you very much for your help!

      – Thanos
      11 hours ago













      omit doesn't take an argument

      – egreg
      11 hours ago





      omit doesn't take an argument

      – egreg
      11 hours ago











      3














      A solution with the eqparbox package. Note that 2 alignment columns are enough.



      documentclass{article}
      usepackage{amsmath}
      usepackage{eqparbox}
      newcommand{eqmathbox}[2][M]{eqmakebox[#1]{$displaystyle#2$}}

      begin{document}

      begin{alignat*}{2}
      sigma(E) &= {}& eqmathbox{vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big}} &= big{sigma_1, sigma_2, cdots, sigma_nbig}\
      C(E) &= {}& eqmathbox{cdotscdots}&= big{C_1, C_2, cdots, C_nbig}\
      end{alignat*}

      end{document}


      enter image description here






      share|improve this answer




























        3














        A solution with the eqparbox package. Note that 2 alignment columns are enough.



        documentclass{article}
        usepackage{amsmath}
        usepackage{eqparbox}
        newcommand{eqmathbox}[2][M]{eqmakebox[#1]{$displaystyle#2$}}

        begin{document}

        begin{alignat*}{2}
        sigma(E) &= {}& eqmathbox{vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big}} &= big{sigma_1, sigma_2, cdots, sigma_nbig}\
        C(E) &= {}& eqmathbox{cdotscdots}&= big{C_1, C_2, cdots, C_nbig}\
        end{alignat*}

        end{document}


        enter image description here






        share|improve this answer


























          3












          3








          3







          A solution with the eqparbox package. Note that 2 alignment columns are enough.



          documentclass{article}
          usepackage{amsmath}
          usepackage{eqparbox}
          newcommand{eqmathbox}[2][M]{eqmakebox[#1]{$displaystyle#2$}}

          begin{document}

          begin{alignat*}{2}
          sigma(E) &= {}& eqmathbox{vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big}} &= big{sigma_1, sigma_2, cdots, sigma_nbig}\
          C(E) &= {}& eqmathbox{cdotscdots}&= big{C_1, C_2, cdots, C_nbig}\
          end{alignat*}

          end{document}


          enter image description here






          share|improve this answer













          A solution with the eqparbox package. Note that 2 alignment columns are enough.



          documentclass{article}
          usepackage{amsmath}
          usepackage{eqparbox}
          newcommand{eqmathbox}[2][M]{eqmakebox[#1]{$displaystyle#2$}}

          begin{document}

          begin{alignat*}{2}
          sigma(E) &= {}& eqmathbox{vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big}} &= big{sigma_1, sigma_2, cdots, sigma_nbig}\
          C(E) &= {}& eqmathbox{cdotscdots}&= big{C_1, C_2, cdots, C_nbig}\
          end{alignat*}

          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 10 hours ago









          BernardBernard

          172k776204




          172k776204























              2














              array is not made for aligning equations, but in this case, with a couple of tricks (@{} and {} where we want a correct spacing after/before the first/last equal sign), it may be convenient.



              documentclass{article}
              usepackage{amsmath}
              usepackage{array}
              begin{document}
              [
              begin{array}{r@{}c@{}l}
              sigma(E) ={} & vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} & {}= big{sigma_1, sigma_2, cdots, sigma_nbig}\
              C(E) ={} &cdots& {}= big{C_1, C_2, cdots, C_nbig}\
              end{array}
              ]
              end{document}


              enter image description here






              share|improve this answer






























                2














                array is not made for aligning equations, but in this case, with a couple of tricks (@{} and {} where we want a correct spacing after/before the first/last equal sign), it may be convenient.



                documentclass{article}
                usepackage{amsmath}
                usepackage{array}
                begin{document}
                [
                begin{array}{r@{}c@{}l}
                sigma(E) ={} & vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} & {}= big{sigma_1, sigma_2, cdots, sigma_nbig}\
                C(E) ={} &cdots& {}= big{C_1, C_2, cdots, C_nbig}\
                end{array}
                ]
                end{document}


                enter image description here






                share|improve this answer




























                  2












                  2








                  2







                  array is not made for aligning equations, but in this case, with a couple of tricks (@{} and {} where we want a correct spacing after/before the first/last equal sign), it may be convenient.



                  documentclass{article}
                  usepackage{amsmath}
                  usepackage{array}
                  begin{document}
                  [
                  begin{array}{r@{}c@{}l}
                  sigma(E) ={} & vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} & {}= big{sigma_1, sigma_2, cdots, sigma_nbig}\
                  C(E) ={} &cdots& {}= big{C_1, C_2, cdots, C_nbig}\
                  end{array}
                  ]
                  end{document}


                  enter image description here






                  share|improve this answer















                  array is not made for aligning equations, but in this case, with a couple of tricks (@{} and {} where we want a correct spacing after/before the first/last equal sign), it may be convenient.



                  documentclass{article}
                  usepackage{amsmath}
                  usepackage{array}
                  begin{document}
                  [
                  begin{array}{r@{}c@{}l}
                  sigma(E) ={} & vec{sigma(E)} = big{sigma(E_1), sigma(E_2), cdots, sigma(E_n)big} & {}= big{sigma_1, sigma_2, cdots, sigma_nbig}\
                  C(E) ={} &cdots& {}= big{C_1, C_2, cdots, C_nbig}\
                  end{array}
                  ]
                  end{document}


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 6 hours ago

























                  answered 7 hours ago









                  CarLaTeXCarLaTeX

                  32.9k551136




                  32.9k551136






























                      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%2f478591%2falign-horizontal-cdots-in-an-alignat-environment%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 did Captain America manage to do this?

                      迪纳利

                      南乌拉尔铁路局