Question about aligning equations












0















When using begin{align}end{align},do I use & or \, or both, to get equations to appear on successive lines



I have a number of equations I would like to appear on successive lines. E.g.



a=b
c=d
.
.
.
e=f


etc... lined up, like such.










share|improve this question















migrated from stackoverflow.com Jan 20 at 14:53


This question came from our site for professional and enthusiast programmers.



















  • Did you try both options (see title)? Please review writing the perfect question to help you to ask a good question, and thus get a good answer.

    – Jeroen Heier
    Jan 19 at 7:28











  • I did try both. It seems only " \" is necessary.

    – Chris Custer
    Jan 19 at 8:27
















0















When using begin{align}end{align},do I use & or \, or both, to get equations to appear on successive lines



I have a number of equations I would like to appear on successive lines. E.g.



a=b
c=d
.
.
.
e=f


etc... lined up, like such.










share|improve this question















migrated from stackoverflow.com Jan 20 at 14:53


This question came from our site for professional and enthusiast programmers.



















  • Did you try both options (see title)? Please review writing the perfect question to help you to ask a good question, and thus get a good answer.

    – Jeroen Heier
    Jan 19 at 7:28











  • I did try both. It seems only " \" is necessary.

    – Chris Custer
    Jan 19 at 8:27














0












0








0








When using begin{align}end{align},do I use & or \, or both, to get equations to appear on successive lines



I have a number of equations I would like to appear on successive lines. E.g.



a=b
c=d
.
.
.
e=f


etc... lined up, like such.










share|improve this question
















When using begin{align}end{align},do I use & or \, or both, to get equations to appear on successive lines



I have a number of equations I would like to appear on successive lines. E.g.



a=b
c=d
.
.
.
e=f


etc... lined up, like such.







mathjax






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 9 mins ago







Chris Custer

















asked Jan 19 at 7:20









Chris CusterChris Custer

1014




1014




migrated from stackoverflow.com Jan 20 at 14:53


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Jan 20 at 14:53


This question came from our site for professional and enthusiast programmers.















  • Did you try both options (see title)? Please review writing the perfect question to help you to ask a good question, and thus get a good answer.

    – Jeroen Heier
    Jan 19 at 7:28











  • I did try both. It seems only " \" is necessary.

    – Chris Custer
    Jan 19 at 8:27



















  • Did you try both options (see title)? Please review writing the perfect question to help you to ask a good question, and thus get a good answer.

    – Jeroen Heier
    Jan 19 at 7:28











  • I did try both. It seems only " \" is necessary.

    – Chris Custer
    Jan 19 at 8:27

















Did you try both options (see title)? Please review writing the perfect question to help you to ask a good question, and thus get a good answer.

– Jeroen Heier
Jan 19 at 7:28





Did you try both options (see title)? Please review writing the perfect question to help you to ask a good question, and thus get a good answer.

– Jeroen Heier
Jan 19 at 7:28













I did try both. It seems only " \" is necessary.

– Chris Custer
Jan 19 at 8:27





I did try both. It seems only " \" is necessary.

– Chris Custer
Jan 19 at 8:27










2 Answers
2






active

oldest

votes


















2














align sets a display math environment where & is used as alignment points (and separation between alignments) while \ is used to separate equations vertically. It works similar to an array or tabular. You don't have to use & in an align, but \ is necessary to put equations on different lines.



enter image description here



documentclass{article}

usepackage{amsmath}

begin{document}

begin{align}
f'(x) &= e^x (sin x + cos x) \
implies f''(x) &= 2e^x cos x \
implies f^3(x) &= 2e^x (cos x - sin x) \
implies f^4(x) &= 2e^x (-2sin x) = -4 f(x) \
implies f^5(x) &= -4 f'(x) \
implies f^8(x) &= -4 f^4(x) = 16 f(x) \
implies f^{10}(x) &= 16 f''(x)
end{align}

end{document}


If you're using MathJax, the same principle holds.






share|improve this answer































    0














    It looks as if both were used in this edit of one of my posts:



    $begin{align}f'(x)&=e^x(sin x+cos x)\
    implies f''(x)&=2e^xcos x\
    implies f^3(x)&=2e^x(cos x-sin x)\
    implies f^4(x)&=2e^x(-2sin x)=-4f(x)\
    implies f^5(x)&=-4f'(x)\
    implies f^8(x)&=-4f^4(x)=16f(x)\
    implies f^{10}(x)&=16f''(x)end{align}$


    I get the impression the &'s aren't really necessary, though. But when I took one '&' out, it didn't render (presumably I could take them all out).






    share|improve this answer



















    • 1





      This is wrong; begin{align}...end{align} should not appear inside math mode $...$ as it sets itself as a display math construction already.

      – Werner
      Jan 19 at 19:28






    • 1





      You can verify this on Mathematics.

      – Werner
      Jan 19 at 19:35











    • Thanks for the heads up.

      – Chris Custer
      Jan 19 at 20:39











    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%2f471008%2fquestion-about-aligning-equations%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














    align sets a display math environment where & is used as alignment points (and separation between alignments) while \ is used to separate equations vertically. It works similar to an array or tabular. You don't have to use & in an align, but \ is necessary to put equations on different lines.



    enter image description here



    documentclass{article}

    usepackage{amsmath}

    begin{document}

    begin{align}
    f'(x) &= e^x (sin x + cos x) \
    implies f''(x) &= 2e^x cos x \
    implies f^3(x) &= 2e^x (cos x - sin x) \
    implies f^4(x) &= 2e^x (-2sin x) = -4 f(x) \
    implies f^5(x) &= -4 f'(x) \
    implies f^8(x) &= -4 f^4(x) = 16 f(x) \
    implies f^{10}(x) &= 16 f''(x)
    end{align}

    end{document}


    If you're using MathJax, the same principle holds.






    share|improve this answer




























      2














      align sets a display math environment where & is used as alignment points (and separation between alignments) while \ is used to separate equations vertically. It works similar to an array or tabular. You don't have to use & in an align, but \ is necessary to put equations on different lines.



      enter image description here



      documentclass{article}

      usepackage{amsmath}

      begin{document}

      begin{align}
      f'(x) &= e^x (sin x + cos x) \
      implies f''(x) &= 2e^x cos x \
      implies f^3(x) &= 2e^x (cos x - sin x) \
      implies f^4(x) &= 2e^x (-2sin x) = -4 f(x) \
      implies f^5(x) &= -4 f'(x) \
      implies f^8(x) &= -4 f^4(x) = 16 f(x) \
      implies f^{10}(x) &= 16 f''(x)
      end{align}

      end{document}


      If you're using MathJax, the same principle holds.






      share|improve this answer


























        2












        2








        2







        align sets a display math environment where & is used as alignment points (and separation between alignments) while \ is used to separate equations vertically. It works similar to an array or tabular. You don't have to use & in an align, but \ is necessary to put equations on different lines.



        enter image description here



        documentclass{article}

        usepackage{amsmath}

        begin{document}

        begin{align}
        f'(x) &= e^x (sin x + cos x) \
        implies f''(x) &= 2e^x cos x \
        implies f^3(x) &= 2e^x (cos x - sin x) \
        implies f^4(x) &= 2e^x (-2sin x) = -4 f(x) \
        implies f^5(x) &= -4 f'(x) \
        implies f^8(x) &= -4 f^4(x) = 16 f(x) \
        implies f^{10}(x) &= 16 f''(x)
        end{align}

        end{document}


        If you're using MathJax, the same principle holds.






        share|improve this answer













        align sets a display math environment where & is used as alignment points (and separation between alignments) while \ is used to separate equations vertically. It works similar to an array or tabular. You don't have to use & in an align, but \ is necessary to put equations on different lines.



        enter image description here



        documentclass{article}

        usepackage{amsmath}

        begin{document}

        begin{align}
        f'(x) &= e^x (sin x + cos x) \
        implies f''(x) &= 2e^x cos x \
        implies f^3(x) &= 2e^x (cos x - sin x) \
        implies f^4(x) &= 2e^x (-2sin x) = -4 f(x) \
        implies f^5(x) &= -4 f'(x) \
        implies f^8(x) &= -4 f^4(x) = 16 f(x) \
        implies f^{10}(x) &= 16 f''(x)
        end{align}

        end{document}


        If you're using MathJax, the same principle holds.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 19 at 19:32









        WernerWerner

        444k689791680




        444k689791680























            0














            It looks as if both were used in this edit of one of my posts:



            $begin{align}f'(x)&=e^x(sin x+cos x)\
            implies f''(x)&=2e^xcos x\
            implies f^3(x)&=2e^x(cos x-sin x)\
            implies f^4(x)&=2e^x(-2sin x)=-4f(x)\
            implies f^5(x)&=-4f'(x)\
            implies f^8(x)&=-4f^4(x)=16f(x)\
            implies f^{10}(x)&=16f''(x)end{align}$


            I get the impression the &'s aren't really necessary, though. But when I took one '&' out, it didn't render (presumably I could take them all out).






            share|improve this answer



















            • 1





              This is wrong; begin{align}...end{align} should not appear inside math mode $...$ as it sets itself as a display math construction already.

              – Werner
              Jan 19 at 19:28






            • 1





              You can verify this on Mathematics.

              – Werner
              Jan 19 at 19:35











            • Thanks for the heads up.

              – Chris Custer
              Jan 19 at 20:39
















            0














            It looks as if both were used in this edit of one of my posts:



            $begin{align}f'(x)&=e^x(sin x+cos x)\
            implies f''(x)&=2e^xcos x\
            implies f^3(x)&=2e^x(cos x-sin x)\
            implies f^4(x)&=2e^x(-2sin x)=-4f(x)\
            implies f^5(x)&=-4f'(x)\
            implies f^8(x)&=-4f^4(x)=16f(x)\
            implies f^{10}(x)&=16f''(x)end{align}$


            I get the impression the &'s aren't really necessary, though. But when I took one '&' out, it didn't render (presumably I could take them all out).






            share|improve this answer



















            • 1





              This is wrong; begin{align}...end{align} should not appear inside math mode $...$ as it sets itself as a display math construction already.

              – Werner
              Jan 19 at 19:28






            • 1





              You can verify this on Mathematics.

              – Werner
              Jan 19 at 19:35











            • Thanks for the heads up.

              – Chris Custer
              Jan 19 at 20:39














            0












            0








            0







            It looks as if both were used in this edit of one of my posts:



            $begin{align}f'(x)&=e^x(sin x+cos x)\
            implies f''(x)&=2e^xcos x\
            implies f^3(x)&=2e^x(cos x-sin x)\
            implies f^4(x)&=2e^x(-2sin x)=-4f(x)\
            implies f^5(x)&=-4f'(x)\
            implies f^8(x)&=-4f^4(x)=16f(x)\
            implies f^{10}(x)&=16f''(x)end{align}$


            I get the impression the &'s aren't really necessary, though. But when I took one '&' out, it didn't render (presumably I could take them all out).






            share|improve this answer













            It looks as if both were used in this edit of one of my posts:



            $begin{align}f'(x)&=e^x(sin x+cos x)\
            implies f''(x)&=2e^xcos x\
            implies f^3(x)&=2e^x(cos x-sin x)\
            implies f^4(x)&=2e^x(-2sin x)=-4f(x)\
            implies f^5(x)&=-4f'(x)\
            implies f^8(x)&=-4f^4(x)=16f(x)\
            implies f^{10}(x)&=16f''(x)end{align}$


            I get the impression the &'s aren't really necessary, though. But when I took one '&' out, it didn't render (presumably I could take them all out).







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 19 at 7:43









            Chris CusterChris Custer

            1014




            1014








            • 1





              This is wrong; begin{align}...end{align} should not appear inside math mode $...$ as it sets itself as a display math construction already.

              – Werner
              Jan 19 at 19:28






            • 1





              You can verify this on Mathematics.

              – Werner
              Jan 19 at 19:35











            • Thanks for the heads up.

              – Chris Custer
              Jan 19 at 20:39














            • 1





              This is wrong; begin{align}...end{align} should not appear inside math mode $...$ as it sets itself as a display math construction already.

              – Werner
              Jan 19 at 19:28






            • 1





              You can verify this on Mathematics.

              – Werner
              Jan 19 at 19:35











            • Thanks for the heads up.

              – Chris Custer
              Jan 19 at 20:39








            1




            1





            This is wrong; begin{align}...end{align} should not appear inside math mode $...$ as it sets itself as a display math construction already.

            – Werner
            Jan 19 at 19:28





            This is wrong; begin{align}...end{align} should not appear inside math mode $...$ as it sets itself as a display math construction already.

            – Werner
            Jan 19 at 19:28




            1




            1





            You can verify this on Mathematics.

            – Werner
            Jan 19 at 19:35





            You can verify this on Mathematics.

            – Werner
            Jan 19 at 19:35













            Thanks for the heads up.

            – Chris Custer
            Jan 19 at 20:39





            Thanks for the heads up.

            – Chris Custer
            Jan 19 at 20:39


















            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%2f471008%2fquestion-about-aligning-equations%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

            Entries order in /etc/network/interfaces

            新発田市

            Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)