[pstricks] [Fwd: Re: PSTricks newbie q. 2 | figure and 'spacing']

Herbert Voss Herbert.Voss at fu-berlin.de
Sat Aug 8 22:53:36 CEST 2009



-------- Original-Nachricht --------
Betreff: Re: PSTricks newbie q. 2 | figure and 'spacing'
Datum: Sat, 08 Aug 2009 21:49:33 +0200
Von: Herbert Voss <Herbert.Voss at fu-berlin.de>
Organisation: T-Online
Newsgruppen: comp.text.tex
Referenzen: <4A7DD230.50204 at NOSPAMverizon.net>

cooch17 at NOSPAMverizon.net schrieb:
> I'm trying to embed a PSTricks generated figure in a document. There
> seems to be a default spacing convention that differs from
> \includegraphics,  which is normally what I do with external .eps files.
> 
> Here is an example. If I comment out the \vspace below, then the figure
> and the preceding text overlap - which is clearly not what I'd like.
> Also, the caption wouldn't be positioned properly either.

the curves are drawn outside of TeX under the control of PostScript.
The reason why TeX doesn't know anything about the width and height.
USe simply an unseen vertical rule:

\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\newpsstyle{Cblue}{fillstyle=solid,fillcolor=blue!30}
\newpsstyle{Cred}{fillstyle=solid,fillcolor=red!30,shadow=true}
\begin{document}

foo

\begin{figure}[!htb]
\centering
\rule[-1.5cm]{0pt}{3.5cm}% has no width, but a depth and height
$\psmatrix[mnode=Circle,radius=5mm,colsep=2.0cm,rowsep=1.5cm,
	arrowscale=1.5]
[name=1,style=Cblue] 1 &  [name=2,shadow=true] 2 &  [name=3,style=Cred] 3
\ncline[nodesep=1pt]{->}{1}{2}_{S_o\lambda^{-1}}
\ncline[nodesep=1pt]{->}{2}{3}_{S_a\lambda^{-1}}
\ncarc[nodesep=1pt,arcangle=60]{<-}{1}{3}^{F_a\lambda^{-1}}
\nccurve[angleA=-105,angleB=-55,ncurv=4,nodesep=1pt]{->}{3}{3}
\nbput[nrot=:U]{S_a\lambda^{-1}}
\endpsmatrix$

\caption{This is an example of a life-cycle diagram drawn using PStricks}
\end{figure}

bar

\end{document}

Herbert


More information about the PSTricks mailing list