How to align numbers in parentheses












5















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
    Jan 27 at 21:28


















5















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
    Jan 27 at 21:28
















5












5








5








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 Jan 27 at 21:34









David Carlisle

496k4111421889




496k4111421889










asked Jan 27 at 21:27









147pm147pm

4771510




4771510








  • 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
    Jan 27 at 21:28
















  • 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
    Jan 27 at 21:28










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
Jan 27 at 21:28







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
Jan 27 at 21:28












3 Answers
3






active

oldest

votes


















9














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































    6














    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































      5














      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









        9














        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




























          9














          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


























            9












            9








            9







            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 Jan 27 at 21:40









            BernardBernard

            174k776207




            174k776207























                6














                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




























                  6














                  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


























                    6












                    6








                    6







                    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 Jan 27 at 21:33









                    David CarlisleDavid Carlisle

                    496k4111421889




                    496k4111421889























                        5














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


                        enter image description here






                        share|improve this answer




























                          5














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


                          enter image description here






                          share|improve this answer


























                            5












                            5








                            5







                            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 Jan 27 at 21:48









                            Steven B. SegletesSteven B. Segletes

                            159k9204413




                            159k9204413






























                                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

                                android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                                SQL update select statement

                                WPF add header to Image with URL pettitions [duplicate]