Math & SciencePst-Platon doesn't look like it should

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Natan
Posts: 9
Joined: Fri Oct 23, 2020 2:53 pm

Pst-Platon doesn't look like it should

Post by Natan »

I just wanted to add some nice d20 to my document, but sadly that didn't work out as planned. While pst-platon-doc has great looking platonic-figures, I fail to generate the same result in my document. https://imgur.com/yxWk2eT.png (my document) https://www.ctan.org/pkg/pst-platon (doc).

My image should look like page 4 since it is the same code

Code: Select all

\documentclass{article}
\usepackage{pst-platon}
\begin{document}
\begin{pspicture}[showgrid=true](-1,-2)(10,5)
 \psTetrahedron[PstPicture=false]
 \rput(2,2){\psTetrahedron[PstPicture=false,Viewpoint=1 1.2 0.5]}
 \psset{unit=1.3}
 \rput(5,3){\psTetrahedron[PstPicture=false,Frame=false,Viewpoint=-1 0.5 2]}
\end{pspicture}
\end{document}
I am using XeLaTeX to compile the document. I also compiled it multiple times just to check if it works like toc.

Any advice?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Pst-Platon doesn't look like it should

Post by Stefan Kottwitz »

Hi Natan,

it runs with LaTeX in DVI mode, dvips and ps2pdf (ghostscript):

Code: Select all

% !TEX latex
\documentclass{article}
\usepackage{pst-platon}
\begin{document}
\begin{pspicture}[showgrid=true](-1,-2)(10,5)
 \psTetrahedron[PstPicture=false]
 \rput(2,2){\psTetrahedron[PstPicture=false,Viewpoint=1 1.2 0.5]}
 \psset{unit=1.3}
 \rput(5,3){\psTetrahedron[PstPicture=false,Frame=false,Viewpoint=-1 0.5 2]}
\end{pspicture}
\end{document}
I only added the compiler engine as comment in the first line as information for the TeXlive.net compiler. Click on "Run LaTeX here" to see the output.

Stefan
LaTeX.org admin
Natan
Posts: 9
Joined: Fri Oct 23, 2020 2:53 pm

Pst-Platon doesn't look like it should

Post by Natan »

Stefan Kottwitz wrote:Hi Natan,

it runs with LaTeX in DVI mode, dvips and ps2pdf (ghostscript):

[...]

I only added the compiler engine as comment in the first line as information for the TeXlive.net compiler. Click on "Run LaTeX here" to see the output.
Stefan
Hey, while your solution does seem to work here in the forum I can't reproduce it. I haven't heard of DVI mode before so maybe I am doing something wrong. It sounds like something which you can use while developing your document. Anyway, I switched to LaTeX (since some sources say it allows said DVI mode), but the result hasn't changed. I also added the compiler information/direction line.

I am used to compile my latex documents using texmaker and I selected the LaTeX option there. I can also compile it using the command line if needed (have done that a few times already).

Would you elaborate a little on what I need to change and why?

--

K Ps2PDF worked, but what if I need to use XeLaTeX for other requirements?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Pst-Platon doesn't look like it should

Post by Stefan Kottwitz »

Natan wrote:Would you elaborate a little on what I need to change and why?
Originally, LaTeX produces a .dvi file. This can be converted to Postscript, a .ps file. This can be converted to a .pdf file. That was the way for quite some time to get a PDF file. (dvi -> ps -> pdf). LaTex editors often have a compiler option that runs all of this by one click.

In contrast, pdfLaTeX produces .pdf output directly.

And XeLaTeX, that you used, produces .dvi and another tool (dvipdfmx) produces the .pdf file.

Different kind of engines (also LuaLaTeX) have been developed over time, hopefully not too confusing :-) but it's good and provides several options with different advantages. Most users are fine with pdfLaTeX, so this is often the default settings for LaTeX editors today.

XeLaTeX is usually good for Postscript and PStricks, such as here. Just in this case there may be an issue, perhaps in the dvi to pdf conversion process. So it's safer to use the original LaTeX and run dvips and ps2pdf. The editor should have an option to do that.
Natan wrote:Ps2PDF worked, but what if I need to use XeLaTeX for other requirements?
If the glitch is in dvipdfmx, you could use the .dvi file that XeLaTeX produces and run dvips and ps2pdf on it.

Stefan
LaTeX.org admin
Natan
Posts: 9
Joined: Fri Oct 23, 2020 2:53 pm

Pst-Platon doesn't look like it should

Post by Natan »

Hey,
this makes a lot of sense so I think I understand where you are coming from. The "problem" I have now, is that I don't get a dvi file when I run XeLaTeX in TeXMaker. When I run XeLaTeX using the terminal I also do not get a dvi file. Do I have to hand over some special argument or?
At the moment I am assuming that XeLaTeX might create a .dvi file and deletes it on the fly after using it.

I think I found out that XeLaTeX doesn't produce .dvi but .XDV and therefore this might not work. Anyway I still couldn't produce the .xdv persistently.

--
I still couldn't find a working solution with XeTeX if anyone has an idea I am still looking :)
Post Reply