# PSTricks: what do you think about using [mnode=anArbitraryCommandName]?

Denis Girou Denis.Girou at idris.fr
Tue Jul 22 17:50:26 CEST 1997

-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

Christophe.Broult> I think that would be nice if we could specify the name of whatever command
Christophe.Broult> accepting a single argument as the value of mnode key e.g
Christophe.Broult> psshadowbox. Is it possible?

Yes, it's easy and you can do what you want. Of course, you can use the
standard LaTeX macro mechanism, but if you found the coding too boring for
that, you can define easily your own node formats.

If you want to use the centering form of \rnode rather than \Rnode, use
\rnode at iv in place of \Rnode at ii

\documentclass{article}

\usepackage{pst-node}

\begin{document}

\begin{psmatrix}
\SB{A} & \SB{B}
\end{psmatrix}

\vspace{1cm}

\makeatletter
\newcommand{\mnode at MyNode}{%
\psshadowbox[linecolor=red]{\rnode at iii\Rnode at ii{\psm at thenode}}}
\makeatother

\begin{psmatrix}[mnode=MyNode]
A & B
\end{psmatrix}

\vspace{1cm}

\makeatletter
\renewcommand{\mnode at MyNode}{%
\psdblframebox[linecolor=green]{\rnode at iii\Rnode at ii{\psm at thenode}}}
\makeatother

\begin{psmatrix}
A & [mnode=MyNode] B & C
\end{psmatrix}

\end{document}

Jean-Francois.Mertens> it would be more pleasant to have some more
Jean-Francois.Mertens> flexibility, and that ideally any node type could be used anywhere, even
Jean-Francois.Mertens> in the psmatrix and pstree environments.

For trees, you have to define your own macros:

\documentclass{article}

\usepackage{pst-tree}

\begin{document}

\pstree{\MyTreeNode{Root}}
{\MyTreeNode{A}
\TR{B}
\MyTreeNode{C}}

\end{document}

D.G.

-----------------------------------------------------------------------------
To [un]subscribe to this list, send mail to pstricks-request at mail.tug.org
Leave the subject line blank and in the body put the line