How to align numbers in parentheses












2















This code aligns the 4 and the -3 roughly centered, i.e., the 4 is centered above the -3. I would like the 4 and the 3 to be perfectly vertically aligned, with the negative sign out to the left and the left parenthesis accommodating. How can I do this?



 begin{align*}
x = begin{pmatrix}
4 \
-3 \
end{pmatrix}
end{align*}









share|improve this question




















  • 1





    use array and a r-aligned column (note this is horizontal alignment rather than vertical alignment, vertical alignment refers to aligning to the top or the bottom of a box)

    – David Carlisle
    35 mins ago


















2















This code aligns the 4 and the -3 roughly centered, i.e., the 4 is centered above the -3. I would like the 4 and the 3 to be perfectly vertically aligned, with the negative sign out to the left and the left parenthesis accommodating. How can I do this?



 begin{align*}
x = begin{pmatrix}
4 \
-3 \
end{pmatrix}
end{align*}









share|improve this question




















  • 1





    use array and a r-aligned column (note this is horizontal alignment rather than vertical alignment, vertical alignment refers to aligning to the top or the bottom of a box)

    – David Carlisle
    35 mins ago
















2












2








2








This code aligns the 4 and the -3 roughly centered, i.e., the 4 is centered above the -3. I would like the 4 and the 3 to be perfectly vertically aligned, with the negative sign out to the left and the left parenthesis accommodating. How can I do this?



 begin{align*}
x = begin{pmatrix}
4 \
-3 \
end{pmatrix}
end{align*}









share|improve this question
















This code aligns the 4 and the -3 roughly centered, i.e., the 4 is centered above the -3. I would like the 4 and the 3 to be perfectly vertically aligned, with the negative sign out to the left and the left parenthesis accommodating. How can I do this?



 begin{align*}
x = begin{pmatrix}
4 \
-3 \
end{pmatrix}
end{align*}






horizontal-alignment parentheses






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 30 mins ago









David Carlisle

487k4111271871




487k4111271871










asked 36 mins ago









147pm147pm

4501410




4501410








  • 1





    use array and a r-aligned column (note this is horizontal alignment rather than vertical alignment, vertical alignment refers to aligning to the top or the bottom of a box)

    – David Carlisle
    35 mins ago
















  • 1





    use array and a r-aligned column (note this is horizontal alignment rather than vertical alignment, vertical alignment refers to aligning to the top or the bottom of a box)

    – David Carlisle
    35 mins ago










1




1





use array and a r-aligned column (note this is horizontal alignment rather than vertical alignment, vertical alignment refers to aligning to the top or the bottom of a box)

– David Carlisle
35 mins ago







use array and a r-aligned column (note this is horizontal alignment rather than vertical alignment, vertical alignment refers to aligning to the top or the bottom of a box)

– David Carlisle
35 mins ago












3 Answers
3






active

oldest

votes


















3














Here are two ways: either use a phantom{-} for the number without a (to be used for each such number), or load mathtools and use its pmatrix* environment, which allows for an optional alignment specifier:



begin{equation*}
x = begin{pmatrix*}[r]
4 \
-3 \
end{pmatrix*}
qquad
x = begin{pmatrix}
phantom{-} 4 \
-3 \
end{pmatrix}
end{equation*}


enter image description here






share|improve this answer































    2














    enter image description here



    documentclass{article}

    usepackage{amsmath}

    begin{document}

    [
    left( begin{array}{@{}r@{}}
    4\-3
    end{array}right)
    ]
    end{document}





    share|improve this answer































      1














      documentclass[12pt]{article}
      usepackage{stackengine}
      setstackEOL{\}
      begin{document}
      [
      x=parenVectorstack[r]{4\-3}
      ]
      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%2f472153%2fhow-to-align-numbers-in-parentheses%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









        3














        Here are two ways: either use a phantom{-} for the number without a (to be used for each such number), or load mathtools and use its pmatrix* environment, which allows for an optional alignment specifier:



        begin{equation*}
        x = begin{pmatrix*}[r]
        4 \
        -3 \
        end{pmatrix*}
        qquad
        x = begin{pmatrix}
        phantom{-} 4 \
        -3 \
        end{pmatrix}
        end{equation*}


        enter image description here






        share|improve this answer




























          3














          Here are two ways: either use a phantom{-} for the number without a (to be used for each such number), or load mathtools and use its pmatrix* environment, which allows for an optional alignment specifier:



          begin{equation*}
          x = begin{pmatrix*}[r]
          4 \
          -3 \
          end{pmatrix*}
          qquad
          x = begin{pmatrix}
          phantom{-} 4 \
          -3 \
          end{pmatrix}
          end{equation*}


          enter image description here






          share|improve this answer


























            3












            3








            3







            Here are two ways: either use a phantom{-} for the number without a (to be used for each such number), or load mathtools and use its pmatrix* environment, which allows for an optional alignment specifier:



            begin{equation*}
            x = begin{pmatrix*}[r]
            4 \
            -3 \
            end{pmatrix*}
            qquad
            x = begin{pmatrix}
            phantom{-} 4 \
            -3 \
            end{pmatrix}
            end{equation*}


            enter image description here






            share|improve this answer













            Here are two ways: either use a phantom{-} for the number without a (to be used for each such number), or load mathtools and use its pmatrix* environment, which allows for an optional alignment specifier:



            begin{equation*}
            x = begin{pmatrix*}[r]
            4 \
            -3 \
            end{pmatrix*}
            qquad
            x = begin{pmatrix}
            phantom{-} 4 \
            -3 \
            end{pmatrix}
            end{equation*}


            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 24 mins ago









            BernardBernard

            168k771195




            168k771195























                2














                enter image description here



                documentclass{article}

                usepackage{amsmath}

                begin{document}

                [
                left( begin{array}{@{}r@{}}
                4\-3
                end{array}right)
                ]
                end{document}





                share|improve this answer




























                  2














                  enter image description here



                  documentclass{article}

                  usepackage{amsmath}

                  begin{document}

                  [
                  left( begin{array}{@{}r@{}}
                  4\-3
                  end{array}right)
                  ]
                  end{document}





                  share|improve this answer


























                    2












                    2








                    2







                    enter image description here



                    documentclass{article}

                    usepackage{amsmath}

                    begin{document}

                    [
                    left( begin{array}{@{}r@{}}
                    4\-3
                    end{array}right)
                    ]
                    end{document}





                    share|improve this answer













                    enter image description here



                    documentclass{article}

                    usepackage{amsmath}

                    begin{document}

                    [
                    left( begin{array}{@{}r@{}}
                    4\-3
                    end{array}right)
                    ]
                    end{document}






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 31 mins ago









                    David CarlisleDavid Carlisle

                    487k4111271871




                    487k4111271871























                        1














                        documentclass[12pt]{article}
                        usepackage{stackengine}
                        setstackEOL{\}
                        begin{document}
                        [
                        x=parenVectorstack[r]{4\-3}
                        ]
                        end{document}


                        enter image description here






                        share|improve this answer




























                          1














                          documentclass[12pt]{article}
                          usepackage{stackengine}
                          setstackEOL{\}
                          begin{document}
                          [
                          x=parenVectorstack[r]{4\-3}
                          ]
                          end{document}


                          enter image description here






                          share|improve this answer


























                            1












                            1








                            1







                            documentclass[12pt]{article}
                            usepackage{stackengine}
                            setstackEOL{\}
                            begin{document}
                            [
                            x=parenVectorstack[r]{4\-3}
                            ]
                            end{document}


                            enter image description here






                            share|improve this answer













                            documentclass[12pt]{article}
                            usepackage{stackengine}
                            setstackEOL{\}
                            begin{document}
                            [
                            x=parenVectorstack[r]{4\-3}
                            ]
                            end{document}


                            enter image description here







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 16 mins ago









                            Steven B. SegletesSteven B. Segletes

                            153k9194402




                            153k9194402






























                                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%2f472153%2fhow-to-align-numbers-in-parentheses%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

                                ف. موراي أبراهام

                                صرب

                                Restoring from pg_dump with foreign key constraints