[pstricks] Pst-pdf and psmatrix ??

Herbert Voss LaTeX at zedat.fu-berlin.de
Fri Feb 10 18:50:08 CET 2006


Alain Matthes wrote:

> This code compile fine :with tex & ghostscript under texshop

split the command arbre in a TeX and PSTricks part.
tested with ps4pdf for Linux.

Herbert



\documentclass{article}
\usepackage{pstricks,pst-node}
\usepackage{pst-pdf}
\usepackage[upright]{fourier}
\usepackage{amsmath} % c'est pour /text evt complémentaire
\DeclareMathSymbol{@}{\mathord}{letters}{"3B}
\usepackage[frenchb]{babel}

\newcounter{nb}% counter def _always_ outside of newcommand

\makeatletter
\newcommand{\arbre}[4]{%
\setcounter{nb}{0}
\@for\liste:=#1\do{%
    \ifcase\thenb
     \edef\@S{\liste}%
       \or
      \edef\@E{\liste}%
      \fi
       \stepcounter{nb}%
    }%fin du do

\setcounter{nb}{0}
   \@for\liste:=#2\do{%
    \ifcase\thenb
       \edef\@SS{\liste}%
       \or
       \edef\@SE{\liste}%
        \or
       \edef\@ES{\liste}%
      \or
       \edef\@EE{\liste}%
      \fi
       \stepcounter{nb}%
    }%fin du do
\setcounter{nb}{0}
   \@for\liste:=#3\do{%
    \ifcase\thenb
       \edef\@PS{\liste}%
       \or
       \edef\@PE{\liste}%
       \fi
      \stepcounter{nb}%
    }%fin du do
\setcounter{nb}{0}

   \@for\liste:=#4\do{%
    \ifcase\thenb
       \edef\@PSS{\liste}%
       \or
       \edef\@PSE{\liste}%
        \or
       \edef\@PES{\liste}%
      \or
       \edef\@PEE{\liste}%
      \fi
       \stepcounter{nb}%
    }%fin du do
}
\makeatother

\begin{document}

\DecimalMathComma
\begin{pspicture}(0,0)(5,5)
%\arbre{A,$\overline{\text{B}}$} {E,F,G,H} {{0,2},x} {{0,3},y,z,{0,8}}
\arbre{A,$\overline{\text{B}}$}{E,F,G,H}{0 at 2,x}{0 at 3,y,z,0 at 8}
\makeatletter
\begin{psmatrix}[rowsep=.2cm,colsep=2cm]
             &               & \@SS   \\
              & \@S     &        \\
             &               & \@SE      \\
$\bullet$   &           &           \\
              &              & \@ES      \\
              & \@E     &        \\
             &           & \@EE
\end{psmatrix}
\scriptsize
\psset{shortput=nab,arrows=->,labelsep=2pt,nodesep=2pt,nrot=:U}
\ncline{4,1}{2,2}\ncput*{$\@PS$}
\ncline{4,1}{6,2}\ncput*{$\@PE$}
%
\ncline{2,2}{1,3}\ncput*{$\@PSS$}
\ncline{2,2}{3,3}\ncput*{$\@PSE$}
%
\ncline{6,2}{5,3}\ncput*{$\@PES$}
\ncline{6,2}{7,3}\ncput*{$\@PEE$}
\end{pspicture}

\end{document}


-- 
LaTeX und Perl in der ZEDAT: http://userpage.fu-berlin.de/~latex





More information about the PSTricks mailing list