[pstricks] psovalbox
Herbert Voss
LaTeX at zedat.fu-berlin.de
Wed Apr 25 08:57:20 CEST 2007
Pedro Jorge Caridade wrote:
> I think this is not possible right now, but maybe someone have some
> workaround. I would like to control the framesep of a psovalbox
> separately in different directions, i.e., the framesep being different
> in height and width. Is this possible, or can it be done easily?
>
>
Is also possible with the \parbox command.
Herbert
\documentclass{article}
\usepackage{pstricks,pst-xkey}
\makeatletter
\newdimen\pst at Xsep\newdimen\pst at Ysep
\define at key[psset]{}{Xsep}{\pssetxlength\pst at Xsep{#1}}
\define at key[psset]{}{Ysep}{\pssetylength\pst at Ysep{#1}}
\psset{Xsep=0,Ysep=0}
\newsavebox\PSTBox
\def\psOvalbox{\pst at object{psOvalbox}}
\def\psOvalbox at i#1{%
\begin at SpecialObj
\sbox\PSTBox{#1}
\pst at dimb=\wd\PSTBox \advance\pst at dimb by 2\pst at Ysep
\pst at dimc=\ht\PSTBox \advance\pst at dimc by 2\pst at Xsep
\psovalbox{\parbox[c][\pst at dimb][c]{\pst at dimc}{\makebox[\pst at dimc]{#1}}}
\end at SpecialObj%
}
\makeatother
\begin{document}
\psOvalbox{foo}
\psOvalbox[Xsep=1pt]{foo}
\psOvalbox[Xsep=1cm]{foo}
\psOvalbox[Ysep=1cm,Xsep=1cm]{foo}
\psOvalbox[Ysep=2cm,Xsep=1cm]{foo}
\psOvalbox[Ysep=1cm,Xsep=2cm]{foo}
\psOvalbox[Ysep=30pt]{foo}
\psOvalbox[shadow=true,Xsep=30pt]{foo}
\psOvalbox[fillstyle=solid,fillcolor=yellow,Xsep=50pt,Ysep=2mm]{\textbf{\color{blue}\Large
foo}}
\end{document}
More information about the PSTricks
mailing list