[pstricks] add latex text (and code) in pstricks

tiM Sportny tiporichie at hotmail.com
Tue Aug 8 20:00:05 CEST 2006


hello,

just started using pstricks two days ago and skipped one night of sleep 
using it. Not that it's hard to use, just because it's too much fun to see 
all possibilities.

But there's one i can't find, don't know if it's possible but lets try:

I'm looking for a way to make a function/environment in latex where a 
paragraph (or two) can be printed and the pstricks picture will adjust it's 
height to it.

For example make the following code:

\begin{mypsenv}
    just some example text that is used to illustrate my plans
\end{mypsenv}

print the text of the environment and place it in a gray box with rounded 
lower corners.

One way i came up with was something like this:

\newenvironment{mypsenv}[0]{\begin{pspicture}(\linewidth,-1)
\psline*[linearc=.5,linecolor=gray](0,0)(0,-\parheight)(\linewidth,-\parheight)(\linewidth,0)
\end{pspicture}}{\vspace{1cm}}

where \parheight would reprecent the total height of the text in the 
environment. There is one majar drawback, i couldn't find a way to determine 
the height of the text in the environment (\parheight).

Does somebody know the way to do this kind of things? I prefer to let latex 
do the typesetting itself so i can use latex tables or something in it, but 
if someone has a solution that fits just for text i'd be a great help to.

Thanks a lot,

tiM





More information about the PSTricks mailing list