[pstricks] pst-tree and pst-circ

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Nov 11 21:25:11 CET 2008


Patrice Mégret schrieb:

Your example works but in my example there were a main tree and
sub-trees (in fact, I have just sent a small part of the tree to
demonstrate the problem).
> 
> If I try with your code, I still get an error:
> ! Missing } inserted.
> <inserted text> 

Patrice,
the following helps, but I have no idea, why there is a problem
without the redefinition of the macro from pstricks. You also
need the pst-circ.tex from http://perce.de/LaTeX/pst-circ
(its the same from last time)

Herbert


\documentclass{article}
\listfiles
\usepackage{pst-tree}
\usepackage{pst-circ}

\makeatletter
\def\special@@coor#1{%
  \ifcat#1a\relax\def\nexxt{\node at coor#1}%
  \else\ifx#1[\relax\def\nexxt{\Node at coor[}%
  \else\ifx#1!\relax\def\nexxt{\raw at coor}%
  \else\ifx#1*\relax\def\nexxt{\alg at coor}%
  \else\def\nexxt{\special@@@coor#1}%
  \fi\fi\fi\fi\nexxt}
\makeatother

\begin{document}

foo
\pstree[levelsep=1.5cm,treesep=0.5cm,nodesep=3pt]{%
    \pstree{\Tr{Main tree}}{%
		\Tr{Item 1}%
		\Tr{Item 2}%
	      \pstree{\Tr{Sub tree 3}}{%
			\Tr{Sub item 1}%
			\Tr{Sub item 2}%
		}%
	}%
}
bar

\begin{pspicture}(5,5)
\dotnode(1,1){A}
\dotnode(3,1){B}
\resistor(1,1)(3,1){R}
\end{pspicture}

\end{document}


More information about the PSTricks mailing list