[pstricks] Alignment of psmatrix environment
Felix Hoffmann
fhoffmann at iam.uni-bonn.de
Wed Nov 17 15:33:28 CET 2010
Hi,
I am about to make some kind of picture, that would show a matrix and I
would like to mark some things in there and point some arrows from the
text into the matrix and stuff like that. Of course I want to do it with
pstricks, and as I was doing something with a matrix, I thought psmatrix
would be the thing to go with. But now I am stuck as my 8 by 8 matrix
makes a weird picture: I have all the entries in the correct alignment,
but the braces, that I want around my matrix are somewhat misplaced and
much too large. It has to do with the alignment of the \psmatrix in the
text and it looks like
/ \
|some entries |
|some entries |
| |
| whiteSpace |
| whiteSpace |
| whiteSpace |
\ whiteSpace /
My code looks like this:
\psset{arrows=-,nodesep=0pt}
\[\left(
\begin{psmatrix}[colsep=.5cm, rowsep=0pt]
0&0&0&0&0&0&0&0\\
\quad&\quad&0&0&0&0&\quad&\quad\\
\quad&\quad&2&0&0&0&\quad&\quad\\
\quad&\quad&0&1&0&0&\quad&\quad\\
\quad&\quad&\quad&0&-1&0&\quad&\quad\\
\quad&\quad&\quad&\quad&0&-2&0&\quad\\
\quad&\quad&\quad&\quad&0&0&-1&0\\
0&0&0&0&0&0&0&1
\ncline{2,1}{7,1}
\ncline{2,2}{7,2}
\ncline{5,3}{7,3}
\ncline{6,4}{7,4}
\ncline{2,7}{5,7}
\ncline{2,8}{6,8}
\end{psmatrix}\right)\]
Of course I can manually correct this, but I was wondering about a good
solution as my manual adjustment looks like this:
$$\left(
\begin{pspicture}(-0.1,1.7)(0.1,4)\begin{psmatrix}[colsep=.5cm, rowsep=0pt]
0&0&0&0&0&0&0&0\\
\quad&\quad&0&0&0&0&\quad&\quad\\
\quad&\quad&2&0&0&0&\quad&\quad\\
\quad&\quad&0&1&0&0&\quad&\quad\\
\quad&\quad&\quad&0&-1&0&\quad&\quad\\
\quad&\quad&\quad&\quad&0&-2&0&\quad\\
\quad&\quad&\quad&\quad&0&0&-1&0\\
0&0&0&0&0&0&0&1
\ncline{2,1}{7,1}
\ncline{2,2}{7,2}
\ncline{5,3}{7,3}
\ncline{6,4}{7,4}
\ncline{2,7}{5,7}
\ncline{2,8}{6,8}
\end{psmatrix}\end{pspicture}\right)$$
I hope you can help me, as I have to do some more matrices
Greetings from Bonn,
Felix
More information about the PSTricks
mailing list