[pstricks] 2 pictures (psmatrix) side by side

Denis Girou Denis.Girou at idris.fr
Mon Nov 26 18:06:10 CET 2001


>>>>> "Richard.Sudarmono" == Richard Sudarmono <iye at gmx.de> writes:

    Richard.Sudarmono> I would like to make 2 psmatrix pictures side by side.
    Richard.Sudarmono> Can anybody tell me, how can I make it or where to find the answer?
    Richard.Sudarmono> Except with minipage environtment, is there another method?

    Richard.Sudarmono> Here is something what I want to do -but with psmatrix-

    Richard.Sudarmono> ...
    Richard.Sudarmono> \hfill
    Richard.Sudarmono> %% ^^^^ doesn't work with psmatrix. :(
    Richard.Sudarmono> ...

  Giving a minimal test file is always the best way to illustrate a question
or to demonstrate a problem. Here, without it, we can't know what you are
doing wrong. A "psmatrix" environment is just a box for TeX, so the \hfill
command must give the expected result, like in this example:

\documentclass{article}

\usepackage{pstcol}
\usepackage{pst-node}

\definecolor{Pink}{rgb}{1.,0.75,0.8}

\newcommand{\MyDiagram}{%
\psframebox[linearc=0.5,cornersize=absolute]{%
  \begin{psmatrix}[rowsep=0.2,colsep=0.2]
    \psovalbox[fillstyle=solid,fillcolor=yellow]{Begin} \\
    \psframebox{Initialisations} \\
    \psdiabox[fillstyle=solid,fillcolor=Pink]{Special} &
       \psframebox{Call to SP1} & \psframebox{Call to SP2} \\
    \psframebox{Action 1} \\
    \psframebox{Action 2} \\
    \psovalbox[fillstyle=solid,fillcolor=yellow]{End}
    % Links
    \ncline{1,1}{2,1}
    \ncline{2,1}{3,1}
    \ncline{3,1}{4,1}<{\textcolor{red}{No}}
    \ncline{4,1}{5,1}
    \ncline{5,1}{6,1}
    \ncline{->}{3,1}{3,2}^{\textcolor{red}{Yes}}
    \ncline{->}{3,2}{3,3}
    \ncbar[angleA=-90,armB=0,nodesepB=0.25]{->}{3,3}{4,1}
    \end{psmatrix}}}

\pagestyle{empty}

\begin{document}

\tiny

\begin{center}
Flow diagram with the psmatrix environment\\[5mm]

\MyDiagram
\hfill
\MyDiagram
\end{center}

\end{document}


D.G.



More information about the PSTricks mailing list