Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\documentclass{article}
\usepackage{graphics,graphicx}
\usepackage{pstricks,pst-node,pst-tree}
\begin{document}
\pstree[levelsep=35pt]{\Tcircle{10}}
{
\Tcircle{11} \Tcircle{21}
}
\end{document}

Why the error:

! Undefined control sequence. \c@lor@to@ps l.5 \pstree[levelsep=35pt]{\Tcircle{10}} ?

I compile with latexmk if that makes any difference:

enter image description here

share|improve this question
2  
@ptrcao: I don't get any error. Please, add \listfiles in front of the code and show the output of this command that you easily find in the .log file. –  egreg May 25 '11 at 10:16
1  
@ptrcao --- Jasper Loy is correct, the problem is caused by using pdflatex, which does not work with pstricks. Try using latexmk -pdfdvi in place of latexmk. –  Ian Thompson May 25 '11 at 14:48
1  
@Jasper --- the manual says it uses dvipdf by default, and I think that uses ghostscript and dvips. It works fine on my system, but maybe -pdfps is a safer option. –  Ian Thompson May 25 '11 at 15:02
    
@egreg Just clarifying your instructions; where does "\listfiles" go in the code exactly? Before \documentclass{article} or after \documentclass{article} but before \begin{document}, or after \begin{document} but before all the rest of the code? –  ptrcao May 25 '11 at 15:51
add comment

1 Answer

You have several possibilities to run PostScript related code with pdflatex:

  • run xelatex instead of latexmk, which is the easiest way.

  • use package auto-pst-pdf and add the optional argument -shell-escape to the pdflatex call

  • instead of pdflatex run latex

see also: http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput

share|improve this answer
    
@Herbert : I need latexmk for my bibliography, so it will run processors the correct number of times. I also want my output as a pdf file. Where does this leave me? –  ptrcao May 25 '11 at 16:58
    
@ptrcao then use package auto-pst-pdf and add the option -shell-escape to the pdflatex call. –  Herbert May 25 '11 at 17:13
    
I'm still relatively new to Latex, would you be so kind as to explicitly spell out the steps involved in adding the -shell-escape option? I use TexWorks. –  ptrcao May 25 '11 at 17:38
    
I got this error: "! Undefined control sequence. <recently read> \c@lor@to@ps l.8 \pstree[levelsep=35pt]{\Tcircle{10}} ?" What now? –  ptrcao May 25 '11 at 17:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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