1

I saw this question, and wonder how to make it using PSTricks...

I tried, but failed. The compilation ends, but fails to produce a pdf. I have the Cisco Icons in a subfolder, and putting them in a \rput doesn't work...

This could have a lot of applications, as I'm actually writing my Master Thesis in Network Engineering...

Here's my MWE :

\documentclass[pstricks, float]{standalone}
\usepackage{graphicx}
\usepackage[table, usenames, dvipsnames]{xcolor}
\usepackage{pstricks, pst-node, pst-circ, pst-plot, pst-3dplot, pst-solides3d, pst-sigsys, pstricks-add, pst-eucl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}    

\begin{document}
    \begin{pspicture}[labelangle=:U, showgrid=false](0, 1)(10, 5)
        \rput[bl](0,0){\rnode{A}{\includegraphics[width=30pt]{Cisco_Icons/pc}}}
        \rput[tr](4,3){\rnode{B}{\includegraphics[width=30pt]{Cisco_Icons/pc}}}
        \ncline[nodesep=3pt]{<->}{A}{B}
    \end{pspicture}
\end{document}

Here is the console output :

Error: /typecheck in --length--
Operand stack:
   1   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1951   1   3   %oparray_pop   1950   1   3   %oparray_pop   1934   1   3   %oparray_pop   1820   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1185/1684(ro)(G)--   --dict:0/20(G)--   --dict:176/200(L)--   --dict:745/1012(L)--   --dict:173/300(L)--   --dict:43/200(L)--   --dict:38/60(L)--   --dict:181/205(L)--   --dict:41/60(L)--   --dict:43/65(L)--   --dict:7/7(L)--   --dict:7/7(L)--
Current allocation mode is local
Last OS error: Invalid argument
Current file position is 531884
GPL Ghostscript 9.16: Unrecoverable error, exit code 1
### FAILED to generate /tmp/altpdflatex.59686-1458308792/Archi_centra.pdf ()

It seems to ba a Ghostscript problem, but I can't figure it.

EDIT 1 : I compile with TeX+DVI

EDIT 2 : This standalone file is to be included in my main.tex like this :

\begin{figure}[H]
    \centering
    \input{Schemas/this_standalone}
    \caption{2 PCs linked together}
    \label{fig:pcLinked}
\end{figure}

And the main.tex HAS to be compiled using TeX+DVI, otherwise I'll get other problems with other packagesif compiled with XeLaTex (breakurl for instance)

FINAL EDIT : All this problem comes from the Cisco Icon package I downloaded. On their page, you have 2 choices, for eps files : B/W or PSM 3015. The files of the latter (PMS 3015) are misunderstood by Ghostscript, leading to the problem I presented...

What works : B/W icons, compiled with LaTeXand TeX+DVI

  • are the Cisco_Icons/pc eps images? – user2478 Mar 18 '16 at 20:52
  • Yes, I downloaded them from the question I saw... – EisenHeim Mar 21 '16 at 7:11
1

with up-to-date TeXLive 2015 I have no problem with your example. However, try to run xelatex instead of latex->dvips->ps2pdf:

\documentclass[pstricks,dvipsnames,table]{standalone}
\usepackage{fontspec}
\usepackage{pstricks, pst-node}
\usepackage[frenchb]{babel}    

\begin{document}
\begin{pspicture}(-1, -1)(6, 5)
    \rput[bl](0,0){\rnode{A}{\includegraphics[width=30pt]{/tmp//pc}}}
    \rput[tr](4,3){\rnode{B}{\includegraphics[width=30pt]{/tmp/pc}}}
    \ncline[nodesep=3pt]{<->}{A}{B}
\end{pspicture}
\end{document}

enter image description here

  • This is ok with xelatex, but I still got the error when including them (with standalonne's \input). – EisenHeim Mar 21 '16 at 19:44
  • Your example code shows no \input – user2478 Mar 21 '16 at 20:15
  • I got problems when compiling it with TeX+DVI, because this file will be included in my main.tex, which I must compile with TeX+DVIanyway... – EisenHeim Mar 21 '16 at 21:41
  • What exactly do you inlcude? If you run your main document with TeX+DVI then you do not need to run standalone. However, you can run your complete document with xelatex – user2478 Mar 21 '16 at 21:45
  • 1
    breakurl is not needed for xelatex. It is done by default. – user2478 Mar 21 '16 at 22:12
0

With this code, it compiles with pdflatex, provided it is launched with the --enable-write18 switch, if you're under MiKTeX, shell-escape under TeX Live or MacTeX.

Another solution might be to convert the icons from èpstopdfformat, with a tool likeepspdf`.

I slightly simplified your code, as pstricks-add loads a number of the packages you use.

\documentclass[pstricks, french, float]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[table, dvipsnames]{xcolor}
\usepackage{pstricks-add, pst-3dplot, pst-solides3d, , pst-eucl, pst-circ, pst-sigsys}
\usepackage{babel}
\usepackage{auto-pst-pdf}

\begin{document}

\begin{pspicture}[labelangle=:U, showgrid=false](0, 1)(10, 5)
    \rput[bl](0,0){\rnode{A}{\includegraphics[width=30pt]{Cisco_Icons/pc}}}
    \rput[tr](4,3){\rnode{B}{\includegraphics[width=30pt]{Cisco_Icons/pc}}}
    \ncline[nodesep=3pt]{<->}{A}{B}
\end{pspicture}

\end{document} 

enter image description here

  • Sorry, I forgot to mention it, but I compile using TeX+DVI... – EisenHeim Mar 18 '16 at 15:03
  • With LaTeX+DVI, the .ps file is queer: only one icon, and a bounding box appear in GsView, and pstopdf, yields a .pdf with two icons, but no bounding box. Do you have any reason not to take the pdflatex way? – Bernard Mar 18 '16 at 15:09
  • Yes, I also use pst-circ and other PSTricks packages to draw my diagrams... – EisenHeim Mar 18 '16 at 15:12
  • Usually it works fine with pdflatex and auto-pst-pdf, which is done for that. – Bernard Mar 18 '16 at 15:14
  • I tried with pdflatex, and I saw that the template I use requires TeX+DVI => I have no choice. And my work is pretty much advandec to change everything ^^ – EisenHeim Mar 18 '16 at 15:17

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.