Double backslash on last line of matrix











up vote
7
down vote

favorite












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



[begin{bmatrix}
3 & 1\
2 & 4\
end{bmatrix}]


and



[begin{bmatrix}
3 & 1\
2 & 4
end{bmatrix}]


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
    7 hours ago










  • 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
    7 hours ago















up vote
7
down vote

favorite












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



[begin{bmatrix}
3 & 1\
2 & 4\
end{bmatrix}]


and



[begin{bmatrix}
3 & 1\
2 & 4
end{bmatrix}]


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
    7 hours ago










  • 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
    7 hours ago













up vote
7
down vote

favorite









up vote
7
down vote

favorite











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



[begin{bmatrix}
3 & 1\
2 & 4\
end{bmatrix}]


and



[begin{bmatrix}
3 & 1\
2 & 4
end{bmatrix}]


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,



[begin{bmatrix}
3 & 1\
2 & 4\
end{bmatrix}]


and



[begin{bmatrix}
3 & 1\
2 & 4
end{bmatrix}]


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 7 hours ago

























asked 7 hours ago









MathIsFun

505




505












  • If it produces the same output, I guess there's no difference.
    – Tvde1
    7 hours ago










  • 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
    7 hours ago


















  • If it produces the same output, I guess there's no difference.
    – Tvde1
    7 hours ago










  • 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
    7 hours ago
















If it produces the same output, I guess there's no difference.
– Tvde1
7 hours ago




If it produces the same output, I guess there's no difference.
– Tvde1
7 hours ago












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
7 hours ago




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
7 hours ago










1 Answer
1






active

oldest

votes

















up vote
7
down vote



accepted










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',
    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
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    7
    down vote



    accepted










    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

























      up vote
      7
      down vote



      accepted










      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























        up vote
        7
        down vote



        accepted







        up vote
        7
        down vote



        accepted






        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 6 hours ago









        egreg

        696k8518483111




        696k8518483111






























             

            draft saved


            draft discarded



















































             


            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




















































































            Popular posts from this blog

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?