Double backslash on last line of matrix










8














Is \ necessary on the final line of environments like matrix, align, and gather? For example, with amsmath,



[beginbmatrix
3 & 1\
2 & 4\
endbmatrix]


and



[beginbmatrix
3 & 1\
2 & 4
endbmatrix]


seem to produce the same output. But are they really the same? Is one preferable to the other, or is it a matter of taste? From my understanding, \ in one of these environments is used to separate lines, and there's nothing else to separate the final line from, so it's not necessary.










share|improve this question























  • If it produces the same output, I guess there's no difference.
    – Tvde1
    Nov 12 '18 at 14:11










  • I think there's no rule for this. I think it depends on the implementation of the environment. With align, for instance, you get an undesired line if you add the \ at the end.
    – Phelype Oleinik
    Nov 12 '18 at 14:16















8














Is \ necessary on the final line of environments like matrix, align, and gather? For example, with amsmath,



[beginbmatrix
3 & 1\
2 & 4\
endbmatrix]


and



[beginbmatrix
3 & 1\
2 & 4
endbmatrix]


seem to produce the same output. But are they really the same? Is one preferable to the other, or is it a matter of taste? From my understanding, \ in one of these environments is used to separate lines, and there's nothing else to separate the final line from, so it's not necessary.










share|improve this question























  • If it produces the same output, I guess there's no difference.
    – Tvde1
    Nov 12 '18 at 14:11










  • I think there's no rule for this. I think it depends on the implementation of the environment. With align, for instance, you get an undesired line if you add the \ at the end.
    – Phelype Oleinik
    Nov 12 '18 at 14:16













8












8








8







Is \ necessary on the final line of environments like matrix, align, and gather? For example, with amsmath,



[beginbmatrix
3 & 1\
2 & 4\
endbmatrix]


and



[beginbmatrix
3 & 1\
2 & 4
endbmatrix]


seem to produce the same output. But are they really the same? Is one preferable to the other, or is it a matter of taste? From my understanding, \ in one of these environments is used to separate lines, and there's nothing else to separate the final line from, so it's not necessary.










share|improve this question















Is \ necessary on the final line of environments like matrix, align, and gather? For example, with amsmath,



[beginbmatrix
3 & 1\
2 & 4\
endbmatrix]


and



[beginbmatrix
3 & 1\
2 & 4
endbmatrix]


seem to produce the same output. But are they really the same? Is one preferable to the other, or is it a matter of taste? From my understanding, \ in one of these environments is used to separate lines, and there's nothing else to separate the final line from, so it's not necessary.







matrices






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 14:11

























asked Nov 12 '18 at 14:07









MathIsFun

675




675











  • If it produces the same output, I guess there's no difference.
    – Tvde1
    Nov 12 '18 at 14:11










  • I think there's no rule for this. I think it depends on the implementation of the environment. With align, for instance, you get an undesired line if you add the \ at the end.
    – Phelype Oleinik
    Nov 12 '18 at 14:16
















  • If it produces the same output, I guess there's no difference.
    – Tvde1
    Nov 12 '18 at 14:11










  • I think there's no rule for this. I think it depends on the implementation of the environment. With align, for instance, you get an undesired line if you add the \ at the end.
    – Phelype Oleinik
    Nov 12 '18 at 14:16















If it produces the same output, I guess there's no difference.
– Tvde1
Nov 12 '18 at 14:11




If it produces the same output, I guess there's no difference.
– Tvde1
Nov 12 '18 at 14:11












I think there's no rule for this. I think it depends on the implementation of the environment. With align, for instance, you get an undesired line if you add the \ at the end.
– Phelype Oleinik
Nov 12 '18 at 14:16




I think there's no rule for this. I think it depends on the implementation of the environment. With align, for instance, you get an undesired line if you add the \ at the end.
– Phelype Oleinik
Nov 12 '18 at 14:16










1 Answer
1






active

oldest

votes


















7














There is no difference at all for bmatrix. There is for align.



Any array or tabular allows a trailing \; it is obviously mandatory if hline is needed at the bottom, but otherwise omitting it is safe.



Since Xmatrix (where X stands for noting, p, b, B, v or V) is array in disguise, the same applies. Also cases falls in this class.



It's very different with align, alignat, xalignat, flalign and gather (or *-forms thereof), where a trailing \ would produce a new empty row (with the equation number in the case of no *), so it must be avoided.



As a habit, I tend to avoid the trailing \ in Xmatrix, just for symmetry with the alignment environments mentioned above.






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%2f459622%2fdouble-backslash-on-last-line-of-matrix%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









    7














    There is no difference at all for bmatrix. There is for align.



    Any array or tabular allows a trailing \; it is obviously mandatory if hline is needed at the bottom, but otherwise omitting it is safe.



    Since Xmatrix (where X stands for noting, p, b, B, v or V) is array in disguise, the same applies. Also cases falls in this class.



    It's very different with align, alignat, xalignat, flalign and gather (or *-forms thereof), where a trailing \ would produce a new empty row (with the equation number in the case of no *), so it must be avoided.



    As a habit, I tend to avoid the trailing \ in Xmatrix, just for symmetry with the alignment environments mentioned above.






    share|improve this answer

























      7














      There is no difference at all for bmatrix. There is for align.



      Any array or tabular allows a trailing \; it is obviously mandatory if hline is needed at the bottom, but otherwise omitting it is safe.



      Since Xmatrix (where X stands for noting, p, b, B, v or V) is array in disguise, the same applies. Also cases falls in this class.



      It's very different with align, alignat, xalignat, flalign and gather (or *-forms thereof), where a trailing \ would produce a new empty row (with the equation number in the case of no *), so it must be avoided.



      As a habit, I tend to avoid the trailing \ in Xmatrix, just for symmetry with the alignment environments mentioned above.






      share|improve this answer























        7












        7








        7






        There is no difference at all for bmatrix. There is for align.



        Any array or tabular allows a trailing \; it is obviously mandatory if hline is needed at the bottom, but otherwise omitting it is safe.



        Since Xmatrix (where X stands for noting, p, b, B, v or V) is array in disguise, the same applies. Also cases falls in this class.



        It's very different with align, alignat, xalignat, flalign and gather (or *-forms thereof), where a trailing \ would produce a new empty row (with the equation number in the case of no *), so it must be avoided.



        As a habit, I tend to avoid the trailing \ in Xmatrix, just for symmetry with the alignment environments mentioned above.






        share|improve this answer












        There is no difference at all for bmatrix. There is for align.



        Any array or tabular allows a trailing \; it is obviously mandatory if hline is needed at the bottom, but otherwise omitting it is safe.



        Since Xmatrix (where X stands for noting, p, b, B, v or V) is array in disguise, the same applies. Also cases falls in this class.



        It's very different with align, alignat, xalignat, flalign and gather (or *-forms thereof), where a trailing \ would produce a new empty row (with the equation number in the case of no *), so it must be avoided.



        As a habit, I tend to avoid the trailing \ in Xmatrix, just for symmetry with the alignment environments mentioned above.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 '18 at 14:29









        egreg

        709k8618823165




        709k8618823165



























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f459622%2fdouble-backslash-on-last-line-of-matrix%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







            這個網誌中的熱門文章

            Barbados

            How to read a connectionString WITH PROVIDER in .NET Core?

            Node.js Script on GitHub Pages or Amazon S3