[pstricks] Alignment of psmatrix environment

Herbert Voss Herbert.Voss at FU-Berlin.DE
Thu Nov 18 09:52:00 CET 2010


Am 17.11.2010 15:33, schrieb Felix Hoffmann:

> 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

please provide full working examples, it makes live easier ...

Herbert

\documentclass{article}

\usepackage{pst-node}
\usepackage{amsmath}
\def\VZ#1{\phantom{-}\ifx\relax#1\relax0\else\rnode{#1}{0}\fi}
\begin{document}

\psset{nodesep=5pt}
\[\left(\arraycolsep=3pt
\begin{array}{*8r}
\rnode{A}{0}& \VZ{B}& \VZ{} & \VZ{} & 0 & 0 & \VZ{E}& \VZ{F}\\
            &       &    0  &    0  & 0 & 0 &       & \\
            &       &    2  &    0  & 0 & 0 &       & \\
            &       & \VZ{C}&    1  & 0 & 0 &       & \\
            &       &       & \VZ{D}&-1 & 0 &       & \\
            &       &       &       & 0 &-2 & \VZ{e}& \\
            &       &       &       & 0 & 0 &-1     & \VZ{f}\\
\rnode{a}{0}& \VZ{b}& \VZ{c}& \VZ{d}& 0 & 0 & 0     & 1
\end{array}\right)
\]
\ncline{A}{a}\ncline{B}{b}\ncline{C}{c}
\ncline{D}{d}\ncline{E}{e}\ncline{F}{f}

or better

\psset{nodesep=5pt}
\[\left(\arraycolsep=3pt
\begin{array}{*8r}
\VZ{A}& \VZ{B}& \VZ{} & \VZ{} & 0 & 0 & \VZ{E}& \VZ{F}\phantom{-}\\
      &       &    0  &    0  & 0 & 0 &       & \\
      &       &    2  &    0  & 0 & 0 &       & \\
      &       & \VZ{C}&    1  & 0 & 0 &       & \\
      &       &       & \VZ{D}&-1 & 0 &       & \\
      &       &       &       & 0 &-2 & \VZ{e}& \\
      &       &       &       & 0 & 0 &-1     & \VZ{f}\phantom{-}\\
\VZ{a}& \VZ{b}& \VZ{c}& \VZ{d}& 0 & 0 & 0     & 1
\end{array}\right)
\]
\ncline{A}{a}\ncline{B}{b}\ncline{C}{c}
\ncline{D}{d}\ncline{E}{e}\ncline{F}{f}

\end{document}


More information about the PSTricks mailing list