[OS X TeX] Stemma using TeXShop

Toke Lindegaard Knudsen toke_knudsen at brown.edu
Thu Dec 6 12:19:11 EST 2007


Hi all,

I am preparing a critical edition of a Sanskrit treatise using LaTeX  
for the introduction and translation.  In the introduction, I am going  
to present a stemma for the manuscripts, and I have been wondering how  
to best to that in LaTeX.  Searching the web, I found this link

<http://tug.org/PSTricks/main.cgi?file=pst-tree/pst-tree#dir>

and I am interested in using the "Another Demo" example for my work.   
However, I run into problems when trying to run the code of the example  
in TeXShop.  (I have attached the code at the bottom of this email.)   
It gives me the following:

==========
! Undefined control sequence.
\XC@@usecolor ...expandafter \c at lor@to at ps #1#2\@@
                                                   \else \expandafter  
\expand...
l.45 \pstree{\MyNode{0}}

?
==========

I thought that all packages should be okay in TeXShop, and I am a  
little confused as to why this objection occurs.

In addition, I would be happy to hear any other suggestions as to how  
to best set up a stemma using LaTeX with TeXShop.

Many, many thanks!

Sincerely,
Toke Lindegaard Knudsen


==========
\documentclass[a4paper]{article}
\usepackage{pst-tree}
\usepackage{lscape}

\makeatletter
\def\pstree at balancedfit#1#2{%
\edef\next{\noexpand\pstree@@balancedfit#1\noexpand\@nil#2\noexpand\@nil 
}%
\next
\ifnum\pst at cntg=\z@
\pstree at max{#1}\pst at cnth
\else
\pstree at max{#2}\pst at cnth
\fi
\advance\pst at cnth\pst at cnth
\advance\pst at cnth\psk at thistreesep\relax
\advance\pst at cnth\pstree at tspace\relax
\gdef\pstree at tspace{\z@}}
\def\pstree@@balancedfit#1,#2\@nil#3,#4\@nil{%
\ifnum#1=\pstree at stop
\let\next\relax
\pst at cntg=\@ne
\else
\ifnum#3=\pstree at stop
\let\next\relax
\pst at cntg=\z@
\else
\def\next{\pstree@@balancedfit#2\@nil#4\@nil}%
\fi
\fi
\next}

\makeatother

\newcommand{\MyNode}[1]{\Tcircle{\makebox[1em]{#1}}}

\setlength{\textwidth}{19cm}
\setlength{\textheight}{23cm}
\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{0cm}

\pagestyle{empty}

\begin{document}

\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \MyNode{4}}
\hspace{1cm}
\pstree{\MyNode{0}}
        {\MyNode{1}
         \pstree{\MyNode{2}}
                {\MyNode{3}
                 \MyNode{4}}}
\hspace{1cm}
\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \pstree{\MyNode{4}}
                {\MyNode{5}
                 \MyNode{6}}}

\vspace{1cm}

\psset{treefit=loose}
\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \MyNode{4}}
\hspace{1cm}
\pstree{\MyNode{0}}
        {\MyNode{1}
         \pstree{\MyNode{2}}
                {\MyNode{3}
                 \MyNode{4}}}
\hspace{1cm}
\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \pstree{\MyNode{4}}
                {\MyNode{5}
                 \MyNode{6}}}

\vspace{1cm}

\psset{treefit=balanced}
\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \MyNode{4}}
\hspace{1cm}
\pstree{\MyNode{0}}
        {\MyNode{1}
         \pstree{\MyNode{2}}
                {\MyNode{3}
                 \MyNode{4}}}
\hspace{1cm}
\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \pstree{\MyNode{4}}
                {\MyNode{5}
                 \MyNode{6}}}

\vspace{1cm}
\pstree[treemode=R,treefit=tight]{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \MyNode{4}}
\hspace{1cm}
\pstree[treemode=R]{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \MyNode{4}}
\hspace{1cm}
\pstree[treemode=R]{\MyNode{0}}
        {\MyNode{4}
         \pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}}

\vspace{1cm}
\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \MyNode{4}
         \pstree{\MyNode{5}}
                {\MyNode{6}
                 \MyNode{7}}
         \MyNode{8}}

\vspace{1cm}
\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}
                 \MyNode{4}}
         \MyNode{5}
         \pstree{\MyNode{6}}
                {\MyNode{7}
                 \MyNode{8}
                 \MyNode{9}}
         \MyNode{10}}

\vspace{1cm}
\pstree{\MyNode{0}}
        {\pstree{\MyNode{1}}
                {\MyNode{2}
                 \MyNode{3}}
         \MyNode{4}}
\hspace{1cm}
\pstree{\MyNode{0}}
        {\MyNode{1}
         \pstree{\MyNode{2}}
                {\MyNode{3}
                 \MyNode{4}}}

\begin{landscape}

% Generated by a pre-processor (which explain the format)
\pstree{\MyNode{0}}{%
\pstree{\MyNode{1}}{%
\pstree{\MyNode{2}}{%
\pstree{\MyNode{4}}{%
\pstree{\MyNode{8}}{%
}\pstree{\MyNode{9}}{%
}}\pstree{\MyNode{5}}{%
\pstree{\MyNode{10}}{%
}\pstree{\MyNode{11}}{%
}}}\pstree{\MyNode{3}}{%
\pstree{\MyNode{6}}{%
\pstree{\MyNode{12}}{%
}\pstree{\MyNode{13}}{%
}}\pstree{\MyNode{7}}{%
\pstree{\MyNode{14}}{%
}\pstree{\MyNode{15}}{%
}}}}\pstree{\MyNode{16}}{%
\pstree{\MyNode{17}}{%
\pstree{\MyNode{19}}{%
}\pstree{\MyNode{20}}{%
}}\pstree{\MyNode{18}}{%
\pstree{\MyNode{21}}{%
}\pstree{\MyNode{22}}{%
}}}}

\end{landscape}
\end{document}




More information about the MacOSX-TeX mailing list