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;
I have a matrix that looks like
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
add a comment |
I have a matrix that looks like
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
2
Take a look at thebmatrix*
environment frommathtools
.
– barbara beeton
8 hours ago
add a comment |
I have a matrix that looks like
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
I have a matrix that looks like
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
horizontal-alignment matrices
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 thebmatrix*
environment frommathtools
.
– barbara beeton
8 hours ago
add a comment |
2
Take a look at thebmatrix*
environment frommathtools
.
– 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
add a comment |
3 Answers
3
active
oldest
votes
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.
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
1
+1 ... interesting packagespalign
! 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
add a comment |
You can change column specifiers from c
to r
and you will obtain:
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
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
add a comment |
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
1
+1 ... interesting packagespalign
! 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
add a comment |
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.
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
1
+1 ... interesting packagespalign
! 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
add a comment |
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.
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
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.
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
answered 8 hours ago
SebastianoSebastiano
13.9k5 gold badges26 silver badges73 bronze badges
13.9k5 gold badges26 silver badges73 bronze badges
1
+1 ... interesting packagespalign
! 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
add a comment |
1
+1 ... interesting packagespalign
! 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
add a comment |
You can change column specifiers from c
to r
and you will obtain:
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
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
add a comment |
You can change column specifiers from c
to r
and you will obtain:
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
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
add a comment |
You can change column specifiers from c
to r
and you will obtain:
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
You can change column specifiers from c
to r
and you will obtain:
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
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
add a comment |
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
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
2
Take a look at the
bmatrix*
environment frommathtools
.– barbara beeton
8 hours ago