[pstricks] Surround with oval box

David Arnold dwarnold45 at suddenlink.net
Fri Mar 6 09:32:57 CET 2009


Herbert,

I can't tell you how much I appreciate your responses. I now have:

\begin{figure}[h]
\centering
\begin{minipage}{0.45\textwidth}
\centering
\begin{pspicture}(1,0.5)(4,3.5)
\multido{\iA=1+1}{4}{%
   \multido{\iB=1+1}{3}{%
     \rput(\iA,\iB){\rnode{p\iA\iB}{\Box}}}}
\ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p11}{p41}
\ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p12}{p42}
\ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p13}{p43}
\end{pspicture}
\subcaption{Three sets of four: $3\cdot4=12$.\label{fig:ThreeOfFour}}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\begin{pspicture}(1,0.5)(4,3.5)
\multido{\iA=1+1}{4}{%
   \multido{\iB=1+1}{3}{%
     \rput(\iA,\iB){\rnode{p\iA\iB}{\Box}}}}
\ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p11}{p13}
\ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p21}{p23}
\ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p31}{p33}
\ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p41}{p43}
\end{pspicture}
\subcaption{Four sets of three: $4\cdot 3=12$.\label{fig:FourOfThree}}
\end{minipage}
\caption{Three sets of four is the same as four sets of three.\label 
{fig:sets}}
\end{figure}

Which yield the result I want:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic.tiff
Type: image/tiff
Size: 140990 bytes
Desc: not available
Url : http://tug.org/pipermail/pstricks/attachments/20090306/f3cdd3d8/attachment-0001.tiff 
-------------- next part --------------


We're working on another free textbook, this one for our prealgebra  
students. We've finished one, written in Context and Metapost for our  
intermediate algebra students:

http://msenux.redwoods.edu/IntAlgText/

Work continues to provide free texts for all of our developmental  
math student at our College (a two year community college in northern  
California).

So thanks for the help.

David Arnold
College of the Redwoods
http:\\msemac.redwoods.edu\~darnold\index.php



On Mar 6, 2009, at 12:05 AM, Herbert Voss wrote:

David Arnold schrieb:
> All,
>
> I'm trying to emulate the dice example to surround the 3 boxes in the
> first column with an oval, but as you can see in this example, I'm  
> off.
>
> \documentclass{article}
>
> \usepackage{pstricks}
> \usepackage{pstricks-add}
> \include{pst-func}
> \begin{document}
>
> \begin{center}
> \begin{pspicture}(-1,-1)(8,8)
> \multido{\iA=1+1}{4}{%
> 	\multido{\iB=1+1}{3}{%
> 		\rput(! \iA\space 7 \iB\space sub){%
> 			\rnode[c]{p\iA\iB}{\psframe[unit=0.75](0,0)(0.75,0.75)}}}}
> \ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p11}{p13}

for TeX all PSTricks objects have a width of 0pt. With \phantom
you can tell TeX the width/height of the object:

     \rnode{p\iA\iB}{\psframebox{\phantom{\rule{4mm}{4mm}}}}}}}

Alternative you can define a TeX-Box

\documentclass{article}
\usepackage{pstricks-add}
\begin{document}

\def\Box{\psframebox{\rule{4mm}{0pt}\rule{0pt}{4mm}}}

\begin{center}
\begin{pspicture}(-1,-1)(8,8)
\multido{\iA=1+1}{4}{%
   \multido{\iB=1+1}{3}{%
     \rput(! \iA\space 7 \iB\space sub){%
       \rnode{p\iA\iB}{\Box}}}}
\ncbox[linearc=0.35,nodesep=0.2,linecolor=blue]{p11}{p13}
\end{pspicture}
\end{center}

\end{document}


Herbert

_______________________________________________
PSTricks mailing list
PSTricks at tug.org
http://tug.org/mailman/listinfo/pstricks



More information about the PSTricks mailing list