[pstricks] Help in ps-tricks
Herbert Voss
herbert49 at googlemail.com
Wed Sep 12 09:39:22 CEST 2007
TeX_Saravanan wrote:
> I need a group of text around by a coloured box and that box bottom
> right corner alone is curved. Is there any way to meet my requirement?
> Kindly suggest me as soon as possible.
not really easy ...
Herbert
\documentclass[12pt,a4paper]{article}
\usepackage{pstricks}
\SpecialCoor
\newsavebox\pstBox
\newlength\pstHeight
\makeatletter
\def\psRBox{\pst at object{psRBox}}
\def\psRBox at i#1{{%
\addbefore at par{linearc=0.4,shadowsize=0.2,
fillstyle=solid,fillcolor=white}
\sbox\pstBox{#1}
\pstWidth=\wd\pstBox
\pstHeight=\ht\pstBox
\advance\pstHeight by \dp\pstBox
\use at par
\advance\pstHeight by \pslinearc
\advance\pstHeight by \psframesep
\advance\pstWidth by \pslinearc
\advance\pstWidth by \psframesep
\begin{pspicture}(\pstWidth,\pstHeight)
\begin at ClosedObj
\addto at pscode{
/W \pst at number\pstWidth def
/H \pst at number\pstHeight def
W H moveto
0 H lineto
0 0 lineto
W 0 W H \pst at number\pslinearc arcto
pop pop pop pop
W H lineto
}%
\end at ClosedObj%
\rput(0.5\pstWidth,0.5\pstHeight){#1}
\end{pspicture}%
\ignorespaces}}
\makeatother
\begin{document}
\psRBox[linearc=0.2]{Some text in a box}
\bigskip
\psRBox[shadow=true,fillcolor=red!40]{%
\parbox{3cm}{Some text in a box with a linearc only
on the lower right side}}
\bigskip
\psRBox[framesep=20pt,linearc=0.5]{%
\parbox{3cm}{Some text in a box with a linearc only
on the lower right side}}
\end{document}
--
http://PSTricks.tug.org
http://www.dante.de/CTAN/info/math/voss/
More information about the PSTricks
mailing list