S.O.S. Mathematics CyberBoard

Your Resource for mathematics help on the web!
It is currently Mon, 20 May 2013 22:51:03 UTC

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Formatting within a matrix...
PostPosted: Wed, 8 Oct 2008 17:18:56 UTC 
Offline
Member of the 'S.O.S. Math' Hall of Fame

Joined: Wed, 6 Apr 2005 01:33:29 UTC
Posts: 627
Location: Virginia Beach, VA
I'm using the following code:

Code:
\[L = \begin{bmatrix}
1 & -1 & 0 & 0\\
-1 & 3 & -1 & -1\\
0 & -1 & 2 & -1\\
0 & -1 & -1 & 2
\end{bmatrix}\]


to create this:

\[L = \begin{bmatrix}
1 & -1 & 0 & 0\\
-1 & 3 & -1 & -1\\
0 & -1 & 2 & -1\\
0 & -1 & -1 & 2
\end{bmatrix}\]

But I don't like how the -1's don't line up. Is there a way I can make it right justified?

_________________
It's quiet now; and as I think my thoughts alone,
I try to keep my head straight, but I think I'm too far gone.
For in this silence, the truth rings even louder.
A constant grinding, begging recognition of its power.


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 8 Oct 2008 17:33:35 UTC 
Offline
Member of the 'S.O.S. Math' Hall of Fame
User avatar

Joined: Sat, 7 Jan 2006 18:29:24 UTC
Posts: 1401
Location: Leeds, UK
This is a laborious way to do it, but you can put a phantom minus sign in front of all the non-negative elements so that they line up.

Code:
\[L = \begin{bmatrix}
\phantom{-}1 & -1 & \phantom{-}0 & \phantom{-}0\\
-1 & \phantom{-}3 & -1 & -1\\
\phantom{-}0 & -1 & \phantom{-}2 & -1\\
\phantom{-}0 & -1 & -1 & \phantom{-}2
\end{bmatrix}\]


Then you get L = \begin{bmatrix}
\phantom{-}1 & -1 & \phantom{-}0 & \phantom{-}0\\
-1 & \phantom{-}3 & -1 & -1\\
\phantom{-}0 & -1 & \phantom{-}2 & -1\\
\phantom{-}0 & -1 & -1 & \phantom{-}2
\end{bmatrix}


Top
 Profile  
 
 Post subject: Re: Formatting within a matrix...
PostPosted: Thu, 9 Oct 2008 00:15:26 UTC 
Offline
Member of the 'S.O.S. Math' Hall of Fame

Joined: Mon, 19 May 2003 19:55:19 UTC
Posts: 7949
Location: Lexington, MA
Hello, Starx!


I use \text{-} to produce a short minus-sign.

. . and it too is laborious . . .


Code:
[tex] L = \begin{bmatrix}
1 & \text{-}1 & 0 & 0 \\
\text{-}1 & 3 & \text{-}1 & \text{-}1 \\
0 & \text{-}1 & 2 & \text{-}1 \\
0 & \text{-}1 & \text{-}1 & 2
\end{bmatrix} [/tex]


L = \begin{bmatrix}
1 & \text{-}1 & 0 & 0\\
\text{-}1 & 3 & \text{-}1 & \text{-}1\\
0 & \text{-}1 & 2 & \text{-}1\\
0 & \text{-}1 & \text{-}1 & 2
\end{bmatrix}



Opalg, I like that "phantom" feature!
Makes me want to experiment with it . . .



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Contact Us | S.O.S. Mathematics Homepage
Privacy Statement | Search the "old" CyberBoard

users online during the last hour
Powered by phpBB © 2001, 2005-2011 phpBB Group.
Copyright © 1999-2013 MathMedics, LLC. All rights reserved.
Math Medics, LLC. - P.O. Box 12395 - El Paso TX 79913 - USA