[pstricks] Pst-pdf and psmatrix ??
Alain Matthes
alain.matthes at free.fr
Fri Feb 10 13:33:24 CET 2006
Hello
This code compile fine :with tex & ghostscript under texshop
\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}
\makeatletter
\newcommand{\arbre}[4]{%
\begin{pspicture}(0,0)(5,5)
\newcounter{nb}\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
\begin{psmatrix}[rowsep=.2cm,colsep=2cm]
& & \@SS \\
& \@S & \\
& & \@SE \\
$\bullet$ & & \\
& & \@ES \\
& \@E & \\
& & \@EE \\
\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{psmatrix}
\end{pspicture}
}
\makeatother
\begin{document}
\DecimalMathComma
%\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}
\end{document}
but if i try with \usepackage{pst-pdf} and ps4pdf i've this error :
Preview: PDFoutput 1
LaTeX Info: Redefining \dots on input line 92.
\c at nb=\count124
! Misplaced alignment tab character &.
\arbre ...gin {psmatrix}[rowsep=.2cm,colsep=2cm] &
& \@SS \\ & \@S &
\\ & & ...
l.97 ...e{\text{B}}$}{E,F,G,H}{0 at 2,x}{0 at 3,y,z,0 at 8}
?
! Emergency stop.
\arbre ...gin {psmatrix}[rowsep=.2cm,colsep=2cm] &
& \@SS \\ & \@S &
\\ & & ...
l.97 ...e{\text{B}}$}{E,F,G,H}{0 at 2,x}{0 at 3,y,z,0 at 8}
End of file on the terminal!
but the file arbre2bis-pics.pdf is fine but arbre2.dvi is empty and
i don't have a arbre2.pdf
Alain Matthes
More information about the PSTricks
mailing list