TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to draw some flowcharts with the psmatrix environment and I must show my input and output in a parallelogram box . I do not have a problem with the nodes while having the parallelogram in my flowchart but whenever I try to draw a horizontal node I encounter the problem with the below figure where a part of the node is inside of the parallelogram image showing problem


% ‎================================‎
% ‎Source‎: ‎http://tug.org/pipermail/pstricks/2009/006766.html‎

    ‎\advance\pst@dima by \psframesep‎
    ‎\pst@dimc=\wd\pst@hbox\advance\pst@dimc by \pst@dima‎
    ‎\pst@dimb=\dp\pst@hbox\advance\pst@dimb by \pst@dima‎
    ‎\pst@dimd=\ht\pst@hbox\advance\pst@dimd by \pst@dima‎
            ‎\pst@number\pst@dima neg‎
            ‎\pst@number\pst@dimb neg‎
            ‎\pst@number\pst@dimd‎ .‎5‎

% ‎From the Frame and Rect PostScript macros‎
/‎ParallelogramA‎ {
‎x1 pgs sub y1 moveto‎
‎x1 y2 lineto‎
‎x2 pgs add y2 lineto‎
‎x2 y1 lineto‎
‎x1 pgs sub y1 lineto‎
‎closepath} def‎
/‎pgs ED‎
‎CLW mul‎
/‎a ED‎
‎3‎ -‎1 roll‎
‎2 copy gt { exch } if‎
‎a sub‎
/‎y2 ED‎
‎a add‎
/‎y1 ED‎
‎2 copy gt { exch } if‎
‎a sub‎
/‎x2 ED‎
‎a add‎
/‎x1 ED‎
‎1 index 0 eq {pop pop ParallelogramA } { OvalFrame } ifelse}>‎


% ‎================================‎

  ‎\begin{psmatrix}[rowsep=0.7,colsep=0.7]% defines the distance between two frames‎ 
   ‎\psovalbox[fillstyle=solid‎, ‎fillcolor=yellow!30,shadow=true]{Start} \\‎
        ‎\psparallelogrambox[fillstyle=solid,fillcolor=blue!20,shadow=true]{Input r} \\‎
    ‎\psdiabox[fillstyle=solid‎, ‎fillcolor=magenta!20,shadow=true]{$ r > 0 $} &‎
          ‎\psparallelogrambox[fillstyle=solid,fillcolor=blue!20,shadow=true]{Print m‎ , ‎d‎ , ‎s} \\‎ 
       ‎\psframebox[shadow=true]{$ d=2*r  $}  &‎ 
            ‎\psovalbox[fillstyle=solid‎, ‎fillcolor=yellow!30,shadow=true]{End}\\‎
       ‎\psframebox[shadow=true]{$ m=2*\pi*r $}  \\‎
       ‎\psframebox[shadow=true]{$ s = \pi*r*r    $}  \\‎
          ‎\psparallelogrambox[fillstyle=solid,fillcolor=blue!20‎, ‎shadow=true]{Print Sum} \\‎ 
       % ‎Links‎

So what should I do in order to have the right nodes ?

share|improve this question
up vote 1 down vote accepted

use the package pstricks-add (v. 3.57) from http://texnik.dante.de/tex/generic/pstricks-add/

It knows the command \psparallelogrambox with a better code. Your example then can be:


   \psovalbox[fillstyle=solid, fillcolor=yellow!30,shadow=true]{Start} \\
   \psparallelogrambox[fillstyle=solid,fillcolor=blue!20,shadow]{Input r} \\
   \psdiabox[fillstyle=solid, fillcolor=magenta!20,shadow=true]{$ r > 0 $} &
     \psparallelogrambox[fillstyle=solid,fillcolor=blue!20,shadow=true]{Print m, d, s} \\
       \psframebox[shadow=true]{$ d=2*r $}  & 
            \psovalbox[fillstyle=solid, fillcolor=yellow!30,shadow=true]{End}\\
       \psframebox[shadow=true]{$ m=2*\pi*r $}  \\
       \psframebox[shadow=true]{$ s=\pi*r*r $}  \\
    \psparallelogrambox[fillstyle=solid,fillcolor=blue!20, shadow=true]{Print Sum} 

enter image description here

share|improve this answer
Unfortunately I'm absolutlely unfamiliar with adding a new package ,would you tell me where can I find a good guide for that? – Negin Dec 20 '11 at 13:17
I mean my pstricks-add is the 3.54 version and I do not know how to update it to 3.57 – Negin Dec 20 '11 at 13:17
save it into your documents directory if you do not know the place where the pstricks-add.tex is saved. However, have a look into the log file of your document, there you find something like (/usr/local/texlive/2011/../texmf-local/tex/generic/pstricks-add/pstricks-add.t‌​ex which shows you the directory – Herbert Dec 20 '11 at 13:46
Thank you very much – Negin Dec 20 '11 at 14:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.