Align the contents of a numerical matrix when you have minus signsSame height for list of comma-separated vectorsSmaller matrices (or other math elements) in displayed mathPositive and Negative power in matrices and fixed sizeSpecific blockmatricesLeft-aligned, inline-ish equationsMoving a matrix (array) to the left marginHow to align different parts of an equation to left or right?equation custom horizontal alignment & numbering each rowShow system of equations with one number and centeredHorizontal alignment of equality signs written on different position of multiple equations

Do medium format lenses have a crop factor?

Three Subway Escalators

What's a German word for »Sandbagger«?

Did Hitler say this quote about homeschooling?

How important are the Author's mood and feelings for writing a story?

Which failed attempts have there been to find a contradiction in ZFC or ZF?

Pauli exclusion principle - black holes

How can I help our ranger feel special about her beast companion?

Inscriptio Labyrinthica

I have found a mistake on someone's code published online: what is the protocol?

Don't individual signal sources affect each other when using a summing amplifier?

How long were the Apollo astronauts allowed to breathe 100% oxygen at 1 atmosphere continuously?

Wait or be waiting?

Do pedestrians imitate auto traffic?

Why isn't a binary file shown as 0s and 1s?

Null expletive objects in Latin? "Cariotae cum ficis certandum habent" (Plin. Ep. 1,8)

How to not confuse readers with simultaneous events?

Why do space operations use "nominal" to mean "working correctly"?

Why do jet engines sound louder on the ground than inside the aircraft?

Do higher dimensions have axes?

What could make large expeditions ineffective for exploring territory full of dangers and valuable resources?

What makes MOVEQ quicker than a normal MOVE in 68000 assembly?

Company looks for long-term employees, but I know I won't be interested in staying long

How was Luke's prosthetic hand in Episode V filmed?



Align the contents of a numerical matrix when you have minus signs


Same height for list of comma-separated vectorsSmaller matrices (or other math elements) in displayed mathPositive and Negative power in matrices and fixed sizeSpecific blockmatricesLeft-aligned, inline-ish equationsMoving a matrix (array) to the left marginHow to align different parts of an equation to left or right?equation custom horizontal alignment & numbering each rowShow system of equations with one number and centeredHorizontal alignment of equality signs written on different position of multiple equations






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I have a matrix that looks like



enter image description here



beginequation* 
left [beginarraycccccc
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right ] endequation*


How should I sort of align this matrix to make it more symmetrical looking and without the disgusting slight shift due to the negative sign?










share|improve this question



















  • 2





    Take a look at the bmatrix* environment from mathtools.

    – barbara beeton
    8 hours ago

















3















I have a matrix that looks like



enter image description here



beginequation* 
left [beginarraycccccc
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right ] endequation*


How should I sort of align this matrix to make it more symmetrical looking and without the disgusting slight shift due to the negative sign?










share|improve this question



















  • 2





    Take a look at the bmatrix* environment from mathtools.

    – barbara beeton
    8 hours ago













3












3








3








I have a matrix that looks like



enter image description here



beginequation* 
left [beginarraycccccc
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right ] endequation*


How should I sort of align this matrix to make it more symmetrical looking and without the disgusting slight shift due to the negative sign?










share|improve this question
















I have a matrix that looks like



enter image description here



beginequation* 
left [beginarraycccccc
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right ] endequation*


How should I sort of align this matrix to make it more symmetrical looking and without the disgusting slight shift due to the negative sign?







horizontal-alignment matrices






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 8 hours ago









Hans Lollo

3721 silver badge11 bronze badges




3721 silver badge11 bronze badges










asked 9 hours ago









OlórinOlórin

1286 bronze badges




1286 bronze badges







  • 2





    Take a look at the bmatrix* environment from mathtools.

    – barbara beeton
    8 hours ago












  • 2





    Take a look at the bmatrix* environment from mathtools.

    – barbara beeton
    8 hours ago







2




2





Take a look at the bmatrix* environment from mathtools.

– barbara beeton
8 hours ago





Take a look at the bmatrix* environment from mathtools.

– barbara beeton
8 hours ago










3 Answers
3






active

oldest

votes


















3














Here there is my proposal. You could to use (for example but there are several strategies) spalign package with has the same approach to build a matrix or array to have minus signs aligned. Here there is a screenshot and a MWE.



enter image description here



documentclass[a4paper,12pt]article
usepackagespalign
begindocument
[ spaligndelims[]spalignmat[r]0 0 6 -6 0 0; 0 0 -6 6 0 0; 0 0 0 0 5 -5; 0 0 0 0 -5 5 ]
enddocument





share|improve this answer


















  • 1





    +1 ... interesting package spalign! So far I didn't aware about it.

    – Zarko
    8 hours ago












  • @Zarko I'm specializing in finding new packages that are very little used but are beautiful and efficacious.

    – Sebastiano
    8 hours ago



















3














You can change column specifiers from c to r and you will obtain:



enter image description here



Is this what you looking for? MWE for above matrix is:



documentclass[a4paper,12pt]article

begindocument
[
left[beginarray*6r
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right]
]
enddocument





share|improve this answer























  • Approved: this was the last vote I had available.

    – Sebastiano
    8 hours ago






  • 1





    @Sebastiano, than you very much! You are very enthusiastic voter ;-)

    – Zarko
    8 hours ago







  • 1





    Thank you! Very much!

    – Olórin
    8 hours ago


















3














The mathtools package extebds amsmath with the matrix* environments, which can take an optional argument for the alignment of their columns (c by default).



I added another solution, for which all columns have the same width, with the mathllap command (also from mathtools):



documentclassarticle%
usepackagemathtools


begindocument

beginequation*
beginbmatrix*[r]
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endbmatrix*
endequation*

beginequation*setlengtharraycolsep6pt
beginbmatrix*[r]
0 & 0 & 6 & mathllap-6 & 0 & 0 \
0 & 0 & mathllap-6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & mathllap-5 \
0 & 0 & 0 & 0 &mathllap-5 & 5
endbmatrix*
endequation*

enddocument


enter image description here






share|improve this answer























  • Please add an example showing a matrix with a negative value in the first column.

    – barbara beeton
    7 hours ago











  • @Barbara Beeton:: That's a challenge! It will destroy symmetry in spacings of left and right bracket. However one can add ; ate the end of each row to make it acceptable – at least from my point of view.

    – Bernard
    6 hours ago













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%2f500655%2falign-the-contents-of-a-numerical-matrix-when-you-have-minus-signs%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 there is my proposal. You could to use (for example but there are several strategies) spalign package with has the same approach to build a matrix or array to have minus signs aligned. Here there is a screenshot and a MWE.



enter image description here



documentclass[a4paper,12pt]article
usepackagespalign
begindocument
[ spaligndelims[]spalignmat[r]0 0 6 -6 0 0; 0 0 -6 6 0 0; 0 0 0 0 5 -5; 0 0 0 0 -5 5 ]
enddocument





share|improve this answer


















  • 1





    +1 ... interesting package spalign! So far I didn't aware about it.

    – Zarko
    8 hours ago












  • @Zarko I'm specializing in finding new packages that are very little used but are beautiful and efficacious.

    – Sebastiano
    8 hours ago
















3














Here there is my proposal. You could to use (for example but there are several strategies) spalign package with has the same approach to build a matrix or array to have minus signs aligned. Here there is a screenshot and a MWE.



enter image description here



documentclass[a4paper,12pt]article
usepackagespalign
begindocument
[ spaligndelims[]spalignmat[r]0 0 6 -6 0 0; 0 0 -6 6 0 0; 0 0 0 0 5 -5; 0 0 0 0 -5 5 ]
enddocument





share|improve this answer


















  • 1





    +1 ... interesting package spalign! So far I didn't aware about it.

    – Zarko
    8 hours ago












  • @Zarko I'm specializing in finding new packages that are very little used but are beautiful and efficacious.

    – Sebastiano
    8 hours ago














3












3








3







Here there is my proposal. You could to use (for example but there are several strategies) spalign package with has the same approach to build a matrix or array to have minus signs aligned. Here there is a screenshot and a MWE.



enter image description here



documentclass[a4paper,12pt]article
usepackagespalign
begindocument
[ spaligndelims[]spalignmat[r]0 0 6 -6 0 0; 0 0 -6 6 0 0; 0 0 0 0 5 -5; 0 0 0 0 -5 5 ]
enddocument





share|improve this answer













Here there is my proposal. You could to use (for example but there are several strategies) spalign package with has the same approach to build a matrix or array to have minus signs aligned. Here there is a screenshot and a MWE.



enter image description here



documentclass[a4paper,12pt]article
usepackagespalign
begindocument
[ spaligndelims[]spalignmat[r]0 0 6 -6 0 0; 0 0 -6 6 0 0; 0 0 0 0 5 -5; 0 0 0 0 -5 5 ]
enddocument






share|improve this answer












share|improve this answer



share|improve this answer










answered 8 hours ago









SebastianoSebastiano

13.9k5 gold badges26 silver badges73 bronze badges




13.9k5 gold badges26 silver badges73 bronze badges







  • 1





    +1 ... interesting package spalign! So far I didn't aware about it.

    – Zarko
    8 hours ago












  • @Zarko I'm specializing in finding new packages that are very little used but are beautiful and efficacious.

    – Sebastiano
    8 hours ago













  • 1





    +1 ... interesting package spalign! So far I didn't aware about it.

    – Zarko
    8 hours ago












  • @Zarko I'm specializing in finding new packages that are very little used but are beautiful and efficacious.

    – Sebastiano
    8 hours ago








1




1





+1 ... interesting package spalign! So far I didn't aware about it.

– Zarko
8 hours ago






+1 ... interesting package spalign! So far I didn't aware about it.

– Zarko
8 hours ago














@Zarko I'm specializing in finding new packages that are very little used but are beautiful and efficacious.

– Sebastiano
8 hours ago






@Zarko I'm specializing in finding new packages that are very little used but are beautiful and efficacious.

– Sebastiano
8 hours ago














3














You can change column specifiers from c to r and you will obtain:



enter image description here



Is this what you looking for? MWE for above matrix is:



documentclass[a4paper,12pt]article

begindocument
[
left[beginarray*6r
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right]
]
enddocument





share|improve this answer























  • Approved: this was the last vote I had available.

    – Sebastiano
    8 hours ago






  • 1





    @Sebastiano, than you very much! You are very enthusiastic voter ;-)

    – Zarko
    8 hours ago







  • 1





    Thank you! Very much!

    – Olórin
    8 hours ago















3














You can change column specifiers from c to r and you will obtain:



enter image description here



Is this what you looking for? MWE for above matrix is:



documentclass[a4paper,12pt]article

begindocument
[
left[beginarray*6r
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right]
]
enddocument





share|improve this answer























  • Approved: this was the last vote I had available.

    – Sebastiano
    8 hours ago






  • 1





    @Sebastiano, than you very much! You are very enthusiastic voter ;-)

    – Zarko
    8 hours ago







  • 1





    Thank you! Very much!

    – Olórin
    8 hours ago













3












3








3







You can change column specifiers from c to r and you will obtain:



enter image description here



Is this what you looking for? MWE for above matrix is:



documentclass[a4paper,12pt]article

begindocument
[
left[beginarray*6r
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right]
]
enddocument





share|improve this answer













You can change column specifiers from c to r and you will obtain:



enter image description here



Is this what you looking for? MWE for above matrix is:



documentclass[a4paper,12pt]article

begindocument
[
left[beginarray*6r
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endarray right]
]
enddocument






share|improve this answer












share|improve this answer



share|improve this answer










answered 8 hours ago









ZarkoZarko

140k8 gold badges78 silver badges189 bronze badges




140k8 gold badges78 silver badges189 bronze badges












  • Approved: this was the last vote I had available.

    – Sebastiano
    8 hours ago






  • 1





    @Sebastiano, than you very much! You are very enthusiastic voter ;-)

    – Zarko
    8 hours ago







  • 1





    Thank you! Very much!

    – Olórin
    8 hours ago

















  • Approved: this was the last vote I had available.

    – Sebastiano
    8 hours ago






  • 1





    @Sebastiano, than you very much! You are very enthusiastic voter ;-)

    – Zarko
    8 hours ago







  • 1





    Thank you! Very much!

    – Olórin
    8 hours ago
















Approved: this was the last vote I had available.

– Sebastiano
8 hours ago





Approved: this was the last vote I had available.

– Sebastiano
8 hours ago




1




1





@Sebastiano, than you very much! You are very enthusiastic voter ;-)

– Zarko
8 hours ago






@Sebastiano, than you very much! You are very enthusiastic voter ;-)

– Zarko
8 hours ago





1




1





Thank you! Very much!

– Olórin
8 hours ago





Thank you! Very much!

– Olórin
8 hours ago











3














The mathtools package extebds amsmath with the matrix* environments, which can take an optional argument for the alignment of their columns (c by default).



I added another solution, for which all columns have the same width, with the mathllap command (also from mathtools):



documentclassarticle%
usepackagemathtools


begindocument

beginequation*
beginbmatrix*[r]
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endbmatrix*
endequation*

beginequation*setlengtharraycolsep6pt
beginbmatrix*[r]
0 & 0 & 6 & mathllap-6 & 0 & 0 \
0 & 0 & mathllap-6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & mathllap-5 \
0 & 0 & 0 & 0 &mathllap-5 & 5
endbmatrix*
endequation*

enddocument


enter image description here






share|improve this answer























  • Please add an example showing a matrix with a negative value in the first column.

    – barbara beeton
    7 hours ago











  • @Barbara Beeton:: That's a challenge! It will destroy symmetry in spacings of left and right bracket. However one can add ; ate the end of each row to make it acceptable – at least from my point of view.

    – Bernard
    6 hours ago















3














The mathtools package extebds amsmath with the matrix* environments, which can take an optional argument for the alignment of their columns (c by default).



I added another solution, for which all columns have the same width, with the mathllap command (also from mathtools):



documentclassarticle%
usepackagemathtools


begindocument

beginequation*
beginbmatrix*[r]
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endbmatrix*
endequation*

beginequation*setlengtharraycolsep6pt
beginbmatrix*[r]
0 & 0 & 6 & mathllap-6 & 0 & 0 \
0 & 0 & mathllap-6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & mathllap-5 \
0 & 0 & 0 & 0 &mathllap-5 & 5
endbmatrix*
endequation*

enddocument


enter image description here






share|improve this answer























  • Please add an example showing a matrix with a negative value in the first column.

    – barbara beeton
    7 hours ago











  • @Barbara Beeton:: That's a challenge! It will destroy symmetry in spacings of left and right bracket. However one can add ; ate the end of each row to make it acceptable – at least from my point of view.

    – Bernard
    6 hours ago













3












3








3







The mathtools package extebds amsmath with the matrix* environments, which can take an optional argument for the alignment of their columns (c by default).



I added another solution, for which all columns have the same width, with the mathllap command (also from mathtools):



documentclassarticle%
usepackagemathtools


begindocument

beginequation*
beginbmatrix*[r]
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endbmatrix*
endequation*

beginequation*setlengtharraycolsep6pt
beginbmatrix*[r]
0 & 0 & 6 & mathllap-6 & 0 & 0 \
0 & 0 & mathllap-6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & mathllap-5 \
0 & 0 & 0 & 0 &mathllap-5 & 5
endbmatrix*
endequation*

enddocument


enter image description here






share|improve this answer













The mathtools package extebds amsmath with the matrix* environments, which can take an optional argument for the alignment of their columns (c by default).



I added another solution, for which all columns have the same width, with the mathllap command (also from mathtools):



documentclassarticle%
usepackagemathtools


begindocument

beginequation*
beginbmatrix*[r]
0 & 0 & 6 & -6 & 0 & 0 \
0 & 0 & -6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & -5 \
0 & 0 & 0 & 0 & -5 & 5
endbmatrix*
endequation*

beginequation*setlengtharraycolsep6pt
beginbmatrix*[r]
0 & 0 & 6 & mathllap-6 & 0 & 0 \
0 & 0 & mathllap-6 & 6 & 0 & 0 \
0 & 0 & 0 & 0 & 5 & mathllap-5 \
0 & 0 & 0 & 0 &mathllap-5 & 5
endbmatrix*
endequation*

enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 8 hours ago









BernardBernard

185k7 gold badges84 silver badges218 bronze badges




185k7 gold badges84 silver badges218 bronze badges












  • Please add an example showing a matrix with a negative value in the first column.

    – barbara beeton
    7 hours ago











  • @Barbara Beeton:: That's a challenge! It will destroy symmetry in spacings of left and right bracket. However one can add ; ate the end of each row to make it acceptable – at least from my point of view.

    – Bernard
    6 hours ago

















  • Please add an example showing a matrix with a negative value in the first column.

    – barbara beeton
    7 hours ago











  • @Barbara Beeton:: That's a challenge! It will destroy symmetry in spacings of left and right bracket. However one can add ; ate the end of each row to make it acceptable – at least from my point of view.

    – Bernard
    6 hours ago
















Please add an example showing a matrix with a negative value in the first column.

– barbara beeton
7 hours ago





Please add an example showing a matrix with a negative value in the first column.

– barbara beeton
7 hours ago













@Barbara Beeton:: That's a challenge! It will destroy symmetry in spacings of left and right bracket. However one can add ; ate the end of each row to make it acceptable – at least from my point of view.

– Bernard
6 hours ago





@Barbara Beeton:: That's a challenge! It will destroy symmetry in spacings of left and right bracket. However one can add ; ate the end of each row to make it acceptable – at least from my point of view.

– Bernard
6 hours ago

















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%2f500655%2falign-the-contents-of-a-numerical-matrix-when-you-have-minus-signs%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

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單