2

I installed the latest MikTex2.9 and tested the following simple code trying to create a node in a tree diagram.

\documentclass{article}
\usepackage{graphics,graphicx}
\usepackage{pstricks,pst-node,pst-tree}
\begin{document}
\pstree[radius=3pt]{\Tcircle{X}}
\end{document}

But I received the following error:

"Undefined controlled sequence. \pstree[radius=3pt]{\Tcircle{X}}"

Any hints what went wrong? Thanks!

1

The first error is most likely the usage of pdftex instead of latex or xelatex.

This can be fixed with \usepackage{auto-pst-pdf}, if --shell-escape is enabled (i.e. the \write18 feature)

The \pstree command needs at least the start node (root) and a successor node, which is missing in the above document. I just choose \TC* for example, i.e. the syntax is

\pstree[options]{root}{successor}

Of course, {successor} can be left empty, but that's no tree actually ;-)

Here's the working document:

\documentclass{article}
\usepackage{graphicx}
\usepackage{pst-tree}
\usepackage{auto-pst-pdf}
\begin{document}
\pstree[radius=3pt]{\Tcircle{X}}{\TC*}
\end{document}

enter image description here

  • 1
    @Chrisstian Hupfer: May be you should add it's necessary to use use the --enable-write18 or -shell-escape switch to make it work. Also, it is enough to load pst-tree, as it loads the first two packages. – Bernard Apr 11 '16 at 21:36
  • @Bernard: Thanks, I've added your recommendations. – user31729 Apr 11 '16 at 21:54
0

You need at least an empty node where the root points to:

\documentclass{article}
\usepackage{pst-tree}
\begin{document}
    \pstree[radius=3pt]{\Tcircle{X}}{}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.