[pstricks] psframebox

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Aug 12 20:08:41 CEST 2008


Charles Pugh schrieb:
> Hello  --
> 
> I'm using latexit and pstricks to make labels for math diagrams in  
> drawing programs EazyDraw and Illustrator CS2.  In latexit the  
> following code produces a framed label with yellow fillcolor and the  
> background shape I want  --  namely, round corners and a 2pt border  
> around the text.
> 
> \documentclass[10pt]{article}
> \usepackage{color} %used for font color
> \usepackage{amssymb} %maths
> \usepackage{amsmath} %maths
> \usepackage[utf8]{inputenc} %useful to type directly accentuated  
> characters
> \usepackage{pstricks}
> \psframebox*[framearc=.5,
> fillcolor=yellow,
> framesep=2pt]{Text}
> 
> (The first 5 lines of the code are supplied by latexit, which also  
> internally adds \begin{document} and \end{document} commands around  
> the last three lines when it processes the code.)

the code is not correct!

\usepackage{color} %used for font color

shouldn't be there, color handling is done by pstricks.sty

> But with fillcolor=white  the framebox has square corners and a  
> border of 0pt.  (I want this text on a white background in order to  
> show up well when it lies on top of shaded portions of the diagram or  
> curves.)
> 
> A kludge solution is to define a new fillcolor with \definecolor 
> {mywhite}{rgb}{.99,.99,.99}, but there should be a nicer way to get a  
> solid white box with a 2pt rounded border.

I suppose, that I do not really understand your problem ...
I get a rounded frame independent from the fillcolor.

\documentclass[12pt]{article}
\usepackage{pstricks}
\begin{document}

\begin{pspicture}(3,3)
\psframe*(3,3)
\rput(1.5,1.5){\psframebox*[framearc=.5,
	fillcolor=white,framesep=2pt]{\huge Text}}
\end{pspicture}

\end{document}

Herbert




More information about the PSTricks mailing list