[pstricks] How to modify the 'Graphics Companion' book example

Denis Girou Denis.Girou at idris.fr
Wed Sep 26 19:52:04 CEST 2001

>>>>> "Szilard" == szilard  <szilard at cs.utwente.nl> writes:

    Szilard> My problem more specifically is in the assigning of separate
    Szilard> names
    Szilard> to all of the elements of a psmatrix (in the book is printed
    Szilard> that all 
    Szilard> cells can be named), but this works only for the first two
    Szilard> elements of the psmatrix. If I insert for instance a
    Szilard> [name=C] before the third 
    Szilard> element of the matrix, then I get a latex error that some
    Szilard> number is missing 
    Szilard> at the end of the psframebox containing the matrix in
    Szilard> question:

    Szilard> -------------------------------------
    Szilard> [2]
    Szilard> ! Missing number, treated as zero.
    Szilard> <to be read again> 
    Szilard>                    n
    Szilard> l.198   }

    Szilard> -------------------------------------

    Szilard> Here is the whole code, if you uncomment the 14th and 16th
    Szilard> lines, the error
    Szilard> will appear:

    Szilard> ...
    Szilard> \psframebox[fillstyle=solid,fillcolor=lightgray,framesep=.75]{%
    Szilard>     \rule{1cm}{0pt}
    Szilard>     \begin{psmatrix}[ref=c]
    Szilard>       [name=A]\Show{Goal} & [name=B]\Show{Criteria}\\
    Szilard>       %[name=C]
    Szilard>       \Show{Sub-goal} &
    Szilard>       %[name=D]
    Szilard>       \Show{Justification}
    Szilard>       ...

  Feature, not a bug... This question is not specific to PSTricks and this is
the standard LaTeX behaviour. I clearly agree that is disturbing and that is
must be a common pitfall...

  I explained it rather long time ago in

% 1. Inside the psmatrix environment, we can't use a parameter for the first
%    column definition if it's not the first row.
%    Reported by <Denis.Girou at idris.fr> in 1995.
%    It's a parsing problem, as the parser wait something like [3mm] after the
%    \\ and not something like [name=B].
%    In fact, this is the "standard" way in which LaTeX work, and this is
%    the same for the "tabular" environment, for instance.
%    Test file:
%    \documentclass{article}
%    \usepackage{pstricks}
%    \begin{document}
%    \begin{psmatrix}
%      [name=A] A \\
%      [name=B] B
%    \end{psmatrix}
%    \end{document}
%    Workaround: add [0pt] after the \\ in these cases:
%      [name=A] A \\[0pt]
%      [name=B] B

  P.S. My apologizes to everybody for the spamming message I authorize to be
sent on the list few minutes later. This is my error. I must check all waiting
messages sent by non subscribers -or registered people who use another address
than the one they used for subscription...-, decide what to do with them and
make an action for each of them (rather painful!) On this last case, I make a
confusion between two pending messages and authorize the wrong one... Sorry!


More information about the PSTricks mailing list