0

I have problems with XeLaTeX and pst-coil. If I want to draw a graph, it works when compiling with latex+dvips+ps2pdf+see pdf. If I compile using Xelatex, there is nothing drawn in the pspicture. Here is an example

\documentclass[oneside,a4paper,12pt]{book}
\usepackage{graphicx}
\usepackage{pst-coil}
\ifx\setlinejoinmode\undefined
  \newcommand{\setlinejoinmode}[1]{}
\fi
\ifx\setlinecaps\undefined
  \newcommand{\setlinecaps}[1]{}
\fi
% This way define your own fonts mapping (for example with ifthen)
\ifx\setfont\undefined
  \newcommand{\setfont}[2]{}
\fi
\begin{document}
\begin{figure}[h]
\begin{center}
\pspicture(-1.000,-6.000)(26.113750,-1.700)
\psscalebox{0.37 -0.37}{
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\newrgbcolor{diafillcolor}{1.000000 1.000000 1.000000}%
\psset{fillcolor=diafillcolor}
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.780392 0.737255 0.737255}%
\psset{linecolor=dialinecolor}
\pspolygon*(7.950000,12.020000)(7.950000,13.940000)(12.850000,13.940000)(12.850000,12.020000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(7.950000,12.020000)(7.950000,13.940000)(12.850000,13.940000)(12.850000,12.020000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.368627 0.341176 0.341176}%
\psset{linecolor=dialinecolor}
\pspolygon*(12.842100,12.000000)(12.842100,13.985000)(15.350000,13.985000)(15.350000,12.000000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(12.842100,12.000000)(12.842100,13.985000)(15.350000,13.985000)(15.350000,12.000000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.180392 0.141176 0.141176}%
\psset{linecolor=dialinecolor}
\pspolygon*(20.250000,12.020000)(20.250000,13.962500)(25.184600,13.962500)(25.184600,12.020000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(20.250000,12.020000)(20.250000,13.962500)(25.184600,13.962500)(25.184600,12.020000)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setfont{Helvetica}{1.000000}
\psset{linewidth=0.050000cm}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(7.937500,14.000000)(7.937500,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(10.403571,14.000000)(10.403571,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(12.869643,14.000000)(12.869643,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(15.335714,14.000000)(15.335714,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(17.801786,14.000000)(17.801786,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(20.267857,14.000000)(20.267857,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(22.733929,14.000000)(22.733929,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(25.200000,14.000000)(25.200000,14.198333)
\psset{linewidth=0.100000cm}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(7.937500,14.000000)(7.937500,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(7.937500,15.395000){\psscalebox{2.5 -2.5}{0}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(10.403571,14.000000)(10.403571,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(10.403571,15.395000){\psscalebox{2.5 -2.5}{1}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(12.869643,14.000000)(12.869643,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(12.869643,15.395000){\psscalebox{2.5 -2.5}{2}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(15.335714,14.000000)(15.335714,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(15.335714,15.395000){\psscalebox{2.5 -2.5}{3}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(17.801786,14.000000)(17.801786,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(17.801786,15.395000){\psscalebox{2.5 -2.5}{4}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(20.267857,14.000000)(20.267857,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(20.267857,15.395000){\psscalebox{2.5 -2.5}{5}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(22.733929,14.000000)(22.733929,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(22.733929,15.395000){\psscalebox{2.5 -2.5}{6}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(25.200000,14.000000)(25.200000,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(25.200000,15.395000){\psscalebox{2.5 -2.5}{7}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(7.937500,14.000000)(25.200000,14.000000)
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](3.00000,7.180000){\psscalebox{2.5 -2.5}{Machine 1}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](3.000,10.175000){\psscalebox{2.5 -2.5}{Machine 2}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](5.405000,10.095000){\psscalebox{1 -1}{}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](3.000,13.145000){\psscalebox{2.5 -2.5}{Machine 3}}
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(15.350000,12.000000)(20.250000,12.020000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.368627 0.341176 0.341176}%
\psset{linecolor=dialinecolor}
\pspolygon*(8.055000,9.045000)(8.055000,10.945000)(12.900000,10.945000)(12.900000,9.045000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(8.055000,9.045000)(8.055000,10.945000)(12.900000,10.945000)(12.900000,9.045000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.180392 0.141176 0.141176}%
\psset{linecolor=dialinecolor}
\pspolygon*(15.405000,8.995000)(15.405000,10.945000)(20.250000,10.945000)(20.250000,8.995000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(15.405000,8.995000)(15.405000,10.945000)(20.250000,10.945000)(20.250000,8.995000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.780392 0.737255 0.737255}%
\psset{linecolor=dialinecolor}
\pspolygon*(20.255000,8.995000)(20.255000,10.980000)(22.762900,10.980000)(22.762900,8.995000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(20.255000,8.995000)(20.255000,10.980000)(22.762900,10.980000)(22.762900,8.995000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.180392 0.141176 0.141176}%
\psset{linecolor=dialinecolor}
\pspolygon*(8.033241,5.977500)(8.033241,7.927500)(15.378241,7.927500)(15.378241,5.977500)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(8.033241,5.977500)(8.033241,7.927500)(15.378241,7.927500)(15.378241,5.977500)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.368627 0.341176 0.341176}%
\psset{linecolor=dialinecolor}
\pspolygon*(15.383241,5.977500)(15.383241,7.927500)(22.728241,7.927500)(22.728241,5.977500)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(15.383241,5.977500)(15.383241,7.927500)(22.728241,7.927500)(22.728241,5.977500)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.780392 0.737255 0.737255}%
\psset{linecolor=dialinecolor}
\pspolygon*(22.733241,5.982500)(22.733241,7.912500)(25.128241,7.912500)(25.128241,5.982500)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(22.733241,5.982500)(22.733241,7.912500)(25.128241,7.912500)(25.128241,5.982500)
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(12.900000,9.045000)(15.405000,8.995000)
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(12.900000,10.945000)(15.405000,10.945000)
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(22.762900,8.995000)(25.378241,8.932500)
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(22.762900,10.980000)(25.278241,10.982500)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(25.184600,13.962500)(26.288068,13.961114)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(25.900186,14.211601)(26.399871,13.960974)(25.899558,13.711602)
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](26.211675,14.810833){\psscalebox{2.5 -2.5}{time}}
}\endpspicture
\end{center}
\caption{Optimal schedule} 
\end{figure}
\end{document}

It produces this when compiling with Xelatex enter image description here

and this when compiling with latex+dvips+ps2pdf+see pdfenter image description here

I need to compile my file with Xelatex, do you have any solutions?

  • I have no problem with your code. Do you have xetex-pstricks installed? – Bernard Oct 19 '16 at 14:53
  • How can I check if it is installed? I tried to add \usepackage{xetex-pstricks} and I got the error: LaTeX Error: File `xetex-pstricks.sty' not found. – Farah Mind Oct 19 '16 at 14:57
  • Are you under MiKTeX? – Bernard Oct 19 '16 at 14:58
  • Yes, I am under MikteX 2.9 and I am using TexMaker – Farah Mind Oct 19 '16 at 14:59
  • Launch MiKTeX Package Manager (Admin), select the package in the list that will appear after a while (you can filter by name) and ask to install. – Bernard Oct 19 '16 at 15:01
0

Here is a simplified, much shorter code. I replaces \pst-coil, which has nothing to do here, with pstricks-add:

\documentclass[12pt]{standalone}%{book}%
\usepackage[scaled=0.80]{helvet}%
\usepackage{pstricks-add}%

\begin{document}
\sffamily
\begin{pspicture}(1,-5.9)(10.4,-2)%
\newrgbcolor{dialinecolor1}{0.780392 0.737255 0.737255}%
\newrgbcolor{dialinecolor2}{0.368627 0.341176 0.341176}%
\newrgbcolor{dialinecolor3}{0.180392 0.141176 0.141176}%
%%
\psscalebox{0.37 -0.37}{%
\psset{fillstyle=solid, fillcolor=white, linewidth=0pt}
\pspolygon[fillcolor=dialinecolor1, linewidth=0pt](7.950000,12.020000)(7.950000,13.940000)(12.850000,13.940000)(12.850000,12.020000)
\pspolygon[fillcolor=dialinecolor2](12.842100,12.000000)(12.842100,13.985000)(15.350000,13.985000)(15.350000,12.000000)
\pspolygon[fillcolor=dialinecolor3](20.250000,12.020000)(20.250000,13.962500)(25.184600,13.962500)(25.184600,12.020000)
%%
\psaxes[linewidth=0.1cm, arrows=-v, veearrowlinewidth=0.9mm,veearrowlength=4.5mm, veearrowangle=60, %
yAxis=false, dx=2.466, ticksize=5mm -0.5mm, tickwidth=1mm, labels=none](7.9375,14)(7.9375,14)(27,14)
\uput{5mm}[u](27,14){\psscalebox{2.5 -2.5}{time}}
\rput(7.937500,15.395000){\psscalebox{2.5 -2.5}{0}}
\rput(10.403571,15.395000){\psscalebox{2.5 -2.5}{1}}
\rput(12.869643,15.395000){\psscalebox{2.5 -2.5}{2}}
\rput(15.335714,15.395000){\psscalebox{2.5 -2.5}{3}}
\rput(17.801786,15.395000){\psscalebox{2.5 -2.5}{4}}
\rput(20.267857,15.395000){\psscalebox{2.5 -2.5}{5}}
\rput(22.733929,15.395000){\psscalebox{2.5 -2.5}{6}}
\rput(25.200000,15.395000){\psscalebox{2.5 -2.5}{7}}
%%
\rput[l](3.00000,7.180000){\psscalebox{2.5 -2.5}{Machine 1}}
\rput[l](3.000,10.175000){\psscalebox{2.5 -2.5}{Machine 2}}
\rput[l](3.000,13.145000){\psscalebox{2.5 -2.5}{Machine 3}}
%%
\pspolygon[fillcolor=dialinecolor2](8.055000,9.045000)(8.055000,10.945000)(12.900000,10.945000)(12.900000,9.045000)
\pspolygon[fillcolor=dialinecolor3](15.405000,8.995000)(15.405000,10.945000)(20.250000,10.945000)(20.250000,8.995000)
\pspolygon[fillcolor=dialinecolor1](20.255000,8.995000)(20.255000,10.980000)(22.762900,10.980000)(22.762900,8.995000)
\pspolygon[fillcolor=dialinecolor3](8.033241,5.977500)(8.033241,7.927500)(15.378241,7.927500)(15.378241,5.977500)
\pspolygon[fillcolor=dialinecolor2](15.383241,5.977500)(15.383241,7.927500)(22.728241,7.927500)(22.728241,5.977500)
\pspolygon[fillcolor=dialinecolor1](22.733241,5.982500)(22.733241,7.912500)(25.128241,7.912500)(25.128241,5.982500)
%%
\psset{linewidth=1mm, linestyle=dotted, dotsep=0.200000}
\psline(12.900000,10.945000)(15.405000,10.945000)
\psline(12.900000,9.045000)(15.405000,8.995000)
\psline(22.762900,8.995000)(25.378241,8.932500)
\psline(22.762900,10.980000)(25.278241,10.982500)
\psline(15.350000,12.000000)(20.250000,12.020000)
}\end{pspicture}

\end{document} 

enter image description here

  • This code is much simpler, it works perfectly, but after updating some old files of for pstricks by running the update manager (admin). – Farah Mind Oct 19 '16 at 21:23

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.