4

I would really love to use package pst-solides3d to draw 3D solids but so far I haven't been able to work on it. I am just a beginner of using pst-solides3d so and I do not know how to figure this following code out. When I was compiling the simple following code, always was being the error, that is: ! Undefined control sequence. Please anybody helps me with that, many thanks to you.

Code complied:

\documentclass[a4paper]{report}
\usepackage{pst-solides3d}
\begin{document}
\begin{pspicture}(1,1)(2,2)
\psSolid[object=cube,a=2,action=draw*]
\end{pspicture}
\end{document}
  • 1
    Welcome to TeX.se, and thanks for posting a good minimal example document. You need to compile pstricks code with LaTeX+dvips or XeLaTeX, not pdfLaTeX. – Alan Munn Jun 19 '17 at 3:16
  • 1
    Or you load auto-pst-pdf after pstricks and add to the command line the --enable-write18 switch (MiKTeX) or -shell-escape (TeX Live, MacTeX). Then you can use pdflatex. – Bernard Jun 19 '17 at 9:25
  • Thanks Mister for your helpful supplies. Could you please show me where the "command line" is. It is in Texmaker (that I am using) or in somewhere else ?. Because I do not know where to put "--enable-write18" in. – Nguyễn Hải Duy Jun 19 '17 at 13:31
  • \documentclass[a4paper]{report} \usepackage{pstricks} \usepackage{auto-pst-pdf} \usepackage{pst-solides3d} \begin{document} \begin{pspicture}(1,1)(2,2) \psSolid[object=cube,a=2,action=draw*] \end{pspicture} \end{document} (my code is still not OK, error stands still) – Nguyễn Hải Duy Jun 19 '17 at 13:33
1

Hope you may update your package which are based on Pstricks, hence I don't have any error on your code, see the screenshot: enter image description here

| improve this answer | |
  • Thank you very much sir. I have tried your suggestion, that is, I have compiled by: Latex+dvips+ps2pdf+View PDF as well as XeLatex + View PDF. But the error:! Undefined control sequence is still on. I do not know why is that on my laptop. You have mentioned that I need to compile pstricks codes, so do I need to do somethong else to get it done ? – Nguyễn Hải Duy Jun 19 '17 at 8:51
  • Do I need to add more packages or fix something in my inner system of the machine – Nguyễn Hải Duy Jun 19 '17 at 8:53
  • Pl mentioned what type of TeX you are using and what version, I am using MikTeX V2.9 – MadyYuvi Jun 19 '17 at 9:39

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