[pstricks] N/A

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Jan 19 09:18:04 CET 2010


Am 18.01.2010 20:43, schrieb Ludwig Meyerhoff:

> \newcount\Graph
> \setcount\Graph=0
> ...
> \ifnum\Graph<5
>   \doSth
> \fi
> ...
> 
> 
> This worked fine until now, when I have to describe a tree. 
> One version relying only on \ovalnode and \rnode works fine this way.
> For a second version I am using pst-tree, and my hiding approach does not compile.
> 
> I am using the following code (snippet), \Rect is just a convenience macro.
> The code compiles if I hide the \TR{yyy} node within the \ifnum block.
> 
> ...
> \def\Rect#1#2{ \TR[name=#1]{ \psframebox{ \parbox{40mm}{ \begin{center} #2
> \end{center}}}}}

please provide full working examples not only fragments.

\documentclass{article}
\usepackage{pst-tree}
\SpecialCoor
\def\Rect#1#2{\TR[name=#1]{\psframebox{\parbox{40mm}{\begin{center} #2
\end{center}}}}}
\def\psedge{%
  \nccurve[nodesepB=3pt,fillstyle=none,angleB=90,angleA=-90,
           linewidth=3pt,linecolor=blue]}
\begin{document}

\def\Graph{3}
\psTree{\Rect{FLUGHH6}{Flughafen HH (6)} }
  \ifnum\Graph<10\relax\def\myTR#1{}\else\let\myTR\TR\fi
  \myTR{yyy}
  \Rect{TRANSPORT}{Term. B (8) }
  \Rect{TERMB}{Term. B (8) }
  \psedge{TRANSPORT}{TERMB}
\endpsTree

\end{document}

Herbert


More information about the PSTricks mailing list